#Map indicator color based on their position on the expanders: 0-15 are on expander 2, 16 to 31 on expander 1. One indicator is missing the blue component, hence
#the "-1" value.
...
...
@@ -51,16 +52,20 @@ class PWRLED:
defsetVch(self,channel,voltage,verbose=False):
# Note: the channel here is the DAC channel.
# The mapping with the power module is not one-to-one
if(verbose):
print" PWRModule: CONFIGURING VOLTAGE FOR PMT",channel+1
print"\tVcontrol=",voltage
if((channel<0)|(3<channel)):
print"PWRModule: channel should be comprised between 0 and 3"
print"\tPWRModule: channel should be comprised between 0 and 3"
else:
if(voltage<0):
print"PWRModule: voltage must be comprised between 0 and 1 V. Coherced to 0 V."
print"\tPWRModule: voltage cannot be negative. Coherced to 0 V."
voltage=0
if(voltage>1):
print"PWRModule: voltage must be comprised between 0 and 1 V. Coherced to 1 V."
voltage=1
dacValue=voltage*65535
if(voltage>self.vCtrlMax):
print"\tPWRModule: voltage cannot exceed vCtrlMax. Coherced to vCtrlMax."
print"\tPWRModule: vCtrlMax=",self.vCtrlMax,"V. See config file to change this value."