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

Python smellie_logger.SMELLIELogger类代码示例

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

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



在下文中一共展示了SMELLIELogger类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: log_exception

def log_exception(exception_string):
    """
    Logs exceptions to logging server at highest level (warn).

    :param exception: The exception to log
    """
    SMELLIELogger.warn(exception_string)
开发者ID:jlidgard,项目名称:newSmellie,代码行数:7,代码来源:exception_handler.py


示例2: set_parameters

    def set_parameters(self):
        """
        set superK control parameters. Most of these should not be configurable and hard-coded for safety.
        """
        if self.isConnected:
            SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.set_parameters()')

            superKControls = superKControlStructure()
            superKControls.trigLevelSetpointmV = c_uint16(1000)
            superKControls.displayBacklightPercent = c_uint8(0)
            superKControls.trigMode = c_uint8(1)
            superKControls.internalPulseFreqHz = c_uint16(0)
            superKControls.burstPulses = c_uint16(1) 
            superKControls.watchdogIntervalSec = c_uint8(0)
            superKControls.internalPulseFreqLimitHz = c_uint32(24000) #doesn't do anything. Possibly a manufacturer option disabled in firmware.
            setSuperKControls(self.COMPort,superKControls)

            #check parameters have been set correctly:
            new_superKControls=self.get_parameters()
            if (superKControls.trigLevelSetpointmV!=new_superKControls.trigLevelSetpointmV or
            superKControls.displayBacklightPercent!=new_superKControls.displayBacklightPercent or
            superKControls.trigMode!=new_superKControls.trigMode or
            superKControls.internalPulseFreqHz!=new_superKControls.internalPulseFreqHz or 
            superKControls.burstPulses!=new_superKControls.burstPulses or 
            superKControls.watchdogIntervalSec!=new_superKControls.watchdogIntervalSec or 
            superKControls.internalPulseFreqLimitHz!=new_superKControls.internalPulseFreqLimitHz):
                SMELLIELogger.warn('SNODROP WARN: Error upon setting SuperK control bits. Specified values have not all been set. Check system.')
                raise SuperKDriverHWError("Error upon setting SuperK control bits. Specified values have not all been set. Check system.{}.") 
        else:
            raise SuperKDriverLogicError("SuperK port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:30,代码来源:superk_driver.py


示例3: get_type

 def get_type(self):
     """
     Get the current Fibre Switch hardware model as a string
     """ 
     self.execute_message("type?")
     type = self.read_back()
     SMELLIELogger.debug('SNODROP DEBUG: FibreSwitch4Chan.get_type = {}'.format(type))
     return type
开发者ID:jlidgard,项目名称:newSmellie,代码行数:8,代码来源:fibre_switch_4chan.py


示例4: get_info

 def get_info(self):
     """
     Get the current Laser Switch hardware model as a string
     """ 
     self.execute_message("y")
     type = self.read_back()
     SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.get_info = {}'.format(type))
     return type
开发者ID:jlidgard,项目名称:newSmellie,代码行数:8,代码来源:laser_switch.py


示例5: get_fwr_version

 def get_fwr_version(self):
     """
     Get the current Laser Switch firmware version as a string
     """
     self.execute_message("x")
     fwr_ver = self.read_back()
     SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.get_fwr_version = {}'.format(fwr_ver))
     return fwr_ver
开发者ID:jlidgard,项目名称:newSmellie,代码行数:8,代码来源:laser_switch.py


示例6: _cleanup

 def _cleanup(self):
     """
     Wait until all n trigger pulses have been sent, and then stop the Trigger Generation task and clear the NI Unit's task memory.
     """
     SMELLIELogger.debug('SNODROP DEBUG: TriggerGenerator._cleanup()')
     if self.taskHandle is not None:
         daqmx.functions.DAQmxStopTask(self.taskHandle)
         daqmx.functions.DAQmxClearTask(self.taskHandle)
     self.taskHandle = None
开发者ID:jlidgard,项目名称:newSmellie,代码行数:9,代码来源:ni_trigger_generator.py


示例7: go_ready

 def go_ready(self, intensity):
     """
     Set PQ driver into its ready state, given intensity, sets soft-lock = off
     """
     if self.isConnected:
         SMELLIELogger.debug('SNODROP DEBUG: PQDriver.go_ready()')
         self.set_intensity(intensity)
         self.set_soft_lock(False)
     else:
         raise PQDriverLogicError("Laser port not open.") 
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:PQ_driver.py


示例8: get_wavelengths

 def get_wavelengths(self):
     """
     undocumented
     """
     if self.isConnected:
         high_wavelength, low_wavelength = getVariaControls(self.COMPort)
         SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.get_wavelengths() = {}, {}'.format(low_wavelength, high_wavelength))
         return low_wavelength, high_wavelength
     else:
         raise SuperKDriverLogicError("SuperK port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:superk_driver.py


示例9: get_parameters

 def get_parameters(self):
     """
     undocumented
     """
     if self.isConnected:
         superKControlStructure = getSuperKControls(self.COMPort)
         SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.get_parameters()')
         return superKControlStructure
     else:
         raise SuperKDriverLogicError("SuperK port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:superk_driver.py


示例10: port_close

 def port_close(self):
     """
     Close the serial port connection
     """
     SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.port_close()')
     if self.isConnected:
         self.serial.close()
         self.isConnected = False
     else:
         raise LaserSwitchLogicError("Laser Switch port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:laser_switch.py


示例11: execute

 def execute(self):
     """
     Change the active Laser Switch channel from the currently active one to the currently selected one
     """
     SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.send_select_command()')
     self.execute_message("e")
     response = self.read_back()
     if (response!="Execute. Sent."):
         raise LaserSwitchHWError("Unrecognised response after select command. Check system.")
     sleep(LASER_SWITCH_EXECUTE_TIME) #time for mains to be switched and Sepia USB device to reconnect
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:laser_switch.py


示例12: set_soft_lock

 def set_soft_lock(self, is_locked = True):
     """
     Set the PQ driver soft-lock to on
     """
     if self.isConnected:
         SMELLIELogger.debug('SNODROP DEBUG: PQDriver.set_soft_lock({})'.format(is_locked))
         if is_locked != self.is_soft_lock_on():
             set_laser_soft_lock(self.dev_id, self.driver_slot_id, is_locked)
     else:
         raise PQDriverLogicError("Laser port not open.") 
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:PQ_driver.py


示例13: get_trigger_mode

 def get_trigger_mode(self):
     """
     undocumented
     """
     if self.isConnected:
         superKControlStructure = self.get_parameters()
         SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.get_trigger_mode() = {}'.format(superKControlStructure.trigMode))
         return superKControlStructure.trigMode #for simplicity, just return mode, not internal trigger rate. Rate should always be set.
     else:
         raise SuperKDriverLogicError("SuperK port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:superk_driver.py


示例14: port_close

 def port_close(self):
     """
     Close the serial port connection
     """
     SMELLIELogger.debug('SNODROP DEBUG: Interlock.port_close()')
     if self.isConnected:
         self.serial.close()
         self.isConnected = False
     else:
         raise InterlockLogicError("Interlock port not open.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:interlock.py


示例15: execute

    def execute(self):
        """
        Change the active Laser Switch channel from the currently active one to the currently selected one
        """
        SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.execute()')
        self.connection.eDigitalOut(0, 1, writeD = 1) 
        self.connection.eDigitalOut(0, 0, writeD = 1)      
        self.connection.eDigitalOut(0, 1, writeD = 1)

        sleep(RELAY_SLEEP)
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:laser_switch_labjack.py


示例16: system_state

 def system_state(self):
     """
     Returns a formatted string with the hardware info and constant settings.
     """
     if self.isConnected:
         superK_info, varia_info = self.get_identity()
         SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.system_state() = {}, {}, {}'.format(superK_info, varia_info, self.NDFilter.system_state() ))
         return "SuperK laser (settings):: Compact Info: {}, Varia Info: {}{}".format(superK_info, varia_info, self.NDFilter.system_state() )
     else:
         raise SuperKDriverLogicError("SuperK port not open.") 
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:superk_driver.py


示例17: current_state

 def current_state(self):
     """
     Returns a formatted string with the current hardware settings
     """
     if self.isConnected:
         low_wavelength, high_wavelength = self.get_wavelengths()
         SMELLIELogger.debug('SNODROP DEBUG: SuperKDriver.current_state() = {},{},{}'.format(self.NDFilter.current_state(), low_wavelength, high_wavelength ))
         return "SuperK laser (settings):: NDFilter Step: {}, Low Wavelength: {}, High Wavelength: {}".format(self.NDFilter.current_state(), low_wavelength, high_wavelength )
     else:
         raise SuperKDriverLogicError("SuperK port not open.")   
开发者ID:jlidgard,项目名称:newSmellie,代码行数:10,代码来源:superk_driver.py


示例18: get_selected_channel

    def get_selected_channel(self):
        """
        Poll the Laser Switch for the current selected channel number

        :returns: current channel
        :type current channel: int
        """
        self.execute_message("c")
        channel_num =  int(filter(str.isdigit, self.read_back()))
        SMELLIELogger.debug('SNODROP DEBUG: LaserSwitch.get_selected_channel() = {}'.format(str(channel_num)))
        return channel_num
开发者ID:jlidgard,项目名称:newSmellie,代码行数:11,代码来源:laser_switch.py


示例19: set_repetition

 def set_repetition(self, frequency):
     """
     Set the repetition rate of the generated triggers.
     
     :params: frequency
     """
     SMELLIELogger.debug('SNODROP DEBUG: TriggerGenerator.set_repetition({})'.format(frequency))
     if frequency <= TRIG_GEN_MAX_FREQUENCY and frequency>0:
         self.frequency = frequency
     else: 
         raise NILogicError("Requested frequency too high.")
开发者ID:jlidgard,项目名称:newSmellie,代码行数:11,代码来源:ni_trigger_generator.py


示例20: set_disarm

    def set_disarm(self):
        """
        Send a command to disarm the interlock

        :param msg: 'd'
        :type msg: string
        """
        SMELLIELogger.debug('SNODROP DEBUG: Interlock.set_disarm()')
        self.execute_message("d")
        response = self.read_back()
        return response
开发者ID:jlidgard,项目名称:newSmellie,代码行数:11,代码来源:interlock.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python logger.error函数代码示例发布时间:2022-05-27
下一篇:
Python smc_firewall.log函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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