Download Untitled - Computer Science
Transcript
7.3. A worked example: a Sony TV H* Standby Channel selected Normal teletext Display nn Large top Display n Large bottom Teletext only Teletext on programme Teletext showing One digit showing Searching Two digits Normal viewing Off 30 minute timer 60 minute timer 90 minute timer H* Sound off Sound on Channels 1–8 Channels 9–59 Clock off H* Clock on Figure 7.4: A statechart for the RM-694 control of the Sony KV-M1421U TV. when we switch it on, it will always be in the watching mode, not adjusting sound or screen properties—that’s the default arrow in the bottom part of the cluster doing its work. The remote control for the Sony TV has a more complicated statechart, which is shown in figure 7.4 (p. 213). The statechart is much more complex than the TV itself—this was the main point made in section 3.2 (p. 63)—but let’s now consider a few details from it. From the statechart, we can see the TV as controlled by the remote can be off, in standby, watching a TV channel, or using teletext. Because of the deep history on the standby state, we can see that switching the TV on will take it to whichever was its last mode before it was switched off. The clock is a simple subsystem we can look at first, with two state clusters, ⇤ as shown in figure 7.5 (p. 214). The clock begins by being off, and the same ⇥Clock button is used to switch it on or off. We haven’t shown the 1, 440 states inside the clock needed when it is on! The details of the rest of the remote control statechart aren’t too interesting, un213