Random Bits of Open Code

Check-in [fd81fdec44]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Removed junk file. Added clean target
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:fd81fdec4499a9016cdb41e79a017e07a12a5f8b
User & Date: matt 2018-08-05 21:07:23
Context
2018-08-06
06:32
Added mostly working del of users subjects check-in: 1247f0c47a user: matt tags: trunk
2018-08-05
21:07
Removed junk file. Added clean target check-in: fd81fdec44 user: matt tags: trunk
21:03
Moved learn-teach app to apps directory. check-in: cb528e1bef user: matt tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to multiapp/Makefile.

35
36
37
38
39
40
41



42
43
44
45
46
47
48
	    cd mtutils; make ;\
	fi

# app deps
# learn-teach
apps/learn-teach/learn-teach.o : apps/learn-teach/help.o apps/learn-teach/learn-teach-config.o




#======================================================================
# DEPLOY
#======================================================================

EXTRASOFILES  = pkts.so dbi.so vg.so margs.so mtconfigf.so mtcommon.so mtdb.so iuputils.so
EXTRAS = $(EXTRASOFILES:%=deploytarg/%)








>
>
>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
	    cd mtutils; make ;\
	fi

# app deps
# learn-teach
apps/learn-teach/learn-teach.o : apps/learn-teach/help.o apps/learn-teach/learn-teach-config.o

clean :
	rm -f src/*.o apps/*/*.o src/*~ apps/*/*~ multiapp *import.scm 

#======================================================================
# DEPLOY
#======================================================================

EXTRASOFILES  = pkts.so dbi.so vg.so margs.so mtconfigf.so mtcommon.so mtdb.so iuputils.so
EXTRAS = $(EXTRASOFILES:%=deploytarg/%)

Deleted multiapp/apps/learn-teach/learn-teach-help.scm.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
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
(use canvas-draw iup foof-loop srfi-18)
(import canvas-draw-iup)
(import canvas-draw-client)

;; (load "vg.scm")
(use vgcanvas)
(use vg) ;; (prefix vg vg:))
(use (prefix geolib geolib:))

;; make a big arrow outline (will add fill later
;;  l = length base to tip
;;  t = base thickness. tip is 1.5t long and 1.5t wide
;;  a = angle from vertical
;;  returns a list of points `( x0 y0 x1 y1 x2 y2 ... xn yn )
;;
(define (big-arrow l t angle #!key (xoff 0)(yoff 0))
  (let* ((t/2    (/ t 2))
	 (t/4    (/ t 4))
	 (hl     (* 1.5 t))       ;; arrow head length
	 (l-h    (- l hl))        ;; length of arrow body
	 (a      `(,(- t/2) 0))
	 (b      `(,(- t/2) ,l-h))
	 (c      `(,(- 0 t/2 t/4) ,l-h))
	 (d      `(0  ,l))
	 (e      `(,(+ t/2 t/4) ,l-h))
	 (f      `(,t/2 ,l-h))
	 (g      `(,t/2 0))
	 (all    (map (lambda (pt)
			;; (print "pt: " pt " (car pt): " (car pt) " (cadr pt): " (cadr pt))
			(geolib:rotate-pt angle (car pt)(cadr pt)))
		      (list a b c d e f g)))
	 (allofs (map (lambda (pt)
			(let* ((newx (+ xoff (car pt)))
			       (newy (+ yoff (cadr pt))))
			  (list newx newy)))
		      all))
	 (flat   (apply append allofs)))
    flat))

(define (add-learn hlib learn)
  (let* ((idelta 10)
	 (x1 10)
	 (y1 190)          ;; top line
	 (x2 (+ x1 5))
	 (y2 (- y1 10))    ;; second line
	 (x3 (+ x1 20))
	 (y3 150)          ;; bottom of drawing ...
	 (x4 (+ x3 5))
	 (x5 (+ x3 20))
	 (y4 (- y2 5))     ;; 175)
	 (y5 150)
	 (y6 (- y4 5))
	 (x6 (+ x5 5))
	 (font "Helvetica, -20"))
    (add-objs-to-comp
     learn
     (text 20 210 "Learn Something!" font: "Helvetica, -40")
     (polygon (big-arrow 20 8 (geolib:deg->rad 90) xoff: 18 yoff: 216))
     ;; this is the subject selection stuff
     (rectangle 0 140 90 200) ;; bounding box
     (line x1 y1 x2 y1)      ;; first h-line
     (text (+ x2 2)(- y1 2) "category" font: font)
     (line x3 (- y1 3 ) x3 y3)
     (line x3 y2 x4 y2)
     (text (+ x4 2)(- y2 2) "subject" font: font)
     (line x5 y4 x5 y5)      ;; vertical line
     (line x5 y6 x6 y6)
     (rectangle (- x6 2)(- y6 3)(+ x6 30)(+ y6 6)
		fill-color: (rgb->number 100 250 100))
     (text (+ x6 2) (- y6
		       2) "time" font: font)
     (text 0 (- y6 55) "(1) Select a \"session\" (a" font: font)
     (text 0 (- y6 65) "combination of subject" font: font)
     (text 0 (- y6 75) "and time)" font: font)
     ;; this is the vote box
     (rectangle 91 140 140 180) ;; bounding box
     (text 92 143 "Vote:  Yes")
     (rectangle 115 142 133 152)
     ;; this is the message for the second arrow
     (text 115 (- y6 55) "(2) Click the \"Yes\" to" font: font)
     (text 115 (- y6 65) "indicate you are interested" font: font)
     (text 115 (- y6 75) "in this session" font: font)
     ;; arrow 1
     (polygon (big-arrow 37 6 (geolib:deg->rad -5) xoff: (+ x6 0) yoff: (- y6 44)))
     ;; arrow 2
     (polygon (big-arrow 15 4 (geolib:deg->rad 5) xoff: (+ x6 75) yoff: (- y6 44)))
     )
    (add-comp-to-lib hlib "learn" learn)
    ))

