diff --git a/.gitignore b/.gitignore index acf419c0f2923c8c74ad47d5eed7ac221caf55f2..902786805a865a3fb78caaa835d292050c671e28 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ Breakpoints_v2.xcbkptlist +*.xcuserstate diff --git a/dstatInterface/dstatInterface.xcodeproj/project.xcworkspace/xcuserdata/mdryden.xcuserdatad/UserInterfaceState.xcuserstate b/dstatInterface/dstatInterface.xcodeproj/project.xcworkspace/xcuserdata/mdryden.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 06cfb4af1309ae19f7b7eb255b33bfdc397317fe..0000000000000000000000000000000000000000 Binary files a/dstatInterface/dstatInterface.xcodeproj/project.xcworkspace/xcuserdata/mdryden.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/dstatInterface/dstat_comm.py b/dstatInterface/dstat_comm.py index fe562bf7fcf3be8022eacaf04c25835f6147b8ba..5908cfce19db3e176901205f441d53c707ef636c 100644 --- a/dstatInterface/dstat_comm.py +++ b/dstatInterface/dstat_comm.py @@ -67,7 +67,7 @@ class Experiment: self.commands[1] += (gain) self.commands[1] += " " - def run(self, strPort, plotbox_instance): + def run(self, strPort, plotbox_instance, databuffer_instance): self.ser = delayedSerial(strPort, 1024000, timeout=3) self.ser.write("ck") @@ -76,8 +76,11 @@ class Experiment: self.ser.flushInput() self.updatecounter = 0 + databuffer_instance.set_text("") + databuffer_instance.place_cursor(databuffer_instance.get_start_iter()) for i in self.commands: + databuffer_instance.insert_at_cursor(i) self.ser.flush() self.ser.write("!") while True: @@ -92,8 +95,8 @@ class Experiment: self.ser.write(i) print i - self.data_handler(plotbox_instance) #Will be overridden by experiment classes to deal with more complicated data - + self.data_handler(plotbox_instance, databuffer_instance) #Will be overridden by experiment classes to deal with more complicated data + self.data_postprocessing() plotbox_instance.update(self) @@ -101,7 +104,7 @@ class Experiment: self.ser.close() - def data_handler(self, plotbox_instance): + def data_handler(self, plotbox_instance, databuffer_instance): while True: for line in self.ser: print line @@ -110,7 +113,7 @@ class Experiment: break if not (line.isspace() or line.lstrip().startswith('#')): - + databuffer_instance.insert_at_cursor(line) self.inputdata = [float(val) for val in line.split()] if(len(self.inputdata) == self.datalength): self.data[0].append((self.inputdata[0]-32768)*3000./65536) @@ -158,7 +161,7 @@ class chronoamp(Experiment): self.commands[2] += str(i) self.commands[2] += " " - def data_handler(self, plotbox_instance): #overrides inherited method to not convert x axis + def data_handler(self, plotbox_instance, databuffer_instance): #overrides inherited method to not convert x axis while True: for line in self.ser: print line @@ -167,7 +170,7 @@ class chronoamp(Experiment): break if not (line.isspace() or line.lstrip().startswith('#')): - + databuffer_instance.insert_at_cursor(line) self.inputdata = [float(val) for val in line.split()] if(len(self.inputdata) == self.datalength): self.data[0].append(self.inputdata[0]) diff --git a/dstatInterface/interface_test.py b/dstatInterface/interface_test.py index 81666457da51ea4652f5d1e6816579e7599cda00..0fb8380ae3f83854b641581a03b61470a42cb0b8 100644 --- a/dstatInterface/interface_test.py +++ b/dstatInterface/interface_test.py @@ -51,6 +51,7 @@ class main: self.statusbar = self.builder.get_object('statusbar') self.window = self.builder.get_object('window1') self.aboutdialog = self.builder.get_object('aboutdialog1') + self.databuffer = self.builder.get_object('databuffer1') self.adc_pot = adc_pot.adc_pot() self.chronoamp = chronoamp.chronoamp() self.lsv = lsv.lsv() @@ -193,7 +194,7 @@ class main: raise InputError(potential,"Step table is empty") self.current_exp = comm.chronoamp(adc_buffer, adc_rate, adc_pga, gain, potential, time, update, updatelimit) - self.current_exp.run(self.serial_liststore.get_value(self.serial_combobox.get_active_iter(), 0), self.plotbox) + self.current_exp.run(self.serial_liststore.get_value(self.serial_combobox.get_active_iter(), 0), self.plotbox, self.databuffer) elif selection == 1: #LSV self.statusbar.remove_all(self.error_context_id) start = int(self.lsv.start_entry.get_text()) @@ -211,7 +212,7 @@ class main: raise InputError(start,"Start cannot equal Stop.") self.current_exp = comm.lsv_exp(adc_buffer, adc_rate, adc_pga, gain, start, stop, slope, update, updatelimit) - self.current_exp.run(self.serial_liststore.get_value(self.serial_combobox.get_active_iter(), 0), self.plotbox) + self.current_exp.run(self.serial_liststore.get_value(self.serial_combobox.get_active_iter(), 0), self.plotbox, self.databuffer) elif selection == 2: #CV self.statusbar.remove_all(self.error_context_id) #clear statusbar