File:
[LON-CAPA] /
doc /
rat /
Attic /
rat.txt
Revision
1.2:
download - view:
text,
annotated -
select for diffs
Fri Mar 8 14:33:40 2002 UTC (22 years, 3 months ago) by
matthew
Branches:
MAIN
CVS tags:
version_0_6_2,
version_0_6,
version_0_5_1,
version_0_5,
version_0_4,
stable_2002_july,
stable_2002_april,
STABLE,
HEAD
Formatting changes to make it printable.
1: Scott Harrison's RAT Notes
2: (written in RAN format.. "ridiculous ascii notation")
3: 09/27/1999
4:
5: Start
6:
7: Who is using RAT?
8: Instructor/Student/Guest
9: Domain
10:
11: file names
12: [domain]_[user]_[resource].rat
13:
14: to do:
15: * implement fancy resource rat widget
16:
17: * implement fancy resource linking information interface
18: widget
19:
20: * implement resources on rat
21:
22:
23: Program documentation
24: GLOBAL VARIABLES
25:
26: row array maps row id to display (example, d=row[i] where 'd' is display and 'i' is id)
27: used by insertrow, findrow, horizontal, joinres, draw, main
28:
29: maxrow scalar number of elements-2 in row array (the last element number in the array, -1 for empty array)
30: used by insertrow, findrow, horizontal, joinres, draw
31:
32: col array maps col id to display (example, d=row[i] where 'd' is display and 'i' is id)
33: used by insertrow, insertcol, findcol, maprow, comingthru, horizontal, joinres, drawrow, draw, main
34:
35: maxcol scalar number of elements-2 in col array (the last element number in the array, -1 for empty array)
36: used by insertcol, findcol, maprow, comingthru, insertport, drawrow, draw
37:
38: colmap array in order of display ids which object is in which column
39: used by maprow, comingthru, insertport, horizontal, drawrow, draw,
40:
41: colmap2 array temporary
42: used by drawrow
43: colmap3 array temporary
44: used by drawrow
45: colmap4 array temporary
46: used by drawrow
47: colmap5 array temporary
48: used by drawrow
49:
50: obj array appended array with drawing objects (which are blocks, verticals, horizontals, and conditions), never emptied
51: used by insertrow, maprow, insertport, addobj, horizontal, joinres, drawrow, draw, main
52:
53: maxobj scalar number of values in obj array-2 (last element, -1 for empty)
54: used by NOTHING
55:
56: rowcont array object ids in a row
57: used by insertrow, maprow, addobj, drawrow, draw, main
58:
59: rowtype array row ids to type
60: used by insertrow, drawrow, main
61:
62: coltype array col ids to type
63: used by insertcol, insertport, drawrow, main
64:
65: rrow array display to id (reverse hash of row)
66: used by draw
67:
68: rcol array display to id (reverse hash of row)
69: used by drawrow, draw
70:
71: cw array column width (temporary)
72: used by drawcell, draw
73:
74: rh array row height (temporary)
75: used by drawrow, draw,
76:
77: data1,data2,data3,data4 array used to buffer memory so that javascript does not CRASH!
78: used by drawrow, insertrow, insertport
79:
80: functions
81:
82: main - invokes RAT
83: \
84: \
85: initializes rows, with resources labelled 5, 4, 3, and 7
86: insert thirteen columns from the left side
87: perform 3 testing swaps
88: initialize maxrow
89: define starting objects (blocks: 3,4,5,7)
90: create 12 joinings between these resources! (joinres ... see below)
91: draw in debugging editting mode!
92: \ b&rowID&colID:inObj:outObj:outCond&...
93: \ h&rowID&incolID:outcolID&inObj:outObj&inupdown:outupdown
94: \ v&colID&inObj:outObj&updown
95: \ simple javascript /
96: \ / /
97: open, configure, and clear a debugging javascript window/ /
98: | |
99: go through all objects and display object information -----------------------
100: write out the value of col array ------- counting col ids from 0 to maxcol, print out a comma separated list of display locations
101: write out the value of row array ------- counting row ids from 0 to maxrow, print out a comma separated list of display locations
102: find all the display rows (findrow) from 0 to last row,
103: | findrow: does this my running through all rows and waiting till the value of an array
104: | index matches the row to display, returns row id
105: map this row (maprow), and output the results (colmap and rowcont) onto
106: |________________
107: | \
108: | -- a debugging window with column id, colmap, and rowcont
109: | where colmap specifies where objects occur within a row based on "display column" location
110: | where rowcont is the objects within a row and
111: |
112: |
113: |
114: initialize display-to-id array rrow (so that rrow[display] equals original row id)
115: initialize display-to-id array rcol (so that rcol[display] equals original col id)
116: initialize row height and column width values where rh[1] is short row,
117: rh[2] is tall row, cw[1] is skinny column, cw[2] is fat column
118: set javascript RAT display window options (javascript stuff...)
119: output HTML beginning to RAT display window
120: run through the rows to display, convert from display row # to row id (rrow) and draw in edit mode (drawrow)
121: |
122: drawrow: drawrow begins by clearing out and initializing
123: these temporary arrays
124: colmap,colmap2,colmap3,colmap4,colmap5
125: output HTML beginning to row set to rowtype height (from row id)
126: if there are contents in the row (rowcont[jid] display them (else just end HTML row)
127: run through all the objects in row
128: if object is a 'b'lock object
129: do a lot of amazing things to position resource within block
130: and draw arrows connecting into block in another amazing feat of code
131: if object is a 'h'orizontal object
132: grab input column id and output column id
133: and depending whether input is less than output in display position
134: draw left-right arrow line or right-left arrow line
135: and set leftmost position and rightmost position
136: look at inupdown and outupdown
137: if inupdown (means what ??) then
138: draw top-to-right line, set colmap2 and colmap3
139: else draw right-to-down line
140: if outupdown (means what ??) then
141: draw top-to-left line, set colmap2 and colmap3
142: else draw left-to-down line
143: if object is a 'v'ertical object
144: set left to display column and USE THIS as the position
145: if there is another element found in the colmap
146: it must be horizontal so draw top-down-right-left intersection ('tdrl')
147: else draw top-to-down or down-to-top depending on
148: 'v'ertical object specification
149: set colmap2[left] and colmap3[left] to a plain vertical line
150: run through columns and draw cells
151: drawcell draws in edit mode html stuff ---- rtype is set to type of row, the cell is drawn with drawcell
152: then using colmap2 and colmap3 draw two more up-down elements
153: in rows below if rowtype is 2
154:
155: ***************
156: joinres from A to B
157:
158: calculate where in the middle of first object is a good place to insert outcoming path
159: calculate where in the middle of second object is a good place to insert incoming path
160: insert the ports based on the objects, the distance from middle of one object to other object, and direction
161: if A is below B, then loop around..set updown!
162: else set updown the other way
163: if inrow equals outrow
164: just draw connecting horizontal element
165: if updown one way then go from row to row finding good columns to go through (comingthru)
166: if there is NO GOOD COLUMN THEN INSERT A ROW! (insertrow)
167: if updown the other way then go from row to row finding good columns to go through (comingthru)
168: if there is NO GOOD COLUMN THEN INSERT A ROW! (insertrow)
169:
170: ***************
171: comingthru
172: see where you can bulldoze..more to write here
173:
174: ***************
175: insertrow
176: make sure you can bulldoze..more to write here
177:
178:
179: Help Documentation
180: on RAT
181:
182: Developer Documentation
183: on RAT
184:
185:
186:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>