The ???_calcValue???
subgenerator??”which is also used by the ???_Alarm??? and ???_Set??? subgenerators??”
provides the basic template for all arithmetic operations within the code generator.
The generation of the simple middle-level Watch Applications such as TASTW
proceeds in the same way. As the middle-level models are simpler than the
applications they contain??”for example, they have no actions??”the resulting code is
also simpler. In order to support the references to the lower-level state machines (i.e.,
65 return null;
59 setstartTime(getsysTime().meMinus(getstopTime()));
60 iconOn("stopwatch");
61 return null;
62 case a22_4857:
63 setstopTime(getsysTime().meMinus(getstartTime()));
64 iconOff("stopwatch");
50
51 public Object perform(int methodId)
52 {
53 switch (methodId)
54 {
55 case a22_3324:
56 setstopTime(getstartTime().meMinus(getstartTime()));
57 return null;
58 case a22_3621:
66 case d22_4302:
67 return getstopTime();
68 case d22_5403:
69 return getsysTime().meMinus(getstartTime());
70 }
71 return null;
72 }
73 }
CODE GENERATION FOR WATCH MODELS 217
to the Watch Applications of which the middle-level model is composed), the
de?¬?nitions of these decomposition structures must be generated. This is taken care of
by the ???_Decompositions??? subgenerator.
9.5.2 C Generator for Watch Models
Since the choice of Java and the highly speci?¬?c state machine framework of the Java
generator were not a familiar approach to most embedded developers, we later built a
C generator.
Pages:
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399