Пример #1
0
    def __init__(self, conf, log, save=1, filt=0):
        #@todo: to be defined.
        #:conf: @todo.
        #:log: @todo.
        #:save:
        #   1: start with the final option.
        #   0: start with the start

        self.conf = conf
        self.log = log
        self.save = save
        self.filt = filt
        self.val = gcv()
        self.flag = self.val.flag_trigger

        self.cpath = os.path.join(
            os.path.split(os.path.realpath(__file__))[0],
            '_filter.cpython-36m-x86_64-linux-gnu.so')
        self.lib = cdll.LoadLibrary(self.cpath)

        self.func_change_stat = self.lib.changeStat
        self.func_change_stat.argtypes = [c_int, c_int]

        self.func_run = self.lib.run
        self.func_run.argtypes = [
            c_char_p,
            np.ctypeslib.ndpointer(dtype=np.float64,
                                   ndim=1,
                                   flags='C_CONTIGUOUS'), c_int
        ]

        self.res = []
Пример #2
0
    def __init__(self, conf, log, shared_data_graph, config_status_change,
                 status_change, data_save, shared_tcp_ip_stat, save_name,
                 local_tcp_ip):
        super(MainCom, self).__init__()
        self.save_name = save_name
        self.shared_data_graph = shared_data_graph
        self.not_change = config_status_change
        self.start_ornot = status_change
        self.data_save = data_save
        self.conf = conf
        self.log = log
        self.cal = Cal(self.conf, self.log)
        self.global_val = gcv()
        self.data_per_line = self.global_val.gui_show_num_all
        self.data_show_second = self.global_val.gui_show_second
        self.shared_tcp_ip_stat = shared_tcp_ip_stat
        self.temp_file = tempfile.TemporaryFile()
        self.flag = gcv.flag_trigger
        self.new = True
        self.iter_send = 1
        self.cache_data = []
        self.judge_tcp_ip = local_tcp_ip
        self.path_dir_save = os.path.join(
            os.path.split(os.path.realpath(__file__))[0], 'save')
        self.path_dir_save_name = os.path.join(self.path_dir_save,
                                               self.save_name)

        self.timer_tcp_ip = RTimer(1, self.tcp_ip_monit)
        self.timer_tcp_ip.start()
Пример #3
0
 def __init__(self, conf, log, dir_pic):
     #@todo: to be defined.
     #:conf: @todo.
     #:log: @todo.
     self.conf = conf
     self.log = log
     self.dir_pic = dir_pic
     self.val = gcv()
     self.num = 0
Пример #4
0
 def __init__(self,
              conf,
              log,
              path_file,
              dir_pic,
              save_loc=1,
              filt=0,
              save_type=1):
     #@todo: to be defined.
     #:conf: @todo.
     #:log: @todo.
     self.conf = conf
     self.log = log
     self.data_process = DataProcess(self.conf, self.log, save_loc, filt)
     self.save_pic = PicSave(self.conf, self.log, dir_pic)
     self.save_file = FileSave(self.conf, self.log, save_type, path_file)
     self.val = gcv()
Пример #5
0
    @pyqtSlot(pg.graphicsItems.PlotItem.PlotItem, str)
    def save_pic(self, e0, e1):
        try:
            exporter = ep.ImageExporter(e0.plotItem)
            if exporter.parameters()['height'] < 800:
                exporter.parameters()['height'] = 800
            exporter.export(os.path.join(e1, 'temp%d.png' % self.graph_no))
            self.graph_no += 1
            self.signal_state_save.emit('Picture Saved Successfully')
        except:
            self.signal_state_save.emit('Picture Saved Failed')


if __name__ == '__main__':  # Entry
    from PyQt5.QtWidgets import QApplication
    val = gcv()
    shared_data_graph = mp.Array('d',
                                 np.array(256 * val.gui_show_num_all * [0]))
    shared_config_change = mp.Value('b', False)
    shared_status_change = mp.Value('b', False)
    shared_data_save = mp.Value('i', 0)
    shared_tcp_ip_status = mp.Value('i', 0)
    shared_show_graph_filter = mp.Value('b', False)
    local_com_tcp_ip = mp.Value('b', False)
    time_cache = time.localtime(time.time())
    save_name = '%4d%02d%02d%02d%02d%02d' % (time_cache[0], time_cache[1],
                                             time_cache[2], time_cache[3],
                                             time_cache[4], time_cache[5])

    queue_save = mp.Queue(maxsize=100)