Difference between revisions of "Phone Specification"
Line 118: | Line 118: | ||
|} | |} | ||
+ | <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | ||
+ | <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | ||
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> | ||
Revision as of 11:49, 20 December 2015
The phone example demonstrates the creation of LSCs using NL play-in. It uses the default system model GUI created automatically by PlayGo. It was later augmented with a manually created Java swing GUI to make the application more user-friendly.
The automatically created system model GUI.
Requirements
For each requirement, we present the requirement in natural language with no additional explanation, since the text is straightforward. Additionally, we present the LSC diagram created and comments on the creation process, when necessary.
Name | Requirement in Natural Language Text | Comments | LSC |
---|---|---|---|
Lock and Unlock | when the user clicks the star and the user clicks the end, if the display state is "Time" then the display state changes to "num" otherwise if the display state is "num" and the chip content is "" then the display state changes to "Time" | Time state is considered to be the lock state, in which the phone displays the time and accepts calls. Num state is the unlock state, in which the user can also dial. Testing scenario: Click the star button and then click the end button, the phone starts as "Time" and should become "num". Change it back to "Time". |
|
Back Color Changes | when the display state changes to "num" then the display backcolor changes to "pink" | Testing scenario: Change states between time, num and off, and see that the color changes to gray, pink and dark gray respectively. | |
when the display state changes, if the display state is "Time" then the display backcolor changes to "gray" otherwise if the display state is "off" then the display backcolor changes to "darkGray" | |||
Dial | when the user clicks any Cnumber, if the display state is "num" and the chip content is "" then the display concatenates the Cnumber value |
Concatenate is a function implemented in Java, that concatenates the digits. It overrides the generated code of the display class. See code in playgo.systemmode.classes. |
|
Clear | when the user clicks the clear, if the chip content is "" then the display clears |
Clear is a function implemented in Java, that clears the last digit. It overrides the generated code of the display class. See code in playgo.systemmode.classes.
|
|
End | when the user clicks the end then the chip clears and the memory clears and the display shows "" and the speaker sound turns "off" | Testing scenario:Press the end button to clear all numbers from the display. Also, check to see that upon pressing the end, the chip content clears, the memory clears and the speaker change to off. | |
Power | when the user clicks the power, if the display state is not "off" and the chip content is "" then the display state changes to "off" and the display Text changes to "" otherwise the display state changes to "num" |
The off state is when the user switches off the phone, in which case the user can’t dial or accept a call. |
|
Call | when the user clicks the call, if the display length is not "1" then the chip content is set to the display Text | When the env gets any call from the chip, the env responses to the chip either by “busy” and the call is not connected, or by “ack“ and the call is connected. To generate an external call from the Env- right-click the Env object in system model and choose 'call other object'. After that right-click the receive method of the chip object and choose 'call message'. When required, provide the argument “ack” or “Busy”. Testing scenario:Dial some digits (not a single digit, since that will activate the speed dial feature for the digit dialed), then press the call button. Depending on the response “busy” or “ack”(set the response from the env) the display will show “busy” or “connected“ and the speaker sound will stop. |
|
when the chip content is set, if the chip content is not "Busy" and the chip content is not "" and the chip content is not "incomingcall" and the chip content is not "ack" and the chip content is not "connected" then the chip makecall to the env and the speaker sound turns "ringout" | |||
when the env receives "ack" to the chip, if the chip content is "ack" then the display shows "connected" and the speaker sound turns "off" | |||
when the env receives "busy" to the chip, if the chip content is "busy" then the display shows "busy" and the speaker sound turns "off" | |||
when the user clicks the call and one second elapses, if the speaker sound is "ringout" then the display shows "busy" and the speaker sound changes to "off" | |||
SpeedDial | when the user clicks any Cnumber and the user clicks the call, if the display length is "1" then the memory retreives the Cnumber value and the display shows the memory value | Retreive is a function defined in memory class. It reads values from an xml file and stores the number corresponding to each speed dial digit. Testing scenario: Dial a single digit, then press the call button. Check that the saved number corresponding to the digit is displayed and that the call is forwarded to the number. |
|
when the memory value changes then the chip content changes to the memory value | |||
when the memory value changes then the display shows the memory value | |||
Speaker | when the speaker sound turns to "ringout" then the speaker plays. | Testing scenario:Dial some digits and click call. The speaker should play the playout tone. Then click the end, which makes the speaker turn off and the tone played stops. Set an incoming call from the env to the chip and check that the speaker plays ring tone. Click the end button to stop the tone. | |
when the speaker sound turns "off" then the speaker stops | |||
when the speaker sound turns to "ringing" then the speaker rings | |||
Incomingcall | when the env receives "incomingcall" to the chip, if the chip content is "incomingcall" then the display shows “incomingcall” and the display state changes to "num" and the speaker sound turns to "ringing" | To generate an external call from the Env, right-click the Env object in the system model and choose 'call other object'. After that right-click the receive method of the chip object and choose 'call message'. When prompted, provide the argument “incomingcall”. Testing scenario: when the env sets “incomingcall” to the chip, the display will show the “incomingcall” and the speaker will start playing ‘playing’ tone. Click the end or call to turn the speaker to off when the display text is “incoming” |
|
when the user clicks the call, if the display Text is "incomingcall" then the speaker sound turns "off" | |||
when the user clicks the call, if the display Text is "incomingcall" then the display Text changes to connected | |||
Clock | when the Clock ticks, if the display state is "Time" then the display shows the Clock stringTime | ||
when the display state changes to "Time" then the display shows the Clock stringTime |
Phone LSC project
To work with the phone application, you can create it in your PlayGo workspace:
- Download PlayGo.
- From the 'File' menu choose New-->Example....-->PlayGo Examples-->Phone
- Click the 'Finish' button.
- The phone example project is now part of your workspace. You can start playing with it. For details refer to how to play out and how to play in.