252fbaacc845f2296e5a27c3c03200db209930e0
David Blume first commit

David Blume authored 4 years ago

1) function init()
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

2)   m.top.ObserveField("pucidHash", "onUpdatePucidHash")
3) 
David Blume first commit

David Blume authored 4 years ago

4)   m.title = m.top.findNode("title")
5)   m.title.font.size=248
6)   m.title.color="0x62C7FF18"
7) 
8)   title_font_size = 34
9)   font_size = 32
10)   m.updates = m.top.findNode("updates")
11)   m.updates.font.size=font_size
12)   m.updates.color="0x52C7F8FF"
13)   m.updates.lineSpacing = 8
14) 
15)   m.updates_title = m.top.findNode("updates_title")
16)   m.updates_title.font.size=title_font_size
17)   m.updates_title.color="0x62E7FFFF"
18)   m.updates_title.text = "Launch Parameters"
19) 
20)   m.updates_lower = m.top.findNode("updates_lower")
21)   m.updates_lower.font.size=font_size
22)   m.updates_lower.color="0x52C7F8FF"
23)   m.updates_lower.text = ""
24)   m.updates_lower.lineSpacing = 8
25) 
26)   m.updates_lower_title = m.top.findNode("updates_lower_title")
27)   m.updates_lower_title.font.size=title_font_size
28)   m.updates_lower_title.color="0x62E7FFFF"
29)   m.updates_lower_title.text = "Events"
30) 
31)   m.updates_right = m.top.findNode("updates_right")
32)   m.updates_right.font.size=font_size
33)   m.updates_right.color="0x52C7F8FF"
34)   m.updates_right.lineSpacing = 8
35) 
36)   m.updates_right_title = m.top.findNode("updates_right_title")
37)   m.updates_right_title.font.size=title_font_size
38)   m.updates_right_title.color="0x62E7FFFF"
dblume Make room for IPv6 addresses

dblume authored 1 year ago

39)   m.updates_right_title.text = "Test Output (Press  ↑  ↓ OK)"
David Blume first commit

David Blume authored 4 years ago

40) 
41)   m.title_color = "0x20204080"
42)   m.title_focus_color = "0x4060B0A0"
43)   m.tl_rect = m.top.findNode("updates_title_rect")
44)   m.tl_rect.color = m.title_color
45)   m.bl_rect = m.top.findNode("updates_lower_title_rect")
46)   m.bl_rect.color = m.title_color
47)   m.r_rect = m.top.findNode("updates_right_title_rect")
48)   m.r_rect.color = m.title_color
49)   label_color = "0x00002080"
50)   r = m.top.findNode("updates_rect")
51)   r.color = label_color
52)   r = m.top.findNode("updates_lower_rect")
53)   r.color = label_color
54)   r = m.top.findNode("updates_right_rect")
55)   r.color = label_color
56) 
David Blume Remove some logging.

David Blume authored 4 years ago

57)   ' m.logger = CreateObject("roLogger")
David Blume Fix static analysis problem...

David Blume authored 4 years ago

58) 
David Blume first commit

David Blume authored 4 years ago

59)   m.myTask = CreateObject("roSGNode", "MyTask")
60)   m.myTask.ObserveField("updateText", "onUpdateText")
61)   m.myTask.ObserveField("updateTextLower", "onUpdateTextLower")
62)   m.myTask.control = "RUN"
63) 
David Blume Run the test code again wit...

David Blume authored 4 years ago

64)   m.testTask = CreateObject("roSGNode", "TestTask")
65)   m.testTask.ObserveField("updateText", "onUpdateTextRight")
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

66)   ' Note m.top.pucidHash is not set at this point, so we can't set it for testTask either.
David Blume Run the test code again wit...

David Blume authored 4 years ago

67)   m.testTask.control = "RUN"
68) 
David Blume first commit

David Blume authored 4 years ago

69)   texttimer = m.top.findNode("textTimer")
70)   texttimer.observeField("fire", "timerUpdate")
71)   texttimer.control = "start"
72) 
dblume Add scrolling to right pane

