Index: dashboard-new.scm ================================================================== --- dashboard-new.scm +++ dashboard-new.scm @@ -70,11 +70,15 @@ (if (args:get-arg "-h") (begin (print help) (exit))) +;; Globals and constants +;; (define *panels* (make-hash-table)) +(define blank-line-rx (regexp "^\\s*$")) + (define (dboard:panel toppath) (let* ((db (open-db toppath)) (db-file-path (conc toppath "/megatest.db")) (read-only (not (file-read-access? db-file-path))) @@ -106,11 +110,18 @@ (hide-empty-runs #f) (ui-dat #f) (megatest-config (setup-for-run toppath)) (megatest-configdat #f) (my-run-shell (cmdshell:make-shell "/bin/bash" toppath)) - (my-env-vars '())) ;; stack up all var val pairs here + (my-env-vars '()) ;; stack up all var val pairs here + (collapsed (make-hash-table)) + ;; functions + (db:been-changed (lambda () + (> (file-modification-time (conc toppath*"/megatest.db")) last-db-update-time)))) + +; (define *row-lookup* (make-hash-table)) ;; testname => (rownum lableobj) + (if (not megatest-config) (begin (print "Failed to find megatest.config, canceling open of " toppath) (sqlite3:finalize! db)) (begin @@ -117,10 +128,14 @@ (set! megatest-configdat (if (car megatest-config)(car megatest-config) #f)) ;; (cmdshell:set-env-var my-run-shell "MT_RUN_AREA_HOME" toppath) ;;; NOPE, cache up the vars (set! my-env-vars (append my-env-vars (list (list "MT_RUN_AREA_HOME" toppath)))) ;; here is where the persistent proc lives (to be run in a thread) (lambda () + (set!last-db-update-time (file-modification-time (conc toppath "/megatest.db"))) +(define (db:set-db-update-time) + (set! *last-db-update-time* (file-modification-time (conc *toppath* "/megatest.db")))) + (define *verbosity* (cond ((args:get-arg "-debug")(string->number (args:get-arg "-debug"))) @@ -202,13 +217,10 @@ (debug:print 6 "*allruns* has " (length *allruns*) " runs") ;; (set! *tot-run-count* (+ 1 (length *allruns*))) maxtests)) *num-tests*))) ;; FIXME, naughty coding eh? -(define *collapsed* (make-hash-table)) -; (define *row-lookup* (make-hash-table)) ;; testname => (rownum lableobj) - (define (toggle-hide lnum) ; fulltestname) (let* ((btn (vector-ref (dboard:uidat-get-lftcol uidat) lnum)) (fulltestname (iup:attribute btn "TITLE")) (parts (string-split fulltestname "(")) (basetestname (if (null? parts) "" (car parts)))) @@ -219,12 +231,10 @@ (hash-table-delete! *collapsed* basetestname)) (begin ;(iup:attribute-set! btn "FGCOLOR" "0 192 192") (hash-table-set! *collapsed* basetestname #t))))) -(define blank-line-rx (regexp "^\\s*$")) - (define (run-item-name->vectors lst) (map (lambda (x) (let ((splst (string-split x "(")) (res (vector "" ""))) (vector-set! res 0 (car splst)) @@ -611,16 +621,10 @@ (iup:attribute-set! *tim* "TIME" 300) (iup:attribute-set! *tim* "RUN" "YES") ;; Move this stuff to db.scm FIXME ;; -(define *last-db-update-time* (file-modification-time (conc *toppath* "/megatest.db"))) -(define (db:been-changed) - (> (file-modification-time (conc *toppath* "/megatest.db")) *last-db-update-time*)) -(define (db:set-db-update-time) - (set! *last-db-update-time* (file-modification-time (conc *toppath* "/megatest.db")))) - (define (run-update x) (update-buttons uidat *num-runs* *num-tests*) ;; (if (db:been-changed) (begin (update-rundat (hash-table-ref/default *searchpatts* "runname" "%") *num-runs*