36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
(import scheme
chicken
data-structures
format
(prefix iup iup:)
canvas-draw
canvas-draw-iup
srfi-1 posix regex regex-case
srfi-69 typed-records sparse-vectors ;; defstruct
treemod
(prefix mtargs args:)
)
|
>
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
(import scheme
chicken
data-structures
format
(prefix iup iup:)
canvas-draw
canvas-draw-iup
matchable
srfi-1 posix regex regex-case
srfi-69 typed-records sparse-vectors ;; defstruct
treemod
(prefix mtargs args:)
)
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
(define *ord* #f)
(iup:attribute-set! *tim* "TIME" 300)
(iup:attribute-set! *tim* "RUN" "YES")
;; areas
;;
(define (get-areas-file)
(conc (get-environment-variable "HOME")"/.ndboard/areas.scm"))
(define (get-areas)
(let* ((areas-file (get-areas-file)))
(if (file-exists? areas-file)
(with-input-from-file areas-file read))))
;; gui utils
;;
(define (message-window msg)
(iup:show
(iup:dialog
(iup:vbox
(iup:label msg #:margin "40x40")))))
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
138
139
140
141
142
143
|
(define *ord* #f)
(iup:attribute-set! *tim* "TIME" 300)
(iup:attribute-set! *tim* "RUN" "YES")
;; areas
;;
(define *areas* (make-hash-table))
(defstruct area
path
)
(define (get-areas-file)
(conc (get-environment-variable "HOME")"/.ndboard/areas.scm"))
(define (get-areas)
(let* ((areas-file (get-areas-file)))
(if (file-exists? areas-file)
(with-input-from-file areas-file read))))
(define (register-area areadat)
(hash-table-set! *areas* (car areadat)
(make-area (cdr areadat))))
(define (get-area-info area-name)
(hash-table-ref/default *areas* area-name #f))
;; gui utils
;;
(define (message-window msg)
(iup:show
(iup:dialog
(iup:vbox
(iup:label msg #:margin "40x40")))))
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
#:value 0
#:title "Areas"
#:expand "YES"
#:addexpanded "YES"
#:size "10x"
#:selection-cb
(lambda (obj id state)
(print "do nothing..."))))
(define (runs window-id)
(iup:hbox
(add-widget "main-tree" (main-tree))
;;
))
(define (runs-init)
(let* ((areas (get-areas))
(tb (get-widget "main-tree")))
(for-each
(lambda (areadat)
(tree:add-node tb "Areas" `(,(car areadat))))
areas)))
;; Browse and control a single run
;;
(define (runcontrol window-id)
(iup:hbox))
|
>
>
>
>
|
>
>
>
>
|
>
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
#:value 0
#:title "Areas"
#:expand "YES"
#:addexpanded "YES"
#:size "10x"
#:selection-cb
(lambda (obj id state)
(let* ((path (tree:node->path obj id)))
(match path
((treename)(print "nothing to do here"))
((treename area)
#f ;; read the megatest area targets and fill out the tree
))
(print "obj: "obj", id: "id", state: "state", path: "path)))))
(define (runs window-id)
(iup:hbox
(add-widget "main-tree" (main-tree))
;;
))
(define (runs-init)
(let* ((areas (get-areas))
(tb (get-widget "main-tree")))
(for-each
(lambda (areadat)
(tree:add-node tb "Areas" `(,(car areadat)))
(register-area areadat))
areas)))
;; Browse and control a single run
;;
(define (runcontrol window-id)
(iup:hbox))
|