︙ | | | ︙ | |
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
((max-row 0) : number)
((running-layout #f) : boolean)
(originx #f)
(originy #f)
((layout-update-ok #t) : boolean)
((compact-layout #t) : boolean)
;; Controls used to launch runs etc.
((command "") : string) ;; for run control this is the command being built up
(command-tb #f)
(key-listboxes #f)
(key-lbs #f)
run-name ;; from run name setting widget
states ;; states for -state s1,s2 ...
|
>
>
>
>
|
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
|
((max-row 0) : number)
((running-layout #f) : boolean)
(originx #f)
(originy #f)
((layout-update-ok #t) : boolean)
((compact-layout #t) : boolean)
;; Run times layout
(graph-button-box #f)
((graph-button-dat (make-hash-table)) : hash-table) ;;RA=> Contains all the button ids mapped to field id
;; Controls used to launch runs etc.
((command "") : string) ;; for run control this is the command being built up
(command-tb #f)
(key-listboxes #f)
(key-lbs #f)
run-name ;; from run name setting widget
states ;; states for -state s1,s2 ...
|
︙ | | | ︙ | |
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
|
((path-run-ids (make-hash-table)) : hash-table) ;; path (target / runname) => id
(runs-tree #f)
;; tab data
((view-changed #t) : boolean)
((xadj 0) : number) ;; x slider number (if using canvas)
((yadj 0) : number) ;; y slider number (if using canvas)
tests-tree ;; used in newdashboard
)
(define (dboard:tabdat-target-string vec)
(let ((targ (dboard:tabdat-target vec)))
(if (list? targ)(string-intersperse targ "/") "no-target-specified")))
|
<
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
|
((path-run-ids (make-hash-table)) : hash-table) ;; path (target / runname) => id
(runs-tree #f)
;; tab data
((view-changed #t) : boolean)
((xadj 0) : number) ;; x slider number (if using canvas)
((yadj 0) : number) ;; y slider number (if using canvas)
tests-tree ;; used in newdashboard
)
(define (dboard:tabdat-target-string vec)
(let ((targ (dboard:tabdat-target vec)))
(if (list? targ)(string-intersperse targ "/") "no-target-specified")))
|
︙ | | | ︙ | |
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
|
(vg:drawing-scalex-set! drawing
(+ scalex
(if (> step 0)
(* scalex 0.02)
(* scalex -0.02))))))
"wheel-cb"))
)))
cnv-obj)))))
;;======================================================================
;; R U N
;;======================================================================
;;
;; display and manage a single run at a time
|
|
>
>
>
>
>
>
>
>
>
>
|
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
|
(vg:drawing-scalex-set! drawing
(+ scalex
(if (> step 0)
(* scalex 0.02)
(* scalex -0.02))))))
"wheel-cb"))
)))
cnv-obj)
(let* ((hb1 (iup:hbox))
(buttondat (dboard:tabdat-graph-button-dat tabdat)))
;; (b1 (iup:button "testbutton")))
(dboard:tabdat-graph-button-box-set! tabdat hb1)
(for-each
(lambda (buttondat)
(let* ((b1 (iup:button "buttondat-graph-name")))
(iup:child-add! b1 hb1))))
hb1)
))))
;;======================================================================
;; R U N
;;======================================================================
;;
;; display and manage a single run at a time
|
︙ | | | ︙ | |
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
|
fieldname
(cons
(apply vector tstart (cdr zeropt))
(hash-table-ref/default res-ht fieldname '())))))))
fields)
res-ht)
#f)))))
;; graph data
;; tsc=timescale, tfn=function; time->x
;;
(define (dboard:graph commondat tabdat tabnum llx lly ulx uly tstart tend tsc tfn compname cmargin)
(let* ((dwg (dboard:tabdat-drawing tabdat))
(lib (vg:get/create-lib dwg "runslib"))
(cnv (dboard:tabdat-cnv tabdat))
|
|
|
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
|
fieldname
(cons
(apply vector tstart (cdr zeropt))
(hash-table-ref/default res-ht fieldname '())))))))
fields)
res-ht)
#f)))))
;; graph data
;; tsc=timescale, tfn=function; time->x
;;
(define (dboard:graph commondat tabdat tabnum llx lly ulx uly tstart tend tsc tfn compname cmargin)
(let* ((dwg (dboard:tabdat-drawing tabdat))
(lib (vg:get/create-lib dwg "runslib"))
(cnv (dboard:tabdat-cnv tabdat))
|
︙ | | | ︙ | |
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
|
(vg:make-text-obj (- smark 1)(- lly 10) label))))
(if (< mark (- tend time-blk))
(loop (+ mark time-blk)(+ count 1))))))
(for-each
(lambda (cf)
(let* ((alldat (dboard:graph-read-data (cadr cf) tstart tend)))
(if alldat
(for-each
(lambda (fieldn)
(let* ((dat (hash-table-ref alldat fieldn))
(vals (map (lambda (x)(vector-ref x 2)) dat)))
(if (not (null? vals))
(let* ((maxval (apply max vals))
(minval (min 0 (apply min vals)))
(yoff (- minval lly)) ;; minval))
(deltaval (- maxval minval))
(yscale (/ delta-y (if (zero? deltaval) 1 deltaval)))
(yfunc (lambda (y)(+ lly (* yscale (- y minval))))) ;; (lambda (y)(* (+ y yoff) yscale))))
|
>
|
>
>
|
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
|
(vg:make-text-obj (- smark 1)(- lly 10) label))))
(if (< mark (- tend time-blk))
(loop (+ mark time-blk)(+ count 1))))))
(for-each
(lambda (cf)
(let* ((alldat (dboard:graph-read-data (cadr cf) tstart tend)))
(if alldat
;; RA => generate canvas
(for-each
(lambda (fieldn)
(let* ((dat (hash-table-ref alldat fieldn))
(vals (map (lambda (x)(vector-ref x 2)) dat))
(buttondat (tabdat-graph-button-dat)))
;; Check if the dat is already added in the buttondat table; if not add it
(if (not (null? vals))
(let* ((maxval (apply max vals))
(minval (min 0 (apply min vals)))
(yoff (- minval lly)) ;; minval))
(deltaval (- maxval minval))
(yscale (/ delta-y (if (zero? deltaval) 1 deltaval)))
(yfunc (lambda (y)(+ lly (* yscale (- y minval))))) ;; (lambda (y)(* (+ y yoff) yscale))))
|
︙ | | | ︙ | |