Difference between revisions of "Phone Specification"
(New page: The phone example demonstrates the creation of LSCs using NL play-in. It uses the default system model GUI created automatically by PlayGo....) |
|||
(14 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
− | The phone example demonstrates the creation of LSCs using [[PlayGo Feature List# | + | The phone example demonstrates the creation of LSCs using [[PlayGo Feature List#Natural language play-in|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.<br/>[[File:Systemmodel GUI.png]] |
− | The automatically created system model GUI. | + | The automatically created system model GUI. |
− | ==Requirements== | + | == Requirements == |
− | For each requirement, we present the requirement in [[PlayGo Feature List# | + | For each requirement, we present the requirement in [[PlayGo Feature List#Natural language play-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. |
{| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | {| width="100%" border="1" align="left" cellpadding="1" cellspacing="1" | ||
Line 16: | Line 16: | ||
| Lock and Unlock | | 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" | | 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.<br>'''''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". | + | | 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.<br/>'''''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". |
− | | [[ | + | | [[File:PhoneLSC01.png|thumb|left|PhoneLSC01.png]] |
|- | |- | ||
| rowspan="2" style="vertical-align:top;hrizontal-align:center;" | Back Color Changes | | rowspan="2" style="vertical-align:top;hrizontal-align:center;" | Back Color Changes | ||
| when the display state changes to "num" then the display backcolor changes to "pink" | | when the display state changes to "num" then the display backcolor changes to "pink" | ||
| rowspan="2" style="vertical-align:center;" | '''''Testing scenario''''': Change states between time, num and off, and see that the color changes to gray, pink and dark gray respectively. | | rowspan="2" style="vertical-align:center;" | '''''Testing scenario''''': Change states between time, num and off, and see that the color changes to gray, pink and dark gray respectively. | ||
− | | [[ | + | | [[File:PhoneLSC2.png|thumb|left|PhoneLSC2.png]] |
|- | |- | ||
| 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" | | 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" | ||
− | | [[ | + | | [[File:PhoneLSC03.png|thumb|left|PhoneLSC03.png]] |
|- | |- | ||
| Dial | | Dial | ||
Line 32: | Line 32: | ||
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. | 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. | ||
− | <span> </span><br>'''''Testing scenario''''':Click the number buttons and check the numbers that appear on the display. | + | <span> </span><br/>'''''Testing scenario''''':Click the number buttons and check the numbers that appear on the display. |
− | | [[ | + | | [[File:PhoneLSC04.png|thumb|left|PhoneLSC04.png]] |
|- | |- | ||
| Clear | | Clear | ||
Line 41: | Line 41: | ||
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. | 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. | ||
− | <br>'''''Testing scenario''''':With the phone in num state (unlocked, display in pink color), dial some numbers and then press the c button, the last digit will be cleared. | + | <br/>'''''Testing scenario''''':With the phone in num state (unlocked, display in pink color), dial some numbers and then press the c button, the last digit will be cleared. |
− | | [[ | + | | [[File:PhoneLSC07.png|thumb|left|PhoneLSC07.png]] |
|- | |- | ||
| End | | 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" | | 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. | | '''''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. | ||
− | | [[ | + | | [[File:PhoneLSC05.png|thumb|left|PhoneLSC05.png]] |
|- | |- | ||
| Power | | Power | ||
Line 55: | Line 55: | ||
The off state is when the user switches off the phone, in which case the user can’t dial or accept a call. | The off state is when the user switches off the phone, in which case the user can’t dial or accept a call. | ||
− | <span> </span><br>'''''Testing scenario''''':Pressing the p button will make the phone turn to off. | + | <span> </span><br/>'''''Testing scenario''''':Pressing the p button will make the phone turn to off. |
− | | [[ | + | | [[File:PhoneLSC06.png|thumb|left|PhoneLSC06.png]] |
|- | |- | ||
| rowspan="5" style="vertical-align:top;hrizontal-align:center;" | Call | | rowspan="5" style="vertical-align:top;hrizontal-align:center;" | 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 user clicks the call, if the display length is not "1" then the chip content is set to the display Text | ||
− | | rowspan="5" | 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.<br><br>'''''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”.<br><br>'''''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. | + | | rowspan="5" | 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.<br/><br/>'''''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”.<br/><br/>'''''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. |
− | | [[ | + | | [[File:PhoneLSC08.png|thumb|left|PhoneLSC08.png]] |
|- | |- | ||
| 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 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" | ||
− | | [[ | + | | [[File:PhoneLSC11.png|thumb|left|PhoneLSC11.png]] |
|- | |- | ||
| 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 "ack" to the chip, if the chip content is "ack" then the display shows "connected" and the speaker sound turns "off" | ||
− | | [[ | + | | [[File:PhoneLSC010.png|thumb|left|PhoneLSC010.png]] |
|- | |- | ||
| 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 env receives "busy" to the chip, if the chip content is "busy" then the display shows "busy" and the speaker sound turns "off" | ||
− | | [[ | + | | [[File:PhoneLSC0011.png|thumb|left|PhoneLSC0011.png]] |
|- | |- | ||
| 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" | | 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" | ||
− | | [[ | + | | [[File:PhoneLSC24.png|thumb|left|PhoneLSC24.png]] |
|- | |- | ||
| rowspan="3" style="vertical-align:top;hrizontal-align:center;" | SpeedDial | | rowspan="3" style="vertical-align:top;hrizontal-align:center;" | 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 | | 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 | ||
− | | rowspan="3" | 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.<br><br>'''''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. | + | | rowspan="3" | 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.<br/><br/>'''''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. |
− | | [[ | + | | [[File:LSC012.png|thumb|left|LSC012.png]] |
|- | |- | ||
| when the memory value changes then the chip content changes to the memory value | | when the memory value changes then the chip content changes to the memory value | ||
− | | [[ | + | | [[File:PhoneLSC013.png|thumb|left|PhoneLSC013.png]] |
|- | |- | ||
| when the memory value changes then the display shows the memory value | | when the memory value changes then the display shows the memory value | ||
− | | [[ | + | | [[File:PhoneLSC18.png|thumb|left|PhoneLSC18.png]] |
|- | |- | ||
| rowspan="3" style="vertical-align:top;hrizontal-align:center;" | Speaker | | rowspan="3" style="vertical-align:top;hrizontal-align:center;" | Speaker | ||
| when the speaker sound turns to "ringout" then the speaker plays. | | when the speaker sound turns to "ringout" then the speaker plays. | ||
| rowspan="3" style="vertical-align:center;" | '''''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. | | rowspan="3" style="vertical-align:center;" | '''''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. | ||
− | | [[ | + | | [[File:PhoneLSC14.png|thumb|left|PhoneLSC14.png]] |
|- | |- | ||
| when the speaker sound turns "off" then the speaker stops | | when the speaker sound turns "off" then the speaker stops | ||
− | | [[ | + | | [[File:PhoneLSC15.png|thumb|left|PhoneLSC15.png]] |
|- | |- | ||
| when the speaker sound turns to "ringing" then the speaker rings | | when the speaker sound turns to "ringing" then the speaker rings | ||
− | | [[ | + | | [[File:PhoneLSC16.png|thumb|left|PhoneLSC16.png]] |
|- | |- | ||
| rowspan="3" style="vertical-align:top;hrizontal-align:center;" | Incomingcall | | rowspan="3" style="vertical-align:top;hrizontal-align:center;" | 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" | | 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" | ||
− | | rowspan="3" | <br>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”.<br><br>'''''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” | + | | rowspan="3" | <br/>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”.<br/><br/>'''''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” |
− | | [[ | + | | [[File:PhoneLSC12.png|thumb|left|PhoneLSC12.png]] |
|- | |- | ||
| 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 speaker sound turns "off" | ||
− | | [[ | + | | [[File:PhoneLSC17.png|thumb|left|PhoneLSC17.png]] |
|- | |- | ||
| when the user clicks the call, if the display Text is "incomingcall" then the display Text changes to connected | | when the user clicks the call, if the display Text is "incomingcall" then the display Text changes to connected | ||
− | | [[ | + | | [[File:PhoneLSC20.png|thumb|left|PhoneLSC20.png]] |
|- | |- | ||
| rowspan="2" | Clock | | rowspan="2" | Clock | ||
| when the Clock ticks, if the display state is "Time" then the display shows the Clock stringTime | | when the Clock ticks, if the display state is "Time" then the display shows the Clock stringTime | ||
| rowspan="2" | | | rowspan="2" | | ||
− | | [[ | + | | [[File:PhoneLSC23.png|thumb|left|PhoneLSC23.png]] |
|- | |- | ||
| when the display state changes to "Time" then the display shows the Clock stringTime | | when the display state changes to "Time" then the display shows the Clock stringTime | ||
− | | [[ | + | | [[File:PhoneLSC22.png|thumb|left|PhoneLSC22.png]] |
|} | |} | ||
− | + | == Phone LSC project == | |
− | + | ||
− | + | ||
− | + | To work with the phone application, you can create it in your PlayGo workspace: | |
− | |||
− | |||
− | |||
− | |||
− | |||
#[[Download PlayGo|Download PlayGo]]. | #[[Download PlayGo|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|how to play out]] and [[How to Play-In|how to play in]]. | |
− | # | + | |
− | + | ||
− | + |
Latest revision as of 11:50, 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.