Difference between revisions of "Phone Specification"

From WeizmannWiki
Jump to: navigation, search
 
(11 intermediate revisions by one user not shown)
Line 1: Line 1:
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> [[Image:Systemmodel GUI.png]]
+
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.<br><br>
+
The automatically created system model GUI.
  
==Requirements==
+
== Requirements ==
  
For each requirement, we present the requirement in [[PlayGo Feature List#Natural_language_play-in|natural language]]&nbsp;with no additional explanation, since the text is straightforward. Additionally, we present the LSC diagram created and comments on the creation process, when necessary.<br><br>
+
For each requirement, we present the requirement in [[PlayGo Feature List#Natural language play-in|natural language]]&nbsp;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".
| [[Image:PhoneLSC01.png|thumb|left|LSC]]
+
| [[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.
| [[Image:PhoneLSC2.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC03.png|thumb|left|LSC]]
+
| [[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&nbsp;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&nbsp;overrides the generated code of the display class. See code in playgo.systemmode.classes.
  
<span>&nbsp;</span><br>'''''Testing scenario''''':Click the number buttons and check the numbers that appear on the display.
+
<span>&nbsp;</span><br/>'''''Testing scenario''''':Click the number buttons and check the numbers that appear on the display.
  
| [[Image:PhoneLSC04.png|thumb|left|LSC]]
+
| [[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.
  
| [[Image:PhoneLSC07.png|thumb|left|LSC]]
+
| [[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.
| [[Image:PhoneLSC05.png|thumb|left|LSC]]
+
| [[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>&nbsp;</span><br>'''''Testing scenario''''':Pressing the p button will make the phone turn to off.
+
<span>&nbsp;</span><br/>'''''Testing scenario''''':Pressing the p button will make the phone turn to off.
  
| [[Image:PhoneLSC06.png|thumb|left|LSC]]
+
| [[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.
| [[Image:PhoneLSC08.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC11.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC010.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC0011.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC24.png|thumb|left|LSC]]
+
| [[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.
| [[Image:LSC012.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC013.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC18.png|thumb|left|LSC]]
+
| [[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.
| [[Image:PhoneLSC14.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC15.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC16.png|thumb|left|LSC]]
+
| [[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”
| [[Image:PhoneLSC12.png|thumb|left|LSC]]
+
| [[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"
| [[Image:PhoneLSC17.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC20.png|thumb|left|LSC]]
+
| [[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" |
| [[Image:PhoneLSC23.png|thumb|left|LSC]]
+
| [[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
| [[Image:PhoneLSC22.png|thumb|left|LSC]]
+
| [[File:PhoneLSC22.png|thumb|left|PhoneLSC22.png]]
 
|}
 
|}
  
<br>
+
== Phone LSC project ==
<br>
+
<br>
+
<br>
+
<br>
+
<br>
+
<br>
+
<br>
+
<br>
+
<br><br>
+
<br>
+
<br>
+
  
== Download the Phone Example  ==
+
To work with the phone application, you can create it in your PlayGo workspace:
  
[https://weizmann.box.com/s/0j0bk7s6rurl88r64omm The phone LSC Project (for development purposes)] <br>
 
 
=== Installation Instructions  ===
 
 
#Extract the downloaded zip.
 
 
#[[Download PlayGo|Download PlayGo]].
 
#[[Download PlayGo|Download PlayGo]].
#Import the downloaded project to your workspace:
+
#From the 'File' menu choose New-->Example....-->PlayGo Examples-->Phone
##From the File menu choose Import--&gt;General--&gt;Existing Projects into Workspace.
+
#Click the 'Finish' button.
##Click the 'Next' button.
+
#The phone example project is now part of your workspace. You can start playing with it. For details refer to&nbsp;[[How to Play-Out|how to play out]] and [[How to Play-In|how to play in]].
##When prompted, select the directory to which you extracted the downloaded phone example.
+
##Click finish.
+
#The phone 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]].
+

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.
Systemmodel GUI.png

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".
PhoneLSC01.png
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.
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"
PhoneLSC03.png
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.

 
Testing scenario:Click the number buttons and check the numbers that appear on the display.

PhoneLSC04.png
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.


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.

PhoneLSC07.png
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.
PhoneLSC05.png
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.

 
Testing scenario:Pressing the p button will make the phone turn to off.

PhoneLSC06.png
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.
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"
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"
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"
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"
PhoneLSC24.png
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.
LSC012.png
when the memory value changes then the chip content changes to the memory value
PhoneLSC013.png
when the memory value changes then the display shows the memory value
PhoneLSC18.png
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.
PhoneLSC14.png
when the speaker sound turns "off" then the speaker stops
PhoneLSC15.png
when the speaker sound turns to "ringing" then the speaker rings
PhoneLSC16.png
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”
PhoneLSC12.png
when the user clicks the call, if the display Text is "incomingcall" then the speaker sound turns "off"
PhoneLSC17.png
when the user clicks the call, if the display Text is "incomingcall" then the display Text changes to connected
PhoneLSC20.png
Clock when the Clock ticks, if the display state is "Time" then the display shows the Clock stringTime
PhoneLSC23.png
when the display state changes to "Time" then the display shows the Clock stringTime
PhoneLSC22.png

Phone LSC project

To work with the phone application, you can create it in your PlayGo workspace:

  1. Download PlayGo.
  2. From the 'File' menu choose New-->Example....-->PlayGo Examples-->Phone
  3. Click the 'Finish' button.
  4. 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.