Changeset 1321 for DCWoRMS/branches


Ignore:
Timestamp:
03/31/14 16:06:25 (11 years ago)
Author:
wojtekp
Message:
 
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  
    3030         
    3131        public boolean setPowerState(PowerStateName state) { 
    32                 if(supportPowerState(state)){ 
     32                if(!supportPowerState(state)) 
     33                        return false; 
     34                         
     35                if(state != currentPowerState){ 
    3336                        currentPowerState = state; 
    3437 
    3538                        for(ComputingResource child:resource.getChildren()){ 
    3639                                if(child.getPowerInterface().supportPowerState(state)){ 
    37                                         boolean status = child.getPowerInterface().setPowerState(state); 
     40                                        child.getPowerInterface().setPowerState(state); 
    3841                                } 
    3942                        } 
     
    5255                         
    5356                        //ResourceController.traceResource(new DateTime().getMillis(), resource.getFullName(), "POWER_STATE_CHANGED", state.getName()); 
    54                         return true; 
    5557                } 
    56                 return false; 
     58                return true; 
    5759        } 
    5860         
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java

    r1247 r1321  
    2828                if(!supportPowerState(state)) 
    2929                        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; 
    3434                        for(ComputingResource child:node.getProcessors()){ 
    3535                                if(child.getPowerInterface() != null){ 
    36                                         pePowerStateChangeStatus = child.getPowerInterface().setPowerState(state);       
     36                                        child.getPowerInterface().setPowerState(state);  
    3737                                } 
    3838                        } 
    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         
    4247                        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());  
    4351                } 
    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()); 
    5352                return true; 
    5453        } 
Note: See TracChangeset for help on using the changeset viewer.