Overview
Comment: | wip |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | xor-two-runs |
Files: | files | file ages | folders |
SHA1: |
4267e55d279f806e3cd3ab87ddee5f9d |
User & Date: | bjbarcla on 2016-08-26 17:51:52 |
Other Links: | branch diff | manifest | tags |
Context
2016-09-02
| ||
18:10 | wip check-in: 26c23ee62d user: bjbarcla tags: xor-two-runs | |
2016-08-26
| ||
17:51 | wip check-in: 4267e55d27 user: bjbarcla tags: xor-two-runs | |
17:51 | Create new branch named "xor-two-runs" check-in: c16967fa8b user: bjbarcla tags: xor-two-runs | |
Changes
Modified dashboard.scm from [8d6f49c706] to [1ccdb1c663].
︙ | ︙ | |||
201 202 203 204 205 206 207 | ((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 ... statuses ;; statuses for -status s1,s2 ... | < > > > > > | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | ((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 ... 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 (xor-src-runid-label #f) (xor-dest-runid-label #f) (mode-flag (make-parameter 'view-one-run)) 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) ;; |
︙ | ︙ | |||
1099 1100 1101 1102 1103 1104 1105 | (car (dashboard:update-target-selector tabdat)))) (curr-runname (dboard:tabdat-run-name tabdat))) (dboard:tabdat-target-set! tabdat targ) ;; (if (dboard:tabdat-updater-for-runs tabdat) ;; ((dboard:tabdat-updater-for-runs tabdat))) (if (or (not (equal? curr-runname (dboard:tabdat-run-name tabdat))) (equal? (dboard:tabdat-run-name tabdat) "")) | | | 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 | (car (dashboard:update-target-selector tabdat)))) (curr-runname (dboard:tabdat-run-name tabdat))) (dboard:tabdat-target-set! tabdat targ) ;; (if (dboard:tabdat-updater-for-runs tabdat) ;; ((dboard:tabdat-updater-for-runs tabdat))) (if (or (not (equal? curr-runname (dboard:tabdat-run-name tabdat))) (equal? (dboard:tabdat-run-name tabdat) "")) (dboard:tabdat-run-name-set! tabdat curr-runname)) (dashboard:update-run-command tabdat))) (define (dashboard:run-controls commondat tabdat #!key (tab-num #f)) (let* ((targets (make-hash-table)) (test-records (make-hash-table)) (all-tests-registry (tests:get-all)) ;; (tests:get-valid-tests *toppath* '())) (test-names (hash-table-keys all-tests-registry)) |
︙ | ︙ | |||
1127 1128 1129 1130 1131 1132 1133 | ;; refer to (dboard:tabdat-keys tabdat), (dboard:tabdat-dbkeys tabdat) for keys (iup:vbox (dcommon:command-execution-control tabdat) (iup:split #:orientation "VERTICAL" ;; "HORIZONTAL" #:value 200 | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | > > > > | > > > > > > > > > > | 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 | ;; refer to (dboard:tabdat-keys tabdat), (dboard:tabdat-dbkeys tabdat) for keys (iup:vbox (dcommon:command-execution-control tabdat) (iup:split #:orientation "VERTICAL" ;; "HORIZONTAL" #:value 200 ;; ;; (iup:split ;; #:value 300 ;; Target, testpatt, state and status input boxes ;; (iup:vbox ;; Command to run, placed over the top of the canvas (dcommon:command-action-selector commondat tabdat tab-num: tab-num) (dcommon:command-runname-selector commondat tabdat tab-num: tab-num) (dcommon:command-testname-selector commondat tabdat update-keyvals)) ;; key-listboxes)) (dcommon:command-tests-tasks-canvas tabdat test-records sorted-testnames tests-draw-state)) ;;(iup:frame ;; #: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:xor-ui-update tabdat) (print "BB> ARGH0") (let* ((mode-flag (dboard:tabdat-mode-flag tabdat)) (current-mode (mode-flag)) (xor-src-runid-label (dboard:tabdat-xor-src-runid-label tabdat)) (xor-dest-runid-label (dboard:tabdat-xor-dest-runid-label tabdat)) (curr-run-id (begin (print "BB> ARGH1") (dboard:tabdat-curr-run-id tabdat))) (prev-run-id (begin (print "BB> ARGH2") (dboard:tabdat-prev-run-id tabdat))) (curr-runname (begin (print "BB> ARGH3") (if curr-run-id (rmt:get-run-name-from-id curr-run-id) "None"))) (prev-runname (begin (print "BB> ARGH4") (if prev-run-id (rmt:get-run-name-from-id prev-run-id) "None"))) ) (print "BB> xor-ui-update HELLO" ) (print "BB> xor-src-runid-label="xor-src-runid-label) (print "BB> xor-dest-runid-label="xor-dest-runid-label) (print "BB> curr-runname="curr-runname) (print "BB> prev-runname="prev-runname) (print "BB> current-mode="current-mode) (case current-mode ((view-one-run) (iup:attribute-set! xor-src-runid-label "TITLE" "") (iup:attribute-set! xor-dest-runid-label "TITLE" "")) ((xor-two-runs) (iup:attribute-set! xor-src-runid-label "TITLE" (conc " SRC: "curr-runname" ")) (iup:attribute-set! xor-dest-runid-label "TITLE" (conc "DEST: "prev-runname" "))) (else (print "BB> WHA?")) ) (print "BB> after case") )) (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))) (curr-runname (dboard:tabdat-run-name tabdat))) (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-run-name-set! tabdat curr-runname) (print "BB> before xor-ui-update") (dboard:xor-ui-update tabdat) (print "BB> after xor-ui-update") (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)) |
︙ | ︙ | |||
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 | ;; ;; display and manage a single run at a time (define (tree-path->run-id tabdat path) (if (not (null? path)) (hash-table-ref/default (dboard:tabdat-path-run-ids tabdat) path #f) #f)) (define (dboard:get-tests-dat tabdat run-id last-update) (let ((tdat (if run-id (rmt:get-tests-for-run run-id (hash-table-ref/default (dboard:tabdat-searchpatts tabdat) "test-name" "%/%") (hash-table-keys (dboard:tabdat-state-ignore-hash tabdat)) ;; '() (hash-table-keys (dboard:tabdat-status-ignore-hash tabdat)) ;; '() #f #f ;; offset limit | > > > > > | 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 | ;; ;; display and manage a single run at a time (define (tree-path->run-id tabdat path) (if (not (null? path)) (hash-table-ref/default (dboard:tabdat-path-run-ids tabdat) path #f) #f)) (define (tree-path->run-name tabdat path) (if (not (null? path)) (hash-table-ref/default (dboard:tabdat-path-run-ids tabdat) path #f) #f)) (define (dboard:get-tests-dat tabdat run-id last-update) (let ((tdat (if run-id (rmt:get-tests-for-run run-id (hash-table-ref/default (dboard:tabdat-searchpatts tabdat) "test-name" "%/%") (hash-table-keys (dboard:tabdat-state-ignore-hash tabdat)) ;; '() (hash-table-keys (dboard:tabdat-status-ignore-hash tabdat)) ;; '() #f #f ;; offset limit |
︙ | ︙ | |||
1349 1350 1351 1352 1353 1354 1355 | ;; 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))) | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 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 | ;; 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* ((runs-dat (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f)) (runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records (run-id (dboard:tabdat-curr-run-id tabdat)) (last-update 0) ;; fix me - have to create and store a rundat record for this (tests-dat (dboard:get-tests-dat tabdat run-id last-update)) ;; does query to get run info (tests-mindat (dcommon:minimize-test-data tests-dat)) ;; reduces data for display (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) (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: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") (iup:attribute-set! run-matrix "NUMCOL" max-col ) (iup:attribute-set! run-matrix "NUMLIN" (if (< max-row max-visible) max-visible max-row)))) ;; min of 20 ;; 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) (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-debug-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"))))) (define (dashboard:xor-two-runs-updater commondat tabdat tb cell-lookup run-matrix ) (let* ((runs-dat (rmt:get-runs-by-patt (dboard:tabdat-keys tabdat) "%" #f #f #f #f)) (runs-header (vector-ref runs-dat 0)) ;; 0 is header, 1 is list of records (prev-run-id (dboard:tabdat-prev-run-id tabdat)) (curr-run-id (dboard:tabdat-curr-run-id tabdat)) (last-update 0) ;; fix me - have to create and store a rundat record for this (curr-tests-dat (dboard:get-tests-dat tabdat curr-run-id last-update)) ;; does query to get run info (prev-tests-dat (dboard:get-tests-dat tabdat prev-run-id last-update)) ;; does query to get run info ;;; STOPPED HERE (tests-mindat (dcommon:minimize-test-data curr-tests-dat)) ;; reduces data for display (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) |
︙ | ︙ | |||
1396 1397 1398 1399 1400 1401 1402 | (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) | | | 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 | (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)) |
︙ | ︙ | |||
1440 1441 1442 1443 1444 1445 1446 | (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-debug-port* "one-run-updater, changed: " changed " pass-num: " pass-num) | | > | 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 | (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-debug-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)) |
︙ | ︙ | |||
1492 1493 1494 1495 1496 1497 1498 | ;; (define dashboard:update-run-summary-tab #f) ;; (define dashboard:update-new-view-tab #f) ;; This is the Run Summary tab ;; (define (dashboard:one-run commondat tabdat #!key (tab-num #f)) | | > > > > > > > > > > > | | | > > > > > > > > | > > > | | < > > | > > | > > > > | | > | > > > > | < > | | | > > | < | > > | > > > > > > | > > | > | | > > > > | 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 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 | ;; (define dashboard:update-run-summary-tab #f) ;; (define dashboard:update-new-view-tab #f) ;; This is the Run Summary tab ;; (define (dashboard:one-run commondat tabdat #!key (tab-num #f)) (let* ((view-one-run-button #f) (xor-two-runs-button #f) (sel-color "180 100 100") (nonsel-color "170 170 170") (mode-flag (dboard:tabdat-mode-flag tabdat)) (tb (dboard:runs-tree-browser commondat tabdat)) (cell-lookup (make-hash-table)) (mode-selector (iup:hbox (let ((temp-button (iup:button "View One Run" #:bgcolor sel-color #:action (lambda (obj) (debug:catch-and-dump (lambda () (mode-flag 'view-one-run) (iup:attribute-set! obj "BGCOLOR" sel-color) (iup:attribute-set! xor-two-runs-button "BGCOLOR" nonsel-color) (dboard:xor-ui-update tabdat)) "temp-button-1")) ))) (set! view-one-run-button temp-button) temp-button) (let ((temp-button (iup:button "XOR Two Runs" #:action (lambda (obj) (debug:catch-and-dump (lambda () (mode-flag 'xor-two-runs) (iup:attribute-set! obj "BGCOLOR" sel-color) (iup:attribute-set! view-one-run-button "BGCOLOR" nonsel-color) (dboard:xor-ui-update tabdat)) "temp-button-2")) ))) (set! xor-two-runs-button temp-button) temp-button) (let ((temp-label (iup:label "" #:size "125x15" #:fontsize "10" ))) (dboard:tabdat-xor-src-runid-label-set! tabdat temp-label) temp-label ) (let ((temp-label (iup:label "" #:size "125x15" #:fontsize "10"))) (dboard:tabdat-xor-dest-runid-label-set! tabdat temp-label) temp-label ) ) ) (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 () (if (dashboard:database-changed? commondat tabdat) (case (mode-flag) ((view-one-run) (dashboard:one-run-updater commondat tabdat tb cell-lookup run-matrix)) ((xor-two-runs) (dashboard:xor-two-runs-updater commondat tabdat tb cell-lookup run-matrix)) ) (dboard:xor-ui-update) )))) (dboard:commondat-add-updater commondat one-run-updater tab-num: tab-num) ;; register updater (dboard:tabdat-runs-tree-set! tabdat tb) (iup:vbox (iup:split (iup:vbox tb) run-matrix) mode-selector) )) ;; (iup:vbox ;; (let* ((cnv-obj (iup:canvas ;; ;; #:size "500x400" ;; #:expand "YES" ;; #:scrollbar "YES" ;; #:posx "0.5" ;; #:posy "0.5" |
︙ | ︙ |