示例#1
0
    def process_system(self, full_record):
        """
        Extract a system record, and if there is a pair of system records with velocities in between determine
        the time offset between velocity timestamps and extract the velocity records.  Also if the first timestamp
        has not been set yet, set it
        :param full_record: The raw data string to pass into the system particle
        """

        if self.previous_system_timestamp is not None and self.stored_velocity_records != []:
            # there has been a pair of system records and with velocity records in between
            n_vel_records = len(self.stored_velocity_records)

            time_offset = 1.0/float(n_vel_records)

            # calculate the timestamps and extract velocity records
            self.extract_velocities(time_offset)

            self.stored_n_velocity_records = n_vel_records

        # get the timestamp associated with this system record
        timestamp = vel3d_velpt_common.get_timestamp(full_record)

        # extract the system record
        self.simple_extract(self.system_class, full_record, timestamp)

        self.previous_system_timestamp = float(timestamp)

        if self.first_timestamp is None:
            self.first_timestamp = timestamp
            # check if head or hardware messages have been received and not sent yet
            self.extract_h_config()
示例#2
0
    def process_user_config(self, full_record):
        """
        Extract the user config particle, and set the first timestamp if it has not been set yet
        :param full_record: The raw data string of the user config particle
        """
        # get the timestamp for this particle
        timestamp = vel3d_velpt_common.get_timestamp(full_record, start_byte=48)

        # if the first timestamp has not been set, set it here
        if self.first_timestamp is None:
            self.first_timestamp = timestamp
            # check if head or hardware messages have been received and not sent yet
            self.extract_h_config()

        self.simple_extract(self.user_config_class, full_record, timestamp)
示例#3
0
    def process_header_data(self, full_record):
        """
        Extract the header data particle, and set the first timestamp if it has not been set
        :param full_record: The raw data string to pass into the header data particle
        """
        # get the timestamp for this particle
        timestamp = vel3d_velpt_common.get_timestamp(full_record)

        # check if the first timestamp has been set, if not set it
        if self.first_timestamp is None:
            self.first_timestamp = timestamp
            # check if head or hardware messages have been received and not sent yet
            self.extract_h_config()

        # extract the data header particle
        self.simple_extract(self.data_header_class, full_record, timestamp)