本文整理汇总了Python中interpreter.Interpreter.buildResetSensor方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.buildResetSensor方法的具体用法?Python Interpreter.buildResetSensor怎么用?Python Interpreter.buildResetSensor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interpreter.Interpreter
的用法示例。
在下文中一共展示了Interpreter.buildResetSensor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Modem
# 需要导入模块: from interpreter import Interpreter [as 别名]
# 或者: from interpreter.Interpreter import buildResetSensor [as 别名]
#.........这里部分代码省略.........
while self.status != Modem.Status.IDLE :
sleep(0.1)
if self.status != Modem.Status.IDLE:
raise ValueError("Modem resetProj unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildResetProj(ID_list, force_flag))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
#self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()
def reqResetSensors(self, sens_t, ID_list, force_flag = 0):
"""
Reset the sensors (either hydrophones, camera or other)
@param self pointer to the class object
@param sens_t of the sensors that have to be reset:
0 --> all
1 --> hydrophone,
2 --> camera
3 --> others
@param ID_list list of the projector IDs that has to be resetted
@param force_flag if 1 reset also if pending operations, if 0 not
@return the message
"""
while self.status != Modem.Status.IDLE :
sleep(0.1)
if self.status != Modem.Status.IDLE:
raise ValueError("Modem reqResetSensor unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildResetSensor(sens_t, ID_list, force_flag))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
#self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()
def reqResetAll(self, force_flag = 0):
"""
Build the reset_all message. This message will reset the node
@param self pointer to the class object
@param force_flag if 1 reset also if pending operations, if 0 not
@return the message
"""
while self.status != Modem.Status.IDLE :
sleep(0.1)
if self.status != Modem.Status.IDLE:
raise ValueError("Modem resetAll unexpected status: \
" + str(self.status))
self.status = Modem.Status.BUSY2REQ
self.send(self.interpreter.buildResetAll(force_flag))
while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
sleep(self.m_to)
#self.recvCommand()
if self.status == Modem.Status.KILL:
return self.close()
return self.errorCheck()
def reqDeleteAllRec(self, sens_t = 0):
"""
Delete the recorded files from the node
@param self pointer to the class object