annotate python/ide/st-util.py @ 292:534b94b40aa8

Fixup reorganize
author Windel Bouwman
date Wed, 27 Nov 2013 08:06:42 +0100
parents python/st-util.py@2ccd57b1d78c
children dcae6574c974
rev   line source
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
1 #!/usr/bin/python
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
2
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
3 import sys
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
4 from PyQt4.QtCore import *
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
5 from PyQt4.QtGui import *
173
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
6 import stlink, devices, stm32, usb
129
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
7 from devices import Interface, Device
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
8 from hexedit import HexEdit
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
9
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 279
diff changeset
10
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
11 class InformationDialog(QDialog):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
12 def __init__(self, parent):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
13 super().__init__(parent)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
14 self.setWindowTitle('Info')
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
15 fl = QFormLayout(self)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
16 if parent.stl:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
17 fl.addRow('ST link version:', QLabel(parent.stl.Version))
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
18 fl.addRow('Chip id:', QLabel('0x{0:X}'.format(parent.stl.ChipId)))
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
19 fl.addRow('Current mode:', QLabel(parent.stl.CurrentModeString))
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
20 fl.addRow('Status:', QLabel(parent.stl.StatusString))
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
21
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 279
diff changeset
22
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
23 class RegisterModel(QAbstractTableModel):
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
24 def __init__(self):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
25 super().__init__()
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
26 self.regCount = 15
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
27 self.device = None
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
28
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
29 def rowCount(self, parent):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
30 if parent.isValid():
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
31 return 0
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
32 if self.device:
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
33 return 21 # TODO make variable
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
34 else:
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
35 return 0
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
36
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
37 def setDevice(self, dev):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
38 self.device = dev
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
39 self.modelReset.emit()
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
40
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
41 def columnCount(self, parent):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
42 if parent.isValid():
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
43 return 0
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
44 return 2
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
45
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
46 def data(self, index, role):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
47 if index.isValid():
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
48 row, col = index.row(), index.column()
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
49 if role == Qt.DisplayRole:
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
50 if col == 0:
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
51 if row == 15:
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
52 return 'PC'
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
53 elif row == 14:
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
54 return 'LR'
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
55 elif row == 13:
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
56 return 'SP'
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
57 else:
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
58 return 'R{0}'.format(row)
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
59 elif col == 1:
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
60 v = self.device.iface.read_reg(row)
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
61 return '0x{0:X}'.format(v)
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
62
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
63 def setData(self, index, value, role):
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
64 if index.isValid():
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
65 row = index.row()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
66 col = index.column()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
67 if role == Qt.EditRole and col == 1:
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
68 value = int(value, 16)
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
69 self.device.iface.write_reg(row, value)
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
70 return True
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
71 return False
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
72
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
73 def flags(self, index):
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
74 if index.isValid():
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
75 row = index.row()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
76 col = index.column()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
77 if col == 1:
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
78 return super().flags(index) | Qt.ItemIsEditable
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
79 return super().flags(index)
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
80
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
81 def refresh(self):
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
82 if self.device:
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
83 fromIndex = self.index(0, 1)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
84 toIndex = self.index(21, 1)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
85 self.dataChanged.emit(fromIndex, toIndex)
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
86
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
87
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
88 class RegisterView(QTableView):
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
89 def __init__(self):
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
90 super().__init__()
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
91 self.mdl = RegisterModel()
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
92 self.setModel(self.mdl)
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
93
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
94 def refresh(self):
144
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
95 if self.mdl.device:
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
96 self.setEnabled(not self.mdl.device.Running)
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
97 self.mdl.refresh()
131
04e45faafd1d Added register view
Windel Bouwman
parents: 130
diff changeset
98
279
2ccd57b1d78c Fix register allocator to do burn2 OK
Windel Bouwman
parents: 247
diff changeset
99
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
100 class MemoryView(QWidget):
240
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
101 BlockSize = 0x100
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
102 def __init__(self):
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
103 super().__init__()
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
104 l = QVBoxLayout(self)
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
105 l2 = QHBoxLayout()
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
106 l2.addWidget(QLabel('Address'))
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
107 self.addressLine = QLineEdit()
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
108 self.addressLine.setInputMask('Hhhhhhhh')
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
109 l2.addWidget(self.addressLine)
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
110 upButton = QPushButton('up')
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
111 l2.addWidget(upButton)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
112 upButton.clicked.connect(self.doUp)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
113 downButton = QPushButton('down')
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
114 downButton.clicked.connect(self.doDown)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
115 l2.addWidget(downButton)
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
116 l.addLayout(l2)
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
117 self.device = None
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
118 self.hexEdit = HexEdit()
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
119 self.Address = 0x8000000
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
120 l.addWidget(self.hexEdit)
240
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
121 self.addressLine.returnPressed.connect(self.refresh)
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
122
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
123 def refresh(self):
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
124 address = self.Address
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
125 if self.device:
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
126 data = self.device.iface.read_mem32(address, self.BlockSize)
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
127 else:
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
128 data = bytearray(self.BlockSize)
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
129 self.hexEdit.bv.Data = data
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
130 self.hexEdit.bv.Offset = address
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
131
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
132 def getAddress(self):
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
133 txt = self.addressLine.text()
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
134 return int(txt, 16)
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
135
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
136 def doUp(self):
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
137 self.Address -= self.BlockSize
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
138
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
139 def doDown(self):
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
140 self.Address += self.BlockSize
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
141
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
142 def setAddress(self, address):
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
143 self.addressLine.setText('{0:08X}'.format(address))
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
144 self.refresh()
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
145 Address = property(getAddress, setAddress)
6259856841a0 Remove project
Windel Bouwman
parents: 173
diff changeset
146 def setDevice(self, dev):
136
9af544be5d2a Added hexfile edit
Windel Bouwman
parents: 132
diff changeset
147 self.device = dev
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
148 self.Address = 0x8000000
132
205578c96a79 Moved hexview to seperate class
Windel Bouwman
parents: 131
diff changeset
149
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
150
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
151 class DebugToolbar(QToolBar):
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
152 statusChange = pyqtSignal()
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
153 codePosition = pyqtSignal(int)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
154 def __init__(self):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
155 super().__init__()
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
156 self.device = None
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
157 # generate actions:
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
158 def genAction(name, callback):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
159 a = QAction(name, self)
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
160 a.triggered.connect(callback)
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
161 self.addAction(a)
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
162 return a
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
163 self.stepAction = genAction('Step', self.doStep)
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
164 self.runAction = genAction('Run', self.doRun)
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
165 self.stopAction = genAction('Stop', self.doHalt)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
166 self.resetAction = genAction('Reset', self.doReset)
144
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
167 self.enableTraceAction = genAction('Enable trace', self.doEnableTrace)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
168 self.updateEnables()
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
169 def updateEnables(self):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
170 if self.device:
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
171 self.resetAction.setEnabled(True)
144
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
172 self.enableTraceAction.setEnabled(True)
143
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
173 self.runAction.setEnabled(not self.device.Running)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
174 self.stepAction.setEnabled(not self.device.Running)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
175 self.stopAction.setEnabled(self.device.Running)
1cc59ac80950 Fixed halt button
Windel Bouwman
parents: 138
diff changeset
176 self.statusChange.emit()
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
177 if not self.device.Running:
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
178 PC = 15
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
179 v = self.device.iface.read_reg(PC)
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
180 self.codePosition.emit(v)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
181 else:
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
182 self.resetAction.setEnabled(False)
144
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
183 self.enableTraceAction.setEnabled(False)
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
184 self.runAction.setEnabled(False)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
185 self.stepAction.setEnabled(False)
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
186 self.stopAction.setEnabled(False)
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
187 def doStep(self):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
188 self.device.iface.step()
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
189 self.updateEnables()
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
190 def doReset(self):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
191 self.device.iface.reset()
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
192 self.updateEnables()
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
193 def doRun(self):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
194 self.device.iface.run()
138
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
195 self.updateEnables()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
196 def doHalt(self):
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
197 self.device.iface.halt()
14e739ed03ab Added halt stub
Windel Bouwman
parents: 137
diff changeset
198 self.updateEnables()
144
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
199 def doEnableTrace(self):
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
200 self.device.iface.traceEnable()
59a9a499e518 Added adi class
Windel Bouwman
parents: 143
diff changeset
201 self.updateEnables()
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
202 def setDevice(self, dev):
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
203 self.device = dev
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
204 self.updateEnables()
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
205
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
206
132
205578c96a79 Moved hexview to seperate class
Windel Bouwman
parents: 131
diff changeset
207 class FlashTool(QWidget):
205578c96a79 Moved hexview to seperate class
Windel Bouwman
parents: 131
diff changeset
208 def __init__(self):
205578c96a79 Moved hexview to seperate class
Windel Bouwman
parents: 131
diff changeset
209 super().__init__()
137
0a540ce31cd5 Added debug toolbar and spaced hexedit
Windel Bouwman
parents: 136
diff changeset
210 # TODO!
132
205578c96a79 Moved hexview to seperate class
Windel Bouwman
parents: 131
diff changeset
211
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
212
129
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
213 class DeviceTreeModel(QAbstractItemModel):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
214 def __init__(self):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
215 super().__init__()
247
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
216 self.chipPixmap = QPixmap('icons/chip.png').scaled(32, 32)
dd8bbb963458 project remove
Windel Bouwman
parents: 240
diff changeset
217 self.hardwarePixmap = QPixmap('icons/hardware.png').scaled(32, 32)
129
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
218 self.refresh()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
219 def refresh(self):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
220 """ Check all usb interfaces for interfaces """
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
221 self.interfaces = devices.createInterfaces()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
222 self.devices = []
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
223 self.modelReset.emit()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
224 def addDevice(self, device):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
225 if device.iface in [lambda d: d.iface for d in self.devices]:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
226 print('device already open')
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
227 return
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
228 self.devices.append(device)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
229 self.modelReset.emit()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
230 def index(self, row, column, parent):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
231 if parent.isValid():
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
232 ip = parent.internalPointer()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
233 if isinstance(ip, Interface):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
234 devs = [d for d in self.devices if d.iface is ip]
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
235 return self.createIndex(row, column, devs[row])
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
236 else:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
237 iface = self.interfaces[row]
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
238 return self.createIndex(row, column, iface)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
239 return idx
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
240 def parent(self, index):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
241 if index.isValid():
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
242 ip = index.internalPointer()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
243 if isinstance(ip, Interface):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
244 return QModelIndex()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
245 elif isinstance(ip, Device):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
246 iface = ip.iface
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
247 row = self.interfaces.index(iface)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
248 return self.createIndex(row, 0, iface)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
249 return QModelIndex()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
250 def rowCount(self, parent):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
251 if parent.isValid():
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
252 # non-root level:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
253 ip = parent.internalPointer()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
254 if isinstance(ip, Interface):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
255 devs = [d for d in self.devices if d.iface is ip]
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
256 return len(devs)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
257 else:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
258 # root level:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
259 return len(self.interfaces)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
260 return 0
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
261 def columnCount(self, parent):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
262 return 1
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
263 def data(self, index, role):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
264 if index.isValid():
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
265 ip = index.internalPointer()
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
266 if role == Qt.DisplayRole:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
267 return str(ip)
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
268 elif role == Qt.DecorationRole:
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
269 if isinstance(ip, Interface):
130
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
270 return self.hardwarePixmap
129
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
271 if isinstance(ip, Device):
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
272 return self.chipPixmap
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
273
130
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
274 class DeviceExplorer(QTreeView):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
275 """ Lists all interfaces plugged in and allows selection """
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
276 deviceSelected = pyqtSignal(Device)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
277 def __init__(self):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
278 super().__init__()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
279 self.mdl = DeviceTreeModel()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
280 self.setModel(self.mdl)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
281 self.activated.connect(self.openItem)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
282 self.header().close()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
283 self.customContextMenuRequested.connect(self.openMenu)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
284 self.setContextMenuPolicy(Qt.CustomContextMenu)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
285 def openItem(self, idx):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
286 if idx.isValid():
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
287 ip = idx.internalPointer()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
288 if isinstance(ip, Interface):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
289 if not ip.IsOpen:
173
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
290 try:
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
291 ip.open()
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
292 except usb.UsbError as e:
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
293 QMessageBox.critical(self, "Error", 'Error opening interface: "{0}"'.format(e))
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
294 else:
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
295 # Try to get a device:
c1d2b6b9f9a7 Rework into passes
Windel Bouwman
parents: 144
diff changeset
296 self.mdl.addDevice(ip.createDevice())
130
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
297 if isinstance(ip, Device):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
298 self.deviceSelected.emit(ip)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
299 def openMenu(self, pt):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
300 idx = self.indexAt(pt)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
301 menu = QMenu()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
302 menu.addAction('Refresh', self.mdl.refresh)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
303 if idx.isValid():
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
304 ip = idx.internalPointer()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
305 if isinstance(ip, Interface):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
306 if ip.IsOpen:
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
307 def closeInterface():
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
308 self.mdl.closeInterface(ip)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
309 menu.addAction('Close', closeInterface)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
310 else:
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
311 def openInterface():
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
312 ip.open()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
313 # Try to get a device:
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
314 self.mdl.addDevice(ip.createDevice())
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
315 menu.addAction('Open', openInterface)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
316 elif isinstance(ip, Device):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
317 def selectDevice():
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
318 self.deviceSelected.emit(ip)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
319 menu.addAction('Select', selectDevice)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
320 menu.exec(self.mapToGlobal(pt))
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
321
292
534b94b40aa8 Fixup reorganize
Windel Bouwman
parents: 279
diff changeset
322
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
323 class StUtil(QMainWindow):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
324 connected = pyqtSignal(bool)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
325 def __init__(self):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
326 super().__init__()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
327 self.stl = None
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
328 def buildAction(name, callback, shortcut=None):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
329 a = QAction(name, self)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
330 a.triggered.connect(callback)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
331 if shortcut:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
332 a.setShortcut(shortcut)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
333 return a
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
334 mb = self.menuBar()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
335 fileMenu = mb.addMenu("File")
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
336 self.connectAction = buildAction('Connect', self.connect)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
337 fileMenu.addAction(self.connectAction)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
338 self.disconnectAction = buildAction('Disconnect', self.disconnect)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
339 fileMenu.addAction(self.disconnectAction)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
340
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
341 self.miscMenu = mb.addMenu("Misc")
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
342 infoAction = buildAction('Info', self.info)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
343 self.miscMenu.addAction(infoAction)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
344
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
345 sb = self.statusBar()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
346
130
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
347 devexplr = DeviceExplorer()
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
348 self.setCentralWidget(devexplr)
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
349 devexplr.deviceSelected.connect(self.handleDeviceSelected)
129
9e350a7dde98 Changed architecture and updated the util
Windel Bouwman
parents: 127
diff changeset
350
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
351 self.connected.connect(self.handleConnectedChange)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
352 self.connected.emit(False)
130
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
353 def handleDeviceSelected(self, dev):
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
354 self.dev = dev
654093a9a1e3 Added icons, improved device explorer
Windel Bouwman
parents: 129
diff changeset
355 self.handleConnectedChange(True)
127
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
356 def handleConnectedChange(self, state):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
357 self.miscMenu.setEnabled(state)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
358 self.connectAction.setEnabled(not state)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
359 self.disconnectAction.setEnabled(state)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
360 msg = 'Connected!' if state else 'Disconnected!'
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
361 self.statusBar().showMessage(msg)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
362 def info(self):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
363 infoDialog = InformationDialog(self)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
364 infoDialog.exec()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
365 def connect(self):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
366 try:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
367 self.stl = stlink.STLink()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
368 self.stl.open()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
369 except (stlink.STLinkException, usb.UsbError) as e:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
370 QMessageBox.warning(self, "Error", str(e))
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
371 self.stl = None
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
372 if self.stl:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
373 self.connected.emit(True)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
374 def disconnect(self):
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
375 if self.stl:
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
376 self.stl.close()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
377 self.connected.emit(False)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
378 self.stl = None
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
379
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
380 if __name__ == '__main__':
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
381 app = QApplication(sys.argv)
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
382 stu = StUtil()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
383 stu.show()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
384 app.exec()
ec1f2cc04d95 Added st util gui start
Windel Bouwman
parents:
diff changeset
385