Skip to content

Commit 46ce518

Browse files
committed
Lisp UI updates
1 parent e94d487 commit 46ce518

File tree

6 files changed

+137
-87
lines changed

6 files changed

+137
-87
lines changed

commands.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2154,10 +2154,11 @@ void Commands::lispSetRunning(bool running)
21542154
emitData(vb);
21552155
}
21562156

2157-
void Commands::lispGetStats()
2157+
void Commands::lispGetStats(bool all)
21582158
{
21592159
VByteArray vb;
21602160
vb.vbAppendUint8(COMM_LISP_GET_STATS);
2161+
vb.vbAppendInt8(all);
21612162
emitData(vb);
21622163
}
21632164

commands.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ public slots:
273273
void lispStreamCode(QByteArray data, quint32 offset, quint32 totLen, qint8 mode);
274274
void lispEraseCode(int size);
275275
void lispSetRunning(bool running);
276-
void lispGetStats();
276+
void lispGetStats(bool all);
277277
void lispSendReplCmd(QString str);
278278

279279
void setBleName(QString name);

pages/pagelisp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ PageLisp::PageLisp(QWidget *parent) :
153153

154154
mPollTimer.start(1000 / ui->pollRateBox->value());
155155
connect(&mPollTimer, &QTimer::timeout, [this]() {
156-
if (ui->pollBox->isChecked()) {
156+
if (!ui->pollOffButton->isChecked()) {
157157
if (mVesc) {
158-
mVesc->commands()->lispGetStats();
158+
mVesc->commands()->lispGetStats(ui->pollAllButton->isChecked());
159159
}
160160
}
161161
});

pages/pagelisp.ui

Lines changed: 105 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>1487</width>
10-
<height>870</height>
9+
<width>1180</width>
10+
<height>701</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
@@ -87,7 +87,7 @@
8787
<string>Read lisp code from connected VESC</string>
8888
</property>
8989
<property name="text">
90-
<string>Read Existing</string>
90+
<string>Read</string>
9191
</property>
9292
<property name="icon">
9393
<iconset resource="../res.qrc">
@@ -98,19 +98,6 @@
9898
</property>
9999
</widget>
100100
</item>
101-
<item>
102-
<spacer name="horizontalSpacer">
103-
<property name="orientation">
104-
<enum>Qt::Horizontal</enum>
105-
</property>
106-
<property name="sizeHint" stdset="0">
107-
<size>
108-
<width>40</width>
109-
<height>20</height>
110-
</size>
111-
</property>
112-
</spacer>
113-
</item>
114101
<item>
115102
<widget class="QPushButton" name="helpButton">
116103
<property name="toolTip">
@@ -128,6 +115,19 @@
128115
</property>
129116
</widget>
130117
</item>
118+
<item>
119+
<spacer name="horizontalSpacer">
120+
<property name="orientation">
121+
<enum>Qt::Horizontal</enum>
122+
</property>
123+
<property name="sizeHint" stdset="0">
124+
<size>
125+
<width>40</width>
126+
<height>20</height>
127+
</size>
128+
</property>
129+
</spacer>
130+
</item>
131131
</layout>
132132
</item>
133133
<item>
@@ -149,45 +149,62 @@
149149
</widget>
150150
<widget class="QWidget" name="layoutWidget2">
151151
<layout class="QVBoxLayout" name="verticalLayout_2">
152+
<property name="spacing">
153+
<number>3</number>
154+
</property>
152155
<item>
153156
<layout class="QHBoxLayout" name="horizontalLayout_8">
154157
<item>
155-
<widget class="QPushButton" name="runButton">
156-
<property name="text">
157-
<string>Run</string>
158+
<widget class="QRadioButton" name="pollOffButton">
159+
<property name="toolTip">
160+
<string>Data polling disabled</string>
158161
</property>
159-
<property name="icon">
160-
<iconset resource="../res.qrc">
161-
<normaloff>:/res/icons/Circled Play-96.png</normaloff>:/res/icons/Circled Play-96.png</iconset>
162+
<property name="text">
163+
<string>Poll Off</string>
162164
</property>
163-
<property name="flat">
165+
<property name="checked">
164166
<bool>true</bool>
165167
</property>
166168
</widget>
167169
</item>
168170
<item>
169-
<widget class="QPushButton" name="stopButton">
170-
<property name="text">
171-
<string>Stop</string>
172-
</property>
173-
<property name="icon">
174-
<iconset resource="../res.qrc">
175-
<normaloff>:/res/icons/Shutdown-96.png</normaloff>:/res/icons/Shutdown-96.png</iconset>
171+
<widget class="QRadioButton" name="pollVtButton">
172+
<property name="toolTip">
173+
<string>Poll variables starting with vt only</string>
176174
</property>
177-
<property name="flat">
178-
<bool>true</bool>
175+
<property name="text">
176+
<string>Poll VT</string>
179177
</property>
180178
</widget>
181179
</item>
182180
<item>
183-
<widget class="QCheckBox" name="pollBox">
181+
<widget class="QRadioButton" name="pollAllButton">
182+
<property name="toolTip">
183+
<string>Poll all variables</string>
184+
</property>
184185
<property name="text">
185-
<string>Poll Status</string>
186+
<string>Poll All</string>
186187
</property>
187188
</widget>
188189
</item>
190+
<item>
191+
<spacer name="horizontalSpacer_3">
192+
<property name="orientation">
193+
<enum>Qt::Horizontal</enum>
194+
</property>
195+
<property name="sizeHint" stdset="0">
196+
<size>
197+
<width>40</width>
198+
<height>20</height>
199+
</size>
200+
</property>
201+
</spacer>
202+
</item>
189203
<item>
190204
<widget class="QSpinBox" name="pollRateBox">
205+
<property name="toolTip">
206+
<string>Poll Rate</string>
207+
</property>
191208
<property name="suffix">
192209
<string> Hz</string>
193210
</property>
@@ -277,41 +294,43 @@
277294
</widget>
278295
</item>
279296
<item>
280-
<layout class="QHBoxLayout" name="horizontalLayout_5">
297+
<layout class="QHBoxLayout" name="horizontalLayout_11">
281298
<item>
282-
<widget class="QLabel" name="label_6">
299+
<widget class="QPushButton" name="runButton">
300+
<property name="toolTip">
301+
<string>Run or re-run evaluator</string>
302+
</property>
283303
<property name="text">
284-
<string>Stream Mode:</string>
304+
<string>Run</string>
285305
</property>
286-
<property name="alignment">
287-
<set>Qt::AlignCenter</set>
306+
<property name="icon">
307+
<iconset resource="../res.qrc">
308+
<normaloff>:/res/icons/Circled Play-96.png</normaloff>:/res/icons/Circled Play-96.png</iconset>
309+
</property>
310+
<property name="flat">
311+
<bool>true</bool>
288312
</property>
289313
</widget>
290314
</item>
291315
<item>
292-
<widget class="QComboBox" name="streamModeBox">
293-
<property name="currentIndex">
294-
<number>1</number>
316+
<widget class="QPushButton" name="stopButton">
317+
<property name="toolTip">
318+
<string>Stop evaluator</string>
319+
</property>
320+
<property name="text">
321+
<string>Stop</string>
322+
</property>
323+
<property name="icon">
324+
<iconset resource="../res.qrc">
325+
<normaloff>:/res/icons/Shutdown-96.png</normaloff>:/res/icons/Shutdown-96.png</iconset>
326+
</property>
327+
<property name="flat">
328+
<bool>true</bool>
295329
</property>
296-
<item>
297-
<property name="text">
298-
<string>Load on top</string>
299-
</property>
300-
</item>
301-
<item>
302-
<property name="text">
303-
<string>Reset &amp; Load</string>
304-
</property>
305-
</item>
306-
<item>
307-
<property name="text">
308-
<string>Reload Flash &amp; Load</string>
309-
</property>
310-
</item>
311330
</widget>
312331
</item>
313332
<item>
314-
<spacer name="horizontalSpacer_2">
333+
<spacer name="horizontalSpacer_4">
315334
<property name="orientation">
316335
<enum>Qt::Horizontal</enum>
317336
</property>
@@ -338,6 +357,34 @@
338357
</item>
339358
</layout>
340359
</item>
360+
<item>
361+
<widget class="QComboBox" name="streamModeBox">
362+
<property name="toolTip">
363+
<string>Stream Mode</string>
364+
</property>
365+
<property name="currentIndex">
366+
<number>1</number>
367+
</property>
368+
<property name="frame">
369+
<bool>false</bool>
370+
</property>
371+
<item>
372+
<property name="text">
373+
<string>After Stream: Load on top</string>
374+
</property>
375+
</item>
376+
<item>
377+
<property name="text">
378+
<string>After Stream: Reset &amp; Load</string>
379+
</property>
380+
</item>
381+
<item>
382+
<property name="text">
383+
<string>After Stream: Reload Flash &amp; Load</string>
384+
</property>
385+
</item>
386+
</widget>
387+
</item>
341388
</layout>
342389
</widget>
343390
</widget>

pages/pagescripting.ui

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,6 @@
9595
</property>
9696
</widget>
9797
</item>
98-
<item>
99-
<spacer name="horizontalSpacer">
100-
<property name="orientation">
101-
<enum>Qt::Horizontal</enum>
102-
</property>
103-
<property name="sizeHint" stdset="0">
104-
<size>
105-
<width>40</width>
106-
<height>20</height>
107-
</size>
108-
</property>
109-
</spacer>
110-
</item>
11198
<item>
11299
<widget class="QPushButton" name="helpButton">
113100
<property name="toolTip">
@@ -125,6 +112,19 @@
125112
</property>
126113
</widget>
127114
</item>
115+
<item>
116+
<spacer name="horizontalSpacer">
117+
<property name="orientation">
118+
<enum>Qt::Horizontal</enum>
119+
</property>
120+
<property name="sizeHint" stdset="0">
121+
<size>
122+
<width>40</width>
123+
<height>20</height>
124+
</size>
125+
</property>
126+
</spacer>
127+
</item>
128128
</layout>
129129
</item>
130130
<item>
Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
1-
;(define a1 0) (define a2 0) (define a3 0) (define a4 0) (define a5 0)
2-
;(define a6 0) (define a7 0) (define a8 0) (define a9 0) (define a10 0)
3-
;(define b1 0) (define b2 0) (define b3 0) (define b4 0) (define b5 0)
4-
;(define b6 0) (define b7 0) (define b8 0) (define b9 0) (define b10 0)
5-
;(define c1 0) (define c2 0) (define c3 0) (define c4 0) (define c5 0)
6-
;(define c6 0) (define c7 0) (define c8 0) (define c9 0) (define c10 0)
7-
81
(defun repeat (f times)
92
(if (<= times 1)
103
(f)
114
(progn (f) (repeat f (- times 1)))
125
))
136

14-
(defun run-gc ()
15-
(progn
16-
(define start (systime))
7+
(defun run-gc () {
8+
(def a1 0) (def a2 0) (def a3 0) (def a4 0) (def a5 0)
9+
(def a6 0) (def a7 0) (def a8 0) (def a9 0) (def a10 0)
10+
(def b1 0) (def b2 0) (def b3 0) (def b4 0) (def b5 0)
11+
(def b6 0) (def b7 0) (def b8 0) (def b9 0) (def b10 0)
12+
(def c1 0) (def c2 0) (def c3 0) (def c4 0) (def c5 0)
13+
(def c6 0) (def c7 0) (def c8 0) (def c9 0) (def c10 0)
14+
15+
(def start (systime))
1716
(repeat 'gc 25)
18-
(define res (secs-since start))
17+
(def res (secs-since start))
1918
(print (list "GC-time (ms):" (* (/ res 25) 1000)))
20-
))
19+
})
20+
21+
(looprange i 0 100 (run-gc))
22+
(print "Done!")

0 commit comments

Comments
 (0)