Skip to content
Snippets Groups Projects
Commit 127049b9 authored by Michael DM Dryden's avatar Michael DM Dryden
Browse files

Merge branch 'data_window' into data_acq

Conflicts:
	dstatInterface/dstatInterface.xcodeproj/project.xcworkspace/xcuserdata/mdryden.xcuserdatad/UserInterfaceState.xcuserstate
parents d056a073 70d6693e
Branches
Tags
No related merge requests found
Breakpoints_v2.xcbkptlist
*.xcuserstate
......@@ -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,7 +95,7 @@ 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()
......@@ -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])
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment