107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
-
-
-
-
-
+
+
+
+
+
-
-
+
+
+
-
-
-
+
+
+
+
|
(megatestdbpath (conc *toppath* "/megatest.db"))
(modtime (max (file-modification-time megatestdbpath)
(file-modification-time monitordbpath))))
;; do stuff here when the db is updated by some other process
(if (> modtime lastmodtime)
(let ((tlst (tasks:get-tasks tdb '() '()))
(mlst (tasks:get-monitors tdb)))
(set! tasksdat tlst)
(set! monitorsdat mlst)
(iup:attribute-set! monitors "VALUE" (tasks:monitors->text-table mlst))
(iup:attribute-set! actions "VALUE" (tasks:tasks->text tlst))
(tasks:process-queue db tdb)
;; (set! tasksdat tlst)
;; (set! monitorsdat mlst)
;; (iup:attribute-set! monitors "VALUE" (tasks:monitors->text-table mlst))
;; (iup:attribute-set! actions "VALUE" (tasks:tasks->text tlst))
;; (tasks:process-queue db tdb)
(set! lastmodtime (max (file-modification-time megatestdbpath)
(file-modification-time monitordbpath)))
(tasks:reset-stuck-tasks tdb)))
(file-modification-time monitordbpath)))
;; (tasks:reset-stuck-tasks tdb)))
))
;; stuff to do every 10 seconds
(if (> (current-seconds) next-touch)
(begin
;; (tasks:process-queue db tdb monitordbpath)
(tasks:monitors-update tdb)
(tasks:reset-stuck-tasks tdb)
(set! monitorsdat (tasks:get-monitors tdb))
;; (tasks:monitors-update tdb)
;; (tasks:reset-stuck-tasks tdb)
(set! monitorsdat (tasks:get-monitors tdb)
)
(set! next-touch (+ (current-seconds) 10))
)))))
(topdialog #f))
(set! topdialog (iup:vbox ;; iup:dialog
#:close_cb (lambda (a)(exit))
#:title "Run Controls"
(iup:vbox
|