Megatest

Diff
Login

Differences From Artifact [04bfccff35]:

To Artifact [d9f190985d]:


1311
1312
1313
1314
1315
1316
1317







1318
1319
1320
1321
1322
1323
1324
			(bval (vector-ref b 2))
			(anum (string->number aval))
			(bnum (string->number bval)))
		   (if (and anum bnum)
		       (< anum bnum)
		       (string<= aval bval)))))))








(define (dboard:update-tree tabdat runs-hash runs-header tb)
  (let* ((run-ids (sort (filter number? (hash-table-keys runs-hash))
			(lambda (a b)
			  (let* ((record-a (hash-table-ref runs-hash a))
				 (record-b (hash-table-ref runs-hash b))
				 (time-a   (db:get-value-by-header record-a runs-header "event_time"))
				 (time-b   (db:get-value-by-header record-b runs-header "event_time")))







>
>
>
>
>
>
>







1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
			(bval (vector-ref b 2))
			(anum (string->number aval))
			(bnum (string->number bval)))
		   (if (and anum bnum)
		       (< anum bnum)
		       (string<= aval bval)))))))


(define (dashboard:safe-cadr-assoc name lst)
  (let ((res (assoc name lst)))
    (if (and res (> (length res) 1))
	(cadr res)
	#f)))

(define (dboard:update-tree tabdat runs-hash runs-header tb)
  (let* ((run-ids (sort (filter number? (hash-table-keys runs-hash))
			(lambda (a b)
			  (let* ((record-a (hash-table-ref runs-hash a))
				 (record-b (hash-table-ref runs-hash b))
				 (time-a   (db:get-value-by-header record-a runs-header "event_time"))
				 (time-b   (db:get-value-by-header record-b runs-header "event_time")))
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377

1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394




1395
1396
1397
1398
1399
1400
1401
	 (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)



    (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)
    




    ;; 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))







|
|
|


|
>




|












>
>
>
>







1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
	 (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))
1423
1424
1425
1426
1427
1428
1429






1430
1431
1432
1433
1434
1435
1436
1437
		       (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 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))







>
>
>
>
>
>
|







1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
		       (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")))))

;;======================================================================
;; 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))