本文整理汇总了Python中smellie.smellie_logger.SMELLIELogger类的典型用法代码示例。如果您正苦于以下问题:Python SMELLIELogger类的具体用法?Python SMELLIELogger怎么用?Python SMELLIELogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SMELLIELogger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)
示例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.")
示例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
示例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
示例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
示例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
示例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.")
示例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.")
示例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.")
示例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.")
示例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
示例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.")
示例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.")
示例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.")
示例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)