Megatest

Diff
Login

Differences From Artifact [13566ec9e6]:

To Artifact [19a89b709c]:


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
(declare (uses servermod))
(declare (uses megamod))
(declare (uses commonmod))
(declare (uses rmtmod))
(declare (uses runsmod))
(declare (uses dbmod))
(declare (uses testsmod))

(declare (uses dcommonmod))



(import gutilsmod)
(import servermod)
(import megamod)
(import commonmod)
(import rmtmod)
(import runsmod)
(import dbmod)
(import testsmod)

(import dcommonmod)





















(include "common_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "task_records.scm")
(include "vg_records.scm")

;; invoke the imports - ORDER IS IMPORTANT!
(declare (uses gutilsmod.import))
(declare (uses commonmod.import))
(declare (uses testsmod.import))
(declare (uses rmtmod.import))
(declare (uses runsmod.import))
(declare (uses megamod.import))
(declare (uses dcommonmod.import))

(mtconfigf#set-debug-printers debug:print debug:print-info debug:print-error *default-log-port*)
(mtconfigf#add-eval-string "(import megamod commonmod (prefix mtargs args:))")


(define help (conc 
	      "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest







>

>










>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







<
<
<
<
<
<
<
<







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
113
114
115
(declare (uses servermod))
(declare (uses megamod))
(declare (uses commonmod))
(declare (uses rmtmod))
(declare (uses runsmod))
(declare (uses dbmod))
(declare (uses testsmod))
(declare (uses tasksmod))
(declare (uses dcommonmod))
(declare (uses tasksmod))


(import gutilsmod)
(import servermod)
(import megamod)
(import commonmod)
(import rmtmod)
(import runsmod)
(import dbmod)
(import testsmod)
(import tasksmod)
(import dcommonmod)

;; invoke the imports - ORDER IS IMPORTANT!
(declare (uses commonmod.import))
(declare (uses odsmod.import))
(declare (uses pgdbmod.import))
(declare (uses tasksmod.import))
(declare (uses gutilsmod.import))
(declare (uses keysmod.import))
(declare (uses dbmod.import))
(declare (uses itemsmod.import))
(declare (uses dbmod.import))
(declare (uses servermod.import))
(declare (uses apimod.import))
(declare (uses rmtmod.import))
(declare (uses testsmod.import))
(declare (uses subrunmod.import))
(declare (uses mtmod.import))
(declare (uses runsmod.import))
(declare (uses megamod.import))
(declare (uses dcommonmod.import))

(include "common_records.scm")
(include "db_records.scm")
(include "run_records.scm")
(include "task_records.scm")
(include "vg_records.scm")










(mtconfigf#set-debug-printers debug:print debug:print-info debug:print-error *default-log-port*)
(mtconfigf#add-eval-string "(import megamod commonmod (prefix mtargs args:))")


(define help (conc 
	      "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
					  (dashboard:sysmon-canvas-updater commondat tabdat tab-num) ;; redraws canvas on user input (I think...)
					  ))))
				   "dashboard:sysmon-tab-updater")))
	 (key-listboxes #f) ;; 
	 (update-keyvals (lambda ()
			   (dboard:target-updater tabdat))))
    (dboard:tabdat-drawing-set! tabdat drawing)
    (dboard:commondat-add-updater commondat run-times-tab-updater tab-num: tab-num)
    (iup:split
     #:orientation "VERTICAL" ;; "HORIZONTAL"
     #:value 150
     (iup:vbox
      (iup:split
       #:orientation "HORIZONTAL"
       #:value 800
      (let* ((cnv-obj (iup:canvas 
		       ;; #:size "250x250" ;; "500x400"
		       #:expand "YES"
		       #:scrollbar "YES"
		       #:posx "0.5"
		       #:posy "0.5"
		       #:action (make-canvas-action
				  (lambda (c xadj yadj)
				    (debug:catch-and-dump
				     (lambda ()
				       (if (not (dboard:tabdat-cnv tabdat))
					   (let ((cnv     (dboard:tabdat-cnv tabdat)))
					     (dboard:tabdat-cnv-set! tabdat c)
					     (vg:drawing-cnv-set! (dboard:tabdat-drawing tabdat)
								  (dboard:tabdat-cnv tabdat))))
				       (let ((drawing (dboard:tabdat-drawing tabdat))
					     (old-xadj (dboard:tabdat-xadj   tabdat))
					     (old-yadj (dboard:tabdat-yadj   tabdat)))
					 (if (not (and (eq? xadj old-xadj)(eq? yadj old-yadj)))
					     (begin
					       ;; (print  "xadj: " xadj " yadj: " yadj "changed: "(eq? xadj old-xadj) " " (eq? yadj old-yadj))
					       (dboard:tabdat-view-changed-set! tabdat #t)
					       (dboard:tabdat-xadj-set! tabdat (* -2000 (- xadj 0.5)))
					       (dboard:tabdat-yadj-set! tabdat (*  2000 (- yadj 0.5)))
					       ))))
				     "iup:canvas action")))
		       #:wheel-cb  (lambda (obj step x y dir) ;; dir is 4 for up and 5 for down. I think.
				     (debug:catch-and-dump
				      (lambda ()
					(let* ((drawing (dboard:tabdat-drawing tabdat))
					       (scalex  (vg:drawing-scalex drawing)))
					  (dboard:tabdat-view-changed-set! tabdat #t)
					  ;; (print "step: " step " x: " x " y: " y " dir: " dir " scalex: " scalex)
					  (vg:drawing-scalex-set! drawing
								  (+ scalex
								     (if (> step 0)
									 (* scalex  0.02)
									 (* scalex -0.02))))))
				      "wheel-cb"))
		       )))
	cnv-obj)
      )))))

