|
| 1 | +PowerSwitch |
| 2 | +=========== |
| 3 | + |
| 4 | +This sample includes a very simple model program and FSM, for an |
| 5 | +on-off power switch and a speed control. |
| 6 | + |
| 7 | +This sample demonstrates several PyModel techniques (including |
| 8 | +composition) on a minimal example. |
| 9 | + |
| 10 | +- *PowerSwitch*: model program for on-off power switch |
| 11 | + |
| 12 | +- *test*: execute *PowerSwitch*, demonstrate *pmt* options *-n* *-c* *-a* *-e* *-r* |
| 13 | + |
| 14 | +- *Scenarios*: test suite with several traces of power switch |
| 15 | + behavior, some allowed by the model program, others not allowed |
| 16 | + |
| 17 | +- *SpeedControl*: FSM for speed control |
| 18 | + |
| 19 | +- *test_scenarios*: execute *PowerSwitch*, *Scenarios*, and |
| 20 | + *SpeedControl*, alone and composed. *PowerSwitch* composed with |
| 21 | + *Scenarios* shows how forbidden traces end in non-accepting states. |
| 22 | + *PowerSwitch* composed with *SpeedControl* shows how unshared actions |
| 23 | + interleave. |
| 24 | + |
| 25 | +- *test_graphics*: generate graphs of *PowerSwitch*, *SpeedControl*, and |
| 26 | + their composition. |
| 27 | + |
| 28 | +- *test_viewer*: Generate the same output as *test_graphics*, but this |
| 29 | + script is shorter because it uses *pmv* instead of *pma* + *pmg* + |
| 30 | + *dot* |
| 31 | + |
| 32 | +- *fsmpy*, *svg*, *ps*, *pdf*: directories of output files from *test_graphics* |
| 33 | + or *test_viewer*, and other graphics generated ad-lib at the command line |
| 34 | + |
| 35 | +You can view the generated graphics files in a browser. Hover the |
| 36 | +pointer over any state bubble to see a tooltip that shows the state |
| 37 | +variables in that state. |
| 38 | + |
| 39 | +- *PowerSwitchFSM*: the graph of the FSM generated by exploring the *PowerSwitch* |
| 40 | + model program |
| 41 | + |
| 42 | +- *SpeedControl*: the graph of the *SpeedControl* FSM |
| 43 | + |
| 44 | +- *PowerSpeed*: the graph of the composition of *PowerSwitch* and |
| 45 | + *SpeedControl*, showing how states combine and actions interleave |
| 46 | + |
| 47 | +There is no stepper in this sample. |
| 48 | + |
| 49 | + |
| 50 | +Revised Mar 2013 |
0 commit comments