예제 #1
0
 def save(self):
     fd = SaveFileDialog(self)
     file = fd.go(key="test")
     if file:
         fid = open(file, 'w')
         fid.write(self.tid.get(0.0, END))
         fid.close()
예제 #2
0
파일: gui.py 프로젝트: cversek/yes-o2ab
    def export_data(self):
        self.app.print_comment("Exporting data...")
        dt_now = datetime.datetime.utcnow()
        dt_now_str = dt_now.strftime("%Y-%m-%d-%H_%m_%S")
        default_filename = "%s_temperature.csv" % (dt_now_str,) 
        fdlg = SaveFileDialog(self.win,title="Save Temperature Data")
        userdata_path = self.app.config['paths']['data_dir']    

        filename = fdlg.go(dir_or_file = userdata_path, 
                           pattern="*.csv", 
                           default=default_filename, 
                           key = None
                          )
        if not filename:
            return #abort
        delim = ","
        comment_prefix = "#"
        eol   = "\n"
        with open(filename, 'w') as f:
                #write header
                f.write(comment_prefix)
                keys =  self.app.temperature_samples.keys()
                f.write(delim.join(keys))
                f.write(eol)
                vals = self.app.temperature_samples.values()
                D = np.vstack(vals).transpose()
                np.savetxt(f, D, fmt=DATA_FORMAT, delimiter=delim)
예제 #3
0
 def save(self):
     fd = SaveFileDialog(self)
     file = fd.go(key="test")
     if file:
         fid = open(file, 'w')
         fid.write(self.tid.get(0.0, END))
         fid.close()
예제 #4
0
파일: gui.py 프로젝트: cversek/peltiator
 def export_data(self):
     self.app.print_comment("exporting data...")
     data     = self.app.data
     metadata = self.app.metadata
     d = datetime.datetime.fromtimestamp(metadata['start_timestamp'])
     d = d.strftime("%Y-%m-%d")        
     default_filename = "%s_%s_peltier_test.csv" % (d,metadata['sample_name'])
     fdlg = SaveFileDialog(self.win,title="Export Data")
     output_dir = os.getcwd()
     filename = fdlg.go(dir_or_file = output_dir, 
                        pattern="*.csv", 
                        default=default_filename, 
                        key = None
                       )
     if filename:
         self.app.export_data(filename)
예제 #5
0
파일: gui.py 프로젝트: koson/olm-pstat
    def export_data(self):
        self._app.print_comment("Exporting data...")
        dt_now = datetime.datetime.utcnow()
        dt_now_str = dt_now.strftime("%Y-%m-%d")
        #get some metadata for title
        v_start = float(self._app._vsweep_dataset.get_metadata('v_start'))
        v_end   = float(self._app._vsweep_dataset.get_metadata('v_end'))
        v_rate  = float(self._app._vsweep_dataset.get_metadata('v_rate'))
        default_filename = "%s_vsweep_%0.2f_to_%0.2fV_by_%0.2fVps.csv" % (dt_now_str,v_start,v_end,v_rate)
        fdlg = SaveFileDialog(self._win,title="Save Voltage Sweep Data")
        userdata_path = self._app._config['paths']['data_dir']

        filename = fdlg.go(dir_or_file = userdata_path,
                           pattern     = "*.csv",
                           default     = default_filename,
                           key         = None,
                          )
        if filename:
            self._app.export_data(filename)
        self._app.print_comment("finished")
 def showOptions(self):
     saveFileDialog = SaveFileDialog(self.optionsBtn)
     self.filePath = saveFileDialog.go(pattern='*.' +
                                       self.outputContainerType)
     if (self.filePath != None):
         self.sessionBtn.config(state='normal')