Index: Makefile ================================================================== --- Makefile +++ Makefile @@ -48,17 +48,15 @@ # install dashboard as dboard so wrapper script can be called dashboard $(PREFIX)/bin/dboard : dboard $(FILES) cp dboard $(PREFIX)/bin/dboard utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard chmod a+x $(PREFIX)/bin/dashboard - utils/mk_dashboard_wrapper $(PREFIX) > $(PREFIX)/bin/dashboard - chmod a+x $(PREFIX)/bin/dashboard install : bin $(PREFIX)/bin/megatest $(PREFIX)/bin/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake bin : - mkdir $(PREFIX)/bin + mkdir -p $(PREFIX)/bin test: tests/tests.scm cd tests;csi -I .. -b -n tests.scm clean : Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -99,10 +99,12 @@ (define *status-ignore-hash* (make-hash-table)) (define *state-ignore-hash* (make-hash-table)) (define *last-db-update-time* 0) (define *please-update-buttons* #t) +(define *delayed-update* 0) + (define *db-file-path* (conc *toppath* "/megatest.db")) (define *tests-sort-reverse* #f) (define *hide-empty-runs* #f) @@ -197,14 +199,16 @@ (null? (filter (lambda (x)(> x 3)) delta)))) ;; keypatts: ( (KEY1 "abc%def")(KEY2 "%") ) (define (update-rundat runnamepatt numruns testnamepatt itemnamepatt keypatts) (let ((modtime (file-modification-time *db-file-path*))) - (if (> modtime *last-db-update-time*) + (if (or (> modtime *last-db-update-time*) + (> *delayed-update* 0)) (begin (set! *please-update-buttons* #t) (set! *last-db-update-time* modtime) + (set! *delayed-update* (- *delayed-update* 1)) (let* ((allruns (db:get-runs *db* runnamepatt numruns ;; (+ numruns 1) ;; (/ numruns 2)) *start-run-offset* keypatts)) (header (db:get-header allruns)) (runs (db:get-rows allruns)) (result '()) @@ -447,10 +451,14 @@ (define (update-search x val) ;; (print "Setting search for " x " to " val) (hash-table-set! *searchpatts* x val)) +(define (mark-for-update) + (set! *last-db-update-time* 0) + (set! *delayed-update* 1)) + (define (make-dashboard-buttons nruns ntests keynames) (let* ((nkeys (length keynames)) (runsvec (make-vector nruns)) (header (make-vector nruns)) (lftcol (make-vector ntests)) @@ -468,28 +476,28 @@ (iup:frame #:title "filter test and items" (iup:hbox (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" #:action (lambda (obj unk val) - (set! *last-db-update-time* 0) + (mark-for-update) (update-search "test-name" val))) (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" #:action (lambda (obj unk val) - (set! *last-db-update-time* 0) + (mark-for-update) (update-search "item-name" val))))) (iup:vbox (iup:hbox (iup:button "Sort" #:action (lambda (obj) (set! *tests-sort-reverse* (not *tests-sort-reverse*)) (iup:attribute-set! obj "TITLE" (if *tests-sort-reverse* "+Sort" "-Sort")) - (set! *last-db-update-time* 0))) + (mark-for-update))) (iup:button "HideEmpty" #:action (lambda (obj) (set! *hide-empty-runs* (not *hide-empty-runs*)) (iup:attribute-set! obj "TITLE" (if *hide-empty-runs* "+Hide" "-Hide")) - (set! *last-db-update-time* 0))) + (mark-for-update))) (iup:button "Refresh" #:action (lambda (obj) - (set! *last-db-update-time* 0)))) + (mark-for-update)))) (iup:hbox (iup:button "Quit" #:action (lambda (obj)(sqlite3:finalize! *db*)(exit))) (iup:button "Monitor" #:action (lambda (obj)(system (conc (car (argv))" -guimonitor &"))))) )) ;; (iup:button "<- Left" #:action (lambda (obj)(set! *start-run-offset* (+ *start-run-offset* 1)))) @@ -501,30 +509,30 @@ (iup:vbox (apply iup:hbox (map (lambda (status) (iup:toggle status #:action (lambda (obj val) - (set! *last-db-update-time* 0) + (mark-for-update) (if (eq? val 1) (hash-table-set! *status-ignore-hash* status #t) (hash-table-delete! *status-ignore-hash* status))))) '("PASS" "FAIL" "WARN" "CHECK" "WAIVED" "STUCK/DEAD" "n/a"))) (apply iup:hbox (map (lambda (state) (iup:toggle state #:action (lambda (obj val) - (set! *last-db-update-time* 0) + (mark-for-update) (if (eq? val 1) (hash-table-set! *state-ignore-hash* state #t) (hash-table-delete! *state-ignore-hash* state))))) '("RUNNING" "COMPLETED" "INCOMPLETE" "LAUNCHED" "NOT_STARTED" "KILLED"))) (iup:valuator #:valuechanged_cb (lambda (obj) (let ((val (inexact->exact (round (/ (string->number (iup:attribute obj "VALUE")) 10)))) (oldmax (string->number (iup:attribute obj "MAX"))) (maxruns *tot-run-count*)) (set! *start-run-offset* val) - (set! *last-db-update-time* 0) + (mark-for-update) (debug:print 6 "*start-run-offset* " *start-run-offset* " maxruns: " maxruns ", val: " val " oldmax: " oldmax) (iup:attribute-set! obj "MAX" (* maxruns 10)))) #:expand "YES" #:max (* 10 (length *allruns*))))) ;(iup:button "inc rows" #:action (lambda (obj)(set! *num-tests* (+ *num-tests* 1)))) @@ -539,11 +547,11 @@ (map (lambda (x) (let ((res (iup:hbox (iup:label x #:size "40x15" #:fontsize "10") ;; #:expand "HORIZONTAL") (iup:textbox #:size "60x15" #:fontsize "10" #:value "%" ;; #:expand "HORIZONTAL" #:action (lambda (obj unk val) - (set! *last-db-update-time* 0) + (mark-for-update) (update-search x val)))))) (set! i (+ i 1)) res)) keynames))))) (let loop ((testnum 0) @@ -572,11 +580,11 @@ ; #:image img1 ; #:impress img2 #:size "100x15" #:fontsize "10" #:action (lambda (obj) - (set! *last-db-update-time* 0) + (mark-for-update) (toggle-hide testnum))))) ;; (iup:attribute obj "TITLE")))) (vector-set! lftcol testnum labl) (loop (+ testnum 1)(cons labl res)))))) ;; (let loop ((runnum 0)