47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
(lambda (runrec)
(let* ((run-id (simple-run-id runrec))
(full-targ-runname (conc (simple-run-target runrec) "/"
(simple-run-runname runrec))))
(debug:print 0 *default-log-port* "Update run " run-id)
(sparse-vector-set! (dboard:rdat-runs rdat) run-id runrec)
(hash-table-set! (dboard:rdat-targ-runid rdat) full-targ-runname run-id)
))
data)
numruns))
;;======================================================================
;; The "new" runs browser, this one sets up the view and registers the
;; updater
;;
(define (dashboard:runs-browse commondat tabdat #!key (tab-num 5))
(let* ((rdat (make-dboard:rdat)))
(dboard:commondat-add-updater
commondat
(lambda ()
(new-runs-updater commondat tabdat rdat))
tab-num: tab-num)
(iup:split
#:orientation "VERTICAL"
#:value 150
(iup:vbox
(dboard:runs-tree-new-view-browser commondat rdat))
(iup:split
#:orientation "VERTICAL"
#:value 250
(iup:vbox
(iup:matrix))
(iup:vbox
(iup:matrix))))))
(define (dashboard:runs-browse-updater commondat tabdat)
#f)
(define (new-runs-updater commondat tabdat rdat)
(let* ((runnum (dboard:rdat-runnum rdat))
(start-time (current-milliseconds))
(tot-runs #f))
(if (eq? runnum 0)(dashboard:update-runs-data rdat))
(set! tot-runs (vector-length (dboard:rdat-runsbynum rdat)))
(let loop ((rn runnum))
(if (and (< (- (current-milliseconds) start-time) 250)
(< rn tot-runs))
(let* ((newrn (if (>= runnum (vector-length (dboard:rdat-runsbynum rdat)))
0 ;; start over
(+ rn 1)))) ;; (+ runnum 1)))
(dashboard:update-run-data rn rdat)
(dboard:rdat-runnum-set! rdat newrn)
(if (> newrn 0)
(loop newrn)))))
(if (>= (dboard:rdat-runnum rdat) tot-runs)
(dboard:rdat-runnum-set! rdat 0))
;; (dboard:rdat-runnum-set! rdat rn))) ;; not needed as it is set above
;; (dboard:rdat-last-update-set! rdat (- (current-seconds) 10))
;; (tree:add-node tb "Runs" (string-split full-targ-runname "/"))
'()))
#;(define (make-runs-view commondat rdat tab-num)
;; register an updater
(dboard:commondat-add-updater
commondat
(lambda ()
|
>
|
|
<
<
<
|
<
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
(lambda (runrec)
(let* ((run-id (simple-run-id runrec))
(full-targ-runname (conc (simple-run-target runrec) "/"
(simple-run-runname runrec))))
(debug:print 0 *default-log-port* "Update run " run-id)
(sparse-vector-set! (dboard:rdat-runs rdat) run-id runrec)
(hash-table-set! (dboard:rdat-targ-runid rdat) full-targ-runname run-id)
(tree:add-node tb "Runs" (string-split full-targ-runname "/"))
))
data)
numruns))
;;======================================================================
;; The "new" runs browser, this one sets up the view and registers the
;; updater
;;
(define (dashboard:runs-browse commondat tabdat #!key (tab-num 5))
(let* ((rdat (make-dboard:rdat)))
(dboard:commondat-add-updater
commondat
(lambda ()
(dashboard:new-runs-updater commondat tabdat rdat))
tab-num: tab-num)
(iup:split
#:orientation "VERTICAL"
#:value 150
(iup:vbox
(dboard:runs-tree-new-view-browser commondat rdat))
(iup:split
#:orientation "VERTICAL"
#:value 250
(iup:vbox
(dboard:runs-new-matrix commondat rdat))
(iup:vbox
(iup:matrix))))))
(define (dashboard:new-runs-updater commondat tabdat rdat)
(let* ((runnum (dboard:rdat-runnum rdat))
(start-time (current-milliseconds))
(tot-runs #f))
(if (eq? runnum 0)(dashboard:update-runs-data rdat))
(set! tot-runs (vector-length (dboard:rdat-runsbynum rdat)))
(let loop ((rn runnum))
(if (and (< (- (current-milliseconds) start-time) 250)
(< rn tot-runs))
(let* ((newrn (if (>= runnum (vector-length (dboard:rdat-runsbynum rdat)))
0 ;; start over
(+ rn 1)))) ;; (+ runnum 1)))
(dashboard:update-run-data rn rdat)
(dboard:rdat-runnum-set! rdat newrn)
(if (> newrn 0)
(loop newrn)))))
(if (>= (dboard:rdat-runnum rdat) tot-runs)
(dboard:rdat-runnum-set! rdat 0))
;; (dboard:rdat-runnum-set! rdat rn))) ;; not needed as it is set above
;; (dboard:rdat-last-update-set! rdat (- (current-seconds) 10))
'()))
#;(define (make-runs-view commondat rdat tab-num)
;; register an updater
(dboard:commondat-add-updater
commondat
(lambda ()
|