Raplce UPS action

This commit is contained in:
Tim Young 2018-05-18 08:13:31 -05:00
parent f5110e542d
commit 1007492961
2 changed files with 7 additions and 4 deletions

View File

@ -263,6 +263,7 @@ namespace EduNetworkBuilder
case NBAction.replace: case NBAction.replace:
break; break;
case NBAction.replaceUPS: case NBAction.replaceUPS:
myNet.RegisterUPSAdded(source.hostname);
break; break;
case NBAction.poweroff: case NBAction.poweroff:
source.PowerOff = true; source.PowerOff = true;
@ -270,6 +271,7 @@ namespace EduNetworkBuilder
break; break;
case NBAction.poweron: case NBAction.poweron:
source.PowerOff = false; source.PowerOff = false;
//We might see about exploding the device here.
break; break;
} }
} }

View File

@ -1214,11 +1214,12 @@ namespace EduNetworkBuilder
{ {
if (ItemClickedOn == null) return; if (ItemClickedOn == null) return;
//Changing a UPS makes sure the power is off when done. //Changing a UPS makes sure the power is off when done.
ItemClickedOn.PowerOff = true; //ItemClickedOn.PowerOff = true;
NB.DoActionPowerOff(ItemClickedOn.GetUniqueIdentifier);
//Mark the replace test as "done" //Mark the replace test as "done"
myNetwork.RegisterDeviceReset(ItemClickedOn.hostname); //replacing something powers it off //myNetwork.RegisterDeviceReset(ItemClickedOn.hostname); //replacing something powers it off
NB.DoActionReplaceDeviceUPS(ItemClickedOn.GetUniqueIdentifier);
myNetwork.RegisterUPSAdded(ItemClickedOn.hostname); //Add the UPS. //myNetwork.RegisterUPSAdded(ItemClickedOn.hostname); //Add the UPS.
UpdateVisuals(); UpdateVisuals();
} }
} }