Megatest

Diff
Login

Differences From Artifact [85d5b279a2]:

To Artifact [77b498cbd6]:


2426
2427
2428
2429
2430
2431
2432
2433

2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
		       (vals    (map (lambda (x)(vector-ref x 2)) dat)))
		  (if (not (null? vals))
		      (let* ((maxval   (apply max vals))
			     (minval   (min 0 (apply min vals)))
			     (yoff     (- minval lly)) ;;  minval))
			     (deltaval (- maxval minval))
			     (yscale   (/ delta-y (if (zero? deltaval) 1 deltaval)))
			     (yfunc    (lambda (y)(+ lly (* yscale (- y minval)))))) ;; (lambda (y)(* (+ y yoff) yscale))))

			;; (print (car cf) "; maxval: " maxval " minval: " minval " deltaval: " deltaval " yscale: " yscale)
			(vg:add-obj-to-comp
			 cmp 
			 (vg:make-text-obj (- llx 10)(yfunc maxval) (conc maxval)))
			(vg:add-obj-to-comp
			 cmp 
			 (vg:make-text-obj (- llx 10)(yfunc minval) (conc minval)))
			(fold 
			 (lambda (next prev)  ;; #(time ? val) #(time ? val)
			   (if prev
			       (let* ((yval       (vector-ref prev 2))
                                      (yval-next  (vector-ref next 2))
				      (last-tval  (tfn   (vector-ref prev 0)))
				      (last-yval  (yfunc yval)) ;; (+ lly (* yscale (vector-ref prev 2))))
                                      (next-yval  (yfunc yval-next))
				      (curr-tval  (tfn   (vector-ref next 0))))
				 (if (>= curr-tval last-tval)
                                     (begin
                                       (vg:add-obj-to-comp
                                        cmp 
                                        ;;(vg:make-rect-obj last-tval lly curr-tval last-yval ;; (- stval 2) lly (+ stval 2)(+ lly (* yval yscale))
                                        (vg:make-line-obj last-tval last-yval curr-tval last-yval
                                                          line-color: stdcolor))
                                       (vg:add-obj-to-comp
                                        cmp 
                                        ;;(vg:make-rect-obj last-tval lly curr-tval last-yval ;; (- stval 2) lly (+ stval 2)(+ lly (* yval yscale))
                                        (vg:make-line-obj curr-tval last-yval curr-tval next-yval
                                                 line-color: stdcolor)))         
				     (print "ERROR: curr-tval is not > last-tval; curr-tval " curr-tval ", last-tval " last-tval))))
			   next)
			 ;; for init create vector tstart,0
			 #f ;; (vector tstart minval minval)
			 dat)
			   
			 ;; (for-each







|
>










|
|
|
|
|
|






|




|







2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
		       (vals    (map (lambda (x)(vector-ref x 2)) dat)))
		  (if (not (null? vals))
		      (let* ((maxval   (apply max vals))
			     (minval   (min 0 (apply min vals)))
			     (yoff     (- minval lly)) ;;  minval))
			     (deltaval (- maxval minval))
			     (yscale   (/ delta-y (if (zero? deltaval) 1 deltaval)))
			     (yfunc    (lambda (y)(+ lly (* yscale (- y minval))))) ;; (lambda (y)(* (+ y yoff) yscale))))
                             (graph-color (vg:generate-color)))
			;; (print (car cf) "; maxval: " maxval " minval: " minval " deltaval: " deltaval " yscale: " yscale)
			(vg:add-obj-to-comp
			 cmp 
			 (vg:make-text-obj (- llx 10)(yfunc maxval) (conc maxval)))
			(vg:add-obj-to-comp
			 cmp 
			 (vg:make-text-obj (- llx 10)(yfunc minval) (conc minval)))
			(fold 
			 (lambda (next prev)  ;; #(time ? val) #(time ? val)
			   (if prev
			       (let* ((yval        (vector-ref prev 2))
                                      (yval-next   (vector-ref next 2))
				      (last-tval   (tfn   (vector-ref prev 0)))
				      (last-yval   (yfunc yval)) ;; (+ lly (* yscale (vector-ref prev 2))))
                                      (next-yval   (yfunc yval-next))
				      (curr-tval   (tfn   (vector-ref next 0))))
				 (if (>= curr-tval last-tval)
                                     (begin
                                       (vg:add-obj-to-comp
                                        cmp 
                                        ;;(vg:make-rect-obj last-tval lly curr-tval last-yval ;; (- stval 2) lly (+ stval 2)(+ lly (* yval yscale))
                                        (vg:make-line-obj last-tval last-yval curr-tval last-yval
                                                          line-color: graph-color))
                                       (vg:add-obj-to-comp
                                        cmp 
                                        ;;(vg:make-rect-obj last-tval lly curr-tval last-yval ;; (- stval 2) lly (+ stval 2)(+ lly (* yval yscale))
                                        (vg:make-line-obj curr-tval last-yval curr-tval next-yval
                                                 line-color: graph-color)))         
				     (print "ERROR: curr-tval is not > last-tval; curr-tval " curr-tval ", last-tval " last-tval))))
			   next)
			 ;; for init create vector tstart,0
			 #f ;; (vector tstart minval minval)
			 dat)
			   
			 ;; (for-each