dblume authored 1 year ago

73)   m.rightLineCount = 100
74)   m.rightVisibleLines = 21
75)   m.rightTopVisibleLine = 0
David Blume first commit

David Blume authored 4 years ago

76)   m.updates_lower_array = CreateObject("roArray", 10, true)
dblume Add scrolling to right pane

dblume authored 1 year ago

77)   m.updates_right_array = CreateObject("roArray", m.rightLineCount, true)
David Blume first commit

David Blume authored 4 years ago

78) 
David Blume Run the test code again wit...

David Blume authored 4 years ago

79)   m.focus_rect = 1
dblume Add scrolling to right pane

dblume authored 1 year ago

80)   m.prevLeftFocus = 0
David Blume first commit

David Blume authored 4 years ago

81)   doUpdateFocus()
82) 
83)   m.top.setFocus(true)
84) end function
85) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

86) 
87) function onUpdatePucidHash() as void
88)     m.testTask.setField("pucidHash", m.top.pucidHash)
89) end function
90) 
91) 
David Blume first commit

David Blume authored 4 years ago

92) function onUpdateText() as void
93)    if m.updates.text.Len() = 0
94)        m.updates.text = m.myTask.updateText
95)    else
96)        m.updates.text = m.updates.text + chr(10) + m.myTask.updateText
97)    end if
David Blume Remove unused QR images; Ad...

David Blume authored 4 years ago

98)    print m.myTask.updateText
David Blume Remove some logging.

David Blume authored 4 years ago

99)    ' m.logger.logConsole("upperleft", [m.myTask.updateText])
David Blume first commit

David Blume authored 4 years ago

100) end function
101) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

102) 
David Blume first commit

David Blume authored 4 years ago

103) function onUpdateTextLower() as void
104)    updateTextLower(m.myTask.updateTextLower)
105) end function
106) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

107) 
David Blume first commit

David Blume authored 4 years ago

108) function updateTextLower(s as String) as void
109)     while m.updates_lower_array.Count() > 9
110)         m.updates_lower_array.Shift()
111)     end while
112)     m.updates_lower_array.Push(s)
113)     m.updates_lower.text = m.updates_lower_array.Join(chr(10))
David Blume Remove unused QR images; Ad...

David Blume authored 4 years ago

114)     print s
David Blume Remove some logging.

David Blume authored 4 years ago

115)     ' m.logger.logConsole("lowerleft", [s])
David Blume first commit

David Blume authored 4 years ago

116) end function
117) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

118) 
dblume Add scrolling to right pane

dblume authored 1 year ago

119) function showTextRight() as void
120)     visibleWindow = []
121)     max = m.updates_right_array.Count() - m.rightTopVisibleLine
122)     if max > m.rightVisibleLines then
123)         max = m.rightVisibleLines
124)     end if
125)     for i = 0 to max - 1
126)         visibleWindow.Push(m.updates_right_array[m.rightTopVisibleLine + i])
127)     end for
128)     m.updates_right.text = visibleWindow.Join(chr(10))
129) end function
130) 
131) 
David Blume first commit

David Blume authored 4 years ago

132) function onUpdateTextRight() as void
dblume Add scrolling to right pane

dblume authored 1 year ago

133)     while m.updates_right_array.Count() > m.rightLineCount - 1
134)         m.updates_right_array.Shift()
135)     end while
136)     m.updates_right_array.Push(m.testTask.updateText)
137)     ' Jump visible window to bottom
138)     m.rightTopVisibleLine = m.updates_right_array.Count() - m.rightVisibleLines
139)     if m.rightTopVisibleLine < 0 then
140)         m.rightTopVisibleLine = 0
141)     end if
142)     showTextRight()
143)     print m.testTask.updateText
David Blume Remove some logging.

David Blume authored 4 years ago

144)    ' m.logger.logConsole("right", [m.testTask.updateText])
David Blume first commit

David Blume authored 4 years ago

145) end function
146) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

