コード例 #1
0
ファイル: secreport.py プロジェクト: cheliequan/aureport-gui
 def draw_gnuplotbar(self,raw_file_name,data_str):
         caption = raw_file_name.strip()
         file_name = "/tmp/%s"%raw_file_name.strip()
         command = "mkbar %s"%file_name
         pipe_in , pipe_out = os.popen2(command, "wr");
         pipe_in.write(data_str);
         pipe_in.write("\n"); 
         pipe_in.flush() 
         ourstring = pipe_out.readline(); 
         if ourstring:
             dlg = Data_visual(self,filename = ourstring,Caption = _(caption))
             dlg.run()
コード例 #2
0
ファイル: secreport.py プロジェクト: cheliequan/aureport-gui
    def data_visual(self):
        plot_done = False

        index = self.security_items.currentItem() 
        raw_file_name = filename_turple[index]
        filename = caption = raw_file_name.strip()
        fname = "/tmp/%s"%filename
        fname += ".png"

        th = threading.Thread(target = self.draw_plot,args=(fname,caption))
        th.start()

        while not self.plot_done:
            qApp.processEvents()

        threading.Thread.join(th)


        if self.close_canvas():
            dlg = Data_visual(self,filename = fname ,Caption = _(caption))
            dlg.run(filename = fname)