︙ | | | ︙ | |
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
tabdats
update-mutex
updaters
updating
uidat ;; needs to move to tabdat at some time
hide-not-hide-tabs
)
(define (dboard:commondat-make)
(make-dboard:commondat
curr-tab-num: 0
tabdats: (make-hash-table)
please-update: #t
update-mutex: (make-mutex)
|
>
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
tabdats
update-mutex
updaters
updating
uidat ;; needs to move to tabdat at some time
hide-not-hide-tabs
)
(define (dboard:commondat-make)
(make-dboard:commondat
curr-tab-num: 0
tabdats: (make-hash-table)
please-update: #t
update-mutex: (make-mutex)
|
︙ | | | ︙ | |
209
210
211
212
213
214
215
216
217
218
219
220
221
222
|
(key-lbs #f)
run-name ;; from run name setting widget
states ;; states for -state s1,s2 ...
statuses ;; statuses for -status s1,s2 ...
;; Selector variables
curr-run-id ;; current row to display in Run summary view
curr-test-ids ;; used only in dcommon:run-update which is used in newdashboard
((filters-changed #f) : boolean) ;; to to indicate that the user changed filters for this tab
((last-filter-str "") : string) ;; conc the target runname and testpatt for a signature of changed filters
((hide-empty-runs #f) : boolean)
((hide-not-hide #t) : boolean) ;; toggle for hide/not hide empty runs
(hide-not-hide-button #f)
((searchpatts (make-hash-table)) : hash-table) ;;
|
>
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
(key-lbs #f)
run-name ;; from run name setting widget
states ;; states for -state s1,s2 ...
statuses ;; statuses for -status s1,s2 ...
;; Selector variables
curr-run-id ;; current row to display in Run summary view
prev-run-id ;; previous runid selected before current runid was selected (used in xor-two-runs runs summary mode
curr-test-ids ;; used only in dcommon:run-update which is used in newdashboard
((filters-changed #f) : boolean) ;; to to indicate that the user changed filters for this tab
((last-filter-str "") : string) ;; conc the target runname and testpatt for a signature of changed filters
((hide-empty-runs #f) : boolean)
((hide-not-hide #t) : boolean) ;; toggle for hide/not hide empty runs
(hide-not-hide-button #f)
((searchpatts (make-hash-table)) : hash-table) ;;
|
︙ | | | ︙ | |
241
242
243
244
245
246
247
248
249
250
251
252
253
254
|
(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")))
|
>
>
>
>
>
>
>
>
>
|
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
(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)
;; runs-summary tab state
((runs-summary-modes '((one-run . "Show One Run") (xor-two-runs . "XOR Two Runs") (xor-two-runs-hide-clean . "XOR; Hide Clean")) ) : list)
((runs-summary-mode-buttons '()) : list)
((runs-summary-mode 'one-run) : symbol)
((runs-summary-mode-change-callbacks '()) : list)
(runs-summary-source-runname-label #f)
(runs-summary-dest-runname-label #f)
;; runs summary view
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")))
|
︙ | | | ︙ | |
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
|
;; #:title "Logs" ;; To be replaced with tabs
;; (let ((logs-tb (iup:textbox #:expand "YES"
;; #:multiline "YES")))
;; (dboard:tabdat-logs-textbox-set! tabdat logs-tb)
;; logs-tb))
(define (dboard:runs-tree-browser commondat tabdat)
(let* ((tb (iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
#:addexpanded "NO"
#:selection-cb
(lambda (obj id state)
(debug:catch-and-dump
(lambda ()
(let* ((run-path (tree:node->path obj id))
(run-id (tree-path->run-id tabdat (cdr run-path))))
;; (dboard:tabdat-view-changed-set! tabdat #t) ;; ?? done below when run-id is a number
(dboard:tabdat-target-set! tabdat (cdr run-path)) ;; (print "run-path: " run-path)
(dboard:tabdat-layout-update-ok-set! tabdat #f)
(if (number? run-id)
(begin
(dboard:tabdat-curr-run-id-set! tabdat run-id)
(dboard:tabdat-view-changed-set! tabdat #t))
(debug:print-error 5 *default-log-port* "tree-path->run-id returned non-number " run-id))))
"treebox"))
;; (print "path: " (tree:node->path obj id) " run-id: " run-id)
)))
(dboard:tabdat-runs-tree-set! tabdat tb)
tb))
;;======================================================================
;; R U N C O N T R O L S
;;======================================================================
;;
|
|
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
>
>
|
|
|
|
|
|
|
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
|
;; #:title "Logs" ;; To be replaced with tabs
;; (let ((logs-tb (iup:textbox #:expand "YES"
;; #:multiline "YES")))
;; (dboard:tabdat-logs-textbox-set! tabdat logs-tb)
;; logs-tb))
(define (dboard:runs-tree-browser commondat tabdat)
(let* ((tb
(iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
#:addexpanded "NO"
#:selection-cb
(lambda (obj id state)
(debug:catch-and-dump
(lambda ()
(let* ((run-path (tree:node->path obj id))
(run-id (tree-path->run-id tabdat (cdr run-path))))
;; (dboard:tabdat-view-changed-set! tabdat #t) ;; ?? done below when run-id is a number
(dboard:tabdat-target-set! tabdat (cdr run-path)) ;; (print "run-path: " run-path)
(dboard:tabdat-layout-update-ok-set! tabdat #f)
(if (number? run-id)
(begin
;; capture last two in tabdat.
(dboard:tabdat-prev-run-id-set!
tabdat
(dboard:tabdat-curr-run-id tabdat))
(dboard:tabdat-curr-run-id-set! tabdat run-id)
(dboard:tabdat-view-changed-set! tabdat #t))
(debug:print-error 5 *default-log-port* "tree-path->run-id returned non-number " run-id))))
"treebox"))
;; (print "path: " (tree:node->path obj id) " run-id: " run-id)
)))
(dboard:tabdat-runs-tree-set! tabdat tb)
tb))
;;======================================================================
;; R U N C O N T R O L S
;;======================================================================
;;
|
︙ | | | ︙ | |
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
|
;; Here we update the tests treebox and tree keys
(tree:add-node tb "Runs" run-path ;; (append key-vals (list run-name))
userdata: (conc "run-id: " run-id))
(hash-table-set! (dboard:tabdat-path-run-ids tabdat) run-path run-id)
;; (set! colnum (+ colnum 1))
))))
run-ids)))
(define (dashboard:one-run-updater commondat tabdat tb cell-lookup run-matrix)
(let* ((last-runs-update (dboard:tabdat-last-runs-update tabdat))
(runs-dat (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f last-runs-update))
(runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records
(run-id (dboard:tabdat-curr-run-id tabdat))
(runs-hash (let ((ht (make-hash-table)))
(for-each (lambda (run)
(hash-table-set! ht (db:get-value-by-header run runs-header "id") run))
(vector-ref runs-dat 1))
ht)))
(dboard:update-tree tabdat runs-hash runs-header tb)
(if run-id
(let* (
(last-update (hash-table-ref/default (dboard:tabdat-run-update-times tabdat) run-id 0))
(db-path (or (hash-table-ref/default (dboard:tabdat-run-db-paths tabdat) run-id #f)
(let* ((db-dir (tasks:get-task-db-path))
(db-pth (conc db-dir "/" run-id ".db")))
(hash-table-set! (dboard:tabdat-run-db-paths tabdat) run-id db-pth)
db-pth)))
(tests-dat (if (or (not run-id)
(configf:lookup *configdat* "setup" "do-not-use-db-file-timestamps")
(not (hash-table-exists? (dboard:tabdat-last-test-dat tabdat) run-id))
(>= (file-modification-time db-path) last-update))
(dboard:get-tests-dat tabdat run-id last-update)
(hash-table-ref (dboard:tabdat-last-test-dat tabdat) run-id)))
(tests-mindat (dcommon:minimize-test-data tests-dat))
(indices (common:sparse-list-generate-index tests-mindat)) ;; proc: set-cell))
(row-indices (cadr indices))
(col-indices (car indices))
(max-row (if (null? row-indices) 1 (common:max (map cadr row-indices))))
(max-col (if (null? col-indices) 1 (common:max (map cadr col-indices))))
(max-visible (max (- (dboard:tabdat-num-tests tabdat) 15) 3)) ;; (dboard:tabdat-num-tests tabdat) is proportional to the size of the window
(numrows 1)
(numcols 1)
(changed #f)
)
(dboard:tabdat-last-runs-update-set! tabdat (- (current-seconds) 2))
(hash-table-set! (dboard:tabdat-last-test-dat tabdat) run-id tests-dat)
(hash-table-set! (dboard:tabdat-run-update-times tabdat) run-id (- (current-seconds) 10))
(dboard:tabdat-filters-changed-set! tabdat #f)
(let loop ((pass-num 0)
(changed #f))
;; Update the runs tree
(dboard:update-tree tabdat runs-hash runs-header tb)
(if (eq? pass-num 1)
(begin ;; big reset
(iup:attribute-set! run-matrix "CLEARVALUE" "ALL") ;; NOTE: Was CONTENTS
(iup:attribute-set! run-matrix "CLEARATTRIB" "CONTENTS")
(iup:attribute-set! run-matrix "RESIZEMATRIX" "YES")))
(if (> max-col (string->number (iup:attribute run-matrix "NUMCOL")))
(iup:attribute-set! run-matrix "NUMCOL" max-col ))
(let ((effective-max-row (if (< max-row max-visible) max-visible max-row)))
(if (> effective-max-row (string->number (iup:attribute run-matrix "NUMLIN")))
(iup:attribute-set! run-matrix "NUMLIN" effective-max-row )))
;; Row labels
(for-each (lambda (ind)
(let* ((name (car ind))
(num (cadr ind))
(key (conc num ":0")))
(if (not (equal? (iup:attribute run-matrix key) name))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key name)))))
row-indices)
;; (print "row-indices: " row-indices " col-indices: " col-indices)
(if (and (eq? pass-num 0) changed)
(loop 1 #t)) ;; force second pass
;; Cell contents
(for-each (lambda (entry)
;; (print "entry: " entry)
(let* ((row-name (cadr entry))
(col-name (car entry))
(valuedat (caddr entry))
(test-id (list-ref valuedat 0))
(test-name row-name) ;; (list-ref valuedat 1))
(item-path col-name) ;; (list-ref valuedat 2))
(state (list-ref valuedat 1))
(status (list-ref valuedat 2))
(value (gutils:get-color-for-state-status state status))
(row-num (cadr (assoc row-name row-indices)))
(col-num (cadr (assoc col-name col-indices)))
(key (conc row-num ":" col-num)))
(hash-table-set! cell-lookup key test-id)
(if (not (equal? (iup:attribute run-matrix key) (cadr value)))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key (cadr value))
(iup:attribute-set! run-matrix (conc "BGCOLOR" key) (car value))))))
tests-mindat)
;; Col labels - do after setting Cell contents so they are accounted for in the size calc.
(for-each (lambda (ind)
(let* ((name (car ind))
(num (cadr ind))
(key (conc "0:" num)))
(if (not (equal? (iup:attribute run-matrix key) name))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key name)
(if (<= num max-col)
(iup:attribute-set! run-matrix "FITTOTEXT" (conc "C" num)))))))
col-indices)
(if (and (eq? pass-num 0) changed)
(loop 1 #t)) ;; force second pass due to column labels changing
;; (debug:print 0 *default-log-port* "one-run-updater, changed: " changed " pass-num: " pass-num)
;; (print "one-run-updater, changed: " changed " pass-num: " pass-num)
(if changed (iup:attribute-set! run-matrix "REDRAW" "ALL"))))))
)
;;======================================================================
;; S U M M A R Y
;;======================================================================
;;
;; General info about the run(s) and megatest area
(define (dashboard:summary commondat tabdat #!key (tab-num #f))
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
|
|
<
<
<
<
<
|
<
|
<
<
<
|
<
>
|
>
|
|
|
|
|
|
|
|
|
|
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
|
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
|
;; Here we update the tests treebox and tree keys
(tree:add-node tb "Runs" run-path ;; (append key-vals (list run-name))
userdata: (conc "run-id: " run-id))
(hash-table-set! (dboard:tabdat-path-run-ids tabdat) run-path run-id)
;; (set! colnum (+ colnum 1))
))))
run-ids)))
(define (dashboard:run-id->tests-mindat run-id tabdat runs-hash)
(let* ((run (hash-table-ref/default runs-hash run-id #f))
(last-update (hash-table-ref/default (dboard:tabdat-run-update-times tabdat) run-id 0))
(db-path (or (hash-table-ref/default (dboard:tabdat-run-db-paths tabdat) run-id #f)
(let* ((db-dir (tasks:get-task-db-path))
(db-pth (conc db-dir "/" run-id ".db")))
(hash-table-set! (dboard:tabdat-run-db-paths tabdat) run-id db-pth)
db-pth)))
(key-vals (rmt:get-key-vals run-id))
(testnamepatt (or (dboard:tabdat-test-patts tabdat) "%"))
(tests-dat (if (or (not run-id)
(configf:lookup *configdat* "setup" "do-not-use-db-file-timestamps")
(not (hash-table-exists? (dboard:tabdat-last-test-dat tabdat) run-id))
(>= (file-modification-time db-path) last-update))
(let ((res
(dboard:get-tests-dat tabdat run-id last-update)
;; TODO: replace above line (get-tests-dat) with below line (get-tests-for-run-duplicate); above is a list, below is a hash - therein lies the problem. The minimize-test-data depends on a pre-sorted list as input; hash is by nature unsorted. and its not a list.
;;(dboard:get-tests-for-run-duplicate tabdat run-id run testnamepatt key-vals)
))
(hash-table-set! (dboard:tabdat-last-test-dat tabdat) run-id res)
(hash-table-set! (dboard:tabdat-run-update-times tabdat) run-id (- (current-seconds) 10))
res)
(hash-table-ref (dboard:tabdat-last-test-dat tabdat) run-id)))
(tests-mindat (dcommon:minimize-test-data tests-dat))) ;; reduces data for display
tests-mindat))
(define (dashboard:runs-summary-xor-matrix-content tabdat runs-hash #!key (hide-clean #f))
(let* ((src-run-id (dboard:tabdat-prev-run-id tabdat))
(dest-run-id (dboard:tabdat-curr-run-id tabdat)))
(if (and src-run-id dest-run-id)
(dcommon:xor-tests-mindat
(dashboard:run-id->tests-mindat src-run-id tabdat runs-hash)
(dashboard:run-id->tests-mindat dest-run-id tabdat runs-hash)
hide-clean: hide-clean)
#f)))
(define (dashboard:runs-summary-updater commondat tabdat tb cell-lookup run-matrix)
(dboard:runs-summary-control-panel-updater tabdat)
(let* ((last-runs-update (dboard:tabdat-last-runs-update tabdat))
(runs-dat (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f last-runs-update))
(runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records
(runs (vector-ref runs-dat 1))
(run-id (dboard:tabdat-curr-run-id tabdat))
(runs-hash (let ((ht (make-hash-table)))
(for-each (lambda (run)
(hash-table-set! ht (db:get-value-by-header run runs-header "id") run))
runs)
ht)))
(dboard:update-tree tabdat runs-hash runs-header tb)
(if run-id
(let* ((matrix-content
(case (dboard:tabdat-runs-summary-mode tabdat)
((one-run) (dashboard:run-id->tests-mindat run-id tabdat runs-hash))
((xor-two-runs) (dashboard:runs-summary-xor-matrix-content tabdat runs-hash))
((xor-two-runs-hide-clean) (dashboard:runs-summary-xor-matrix-content tabdat runs-hash hide-clean: #t))
(else (dashboard:run-id->tests-mindat run-id tabdat runs-hash)))))
(when matrix-content
(let* ((indices (common:sparse-list-generate-index matrix-content)) ;; proc: set-cell))
(row-indices (cadr indices))
(col-indices (car indices))
(max-row (if (null? row-indices) 1 (common:max (map cadr row-indices))))
(max-col (if (null? col-indices) 1 (common:max (map cadr col-indices))))
(max-visible (max (- (dboard:tabdat-num-tests tabdat) 15) 3)) ;; (dboard:tabdat-num-tests tabdat) is proportional to the size of the window
(numrows 1)
(numcols 1)
(changed #f)
)
(dboard:tabdat-last-runs-update-set! tabdat (- (current-seconds) 2))
(dboard:tabdat-filters-changed-set! tabdat #f)
(let loop ((pass-num 0)
(changed #f))
;; Update the runs tree
(dboard:update-tree tabdat runs-hash runs-header tb)
(if (eq? pass-num 1)
(begin ;; big reset
(iup:attribute-set! run-matrix "CLEARVALUE" "ALL") ;; NOTE: Was CONTENTS
(iup:attribute-set! run-matrix "CLEARATTRIB" "CONTENTS")
(iup:attribute-set! run-matrix "RESIZEMATRIX" "YES")))
(if (> max-col (string->number (iup:attribute run-matrix "NUMCOL")))
(iup:attribute-set! run-matrix "NUMCOL" max-col ))
(let ((effective-max-row (if (< max-row max-visible) max-visible max-row)))
(if (> effective-max-row (string->number (iup:attribute run-matrix "NUMLIN")))
(iup:attribute-set! run-matrix "NUMLIN" effective-max-row )))
;; Row labels
(for-each (lambda (ind)
(let* ((name (car ind))
(num (cadr ind))
(key (conc num ":0")))
(if (not (equal? (iup:attribute run-matrix key) name))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key name)))))
row-indices)
;; (print "row-indices: " row-indices " col-indices: " col-indices)
(if (and (eq? pass-num 0) changed)
(loop 1 #t)) ;; force second pass
;; Cell contents
(for-each (lambda (entry)
;; (print "entry: " entry)
(let* ((row-name (cadr entry))
(col-name (car entry))
(valuedat (caddr entry))
(test-id (list-ref valuedat 0))
(test-name row-name) ;; (list-ref valuedat 1))
(item-path col-name) ;; (list-ref valuedat 2))
(state (list-ref valuedat 1))
(status (list-ref valuedat 2))
(value (gutils:get-color-for-state-status state status))
(row-num (cadr (assoc row-name row-indices)))
(col-num (cadr (assoc col-name col-indices)))
(key (conc row-num ":" col-num)))
(hash-table-set! cell-lookup key test-id)
(if (not (equal? (iup:attribute run-matrix key) (cadr value)))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key (cadr value))
(iup:attribute-set! run-matrix (conc "BGCOLOR" key) (car value))))))
matrix-content)
;; Col labels - do after setting Cell contents so they are accounted for in the size calc.
(for-each (lambda (ind)
(let* ((name (car ind))
(num (cadr ind))
(key (conc "0:" num)))
(if (not (equal? (iup:attribute run-matrix key) name))
(begin
(set! changed #t)
(iup:attribute-set! run-matrix key name)
(if (<= num max-col)
(iup:attribute-set! run-matrix "FITTOTEXT" (conc "C" num)))))))
col-indices)
(if (and (eq? pass-num 0) changed)
(loop 1 #t)) ;; force second pass due to column labels changing
;; (debug:print 0 *default-log-port* "runs-summary-updater, changed: " changed " pass-num: " pass-num)
;; (print "runs-summary-updater, changed: " changed " pass-num: " pass-num)
(if changed (iup:attribute-set! run-matrix "REDRAW" "ALL")))))))))
;;======================================================================
;; S U M M A R Y
;;======================================================================
;;
;; General info about the run(s) and megatest area
(define (dashboard:summary commondat tabdat #!key (tab-num #f))
|
︙ | | | ︙ | |
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
|
((eval (string->symbol updater)) commondat tabs tab-num view-name views-cfgdat *configdat*)))
tab-num: tab-num))
(if success
(begin
;; (iup:attribute-set! tabs (conc "TABTITLE" tab-num) view-name)
(dboard:common-set-tabdat! commondat tab-num (dboard:tabdat-make-data))))
result-child))
;;======================================================================
;; R U N
;;======================================================================
;;
;; display and manage a single run at a time
;; This is the Run Summary tab
;;
(define (dashboard:one-run commondat tabdat #!key (tab-num #f))
(let* ((update-mutex (dboard:commondat-update-mutex commondat))
(tb (iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
#:addexpanded "NO"
#:selection-cb
(lambda (obj id state)
(debug:catch-and-dump
(lambda ()
;; (print "obj: " obj ", id: " id ", state: " state)
(let* ((run-path (tree:node->path obj id))
(run-id (tree-path->run-id tabdat (cdr run-path))))
(if (number? run-id)
(begin
(dboard:tabdat-curr-run-id-set! tabdat run-id)
(dboard:tabdat-layout-update-ok-set! tabdat #f)
;; (dashboard:update-run-summary-tab)
)
;; (debug:print-error 0 *default-log-port* "tree-path->run-id returned non-number " run-id)
)))
"selection-cb in one-run")
;; (print "path: " (tree:node->path obj id) " run-id: " run-id)
)))
(cell-lookup (make-hash-table))
(run-matrix (iup:matrix
#:expand "YES"
#:click-cb
(lambda (obj lin col status)
(let* ((toolpath (car (argv)))
(key (conc lin ":" col))
(test-id (hash-table-ref/default cell-lookup key -1))
(cmd (conc toolpath " -test " (dboard:tabdat-curr-run-id tabdat) "," test-id "&")))
(system cmd)))))
(one-run-updater
(lambda ()
(mutex-lock! update-mutex)
(if (or (dashboard:database-changed? commondat tabdat)
(dboard:tabdat-view-changed tabdat))
(debug:catch-and-dump
(lambda () ;; check that run-matrix is initialized before calling the updater
(if run-matrix
(dashboard:one-run-updater commondat tabdat tb cell-lookup run-matrix)))
"dashboard:one-run-updater")
)
(mutex-unlock! update-mutex))))
(dboard:commondat-add-updater commondat one-run-updater tab-num: tab-num)
(dboard:tabdat-runs-tree-set! tabdat tb)
(iup:vbox
(iup:split
tb
run-matrix)
(dboard:make-controls commondat tabdat))))
;;======================================================================
;; R U N S
;;======================================================================
(define (dboard:make-controls commondat tabdat)
(let ((btn-fontsz (dboard:tabdat-runs-btn-fontsz tabdat)))
(iup:hbox
(iup:vbox
(iup:frame
#:title "filter test and items"
(iup:hbox
(iup:vbox
(iup:textbox #:size "120x15" #:fontsize "10" #:value "%"
#:expand "NO"
#:action (lambda (obj unk val)
(debug:catch-and-dump
(lambda ()
(mark-for-update tabdat)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
|
|
|
|
|
>
>
|
>
|
|
>
|
|
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
|
((eval (string->symbol updater)) commondat tabs tab-num view-name views-cfgdat *configdat*)))
tab-num: tab-num))
(if success
(begin
;; (iup:attribute-set! tabs (conc "TABTITLE" tab-num) view-name)
(dboard:common-set-tabdat! commondat tab-num (dboard:tabdat-make-data))))
result-child))
(define (dboard:runs-summary-buttons-updater tabdat)
(let loop ((buttons-left (dboard:tabdat-runs-summary-mode-buttons tabdat))
(modes-left (dboard:tabdat-runs-summary-modes tabdat)))
(if (or (null? buttons-left) (null? modes-left))
#t
(let* ((this-button (car buttons-left))
(mode-item (car modes-left))
(this-mode (car mode-item))
(sel-color "180 100 100")
(nonsel-color "170 170 170")
(current-mode (dboard:tabdat-runs-summary-mode tabdat)))
(if (eq? this-mode current-mode)
(iup:attribute-set! this-button "BGCOLOR" sel-color)
(iup:attribute-set! this-button "BGCOLOR" nonsel-color))
(loop (cdr buttons-left) (cdr modes-left))))))
(define (dboard:runs-summary-xor-labels-updater tabdat)
(let ((source-runname-label (dboard:tabdat-runs-summary-source-runname-label tabdat))
(dest-runname-label (dboard:tabdat-runs-summary-dest-runname-label tabdat))
(mode (dboard:tabdat-runs-summary-mode tabdat)))
(when (and source-runname-label dest-runname-label)
(case mode
((xor-two-runs xor-two-runs-hide-clean)
(let* ((curr-run-id (dboard:tabdat-curr-run-id tabdat))
(prev-run-id (dboard:tabdat-prev-run-id tabdat))
(curr-runname (if curr-run-id
(rmt:get-run-name-from-id curr-run-id)
"None"))
(prev-runname (if prev-run-id
(rmt:get-run-name-from-id prev-run-id)
"None")))
(iup:attribute-set! source-runname-label "TITLE" (conc " SRC: "prev-runname" "))
(iup:attribute-set! dest-runname-label "TITLE" (conc "DEST: "curr-runname" "))))
(else
(iup:attribute-set! source-runname-label "TITLE" "")
(iup:attribute-set! dest-runname-label "TITLE" ""))))))
(define (dboard:runs-summary-control-panel-updater tabdat)
(dboard:runs-summary-xor-labels-updater tabdat)
(dboard:runs-summary-buttons-updater tabdat))
;; setup buttons and callbacks to switch between modes in runs summary tab
;;
(define (dashboard:runs-summary-control-panel tabdat)
(let* ((summary-buttons ;; build buttons
(map
(lambda (mode-item)
(let* ((this-mode (car mode-item))
(this-mode-label (cdr mode-item)))
(iup:button this-mode-label
#:action
(lambda (obj)
(debug:catch-and-dump
(lambda ()
(dboard:tabdat-runs-summary-mode-set! tabdat this-mode)
(dboard:runs-summary-control-panel-updater tabdat))
"runs summary control panel updater")))))
(dboard:tabdat-runs-summary-modes tabdat)))
(summary-buttons-hbox (apply iup:hbox summary-buttons))
(xor-runname-labels-hbox
(iup:hbox
(let ((temp-label
(iup:label "" #:size "125x15" #:fontsize "10" )))
(dboard:tabdat-runs-summary-source-runname-label-set! tabdat temp-label)
temp-label
)
(let ((temp-label
(iup:label "" #:size "125x15" #:fontsize "10")))
(dboard:tabdat-runs-summary-dest-runname-label-set! tabdat temp-label)
temp-label))))
(dboard:tabdat-runs-summary-mode-buttons-set! tabdat summary-buttons)
;; maybe wrap in a frame
(let ((res (iup:vbox summary-buttons-hbox xor-runname-labels-hbox )))
(dboard:runs-summary-control-panel-updater tabdat)
res
)))
;;======================================================================
;; R U N
;;======================================================================
;;
;; display and manage a single run at a time
;; This is the Run Summary tab
;;
(define (dashboard:runs-summary commondat tabdat #!key (tab-num #f))
(let* ((update-mutex (dboard:commondat-update-mutex commondat))
(tb (iup:treebox
#:value 0
#:name "Runs"
#:expand "YES"
#:addexpanded "NO"
#:selection-cb
(lambda (obj id state)
(debug:catch-and-dump
(lambda ()
;; (print "obj: " obj ", id: " id ", state: " state)
(let* ((run-path (tree:node->path obj id))
(run-id (tree-path->run-id tabdat (cdr run-path))))
(if (number? run-id)
(begin
(dboard:tabdat-prev-run-id-set!
tabdat
(dboard:tabdat-curr-run-id tabdat))
(dboard:tabdat-curr-run-id-set! tabdat run-id)
(dboard:tabdat-layout-update-ok-set! tabdat #f)
;; (dashboard:update-run-summary-tab)
)
;; (debug:print-error 0 *default-log-port* "tree-path->run-id returned non-number " run-id)
)))
"selection-cb in runs-summary")
;; (print "path: " (tree:node->path obj id) " run-id: " run-id)
)))
(cell-lookup (make-hash-table))
(run-matrix (iup:matrix
#:expand "YES"
#:click-cb
(lambda (obj lin col status)
(let* ((toolpath (car (argv)))
(key (conc lin ":" col))
(test-id (hash-table-ref/default cell-lookup key -1))
(cmd (conc toolpath " -test " (dboard:tabdat-curr-run-id tabdat) "," test-id "&")))
(system cmd)))))
(runs-summary-updater
(lambda ()
(mutex-lock! update-mutex)
(if (or (dashboard:database-changed? commondat tabdat)
(dboard:tabdat-view-changed tabdat))
(debug:catch-and-dump
(lambda () ;; check that run-matrix is initialized before calling the updater
(if run-matrix
(dashboard:runs-summary-updater commondat tabdat tb cell-lookup run-matrix)))
"dashboard:runs-summary-updater")
)
(mutex-unlock! update-mutex)))
(runs-summary-control-panel (dashboard:runs-summary-control-panel tabdat))
)
(dboard:commondat-add-updater commondat runs-summary-updater tab-num: tab-num)
(dboard:tabdat-runs-tree-set! tabdat tb)
(iup:vbox
(iup:split
#:value 200
tb
run-matrix)
(dboard:make-controls commondat tabdat extra-widget: runs-summary-control-panel))))
;;======================================================================
;; R U N S
;;======================================================================
(define (dboard:make-controls commondat tabdat #!key (extra-widget #f) )
(let ((btn-fontsz (dboard:tabdat-runs-btn-fontsz tabdat)))
(iup:hbox
(iup:vbox
(iup:frame
#:title "filter test and items"
(iup:vbox
(iup:hbox
(iup:vbox
(iup:textbox #:size "120x15" #:fontsize "10" #:value "%"
#:expand "NO"
#:action (lambda (obj unk val)
(debug:catch-and-dump
(lambda ()
(mark-for-update tabdat)
|
︙ | | | ︙ | |
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
|
(sort-lb (iup:listbox #:expand "NO" ;; "HORIZONTAL"
#:size "80x15"
#:dropdown "YES"
#:action (lambda (obj val index lbstate)
(set! *tests-sort-reverse* index)
(mark-for-update tabdat))))
(default-cmd (car (list-ref *tests-sort-type-index* *tests-sort-reverse*))))
(iuplistbox-fill-list sort-lb cmds-list selected-item: default-cmd)
(set! hide-empty (iup:button "HideEmpty"
;; #:expand HORIZONTAL"
#:expand "NO" #:size "80x15"
#:action (lambda (obj)
(dboard:tabdat-hide-empty-runs-set! tabdat (not (dboard:tabdat-hide-empty-runs tabdat)))
|
>
|
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
|
(sort-lb (iup:listbox #:expand "NO" ;; "HORIZONTAL"
#:size "80x15"
#:dropdown "YES"
#:action (lambda (obj val index lbstate)
(set! *tests-sort-reverse* index)
(mark-for-update tabdat))))
(default-cmd (car (list-ref *tests-sort-type-index* *tests-sort-reverse*))))
(iuplistbox-fill-list sort-lb cmds-list selected-item: default-cmd)
(set! hide-empty (iup:button "HideEmpty"
;; #:expand HORIZONTAL"
#:expand "NO" #:size "80x15"
#:action (lambda (obj)
(dboard:tabdat-hide-empty-runs-set! tabdat (not (dboard:tabdat-hide-empty-runs tabdat)))
|
︙ | | | ︙ | |
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
|
(dboard:tabdat-hide-not-hide-set! tabdat #f) ;; (not (dboard:tabdat-hide-not-hide tabdat)))
(iup:attribute-set! show "BGCOLOR" sel-color)
(iup:attribute-set! hide "BGCOLOR" nonsel-color)
(mark-for-update tabdat))))
(iup:attribute-set! hide "BGCOLOR" sel-color)
(iup:attribute-set! show "BGCOLOR" nonsel-color)
;; (dboard:tabdat-hide-not-hide-button-set! tabdat hideit) ;; never used, can eliminate ...
(iup:vbox
(iup:hbox hide show)
hide-empty sort-lb)))
)))
(iup:frame
#:title "state/status filter"
(iup:vbox
(apply
iup:hbox
(map (lambda (status)
(iup:toggle (conc status " ")
|
|
|
|
>
>
>
>
>
>
>
>
>
>
|
>
|
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
|
(dboard:tabdat-hide-not-hide-set! tabdat #f) ;; (not (dboard:tabdat-hide-not-hide tabdat)))
(iup:attribute-set! show "BGCOLOR" sel-color)
(iup:attribute-set! hide "BGCOLOR" nonsel-color)
(mark-for-update tabdat))))
(iup:attribute-set! hide "BGCOLOR" sel-color)
(iup:attribute-set! show "BGCOLOR" nonsel-color)
;; (dboard:tabdat-hide-not-hide-button-set! tabdat hideit) ;; never used, can eliminate ...
(iup:vbox
(iup:hbox hide show)
sort-lb)))
)
;; insert extra widget here
(if extra-widget
extra-widget
(iup:hbox)) ;; empty widget
)))
(iup:frame
#:title "state/status filter"
(iup:vbox
(apply
iup:hbox
(map (lambda (status)
(iup:toggle (conc status " ")
|
︙ | | | ︙ | |
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
|
(mark-for-update tabdat)
(debug:print 6 *default-log-port* "(dboard:tabdat-start-run-offset tabdat) " (dboard:tabdat-start-run-offset tabdat) " maxruns: " maxruns ", val: " val " oldmax: " oldmax)
(iup:attribute-set! obj "MAX" (* maxruns 10))))
#:expand "HORIZONTAL"
#:max (* 10 (length (dboard:tabdat-allruns tabdat)))
#:min 0
#:step 0.01)))
;(iup:button "inc rows" #:action (lambda (obj)(dboard:tabdat-num-tests-set! tabdat (+ (dboard:tabdat-num-tests tabdat) 1))))
;(iup:button "dec rows" #:action (lambda (obj)(dboard:tabdat-num-tests-set! tabdat (if (> (dboard:tabdat-num-tests tabdat) 0)(- (dboard:tabdat-num-tests tabdat) 1) 0))))
)))
(define (dashboard:popup-menu buttndat run-id test-id target runname test-name testpatt)
(iup:menu
(iup:menu-item
"Run"
|
|
|
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
|
(mark-for-update tabdat)
(debug:print 6 *default-log-port* "(dboard:tabdat-start-run-offset tabdat) " (dboard:tabdat-start-run-offset tabdat) " maxruns: " maxruns ", val: " val " oldmax: " oldmax)
(iup:attribute-set! obj "MAX" (* maxruns 10))))
#:expand "HORIZONTAL"
#:max (* 10 (length (dboard:tabdat-allruns tabdat)))
#:min 0
#:step 0.01)))
;;(iup:button "inc rows" #:action (lambda (obj)(dboard:tabdat-num-tests-set! tabdat (+ (dboard:tabdat-num-tests tabdat) 1))))
;(iup:button "dec rows" #:action (lambda (obj)(dboard:tabdat-num-tests-set! tabdat (if (> (dboard:tabdat-num-tests tabdat) 0)(- (dboard:tabdat-num-tests tabdat) 1) 0))))
)))
(define (dashboard:popup-menu buttndat run-id test-id target runname test-name testpatt)
(iup:menu
(iup:menu-item
"Run"
|
︙ | | | ︙ | |
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
|
(let* ((tab-num (dboard:commondat-curr-tab-num commondat))
(tabdat (dboard:common-get-tabdat commondat tab-num: tab-num)))
(dboard:commondat-please-update-set! commondat #t)
(dboard:tabdat-layout-update-ok-set! tabdat #t)))
"tabchangepos"))
(dashboard:summary commondat stats-dat tab-num: 0)
runs-view
(dashboard:one-run commondat onerun-dat tab-num: 2)
;; (dashboard:new-view db data new-view-dat tab-num: 3)
(dashboard:run-controls commondat runcontrols-dat tab-num: 3)
(dashboard:run-times commondat runtimes-dat tab-num: 4)
additional-views)))
;; (set! (iup:callback tabs tabchange-cb:) (lambda (a b c)(print "SWITCHED TO TAB: " a " " b " " c)))
(iup:attribute-set! tabs "TABTITLE0" "Summary")
(iup:attribute-set! tabs "TABTITLE1" "Runs")
|
|
|
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
|
(let* ((tab-num (dboard:commondat-curr-tab-num commondat))
(tabdat (dboard:common-get-tabdat commondat tab-num: tab-num)))
(dboard:commondat-please-update-set! commondat #t)
(dboard:tabdat-layout-update-ok-set! tabdat #t)))
"tabchangepos"))
(dashboard:summary commondat stats-dat tab-num: 0)
runs-view
(dashboard:runs-summary commondat onerun-dat tab-num: 2)
;; (dashboard:new-view db data new-view-dat tab-num: 3)
(dashboard:run-controls commondat runcontrols-dat tab-num: 3)
(dashboard:run-times commondat runtimes-dat tab-num: 4)
additional-views)))
;; (set! (iup:callback tabs tabchange-cb:) (lambda (a b c)(print "SWITCHED TO TAB: " a " " b " " c)))
(iup:attribute-set! tabs "TABTITLE0" "Summary")
(iup:attribute-set! tabs "TABTITLE1" "Runs")
|
︙ | | | ︙ | |