本文整理汇总了Python中sc_library.hdebug.logText函数的典型用法代码示例。如果您正苦于以下问题:Python logText函数的具体用法?Python logText怎么用?Python logText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logText函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: dropEvent
def dropEvent(self, event):
# Initialize filenames variable
filenames = []
# Tranfer urls to filenames
for url in event.mimeData().urls():
filenames.append(str(url.toLocalFile()))
# Sort file names
filenames = sorted(filenames)
# Identify first type
name, firstType = os.path.splitext(filenames[0])
# Check to see if all types are the same
sameType = []
for filename in filenames:
name, fileType = os.path.splitext(filename)
sameType.append(fileType == firstType)
# If not, raise an error and abort load
if not all(sameType):
hdebug.logText(" Loaded mixed file types")
QtGui.QMessageBox.information(self, "Too many file types", "")
return
# Load files
if firstType == ".dax": # Load dax files
self.loadMovie(filenames)
elif firstType == ".msc": # Load mosaics
for filename in sorted(filenames):
self.loadMosaic(filename)
else:
hdebug.logText(" " + firstType + " is not recognized")
QtGui.QMessageBox.information(self, "File type not recognized", "")
开发者ID:amancebo,项目名称:storm-control,代码行数:35,代码来源:steve.py
示例2: sendComplete
def sendComplete(self, a_string):
if self.isConnected():
hdebug.logText("sendComplete " + a_string)
self.socket.write(QtCore.QByteArray("Complete," + a_string + "\n"))
self.socket.flush()
else:
hdebug.logText("sendComplete: not connected")
开发者ID:gtdempsey,项目名称:storm-control,代码行数:7,代码来源:tcpControl.py
示例3: initCamera
def initCamera(self):
if not self.cameras[0]:
hdebug.logText(" Initializing Andor Cameras", False)
if (platform.architecture()[0] == "32bit"):
path = "c:/Program Files/Andor iXon/Drivers/"
driver = "atmcd32d.dll"
if os.path.exists(path + driver):
self.initCameraHelperFn(path, driver)
return
path = "c:/Program Files/Andor Solis/"
driver = "atmcd32d.dll"
if os.path.exists(path + driver):
self.initCameraHelperFn(path, driver)
return
else:
path = "c:/Program Files/Andor Solis/Drivers/"
driver = "atmcd64d.dll"
if os.path.exists(path + driver):
self.initCameraHelperFn(path, driver)
return
path = "c:/Program Files (x86)/Andor Solis/Drivers/"
driver = "atmcd64d.dll"
if os.path.exists(path + driver):
self.initCameraHelperFn(path, driver)
return
print "Can't find Andor Camera drivers"
开发者ID:gtdempsey,项目名称:storm-control,代码行数:31,代码来源:andordualCameraControl.py
示例4: disconnected
def disconnected(self):
if hdebug.getDebug():
hdebug.logText(" TCPControl lost connection. " + str(self.isConnected()))
self.socket.disconnectFromHost()
self.socket.close()
self.socket = None
self.commLostConnection.emit()
开发者ID:gtdempsey,项目名称:storm-control,代码行数:7,代码来源:tcpControl.py
示例5: readyRead
def readyRead(self):
while self.socket.canReadLine():
message = str(self.socket.readLine())[:-1]
if hdebug.getDebug():
hdebug.logText("Got: " + message)
# Send an acknowledgement that the command was recieved.
self.socket.write(QtCore.QByteArray("Ack\n"))
self.socket.flush()
# Parse the message to generate the command.
message_split = message.split(",")
# Get command type.
command_type = message_split[0]
# Parse command data.
i = 0
command_data = []
message_data = message_split[1:]
while(i < len(message_data)):
m_type = message_data[i]
m_value = message_data[i+1]
if (m_type == "string"):
command_data.append(m_value)
elif (m_type == "int"):
command_data.append(int(m_value))
elif (m_type == "float"):
command_data.append(float(m_value))
else:
print "Unknown type:", m_type
i += 2
self.commMessage.emit(TCPMessage(command_type, command_data))
开发者ID:gtdempsey,项目名称:storm-control,代码行数:35,代码来源:tcpControl.py
示例6: startFilm
def startFilm(self, film_name, run_shutters):
# Recording the power.
if film_name:
self.fp = open(film_name + ".power", "w")
frame_base = "frame"
for channel in self.channels:
frame_base = frame_base + " " + channel.getName()
self.fp.write(frame_base + "\n")
# Running the shutters.
if run_shutters:
self.running_shutters = True
# Setup channels.
for channel in self.channels:
channel.setupFilm()
try:
# Start hardware.
for name, instance in self.hardware_modules.iteritems():
if (instance.getStatus() == True):
instance.startFilm(self.parameters.get("seconds_per_frame"),
self.parameters.get("illumination.shutter_oversampling"))
# Start channels.
for channel in self.channels:
channel.startFilm()
except halExceptions.HardwareException as error:
error_message = "startFilm in illumination control encountered an error: \n" + str(error)
hdebug.logText(error_message)
raise halModule.StartFilmException(error_message)
开发者ID:AlistairBoettiger,项目名称:storm-control,代码行数:33,代码来源:illuminationControl.py
示例7: newParameters
def newParameters(self, parameters):
p = parameters.get("camera1")
try:
# Set binning. Some cameras might support x_bin != y_bin to
# for now we are requiring these to be equal.
x_bin = p.get("x_bin")
if (x_bin != p.get("y_bin")):
raise AssertionError("unequal binning is not supported.")
if (x_bin == 1):
self.camera.setProperty("AOIBinning", "enum", "1x1")
elif (x_bin == 2):
self.camera.setProperty("AOIBinning", "enum", "2x2")
elif (x_bin == 3):
self.camera.setProperty("AOIBinning", "enum", "3x3")
elif (x_bin == 4):
self.camera.setProperty("AOIBinning", "enum", "4x4")
elif (x_bin == 8):
self.camera.setProperty("AOIBinning", "enum", "8x8")
else:
raise andor.AndorException("unsupported bin size " + str(p.get("x_bin")))
# Set ROI location and size.
if ((p.get("x_pixels") % x_bin) != 0) or ((p.get("y_pixels") % x_bin) != 0):
raise andor.AndorException("image size must be a multiple of the bin size.")
self.camera.setProperty("AOIWidth", "int", p.get("x_pixels")/x_bin)
self.camera.setProperty("AOIHeight", "int", p.get("y_pixels")/x_bin)
self.camera.setProperty("AOILeft", "int", p.get("x_start"))
self.camera.setProperty("AOITop", "int", p.get("y_start"))
# Set the rest of the camera properties.
#
# Note: These could overwrite the above. For example, if you
# have both "x_start" and "AOILeft" in the parameters
# file then "AOILeft" will overwrite "x_start". Trouble
# may follow if they are not set to the same value.
#
for key, value in p.__dict__.iteritems():
if self.camera.hasFeature(key):
value_type = str(type(value).__name__)
self.camera.setProperty(key, value_type, value)
self.got_camera = True
except andor.AndorException:
hdebug.logText("QCameraThread: Bad camera settings")
print traceback.format_exc()
self.got_camera = False
if not p.has("bytes_per_frame"):
p.set("bytes_per_frame", 2 * p.get("x_pixels") * p.get("y_pixels"))
# Get the target temperature for the camera. On some
# cameras this cannot be set.
if not p.has("temperature"):
p.set("temperature", self.camera.getProperty("TemperatureControl", "enum"))
self.parameters = p
开发者ID:amancebo,项目名称:storm-control,代码行数:60,代码来源:andorSDK3CameraControl.py
示例8: getSettings
def getSettings(self):
if not self.tcp_client.isConnected():
hdebug.logText("getSettings: not connected to HAL.")
return
self.messages.append(mosaicSettingsMessage())
self.messages.append(objectiveMessage(True))
self.sendFirstMessage()
开发者ID:BogdanBintu,项目名称:storm-control,代码行数:9,代码来源:capture.py
示例9: toggleSettings
def toggleSettings(self):
self.parameters = self.parameters_box.getCurrentParameters()
self.stopCamera()
try:
self.newParameters()
except:
hdebug.logText("bad parameters")
QtGui.QMessageBox.information(self, "Bad parameters", traceback.format_exc())
self.startCamera()
开发者ID:amancebo,项目名称:storm-control,代码行数:9,代码来源:hal-4000.py
示例10: stopFilm
def stopFilm(self):
illuminationHardware.DaqModulation.stopFilm(self)
for task in [self.ct_task, self.ao_task, self.do_task]:
if task:
try:
task.stopTask()
task.clearTask()
except nicontrol.NIException as e:
hdebug.logText("stop / clear failed for task " + str(task) + " with " + str(e))
开发者ID:AlistairBoettiger,项目名称:storm-control,代码行数:9,代码来源:hNicontrol.py
示例11: getPosition
def getPosition(self):
if not self.tcp_client.isConnected():
hdebug.logText("getPosition: not connected to HAL.")
return
message = getPositionMessage()
self.messages.append(message)
self.sendFirstMessage()
开发者ID:CMSpeer,项目名称:storm-control,代码行数:9,代码来源:capture.py
示例12: sendCommand
def sendCommand(self, command):
if self.isConnected():
hdebug.logText(" sending: " + command)
self.unacknowledged += 1
self.socket.sendCommand(command)
self.socket.flush()
time.sleep(0.05)
else:
hdebug.logText(" Not connected?!?")
开发者ID:gtdempsey,项目名称:storm-control,代码行数:9,代码来源:tcpClient.py
注:本文中的sc_library.hdebug.logText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论