コード例 #1
0
 def stream_config(cls):
     return [WfpEngStcImodemStatusRecoveredDataParticle.type(),
             WfpEngStcImodemStartRecoveredDataParticle.type(),
             WfpEngStcImodemEngineeringRecoveredDataParticle.type(),
             WfpEngStcImodemStatusTelemeteredDataParticle.type(),
             WfpEngStcImodemStartTelemeteredDataParticle.type(),
             WfpEngStcImodemEngineeringTelemeteredDataParticle.type()]
コード例 #2
0
ファイル: driver.py プロジェクト: unwin/marine-integrations
 def stream_config(cls):
     return [
         WfpEngStcImodemStatusRecoveredDataParticle.type(),
         WfpEngStcImodemStartRecoveredDataParticle.type(),
         WfpEngStcImodemEngineeringRecoveredDataParticle.type(),
         WfpEngWfpSioMuleParserDataStartTimeParticle.type(),
         WfpEngWfpSioMuleParserDataStatusParticle.type(),
         WfpEngWfpSioMuleParserDataEngineeringParticle.type()
     ]
コード例 #3
0
ファイル: driver.py プロジェクト: ooici/marine-integrations
 def stream_config(cls):
     return [
         WfpEngStcImodemStatusRecoveredDataParticle.type(),
         WfpEngStcImodemStartRecoveredDataParticle.type(),
         WfpEngStcImodemEngineeringRecoveredDataParticle.type(),
         WfpEngWfpSioMuleParserDataStartTimeParticle.type(),
         WfpEngWfpSioMuleParserDataStatusParticle.type(),
         WfpEngWfpSioMuleParserDataEngineeringParticle.type(),
     ]
