• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python hallog.debug函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyelixys.logs.hallog.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了debug函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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) 
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:7,代码来源:pressureregulator.py


示例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()
开发者ID:henryeherman,项目名称:pyelixys,代码行数:26,代码来源:controlbox.py


示例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_
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:7,代码来源:hal.py


示例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
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:7,代码来源:pneumaticactuator.py


示例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)
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:7,代码来源:hal.py


示例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)
开发者ID:mgramli1,项目名称:pyelixys,代码行数:7,代码来源:stopcock.py


示例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
开发者ID:mgramli1,项目名称:pyelixys,代码行数:32,代码来源:hal.py


示例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_
开发者ID:mgramli1,项目名称:pyelixys,代码行数:7,代码来源:hal.py


示例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)
开发者ID:mgramli1,项目名称:pyelixys,代码行数:8,代码来源:gripper.py


示例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_
开发者ID:mgramli1,项目名称:pyelixys,代码行数:9,代码来源:hal.py


示例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
开发者ID:mgramli1,项目名称:pyelixys,代码行数:9,代码来源:pressureregulator.py


示例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))                
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:9,代码来源:hal.py


示例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
开发者ID:mgramli1,项目名称:pyelixys,代码行数:9,代码来源:pressureregulator.py


示例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()
开发者ID:mgramli1,项目名称:pyelixys,代码行数:9,代码来源:reagentrobot.py


示例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
开发者ID:mgramli1,项目名称:pyelixys,代码行数:10,代码来源:hal.py


示例16: set_setpoint

 def set_setpoint(self, value):
     if value > 180.0:
         #Raise exception
         log.debug("Error Temperature Controller %d setpoint -> %f,"
                   "TOO HOT, should be less than 180"
                   % (self.id_, self.setpoint_))
         return
     self.setpoint_ = value
     log.debug("Set Temperature Controller %d setpoint -> %f"
               % (self.id_, self.setpoint_))
     cmd = self.cmd_lookup['TemperatureControllers']['set_setpoint'][self.id_](value)
     self.comproc.run_cmd(cmd)
开发者ID:mgramli1,项目名称:pyelixys,代码行数:12,代码来源:hal.py


示例17: lower

 def lower(self):
     """ Lower actuator and unsure it gets there """
     for i in xrange(self.conf['retry_count']):
         begintime = datetime.now()
         self.lower_no_check()
         while self.timeout > datetime.now() - begintime:
             time.sleep(0.1)
             if self.is_down:
                 log.debug("Lower actuator %s success", repr(self))
                 return
         log.info("Failed to raise actuator %s before timeout, retry %d",
                     repr(self), i)
     log.error("Failed to lower actuator %s after retrys", repr(self))
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:13,代码来源:pneumaticactuator.py


示例18: close

 def close(self):
     """ Close the gripper and make sure it closes """
     for i in xrange(self.conf['retry_count']):
         begintime = datetime.now()
         self.close_no_check()
         while self.timeout > datetime.now() - begintime:
             time.sleep(0.1)
             if self.is_closed:
                 log.debug("Close actuator %s success", repr(self))
                 return
         log.info("Failed to close actuator %s before timeout, retry %d",
                     repr(self), i)
     log.error("Failed to close actuator %s after retrys", repr(self))
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:13,代码来源:gripper.py


示例19: lift

    def lift(self):
        """ Move the actuator up and ensure it gets there """
        for i in xrange(self.conf['retry_count']):
            begintime = datetime.now()
            self.lift_no_check()
            while self.timeout > datetime.now() - begintime:
                time.sleep(0.1)
                if self.is_up:
                    log.debug("Lift actuator %s success", repr(self))
                    return

            log.info("Failed to raise actautor %s before timeout, retry %d",
                        repr(self), i)
        log.error("Failed to raise actuator %s after retrys", repr(self))
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:14,代码来源:pneumaticactuator.py


示例20: open

    def open(self):
        """ Open the gripper and make sure it opens """
        for i in xrange(self.conf['retry_count']):
            begintime = datetime.now()
            self.open_no_check()
            while self.timeout > datetime.now() - begintime:
                time.sleep(0.1)
                if self.is_open:
                    log.debug("Open actuator %s success", repr(self))
                    return

            log.info("Failed to open actautor %s before timeout, retry %d",
                        repr(self), i)
        log.error("Failed to open actuator %s after retrys", repr(self))
开发者ID:LuisFuentes,项目名称:pyelixys,代码行数:14,代码来源:gripper.py



注:本文中的pyelixys.logs.hallog.debug函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python hwsimlog.debug函数代码示例发布时间:2022-05-25
下一篇:
Python downtime.DowntimePronePool类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap