Presentation is loading. Please wait.

Presentation is loading. Please wait.

State diagrams Practice 5. Task 1  After the creation of the article “Paper” is only a draft “Draft”. After sending (“send”) this article is considered.

Similar presentations


Presentation on theme: "State diagrams Practice 5. Task 1  After the creation of the article “Paper” is only a draft “Draft”. After sending (“send”) this article is considered."— Presentation transcript:

1 State diagrams Practice 5

2 Task 1  After the creation of the article “Paper” is only a draft “Draft”. After sending (“send”) this article is considered by the program committee of the conference “OnReview”, it will review the article “reviewPaper”. If the committee is agree to take the article (“approved”) the article is accepted for the conference “Accepted”. Unless the Committee adopted article “declined”, the article becomes again a draft “Draft”.

3 Task 1  Check changes of the states of the article under review. After receiving the article is checked “Checked”. If some deficiencies are found, the article is sent for revision (“correct”) into the state “OnCorrection”. If there are no shortcomings, review of the article concludes. If you are re- submitting the article “sent”, it is checked again “Checked”.  Specify that if the article was not sent with the corrections within 10 days, the review shall be terminated and the article becomes a draft “Draft”.

4 Task 2  The traffic light “TrafficLights” after the creation goes to the state «off» (“Offline”). When it is switched on (“On”), the traffic light goes in the sub state “Green” of the state included in “Online”. After 50 seconds, the traffic light enters the state “Yellow” in “Online”. Then, after 3 seconds – into the state of “Red”. After 50 seconds the light returns to the state «Green».  Add the ability to turn off the included traffic light.

5 Task 2  Modify the model, specify that the interval t between the switching signals of the traffic light is configured by the challenge of operations “setGreen”, “setRed” and “setYellow” when the traffic light is off.  Change the order of initialization of traffic light, using the security conditions, specify on the analogy of the previous paragraphs, that the initial signal of the traffic light “initialGreen”, “initialYellow” or “initialRed” when it is on are adjusted (“setInitial”) when it is off.

6 Task 3  The controller of the multimedia player “PlayerController” is in an uninitialized state “NotInitialized” at first. When you start the player, it happens the transition to the state of booting “Loading”, at the entrance to which the engine “initEngine” and the interface of the player “initUI” are initialized. Simultaneously in the body of the controller the available plug-ins are loading “loadPlugins”. On the completion of the loading the controller goes into a state of readiness “Ready”.

7 Task 3  The main purpose of the player is to play audio and video. Add in a state of readiness the modes of play, stop and pause and the events, initiating the transitions between these modes.  Good multimedia players simultaneously the process of playing can automatically update the media library: they search of new content and download information about it from the network. Add this functionality to the model.

8 Task 4  At first the desk lamp “Lamp” is switched Off. When you switch the tumbler “turnOn” the lamp are starting working “Light”. When the lamp is operated, under the condition of switching off it turns off “turnOff”.  Modify the model, specify that if the lamp is falling down (“fell”) or becomes burned off (“burmDown”) then it is damaged (“Damaged”).  Specify that lamps which are not working (“Damaged”) are going to the disposal (“dispose”), when the lamp is destroyed.

9 Task 5 Initially the coffee machine (“CoffeeMachine”) is switched off (“Off”). When you press on the power button (“powerButton”) the coffee machine goes into a composite state “On”. In this state, it firstly performs a self-check (“SelfTest”). After successful checking (condition “testSuccess”) the transition occurs in the composite state to the substate of readiness for work (“Ready”). In this state, coffee machine is in standby mode until the user does not press the button for making coffee (“makeButton”). When receiving such a signal (“makeButtonPressed”) the coffee machine at first grinds the grain (“Grind”), then heats up the steam and process by this steam a gained ground coffee. After that it pours brewed coffee and returns to standby mode.

10 Task 5  Add to the state diagram the action of on and off the display when the coffee machine is turned on and turned off.  Heating the steam directly in front of the preparation of coffee is a very long deal. The user wants to get his cup of coffee as soon as possible. Implement with the help of the orthogonal state the possibility to maintain the temperature of the water in the coffee machine during the whole state of readiness, independent of the process of making coffee.  Add the button for canceling of making coffee (“cancelButton”), by pressing which the cooking process is interrupted, and coffee machine resets the state of readiness.

11 Task 5  When grinding the coffee beans may not be enough. Then the machine has to get back in the standby mode, showing the user a message.  Build a minimum sufficient structural model for the coffee machine.

12 Task 6  The microwave furnace (“Microwave”) after the creation switches in the state “Off”. If you press the power button (“turnOn”), the furnace goes into a state of preparation “On”. Before cooking, the value of the attribute "timer“ of the class “Microwave” is set to zero and the value of the attribute of the preparation time “cookingTime” is taken as equal to ten. At the expiration of a second in the state of preparation, the timer value is incremented by one. If the value of the timer exceeded the cooking time then the furnace becomes off.

13 Task 6  Add the ability to transfer a microwave furnace by the click of a button “turnOff” from the state of preparation to the state of being off. What meaning will the attribute “cookingTime” have if you turn off and then turn on the furnace?  Implement a function for adding 10 seconds to the cooking time by pressing the button “turnOn” in the state “On”.  Show two substates: “Working” and “NotWorking” in the state of preparation. Show, that the furnace goes from “Working: to “NotWorking” when the door is opened “Open” and back when the door is closed “Close”. The cooking time is counted only in the state of “Working” in which the furnace gets by default in the transition to a state of preparation.

14 Task 6  Using the orthodoxial regions, display at the model the state of the door: opened (“DoorOpen”) and closed (“DoorClosed”), and the transitions between them when receiving signals. Using complex transitions, specify that the furnace after “turnOn” goes into “Working”, if the door is closed and into “NotWorking”, if the door is opened.


Download ppt "State diagrams Practice 5. Task 1  After the creation of the article “Paper” is only a draft “Draft”. After sending (“send”) this article is considered."

Similar presentations


Ads by Google