コード例 #4
0
    def setUp(self):
        ParserUnitTestCase.setUp(self)
        self.config = {
            DataTypeKey.WFP_ENG_STC_IMODEM_RECOVERED: {
                DataSetDriverConfigKeys.PARTICLE_MODULE:
                'mi.dataset.parser.wfp_eng__stc_imodem_particles',
                DataSetDriverConfigKeys.PARTICLE_CLASS: None,
                DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
                    'status_data_particle_class':
                    WfpEngStcImodemStatusRecoveredDataParticle,
                    'start_data_particle_class':
                    WfpEngStcImodemStartRecoveredDataParticle,
                    'engineering_data_particle_class':
                    WfpEngStcImodemEngineeringRecoveredDataParticle
                }
            },
            DataTypeKey.WFP_ENG_STC_IMODEM_TELEMETERED: {
                DataSetDriverConfigKeys.PARTICLE_MODULE:
                'mi.dataset.parser.wfp_eng__stc_imodem_particles',
                DataSetDriverConfigKeys.PARTICLE_CLASS: None,
                DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: {
                    'status_data_particle_class':
                    WfpEngStcImodemStatusTelemeteredDataParticle,
                    'start_data_particle_class':
                    WfpEngStcImodemStartTelemeteredDataParticle,
                    'engineering_data_particle_class':
                    WfpEngStcImodemEngineeringTelemeteredDataParticle
                }
            },
        }

        self.start_state = {StateKey.POSITION: 0}

        # Define test data particles and their associated timestamps which will be
        # compared with returned results
        timestamp1_time = self.timestamp_to_ntp('R\x9d\xac\x19')
        self.particle_a_start_time_recov = WfpEngStcImodemStartRecoveredDataParticle(
            b'\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00R\x9d\xab\xa2R\x9d\xac\x19',
            internal_timestamp=timestamp1_time)
        self.particle_a_start_time_telem = WfpEngStcImodemStartTelemeteredDataParticle(
            b'\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x01\x00\x00\x00\x00R\x9d\xab\xa2R\x9d\xac\x19',
            internal_timestamp=timestamp1_time)

        timestamp1_eng = self.timestamp_to_ntp('R\x9d\xac\x1d')
        self.particle_a_eng_recov = WfpEngStcImodemEngineeringRecoveredDataParticle(
            b'R\x9d\xac\x1d\x00\x00\x00\x00A:6\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x00h\x00N',
            internal_timestamp=timestamp1_eng)
        self.particle_a_eng_telem = WfpEngStcImodemEngineeringTelemeteredDataParticle(
            b'R\x9d\xac\x1d\x00\x00\x00\x00A:6\xe3\x00\x00\x00\x00\x00\x00\x00\x00\x01\x03\x00h\x00N',
            internal_timestamp=timestamp1_eng)

        timestamp2_eng = self.timestamp_to_ntp('R\x9d\xac!')
        self.particle_b_eng_recov = WfpEngStcImodemEngineeringRecoveredDataParticle(
            b'R\x9d\xac!C\t\xf2\xf7A9A!\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf2\x00c\x00O',
            internal_timestamp=timestamp2_eng)
        self.particle_b_eng_telem = WfpEngStcImodemEngineeringTelemeteredDataParticle(
            b'R\x9d\xac!C\t\xf2\xf7A9A!\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf2\x00c\x00O',
            internal_timestamp=timestamp2_eng)

        timestamp3_eng = self.timestamp_to_ntp('R\x9d\xac&')
        self.particle_c_eng_recov = WfpEngStcImodemEngineeringRecoveredDataParticle(
            b"R\x9d\xac&C\xbc\x9f\xa7A7'\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc2\x00^\x00O",
            internal_timestamp=timestamp3_eng)
        self.particle_c_eng_telem = WfpEngStcImodemEngineeringTelemeteredDataParticle(
            b"R\x9d\xac&C\xbc\x9f\xa7A7'\xbb\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc2\x00^\x00O",
            internal_timestamp=timestamp3_eng)

        timestamp4_eng = self.timestamp_to_ntp('R\x9d\xac*')
        self.particle_d_eng_recov = WfpEngStcImodemEngineeringRecoveredDataParticle(
            b'R\x9d\xac*C\xc5\xad\x08A6\xd5\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x00n\x00O',
            internal_timestamp=timestamp4_eng)
        self.particle_d_eng_telem = WfpEngStcImodemEngineeringTelemeteredDataParticle(
            b'R\x9d\xac*C\xc5\xad\x08A6\xd5\xd0\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb4\x00n\x00O',
            internal_timestamp=timestamp4_eng)

        timestamp_last_eng = self.timestamp_to_ntp('R\x9d\xac\xcf')
        self.particle_last_eng_recov = WfpEngStcImodemEngineeringRecoveredDataParticle(
            b'R\x9d\xac\xcfA\xfa\xb2:A5\x0b\x0fA\xf2\x8f\\\x00\x00\x00\x00\x00\xaf\x00m\x00P',
            internal_timestamp=timestamp_last_eng)
        self.particle_last_eng_telem = WfpEngStcImodemEngineeringTelemeteredDataParticle(
            b'R\x9d\xac\xcfA\xfa\xb2:A5\x0b\x0fA\xf2\x8f\\\x00\x00\x00\x00\x00\xaf\x00m\x00P',
            internal_timestamp=timestamp_last_eng)

        timestamp1_status = self.timestamp_to_ntp('R\x9d\xac\xd4')
        self.particle_a_status_recov = WfpEngStcImodemStatusRecoveredDataParticle(
            b'\xff\xff\xff\xff\x00\x00\x00\rR\x9d\xac\xd4R\x9d\xadQ',
            internal_timestamp=timestamp1_status)
        self.particle_a_status_telem = WfpEngStcImodemStatusTelemeteredDataParticle(
            b'\xff\xff\xff\xff\x00\x00\x00\rR\x9d\xac\xd4R\x9d\xadQ',
            internal_timestamp=timestamp1_status)

        # uncomment the following to generate particles in yml format for driver testing results files
        #self.particle_to_yml(self.particle_a_start_time_recov)
        #self.particle_to_yml(self.particle_a_eng)
        #self.particle_to_yml(self.particle_b_eng)
        #self.particle_to_yml(self.particle_c_eng)
        #self.particle_to_yml(self.particle_d_eng)
        #self.particle_to_yml(self.particle_a_stat)

        self.file_ingested = False
        self.state_callback_value = None
        self.publish_callback_value = None