Changeset 1321 for DCWoRMS/branches
- Timestamp:
- 03/31/14 16:06:25 (11 years ago)
- Location:
- DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java
r1284 r1321 30 30 31 31 public boolean setPowerState(PowerStateName state) { 32 if(supportPowerState(state)){ 32 if(!supportPowerState(state)) 33 return false; 34 35 if(state != currentPowerState){ 33 36 currentPowerState = state; 34 37 35 38 for(ComputingResource child:resource.getChildren()){ 36 39 if(child.getPowerInterface().supportPowerState(state)){ 37 boolean status =child.getPowerInterface().setPowerState(state);40 child.getPowerInterface().setPowerState(state); 38 41 } 39 42 } … … 52 55 53 56 //ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName()); 54 return true;55 57 } 56 return false;58 return true; 57 59 } 58 60 -
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java
r1247 r1321 28 28 if(!supportPowerState(state)) 29 29 return false; 30 currentPowerState = state;31 Node node = (Node) resource;32 boolean pePowerStateChangeStatus = false;33 if(node.getProcessors() != null) {30 if(state != currentPowerState){ 31 currentPowerState = state; 32 33 Node node = (Node) resource; 34 34 for(ComputingResource child:node.getProcessors()){ 35 35 if(child.getPowerInterface() != null){ 36 pePowerStateChangeStatus =child.getPowerInterface().setPowerState(state);36 child.getPowerInterface().setPowerState(state); 37 37 } 38 38 } 39 } 40 41 if(!pePowerStateChangeStatus){ 39 40 if(state == StandardPowerStateName.OFF){ 41 node.setStatus(ResourceStatus.UNAVAILABLE); 42 } 43 else if(state == StandardPowerStateName.ON){ 44 node.setStatus(ResourceStatus.FREE); 45 } 46 42 47 node.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, node.getFullName())); 48 49 //node.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName())); 50 //ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName()); 43 51 } 44 45 if(state == StandardPowerStateName.OFF){46 node.setStatus(ResourceStatus.UNAVAILABLE);47 }48 else if(state == StandardPowerStateName.ON){49 node.setStatus(ResourceStatus.FREE);50 }51 //node.handleEvent(new EnergyEvent(EnergyEventType.POWER_STATE_CHANGED, computingNode.getName()));52 //ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName());53 52 return true; 54 53 }
Note: See TracChangeset
for help on using the changeset viewer.