예제 #1
0
    def _init_saving_session(self):
        """Start storing data..."""

        if self._session_is_active:
            self.logger.error("Attempting to start saving signal to file while not closing previously opened file!")
            return
        append_ts = int(self.config.get_param("append_timestamps"))
        use_tmp_file = int(self.config.get_param("use_tmp_file"))
        use_own_buffer = int(self.config.get_param("use_own_buffer"))
        signal_type = self.config.get_param("signal_type")
        self._samples_per_packet = int(self.config.get_param("samples_per_packet"))

        l_f_name =  self.config.get_param("save_file_name")
        l_f_dir = self.config.get_param("save_file_path")
        self._number_of_samples = 0
        l_f_dir = os.path.expanduser(os.path.normpath(l_f_dir))
        if not os.access(l_f_dir, os.F_OK):
             os.mkdir(l_f_dir)
        self._file_path = os.path.normpath(os.path.join(
               l_f_dir, l_f_name + DATA_FILE_EXTENSION))

        self._data_proxy = data_write_proxy.get_proxy(
            self._file_path, append_ts, use_tmp_file, use_own_buffer, signal_type)

        self._mx_signal_type = types.__dict__[self.config.get_param("mx_signal_type")]
예제 #2
0
    def __init__(self, addresses):
        super(EtrSaver, self).__init__(addresses=addresses, type=peers.ETR_SAVER)
        self.logger.info("Request system settings ...")

        f_dir = os.path.expanduser(os.path.normpath(self.config.get_param("save_file_path")))
        f_name = self.config.get_param("save_file_name")
        if not os.access(f_dir, os.F_OK):
            os.mkdir(f_dir)
        f_path = os.path.normpath(os.path.join(f_dir, f_name + DATA_FILE_EXTENSION))
        self._data_proxy = data_write_proxy.get_proxy(f_path)

        self.ready()
        self.logger.info("EtrSaver init finished!")
예제 #3
0
    def __init__(self, addresses):
        super(EtrSaver, self).__init__(addresses=addresses,
                                       type=peers.ETR_SAVER)
        self.logger.info("Request system settings ...")

        f_dir = os.path.expanduser(
            os.path.normpath(self.config.get_param("save_file_path")))
        f_name = self.config.get_param("save_file_name")
        if not os.access(f_dir, os.F_OK):
            os.mkdir(f_dir)
        f_path = os.path.normpath(
            os.path.join(f_dir, f_name + DATA_FILE_EXTENSION))
        self._data_proxy = data_write_proxy.get_proxy(f_path, format='DOUBLE')

        self.ready()
        self.logger.info("EtrSaver init finished!")