147) 
David Blume first commit

David Blume authored 4 years ago

148) function onKeyEvent(key as String, press as Boolean) as Boolean
149)     handled = false
150)     if press then
David Blume Run the test code again wit...

David Blume authored 4 years ago

151)         if key = "back" then
David Blume first commit

David Blume authored 4 years ago

152)             handled = false
153)         else
154)             update_ui = false
dblume Add scrolling to right pane

dblume authored 1 year ago

155)             if key = "OK" and m.focus_rect = 1
David Blume Run the test code again wit...

David Blume authored 4 years ago

156)                 m.testTask.control = "RUN"
157)             elseif key = "up"
dblume Add scrolling to right pane

dblume authored 1 year ago

158)                 if m.focus_rect = 3
David Blume first commit

David Blume authored 4 years ago

159)                     m.focus_rect = 0
160)                     update_ui = true
dblume Add scrolling to right pane

dblume authored 1 year ago

161)                 elseif m.focus_rect = 1
162)                     if m.rightTopVisibleLine > 0
163)                         m.rightTopVisibleLine = m.rightTopVisibleLine - 1
164)                         showTextRight()
165)                     endif
David Blume first commit

David Blume authored 4 years ago

166)                 endif
167)             elseif key = "right"
dblume Add scrolling to right pane

dblume authored 1 year ago

168)                 if m.focus_rect = 0
169)                     m.prevLeftFocus = 0
David Blume first commit

David Blume authored 4 years ago

170)                     m.focus_rect = 1
171)                     update_ui = true
172)                 elseif m.focus_rect = 3
dblume Add scrolling to right pane

dblume authored 1 year ago

173)                     m.prevLeftFocus = 3
174)                     m.focus_rect = 1
David Blume first commit

David Blume authored 4 years ago

175)                     update_ui = true
176)                 endif
177)             elseif key = "down"
dblume Add scrolling to right pane

dblume authored 1 year ago

178)                 if m.focus_rect = 0
David Blume first commit

David Blume authored 4 years ago

179)                     m.focus_rect = 3
180)                     update_ui = true
181)                 elseif m.focus_rect = 1
dblume Add scrolling to right pane

dblume authored 1 year ago

182)                     if m.rightTopVisibleLine < m.updates_right_array.Count() - 1
183)                         m.rightTopVisibleLine = m.rightTopVisibleLine + 1
184)                         showTextRight()
185)                     endif
David Blume first commit

David Blume authored 4 years ago

186)                 endif
187)             elseif key = "left"
188)                 if m.focus_rect = 1:
dblume Add scrolling to right pane

dblume authored 1 year ago

189)                     m.focus_rect = m.prevLeftFocus
David Blume first commit

David Blume authored 4 years ago

190)                     update_ui = true
191)                 endif
192)             end if
193)             if update_ui
194)                 doUpdateFocus()
195)             endif
dblume Better and more events

dblume authored 1 year ago

196)             dt = Mid(CreateObject("roDateTime").ToISOString(), 12, 8)
David Blume first commit

David Blume authored 4 years ago

197)             updateTextLower(dt + " " + key)
198)             handled = true
199)         end if
200)     end if
201)     return handled
202) end function
203) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

204) 
David Blume first commit

David Blume authored 4 years ago

205) sub doUpdateFocus()
206)     if m.focus_rect = 0
207)         m.tl_rect.color = m.title_focus_color
208)         m.bl_rect.color = m.title_color
209)         m.r_rect.color = m.title_color
210)     elseif m.focus_rect = 1 or m.focus_rect = 2
211)         m.tl_rect.color = m.title_color
212)         m.bl_rect.color = m.title_color
213)         m.r_rect.color = m.title_focus_color
214)     elseif m.focus_rect = 3
215)         m.tl_rect.color = m.title_color
216)         m.bl_rect.color = m.title_focus_color
217)         m.r_rect.color = m.title_color
218)     end if
219) end sub
220) 
David Blume Add test support for DIAL;...

David Blume authored 4 years ago

221)