Change to device is frozen instead of device is bad. I got mixed up in my notes. One of the other future things I wanted to add will have us replace the device, but this fix is not that one.

This commit is contained in:
Tim Young 2018-02-13 20:34:10 +00:00
parent faf8ed1984
commit 1678207546
6 changed files with 22 additions and 18 deletions

View File

@ -48,7 +48,7 @@ namespace EduNetworkBuilder
DHCPServerEnabled, SuccessfullyTraceroutes, DHCPServerEnabled, SuccessfullyTraceroutes,
LockAll, LockIP, LockRoute, LockNic, LockDHCP, LockGateway, LockAll, LockIP, LockRoute, LockNic, LockDHCP, LockGateway,
LockVLANsOnHost, LockNicVLAN, LockInterfaceVLAN, LockVLANNames, LockVLANsOnHost, LockNicVLAN, LockInterfaceVLAN, LockVLANNames,
DeviceIsBad, DeviceIsFrozen,
} }
public enum ContextTest { ping, arp, traceroute } public enum ContextTest { ping, arp, traceroute }
public enum NetTestVerbosity { none, basic, hints, full } public enum NetTestVerbosity { none, basic, hints, full }

View File

@ -133,7 +133,7 @@ namespace EduNetworkBuilder
case NetTestVerbosity.hints: case NetTestVerbosity.hints:
switch (TheTest) switch (TheTest)
{ {
case NetTestType.DeviceIsBad: case NetTestType.DeviceIsFrozen:
toreturn = NB.Translate("NT_TstDscriptBadDevice"); toreturn = NB.Translate("NT_TstDscriptBadDevice");
break; break;
case NetTestType.NeedsDefaultGW: case NetTestType.NeedsDefaultGW:
@ -220,7 +220,7 @@ namespace EduNetworkBuilder
case NetTestVerbosity.full: case NetTestVerbosity.full:
switch (TheTest) switch (TheTest)
{ {
case NetTestType.DeviceIsBad: case NetTestType.DeviceIsFrozen:
toreturn = NB.Translate("NT_TstDscriptBadDevice2"); toreturn = NB.Translate("NT_TstDscriptBadDevice2");
break; break;
case NetTestType.NeedsDefaultGW: case NetTestType.NeedsDefaultGW:
@ -513,7 +513,7 @@ namespace EduNetworkBuilder
case NetTestType.HelpRequest: case NetTestType.HelpRequest:
case NetTestType.ReadContextHelp: case NetTestType.ReadContextHelp:
case NetTestType.FailedPing: case NetTestType.FailedPing:
case NetTestType.DeviceIsBad: case NetTestType.DeviceIsFrozen:
return TaskWasDone; //This variable will tell us if these tests have been done. return TaskWasDone; //This variable will tell us if these tests have been done.
case NetTestType.DHCPServerEnabled: case NetTestType.DHCPServerEnabled:
if (Source == null) return false; //Unable to do it. Do not count it against them. if (Source == null) return false; //Unable to do it. Do not count it against them.

View File

@ -226,7 +226,7 @@ namespace EduNetworkBuilder
{ {
cbDest.Items.Add(NB.Translate("_All")); cbDest.Items.Add(NB.Translate("_All"));
} }
else if (ToEdit.TheTest == NetTestType.DeviceIsBad) else if (ToEdit.TheTest == NetTestType.DeviceIsFrozen)
{ {
cbDest.Items.Add(ToEdit.sHost); cbDest.Items.Add(ToEdit.sHost);
} }

View File

@ -1693,7 +1693,7 @@ namespace EduNetworkBuilder
{ {
foreach(NetTest one in NetTests) foreach(NetTest one in NetTests)
{ {
if(one.sHost == source && one.TheTest == NetTestType.DeviceIsBad) if(one.sHost == source && one.TheTest == NetTestType.DeviceIsFrozen)
{ {
one.SetDone(); one.SetDone();
} }

View File

@ -878,15 +878,16 @@ namespace EduNetworkBuilder
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_PowerOff")); pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_PowerOff"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_PowerOff_Click; pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_PowerOff_Click;
} }
if(myNetwork.ItemHasTest(ReleasedOn.hostname,NetTestType.DeviceIsBad)) //We power off to fix this.
{ //if(myNetwork.ItemHasTest(ReleasedOn.hostname,NetTestType.DeviceIsBad))
if(!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceIsBad)) //{
{ // if(!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceIsBad))
//If the item is bad and has not been replaced, then add a context menu to replace it // {
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_Replace")); // //If the item is bad and has not been replaced, then add a context menu to replace it
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Replace_Click; // pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_Replace"));
} // pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Replace_Click;
} // }
//}
} }
} }
else //we are locked out. else //we are locked out.
@ -947,11 +948,14 @@ namespace EduNetworkBuilder
if (ItemClickedOn != null) if (ItemClickedOn != null)
{ {
ItemClickedOn.PowerOff = true; ItemClickedOn.PowerOff = true;
//Mark the replace test as "done"
myNetwork.RegisterDeviceReset(ItemClickedOn.hostname);
UpdateLinks(); UpdateLinks();
UpdateVisuals(); UpdateVisuals();
} }
} }
//We will still do this for devices that are spraying the network
private void pbNetworkView_Replace_Click(object sender, EventArgs e) private void pbNetworkView_Replace_Click(object sender, EventArgs e)
{ {
if (ItemClickedOn != null) if (ItemClickedOn != null)
@ -959,7 +963,7 @@ namespace EduNetworkBuilder
if (ItemClickedOn == null) return; if (ItemClickedOn == null) return;
ItemClickedOn.ClearIPs(); //reset the device ItemClickedOn.ClearIPs(); //reset the device
//Mark the replace test as "done" //Mark the replace test as "done"
myNetwork.RegisterDeviceReset(ItemClickedOn.hostname); //myNetwork.RegisterDeviceReplaced(ItemClickedOn.hostname);
UpdateVisuals(); UpdateVisuals();
} }
} }

View File

@ -730,9 +730,9 @@ namespace EduNetworkBuilder
mynet = NB.GetNetwork(); mynet = NB.GetNetwork();
nd = mynet.GetDeviceFromID(myID); nd = mynet.GetDeviceFromID(myID);
if(mynet.ItemHasTest(nd.hostname,NetTestType.DeviceIsBad)) if(mynet.ItemHasTest(nd.hostname,NetTestType.DeviceIsFrozen))
{ {
if(!mynet.ItemTestIsComplete(nd.hostname, NetTestType.DeviceIsBad)) if(!mynet.ItemTestIsComplete(nd.hostname, NetTestType.DeviceIsFrozen))
{ {
//the device is busted and nonfunctional. No response. //the device is busted and nonfunctional. No response.
tPacket.AddMessage(DebugLevel.info, ""); tPacket.AddMessage(DebugLevel.info, "");