SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 284 | Next

Steven Kelly and Juha-Pekka Tolvanen

"Domain-Specific Modeling"


:3_266 /* code for "Welcome to the system!" */
Say 0x12 8 'Welcome to the system!'
Say 0x13 7 'Press 1 for mode menu'
Say 0x14 8 'Press 2 for version info'
:3_306
GetDTMF Timeout 5
IfNot
Jump 3_354
Test DTMF = 1
If
Jump 3_450
Test DTMF = 2
If
Jump 3_468
Say 0x11 5 'Invalid input!'
Jump 3_266
:3_354
Say 0x10 3 'Timeout!'
Jump 3_266
:3_450 /* code for "The current mode is... Pick mode" */
...
:3_468 /* code for "This is version..." */
...
The ?¬?rst block, labeled 3_266, is speci?¬?ed in the lower-level VoiceOutput
subdiagram. 3_306 is the start of the DTMF handling: wait for DTMF input,
timing out after 5 seconds (this period is taken from the Timeout relationship). If
154 HOME AUTOMATION
we time out with no input, jump to 3_354, say the voice output speci?¬?ed in
the Timeout relationship??™s reused VoiceOutput subdiagram, and jump back to the
start of the ?¬?rst block.
The meat of the DTMF handling is a series of Test-If-Jump blocks, which
compare the DTMF tones received with the characters speci?¬?ed in the
ConditionalFlow relationships, jumping to the appropriate VoiceOutput block if
there is a match. If no match is found, we fall through to the ???Invalid input!???
section at the end of the 3_306 block, which is generated similarly to the Timeout
section.
Moving on to the VoiceOutput section of the generator, Listing 7.


Pages:
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
zaklady bukmacherskie videofilmowanie przeworsk kartki wielkanocne przeszczep włosów