If something is both frozen and burned. If you replace it, you have also rebooted it. A replaced item starts "off"

This commit is contained in:
Tim Young 2018-02-14 16:47:46 +00:00
parent 5e1c38e81f
commit fd7a9bd48a

View File

@ -783,7 +783,7 @@ namespace EduNetworkBuilder
if (!LockedOut) if (!LockedOut)
{ {
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice()) if (ReleasedOn != null && ReleasedOn.IsNotNetDevice() && !ReleasedOn.IsBurned)
{ {
List<string> DoneList = new List<string>(); List<string> DoneList = new List<string>();
if (!PoweredOff) if (!PoweredOff)
@ -824,7 +824,7 @@ namespace EduNetworkBuilder
} }
} }
} }
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice()) if (ReleasedOn != null && ReleasedOn.IsNotNetDevice() && !ReleasedOn.IsBurned)
{ {
if (!PoweredOff) if (!PoweredOff)
{ {
@ -846,7 +846,7 @@ namespace EduNetworkBuilder
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Delete_Click; pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Delete_Click;
} }
} }
if (ReleasedOn != null && ReleasedOn.IsNotNetDevice() && !PoweredOff) if (ReleasedOn != null && ReleasedOn.IsNotNetDevice() && !PoweredOff && !ReleasedOn.IsBurned)
{ {
pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Edit")); pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("_Edit"));
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Edit_Click; pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Edit_Click;
@ -855,7 +855,7 @@ namespace EduNetworkBuilder
if (ReleasedOn != null) if (ReleasedOn != null)
{ {
ItemClickedOn = ReleasedOn; ItemClickedOn = ReleasedOn;
if (!PoweredOff) if (!PoweredOff && !ReleasedOn.IsBurned)
{ {
if (ReleasedOn.HasDHCPNic()) if (ReleasedOn.HasDHCPNic())
{ {
@ -878,7 +878,6 @@ 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;
} }
//We power off to fix this.
if (myNetwork.ItemHasTest(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower) || ReleasedOn.IsBurned) if (myNetwork.ItemHasTest(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower) || ReleasedOn.IsBurned)
{ {
if (!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower)) if (!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower))
@ -970,8 +969,11 @@ namespace EduNetworkBuilder
if (ItemClickedOn == null) return; if (ItemClickedOn == null) return;
ItemClickedOn.ClearIPs(); //reset the device ItemClickedOn.ClearIPs(); //reset the device
ItemClickedOn.IsBurned = false; //If it had been burned before, it is no longer burned ItemClickedOn.IsBurned = false; //If it had been burned before, it is no longer burned
ItemClickedOn.PowerOff = true;
//Mark the replace test as "done" //Mark the replace test as "done"
myNetwork.RegisterDeviceReplaced(ItemClickedOn.hostname); myNetwork.RegisterDeviceReset(ItemClickedOn.hostname); //replacing something powers it off
myNetwork.RegisterDeviceReplaced(ItemClickedOn.hostname); //replace it.
UpdateVisuals(); UpdateVisuals();
} }
} }