当前位置: 首页>>代码示例>>Python>>正文


Python Interpreter.buildGetData方法代码示例

本文整理汇总了Python中interpreter.Interpreter.buildGetData方法的典型用法代码示例。如果您正苦于以下问题:Python Interpreter.buildGetData方法的具体用法?Python Interpreter.buildGetData怎么用?Python Interpreter.buildGetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在interpreter.Interpreter的用法示例。


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

示例1: Modem

# 需要导入模块: from interpreter import Interpreter [as 别名]
# 或者: from interpreter.Interpreter import buildGetData [as 别名]

#.........这里部分代码省略.........
    def reqDataFile(self, file_name, delete_flag = 1):
        """
        Require a file from the submerged node
        @param self pointer to the class object
        @param file_name name of the required file
        @param delete_flag, if 1 erase it after sending, if 0 not
        """
        while self.status != Modem.Status.IDLE :
            sleep(0.1)
        if self.status != Modem.Status.IDLE:
            raise ValueError("Modem reqDataFile unexpected status: \
                " + str(self.status))
        self.status = Modem.Status.BUSY2REQ
        self.send(self.interpreter.buildGetFile(file_name, delete_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 reqAllData(self, delete_flag = 1):
        """
        Require all the data from the submerged node
        @param self pointer to the class object
        @param delete_flag, if 1 erase it after sending, if 0 not
        """
        while self.status != Modem.Status.IDLE :
            sleep(0.1)
        if self.status != Modem.Status.IDLE:
            raise ValueError("Modem reqAllData unexpected status: \
                " + str(self.status))
        self.status = Modem.Status.BUSY2REQ
        self.send(self.interpreter.buildGetData(delete_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 reqRTData(self, ID_list, starting_time, duration, \
        chunck_duration = 1, delete = 1, force_flag = 0):
        """
        Require the data real time from the submerged node.
        @param self pointer to the class object
        @param ID_list list of the projector IDs used to record the audio
        @param starting_time Unix timestamp, in second, when to start recording the file
        @param duration duration, in minutes of the recording
        @param chunck_duration chunk duration, in seconds
        @param delete flag, if 1 erase it after sending, otherwise if 0 not
        @param force_flag if trying to record while transmitting:
            0 (default) not allowed (error feedback)
            1 (force) stop transmitting and start recording
            2 (both) do both the operations together
        """
        while self.status != Modem.Status.IDLE :
            sleep(0.1)
        if self.status != Modem.Status.IDLE:
            raise ValueError("Modem reqRTData unexpected status: \
                " + str(self.status))
        self.status = Modem.Status.BUSY2REQ
        self.send(self.interpreter.buildGetRTData(ID_list, starting_time, \
            duration, chunck_duration, delete , force_flag))
        while self.status != Modem.Status.IDLE and self.status != Modem.Status.KILL:
            sleep(self.m_to)
开发者ID:marinetech,项目名称:Udoo,代码行数:70,代码来源:modem.py


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