;; run times canvas updater
;;
(define (dashboard:sysmon-canvas-updater commondat tabdat tab-num)
  (let ((cnv (dboard:tabdat-cnv tabdat))
	(dwg (dboard:tabdat-drawing tabdat))
	(mtx (dboard:tabdat-runs-mutex tabdat))







|
<
<
<
|
<
<
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<







1456
1457
1458
1459
1460
1461
1462
1463



1464



1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505

1506
1507
1508
1509
1510
1511
1512
					  (dashboard:sysmon-canvas-updater commondat tabdat tab-num) ;; redraws canvas on user input (I think...)
					  ))))
				   "dashboard:sysmon-tab-updater")))
	 (key-listboxes #f) ;; 
	 (update-keyvals (lambda ()
			   (dboard:target-updater tabdat))))
    (dboard:tabdat-drawing-set! tabdat drawing)
    (dboard:commondat-add-updater commondat sysmon-tab-updater tab-num: tab-num)



    (iup:vbox



     (let* ((cnv-obj (iup:canvas 
		      ;; #:size "250x250" ;; "500x400"
		      #:expand "YES"
		      #:scrollbar "YES"
		      #:posx "0.5"
		      #:posy "0.5"
		      #:action (make-canvas-action
				(lambda (c xadj yadj)
				  (debug:catch-and-dump
				   (lambda ()
				     (if (not (dboard:tabdat-cnv tabdat))
					 (let ((cnv     (dboard:tabdat-cnv tabdat)))
					   (dboard:tabdat-cnv-set! tabdat c)
					   (vg:drawing-cnv-set! (dboard:tabdat-drawing tabdat)
								(dboard:tabdat-cnv tabdat))))
				     (let ((drawing (dboard:tabdat-drawing tabdat))
					   (old-xadj (dboard:tabdat-xadj   tabdat))
					   (old-yadj (dboard:tabdat-yadj   tabdat)))
				       (if (not (and (eq? xadj old-xadj)(eq? yadj old-yadj)))
					   (begin
					     ;; (print  "xadj: " xadj " yadj: " yadj "changed: "(eq? xadj old-xadj) " " (eq? yadj old-yadj))
					     (dboard:tabdat-view-changed-set! tabdat #t)
					     (dboard:tabdat-xadj-set! tabdat (* -2000 (- xadj 0.5)))
					     (dboard:tabdat-yadj-set! tabdat (*  2000 (- yadj 0.5)))
					     ))))
				   "iup:canvas action")))
		      #:wheel-cb  (lambda (obj step x y dir) ;; dir is 4 for up and 5 for down. I think.
				    (debug:catch-and-dump
				     (lambda ()
				       (let* ((drawing (dboard:tabdat-drawing tabdat))
					      (scalex  (vg:drawing-scalex drawing)))
					 (dboard:tabdat-view-changed-set! tabdat #t)
					 ;; (print "step: " step " x: " x " y: " y " dir: " dir " scalex: " scalex)
					 (vg:drawing-scalex-set! drawing
								 (+ scalex
								    (if (> step 0)
									(* scalex  0.02)
									(* scalex -0.02))))))
				     "wheel-cb"))
		      )))
       cnv-obj))))


;; run times canvas updater
;;
(define (dashboard:sysmon-canvas-updater commondat tabdat tab-num)
  (let ((cnv (dboard:tabdat-cnv tabdat))
	(dwg (dboard:tabdat-drawing tabdat))
	(mtx (dboard:tabdat-runs-mutex tabdat))