(define (add-teach hlib teach)
  (let* ((idelta 10)
	 (x1 10)
	 (y1 190)          ;; top line
	 (x2 (+ x1 5))
	 (y2 (- y1 10))    ;; second line
	 (x3 (+ x1 20))
	 (y3 150)          ;; bottom of drawing ...
	 (x4 (+ x3 5))
	 (x5 (+ x3 20))
	 (y4 (- y2 5))     ;; 175)
	 (y5 150)
	 (y6 (- y4 5))
	 (x6 (+ x5 5))
	 (font "Helvetica, -20"))
    (add-objs-to-comp
     teach
     (text 20 210 "Learn Something!" font: "Helvetica, -40")
     (polygon (big-arrow 20 8 (geolib:deg->rad 90) xoff: 18 yoff: 216))
     ;; this is the subject selection stuff
     (rectangle 0 140 90 200) ;; bounding box
     (line x1 y1 x2 y1)      ;; first h-line
     (text (+ x2 2)(- y1 2) "category" font: font)
     (line x3 (- y1 3 ) x3 y3)
     (line x3 y2 x4 y2)
     (text (+ x4 2)(- y2 2) "subject" font: font)
     (line x5 y4 x5 y5)      ;; vertical line
     (line x5 y6 x6 y6)
     (rectangle (- x6 2)(- y6 3)(+ x6 30)(+ y6 6)
		fill-color: (rgb->number 100 250 100))
     (text (+ x6 2) (- y6
		       2) "time" font: font)
     (text 0 (- y6 55) "(1) Select a \"session\" (a" font: font)
     (text 0 (- y6 65) "combination of subject" font: font)
     (text 0 (- y6 75) "and time)" font: font)
     ;; this is the vote box
     (rectangle 91 140 140 180) ;; bounding box
     (text 92 143 "Vote:  Yes")
     (rectangle 115 142 133 152)
     ;; this is the message for the second arrow
     (text 115 (- y6 55) "(2) Click the \"Yes\" to" font: font)
     (text 115 (- y6 65) "indicate you are interested" font: font)
     (text 115 (- y6 75) "in this session" font: font)
     ;; arrow 1
     (polygon (big-arrow 37 6 (geolib:deg->rad -5) xoff: (+ x6 0) yoff: (- y6 44)))
     ;; arrow 2
     (polygon (big-arrow 15 4 (geolib:deg->rad 5) xoff: (+ x6 75) yoff: (- y6 44)))
     )
    (add-comp-to-lib hlib "teach" teach)
    ))

(define (help)
  (let* ((c1           #f)
	 (help-drawing (make-drawing))
	 (hlib         (make-lib))
	 ;; components
	 (learn     (make-comp))
	 (teach     (make-comp)))
    (add-lib help-drawing "hlib" hlib) ;; add library hlib to drawing
    ;; add objects to learn tree sketch

    (add-learn hlib learn)
    (add-teach hlib teach)

    ;; instantiate component teach from library hlib in drawing help-drawing
    (instantiate help-drawing "hlib" "learn" "s1" 20 40)
    ;; instantiate component learn from library hlib in drawing help-drawing
    (instantiate help-drawing "hlib" "teach" "s1" 20 40)
    
    (drawing-scalex-set! help-drawing 1.5)
    (drawing-scaley-set! help-drawing 1.5)
    
    (drawing-update-proc-set!
     help-drawing
     (lambda (dwg c xadj yadj)
       (set! c1 c)
       (canvas-clear! c)
       (draw dwg #t)))
    
    (let ((c (drawing-init help-drawing)))
      (print "c:   " c)
      (show
       (dialog
	(vbox
	 #:expand "YES"
	 (label "The drawing")
	 c)))
      (values c c1) ;; return the canvas and the lowerlevel accessor of that canvas
      )))

;; (main-loop)

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<