本文整理汇总了Python中pyelixys.logs.hallog.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_setpoint
def set_setpoint(self, value):
""" Set the pressure regulator,
setpoint is generally in psi, but really
depends on the hw configuration """
value = value * self.conf['PSICONV']
log.debug("Set pressure regulator %d to %f", self.id_, value)
self.synth.cbox.set_dac(self.id_, value)
示例2: set_dac
def set_dac(self, devid, value):
""" Set the DAC0 output"""
tmpstr = "/DAC/run %d %x\n"
if devid == 0:
val = value / self.conf['DACCONST0']
elif devid == 1:
val = value / self.conf['DACCONST1']
else:
raise ElixysCBoxError("Unexpected DAC device id")
val = int(math.ceil(val))
dacmax = self.conf['DACMAX']
if val > dacmax:
log.warn("Attempt to set DAC %d to "
"%d, setting to MAX %d", devid, val, dacmax)
val = dacmax
dacmin = self.conf['DACMIN']
if val < dacmin:
log.warn("Attempt to set DAC %d to "
"%d, setting to MIN %d", devid, val, dacmin)
tmpstr = tmpstr % (devid, val)
log.debug("Set DAC: sent %s", tmpstr)
self.write(tmpstr)
self.read()
示例3: all
def all(self):
self.state_ = self.status.DigitalInputs['state']
self.all_state_ = [not bool(self.state_ >> sensorbit & 1)
for sensorbit in range(self.sysconf['DigitalInputs']['count'])]
log.debug("Get Digital input %d tripped -> %s"
% (self.id_, self.tripped_))
return self.all_state_
示例4: lower_no_check
def lower_no_check(self):
""" Move the actuator down but don't wait """
log.debug("Actuator %s lower | Turn on valve:%d, Turn off valve:%d",
repr(self), self._down_valve_id, self._up_valve_id)
self.synth.valves[self._up_valve_id].on = False
time.sleep(0.2)
self.synth.valves[self._down_valve_id].on = True
示例5: set_on
def set_on(self, value):
log.debug("Set Mixer %d on -> %s" % (self.id_, value))
self.on_ = value
if value is True:
self.set_duty_cycle(100.0)
else:
self.set_duty_cycle(0.0)
示例6: turn_counter_clockwise
def turn_counter_clockwise(self):
""" Turn the stopcock counter clockwise """
log.debug("Turn stopcock %d counter-clockwise", self.id_)
self.synth.valves[self._cw_valve_id].on = False
time.sleep(0.2)
self.synth.valves[self._ccw_valve_id].on = True
time.sleep(0.2)
示例7: set_on
def set_on(self, value):
""" Set the valve state """
if not hasattr(self,'valve_state0') or not hasattr(self,'valve_state1') \
or not hasattr(self,'valve_state2'):
self.load_states()
log.debug("Set Valve %d on -> %s" % (self.id_, value))
self.on_ = value
if self.id_ < 16:
log.debug("Before Set Valve %d (state0) on -> %s" % (self.id_, bin(Valve.valve_state0)))
if value is True:
Valve.valve_state0 |= (1<<(self.id_%16))
else:
Valve.valve_state0 &= ~(1<<(self.id_%16))
self.comproc.run_cmd(self.cmd_lookup['Valves']['set_state0'](Valve.valve_state0))
log.debug("After Set Valve %d (state0) on -> %s" % (self.id_, bin(Valve.valve_state0)))
self.on_ = True
elif self.id_ < 32:
if value is True:
Valve.valve_state1 |= (1<< (self.id_%16))
else:
Valve.valve_state1 &= ~(1<<(self.id_%16))
self.comproc.run_cmd(self.cmd_lookup['Valves']['set_state1'](Valve.valve_state1))
log.debug("Set Valve %d (state1) on -> %s" % (self.id_, bin(Valve.valve_state1)))
self.on_ = True
elif self.id_ < 48:
if value is True:
Valve.valve_state2 |= (1<< (self.id_%16))
else:
Valve.valve_state2 &= ~(1<<(self.id_%16))
self.comproc.run_cmd(self.cmd_lookup['Valves']['set_state2'](Valve.valve_state2))
log.debug("Set Valve %d (state2) on -> %s" % (self.id_, bin(Valve.valve_state2)))
self.on_ = True
示例8: get_analog_out
def get_analog_out(self):
""" Return the analog Liquid Sensor value
"""
self.analog_out_ = self.status.LiquidSensors[self.id_]['analog_in'] / 4095.0
log.debug("Get Liquid Sensor Analog in %d on -> %s"
% (self.id_, self.analog_out_))
return self.analog_out_
示例9: close_no_check
def close_no_check(self):
""" Close the gripper and don't check the sensors """
log.debug("Gripper Close | Turn off valve:%d, Turn on valve:%d",
self._open_valve_id, self._close_valve_id)
self.synth.valves[self._open_valve_id].on = False
time.sleep(0.2)
self.synth.valves[self._close_valve_id].on = True
time.sleep(0.2)
示例10: get_on
def get_on(self):
log.debug("Get Temperature Controller %d on -> %s"
% (self.id_, self.on_))
errcode = self.status.TemperatureControllers[0]['error_code']
if errcode == '\x01':
self.on_ = True
else:
self.on_ = False
return self.on_
示例11: get_setpoint
def get_setpoint(self):
""" Get the pressure regulator
setpoint, i.e. the pressure it is suppose to get to
"""
value = self.synth.cbox.get_dacs()[self.id_]
value = value / self.conf['PSICONV']
log.debug("Current setpoint on regulator %d = %f",
self.id_, value)
return value
示例12: set_duty_cycle
def set_duty_cycle(self, value):
log.debug("Set Mixer %d duty cycle -> %f" % (self.id_, value))
if value >= 0.0 and value <= 100.0:
self.duty_ = value
cmd = self.cmd_lookup['Mixers']['set_duty_cycle'][self.id_](value)
self.comproc.run_cmd(cmd)
else:
# Raise Exception, value out of range!
log.error("Mixer %d duty cycle -> %f out of range" % (self.id_, value))
示例13: get_pressure
def get_pressure(self):
""" Return the actual pressure in PSI,
or something else depending on hwconf.ini
"""
value = self.synth.cbox.get_adcs()[self.id_]
value = value / self.conf['PSICONV']
log.debug("Current pressure on regulator %d = %f",
self.id_, value)
return value
示例14: move_coord
def move_coord(self, x, y):
""" Move to x, y coordinates """
log.debug("Move Reagent Robot to %d, %d", x, y)
self.prepare_move()
self.xactuator.move(x)
self.yactuator.move(y)
self.yactuator.wait()
self.xactuator.wait()
示例15: set_analog_out
def set_analog_out(self, value):
if not(value >= 0.0 and value <= 10.0):
# Should raise exception in future!!!!
log.error("SMC Analog setpoint (%f) out of range" % value)
return
self.comproc.run_cmd(self.cmd_lookup['SMCInterfaces']['set_analog_out'][self.id_](value))
log.debug("Set SMC Analog out %d on -> %s"
% (self.id_, value))
self.analog_out_ = value