Difference between revisions of "Getting Started with PlayGo"

From WeizmannWiki
Jump to: navigation, search
(Create your first LSC project)
 
(10 intermediate revisions by one user not shown)
Line 1: Line 1:
== Install PlayGo ==
+
== Install PlayGo ==
PlayGo is based on Eclipse and is packaged and provided as an Eclipse Product. In addition to the product itself, we provide a workspace with several examples.
+
  
To install PlayGo, create a new directory and extract the downloaded zip file to that newly created directory. Throughout this document we refer to this directory as <PlayGo>.
+
PlayGo is based on Eclipse and is packaged and provided as an Eclipse Product.
  
Once extracted, your <PlayGo> directory should have the following content:
+
To install PlayGo, extract the downloaded zip file. The zip file contains a directory named PlayGo with the following content:
  
[[Image:Playgo.install.dir.JPG]]
+
[[Image:playgo.install.dir.jpg]]
  
== Run PlayGo with the provided workspace ==
+
Throughout this section we refer to the newly extracted directory as <PlayGo>.
=== Startup PlayGo ===
+
To start PlayGo, go to your <PlayGo>/playgo/ directory and double-click the PlayGo.exe file. As it is in Eclipse, PlayGo will ask you for the workspace to start with. Create a new workspace, or choose the workspace provided with the installation (i.e., <PlayGo>/workspace/).
+
  
The <PlayGo>/workspace/ contains four projects:
+
== Startup PlayGo ==
  
