deleted and moved some files

This commit is contained in:
Stefan Kögl 2012-11-18 15:38:57 +01:00
parent f662ce3b52
commit 5be31d4c86
7 changed files with 30 additions and 118 deletions

BIN
burn.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File

@ -390,8 +390,27 @@ class ConstraintWidget(QtGui.QWidget):
QtCore.SIGNAL("clicked(QModelIndex)"),
self.constraint_clicked)
self.connect(self.add_button, QtCore.SIGNAL("clicked()"), self.add_constraint)
self.connect(self.remove_button, QtCore.SIGNAL("clicked()"), self.remove_constraint)
self.connect(
self.add_button,
QtCore.SIGNAL("clicked()"),
self.add_constraint)
self.connect(
self.remove_button,
QtCore.SIGNAL("clicked()"),
self.remove_constraint)
def setData(self, solder):
self.solder = solder
self.all_psteps.setSteps(self.solder.psteps)
self.getConstraints()
def constraint_clicked(self, index):
raise NotImplementedError()
def getConstraints(self):
raise NotImplementedError()
def add_constraint(self):
raise NotImplementedError()
@ -399,35 +418,7 @@ class ConstraintWidget(QtGui.QWidget):
def remove_constraint(self):
raise NotImplementedError()
def setData(self, solder):
self.solder = solder
#for k,v in self.checkboxes.iteritems():
#self.cl.removeWidget(v)
#self.checkboxes = dict()
self.all_psteps.setSteps(self.solder.psteps)
#for i in solder.psteps:
#cb = QtGui.QCheckBox(self, checked=False)
#label = QtGui.QLabel(i.name, self)
#label.setBuddy(cb)
#self.checkboxes[i] = cb
##self.cl.addWidget(label)
##self.cl.addWidget(cb)
self.getConstraints()
def getConstraints(self):
raise NotImplementedError()
def constraint_clicked(self, index):
#for cb in self.checkboxes.itervalues():
#cb.setChecked(False)
self.handle_clicked(index)
def handle_clicked(self, index):
raise NotImplementedError()
class DurationConstraintWidget(ConstraintWidget):
@ -441,6 +432,7 @@ class DurationConstraintWidget(ConstraintWidget):
self.value.setValue(t)
self.constraint_list_view.setCurrentIndex(self.constraint_model.index(0, 0))
self.constraint_clicked(self.constraint_model.index(0, 0))
def add_constraint(self):
self.selected_psteps.psteps.append(self.all_psteps.psteps[self.all_psteps_view.currentIndex().row()])
@ -454,7 +446,7 @@ class DurationConstraintWidget(ConstraintWidget):
#self.selected_psteps_view.setCurrentIndex(QtCore.QModelIndex())
self.selected_psteps_view.clearSelection()
def handle_clicked(self, index):
def constraint_clicked(self, index):
psteps, value = self.solder.durations[index.row()]
self.selected_psteps.setSteps(psteps)
self.value.setValue(value)
@ -472,8 +464,9 @@ class RateConstraintWidget(ConstraintWidget):
self.value.setValue(t)
self.constraint_list_view.setCurrentIndex(self.constraint_model.index(0, 0))
self.constraint_clicked(self.constraint_model.index(0, 0))
def handle_clicked(self, index):
def constraint_clicked(self, index):
psteps, value = self.solder.durations[index.row()]
self.selected_psteps.setSteps(psteps)
self.value.setValue(value)
@ -499,18 +492,14 @@ class ApplicationWindow(QtGui.QMainWindow):
self.main_widget = QtGui.QWidget(self)
self.profile_widget = QtGui.QWidget(self)
self.steps_box = QtGui.QGroupBox(self)
self.tab_widget = QtGui.QTabWidget(self)
self.duration_widget = DurationConstraintWidget(u"Duration (s)")
self.rate_widget = RateConstraintWidget(u"Rate (°C/s)")
self.tab_widget.addTab(self.duration_widget, u"Duration (s)")
self.tab_widget.addTab(self.rate_widget, u"Rate (°C/s)")
self.dpi = 100
pl = QtGui.QHBoxLayout(self.profile_widget)
sl = QtGui.QVBoxLayout(self.steps_box)
self.solder_model = SolderListModel(self)
self.pstep_model = PStepModel(self)
@ -527,8 +516,12 @@ class ApplicationWindow(QtGui.QMainWindow):
QtCore.SIGNAL("clicked(QModelIndex)"),
self.solder_selected)
self.tab_widget.addTab(self.pstep_view, u"Temperature Steps")
self.tab_widget.addTab(self.duration_widget, u"Duration (s)")
self.tab_widget.addTab(self.rate_widget, u"Rate (°C/s)")
pl.addWidget(self.solder_view, 1)
pl.addWidget(self.pstep_view, 2)
pl.addWidget(self.tab_widget, 7)
#pl.addWidget(self.duration_widget)
#pl.addWidget(self.rate_widget)

View File

@ -1,81 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
import serial, struct, time
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=2)
buf = ""
alles = []
#def parse():
#buffer = list()
#while 1:
#try:
#i = ser.read(1)
#if ord(i) == 255:
#except Exception, e:
#print e
#else:
def recv_config():
ser.write(chr(255))
ser.flush()
read(30)
ser.flushInput()
data = struct.unpack("hhhhhhhhhhhhhhh", buf)
print
print "Profile:"
print "ts_min:", data[0]
print "ts_max:", data[1]
print "tl:", data[2]
print "tp:", data[3]
print "time_max:", data[4]
print "ramp_up_min:", data[5]
print "ramp_up_max:", data[6]
print "ramp_down_min:", data[7]
print "ramp_down_max:", data[8]
print "ts_duration_min:", data[9]
print "ts_duration_max:", data[10]
print "tl_duration_min:", data[11]
print "tl_duration_max:", data[12]
print "tp_duration_min:", data[13]
print "tp_duration_max:", data[14]
print
def recv_state():
ser.write(chr(254))
ser.flush()
read(11)
data = struct.unpack("hhhhhb", buf)
print "time: %ds, temperature: %d°C, last temperature: %d°C, state: %d, error condition: %d, heating: %d" % data
def send_config():
ser.write(chr(253))
ser.write(buf)
ser.flushInput()
def read(l):
global buf
global alles
buf = ""
while len(buf) < l:
try:
buf += ser.read(l)
alles.append(buf)
except Exception, e:
print e
ser.flushInput()
time.sleep(2)
recv_config()
while 1:
recv_state()
time.sleep(1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB