able to replace a burned item.

This commit is contained in:
Tim Young 2018-02-14 12:36:55 +00:00
parent 5b3be85e99
commit 44c7b90c3b

View File

@ -879,15 +879,15 @@ namespace EduNetworkBuilder
pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_PowerOff_Click; pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_PowerOff_Click;
} }
//We power off to fix this. //We power off to fix this.
//if(myNetwork.ItemHasTest(ReleasedOn.hostname,NetTestType.DeviceIsBad)) if (myNetwork.ItemHasTest(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower) || ReleasedOn.IsBurned)
//{ {
// if(!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceIsBad)) if (!myNetwork.ItemTestIsComplete(ReleasedOn.hostname, NetTestType.DeviceBlowsUpWithPower))
// { {
// //If the item is bad and has not been replaced, then add a context menu to replace it //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")); pbNetworkView.ContextMenuStrip.Items.Add(NB.Translate("NB_Replace"));
// pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Replace_Click; pbNetworkView.ContextMenuStrip.Items[index++].Click += pbNetworkView_Replace_Click;
// } }
//} }
} }
} }
else //we are locked out. else //we are locked out.
@ -938,6 +938,13 @@ namespace EduNetworkBuilder
if (ItemClickedOn != null) if (ItemClickedOn != null)
{ {
ItemClickedOn.PowerOff = false; ItemClickedOn.PowerOff = false;
if(myNetwork.ItemHasTest(ItemClickedOn.hostname,NetTestType.DeviceBlowsUpWithPower))
{
if(!myNetwork.ItemTestIsComplete(ItemClickedOn.hostname, NetTestType.DeviceBlowsUpWithPower))
{
ItemClickedOn.IsBurned = true;
}
}
UpdateLinks(); UpdateLinks();
UpdateVisuals(); UpdateVisuals();
} }
@ -964,7 +971,7 @@ namespace EduNetworkBuilder
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
//Mark the replace test as "done" //Mark the replace test as "done"
//myNetwork.RegisterDeviceReplaced(ItemClickedOn.hostname); myNetwork.RegisterDeviceReplaced(ItemClickedOn.hostname);
UpdateVisuals(); UpdateVisuals();
} }
} }