*ATM – example for ATM System. The ATM GUI side is based on [http://code.google.com/webtoolkit/ GWT]. ATM behavior was modeled by playing in a set of scenarios. S2A is used for generating aspects, which are used to monitor and run the system ([[Language_%26_Concepts#Play-Out|play-out]]).
+
To start PlayGo, go to your &lt;PlayGo&gt; directory and double-click the playgo.exe file. As it is in Eclipse, PlayGo will ask you for the [[Eclipse Orientation#workspace|workspace]] to start with. Create a new workspace (e.g., &lt;PlayGo&gt;/workspace/) and select it.<br>
*BabyMonitor – Another example system. The GUI side is based on Swing. Its behavior was modeled by playing in a set of scenarios. S2A is used for generating aspects, which are used to monitor and run the system ([[Language_%26_Concepts#Play-Out|play-out]]).
+
*GWTMemoryGame – Another example system. The Memory Game GUI side is based on [http://code.google.com/webtoolkit/ GWT]. Its behavior was modeled by playing in a set of scenarios. S2A is used for generating aspects, which are used to monitor and run the system ([[Language_%26_Concepts#Play-Out|play-out]]).
+
*il.ac.wis.cs.common – a library that contains a few examples of creating LSC models using Java API.
+
  
We will refer to these projects in the following sections.
+
[[Troubleshoot#Error_when_launching_PlayGo|Troubleshoot...]]
  
Once PlayGo is open, note that the PlayGo perspective is selected. It is recommended to use this perspective, as it provides some shortcuts.
+
== Create your first LSC project  ==
  
[[Image:playgo.perspective.JPG]]
+
Creating a new LSC project is done from the 'File' menu: choose New --&gt; LSC Project. Keep the flags checked and unchecked, as follows: <br><br>[[Image:New.LSC.project.JPG]] <br><br> [[Troubleshoot#LSC_perspective|Troubleshoot...]] <br><br> Start playing in, by selecting the project and clicking the 'NL Play-In':<br> [[Image:NL.play-in.start.png|800px]] <br><br> You will be prompted to select a name and location for the specification file, the file where the LSCs you create will be stored:<br> [[Image:SpecFile.png]]
  
=== Configure the examples ===
+
<br> Start entering your requirements. For each one, enter the LSC name and the requirement's text, and then click the [[Image:NL.plus.jpg]] button on the view toolbar to add the text you entered to the specification file. <br><br> For example, to create a sample "Hello World" scenario, you can enter the following text: <br><br> '''when the user clicks the button, the display text changes to "Hello World"''' <br><br>Type a space at the end of the sentence for it to parse. <br><br> Hover over the words that are marked with a squiggly line, and select an alternative from the quickfix box, by clicking it. The word will be interpreted and the corresponding object will be added to the system model view: <br> [[Image:GreenQuickFix1.jpg]] <br><br>
Since some of our examples are based on GWT, you should configure the GWT settings before you can run the examples:
+
  
1. From Window menu, choose Preferences-&gt;Google-&gt;Web Toolkit. Configure it to point to your &lt;PlayGo&gt;\plugins\com.google.gwt.eclipse.sdkbundle.2.0.0_2.0.0.v200912062003\gwt-2.0.0 directory:
+
Clicking the [[Image:NL.plus.jpg]] button will then result in the following LSC: <br><br> [[Image:Specification.sampleProject.png|800px]] <br><br>
  
[[Image:Gwt.preferences.jpg]]
+
[[How to Play-In|More about play-in...]] <br><br>
  
<br>
+
Once done, stop the play-in session, by clicking the 'Stop' button on the toolbar. Click the 'Play-Out' button on the toolbar to start playing out:<br><br> [[Image:Toolbar.playout.png]] <br><br> As a result, a default GUI will be launched, from which you can play out (e.g., click the button and see the "Hello World" text in the display text field).
  
2.From Window menu, choose Preferences-&gt;Google-&gt;App Engine. Configure it to point to your &lt;PlayGo&gt;\plugins\com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120\appengine-java-sdk-1.3.0 directory:
+
[[How to Play-Out|More about play-out...]]
 
+
[[Image:Gwt.preferences2.jpg]]
+
 
+
<br>
+
 
+
[[S2A_Configuration | '''S2A Configuration''']]
+
 
+
=== Start playing ===
+
 
+
====Run the examples: play-out====
+
The examples provided are configured and ready to be played out. Aspects are
+
already generated and Java-compiled. To play out, select an example project (e.g.,
+
GWTMemoryGame) and click the 'Play-Out' button on the toolbar.
+
As a result, the application will start (if this is a GWT application, the corresponding GWT application will start and its URL will be copied to the Eclipse Internal Web Browser) and the LSC specification will be open in the LSC editor.
+
You can now start working with the application. For example: flip up cards in a memory game, and see how the application works, with the cut changing on the LSC diagram.
+
 
+
To stop playing out, click the 'Stop' button on the toolbar, next to the 'Play-Out' and
+
'Play-In' buttons.
+
 
+
If the example fails to run, check out our [[troubleshoot]] section.
+
 
+
=====Debug =====
+
When playing out an example, it is executed in debug mode. Thus, you see the LSC diagram at runtime with additional debugging information, such as the cut:[[Image:debug.jpg|800px]]
+
 
+
You can right-click a message and toggle a Breakpoint. The LSC debugger will stop on breakpoint. To continue, choose Resume from the Debug View.
+
 
+
====Enrich the examples with scenarios: play-in====
+
For playing in, select an example project (e.g. BabyMonitor) and click the 'Play-In' button on the toolbar. As a result, the play-in server starts and the application starts (if this is a GWT-based application, i.e., GWTMemoryGame, the corresponding GWT application starts and its URL is copied to the Eclipse Internal Web Browser).
+
 
+
You can now start [[How_to_Play-In | playing in]].
+
 
+
== Create your First LSC Project ==
+
Creating a new LSC project is done from the file menu: choose New --> LSC Project. Note: if you're not using the PlayGo perspective you may not see this option, in which case choose New --> Other --> PlayGo category --> LSC Project. Keep the flags checked, as follows:
+
<br><br>[[Image:New.LSC.project.JPG]]
+
 
+
You can now start working on your system.
+
Refer to [[How to define play-in-able Swing GUI application]] for step by step instructions on defining an LSC application with a GUI.
+

Latest revision as of 12:42, 23 August 2014

Install PlayGo

PlayGo is based on Eclipse and is packaged and provided as an Eclipse Product.

To install PlayGo, extract the downloaded zip file. The zip file contains a directory named PlayGo with the following content:

Playgo.install.dir.jpg

Throughout this section we refer to the newly extracted directory as <PlayGo>.

Startup PlayGo

To start PlayGo, go to your <PlayGo> directory and double-click the playgo.exe file. As it is in Eclipse, PlayGo will ask you for the workspace to start with. Create a new workspace (e.g., <PlayGo>/workspace/) and select it.

Troubleshoot...

Create your first LSC project

Creating a new LSC project is done from the 'File' menu: choose New --> LSC Project. Keep the flags checked and unchecked, as follows:

New.LSC.project.JPG

Troubleshoot...

Start playing in, by selecting the project and clicking the 'NL Play-In':
NL.play-in.start.png

You will be prompted to select a name and location for the specification file, the file where the LSCs you create will be stored:
SpecFile.png


Start entering your requirements. For each one, enter the LSC name and the requirement's text, and then click the NL.plus.jpg button on the view toolbar to add the text you entered to the specification file.

For example, to create a sample "Hello World" scenario, you can enter the following text:

when the user clicks the button, the display text changes to "Hello World"

Type a space at the end of the sentence for it to parse.

Hover over the words that are marked with a squiggly line, and select an alternative from the quickfix box, by clicking it. The word will be interpreted and the corresponding object will be added to the system model view:
GreenQuickFix1.jpg

Clicking the NL.plus.jpg button will then result in the following LSC:

Specification.sampleProject.png

More about play-in...

Once done, stop the play-in session, by clicking the 'Stop' button on the toolbar. Click the 'Play-Out' button on the toolbar to start playing out:

Toolbar.playout.png

As a result, a default GUI will be launched, from which you can play out (e.g., click the button and see the "Hello World" text in the display text field).

More about play-out...