Difference between revisions of "Getting Started with PlayGo"

From WeizmannWiki
Jump to: navigation, search
(Install PlayGo)
Line 2: Line 2:
 
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.
 
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 files to that newly created directory. Throughout this document we refer to this directory as <PlayGo>.
+
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>.
  
 
Once extracted, your <PlayGo> directory should have the following content:
 
Once extracted, your <PlayGo> directory should have the following content:
  
 
[[Image:Playgo.install.dir.JPG]]
 
[[Image:Playgo.install.dir.JPG]]
 +
 +
== 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/).
 +
 +
== Create your first LSC project ==
 +
Creating a new LSC project is done from the file menu: choose New --> LSC Project. Note: if you are 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]]
 +
<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 specification file name and location:<br>
 +
[[Image:specFile.png]]
 +
 +
 +
Start entering your requirements. For each one, enter the LSC name and the requirement's text, and then click the '+' button on the view toolbar to add the specification to the specification file. <br><br>
 +
For example, to create a sample "Hello World" specification, enter the following requirement: <br><br>
 +
'''when the user clicks the button, the display text changes to "Hello World"'''
 +
<br><br>
 +
Clicking the '+' button will then result in the following LSC: <br>
 +
[[Image:specification.sampleProject.png|800px]]
 +
<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>
 +
[[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).
  
 
== Run PlayGo with the provided workspace ==
 
== Run PlayGo with the provided workspace ==
=== Startup PlayGo ===
+
Startup PlayGo. When prompted to select a workspace, choose the workspace provided with the installation (i.e., <PlayGo>/workspace/).
To start PlayGo, go to your &lt;PlayGo&gt;/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., &lt;PlayGo&gt;/workspace/).
+
  
 
The &lt;PlayGo&gt;/workspace/ contains four projects:
 
The &lt;PlayGo&gt;/workspace/ contains four projects:
Line 48: Line 73:
 
already generated and Java-compiled. To play out, select an example project (e.g.,
 
already generated and Java-compiled. To play out, select an example project (e.g.,
 
GWTMemoryGame) and click the 'Play-Out' button on the toolbar.
 
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.
+
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 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.
 
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.
  
Line 56: Line 81:
 
If the example fails to run, check out our [[troubleshoot]] section.
 
If the example fails to run, check out our [[troubleshoot]] section.
  
=====Debug =====
+
For more information about play-out, click [[How_to_Play-Out | here]].
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====
 
====Enrich the examples with scenarios: play-in====
Line 65: Line 87:
  
 
You can now start [[How_to_Play-In | playing in]].
 
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.
 

Revision as of 12:36, 27 November 2012

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

Once extracted, your <PlayGo> directory should have the following content:

Playgo.install.dir.JPG

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/).

Create your first LSC project

Creating a new LSC project is done from the file menu: choose New --> LSC Project. Note: if you are 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:

New.LSC.project.JPG

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 specification file name and location:
SpecFile.png


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

For example, to create a sample "Hello World" specification, enter the following requirement:

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

Clicking the '+' button will then result in the following LSC:
Specification.sampleProject.png

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).

Run PlayGo with the provided workspace

Startup PlayGo. When prompted to select a workspace, choose the workspace provided with the installation (i.e., <PlayGo>/workspace/).

The <PlayGo>/workspace/ contains four projects:

  • ATM – example for ATM System. The ATM GUI side is based on 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 (play-out).
  • 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 (play-out).
  • GWTMemoryGame – Another example system. The Memory Game GUI side is based on 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 (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.

Once PlayGo is open, note that the PlayGo perspective is selected. It is recommended to use this perspective, as it provides some shortcuts.

Playgo.perspective.JPG

Configure the examples

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->Google->Web Toolkit. Configure it to point to your <PlayGo>\plugins\com.google.gwt.eclipse.sdkbundle.2.0.0_2.0.0.v200912062003\gwt-2.0.0 directory:

Gwt.preferences.jpg


2.From Window menu, choose Preferences->Google->App Engine. Configure it to point to your <PlayGo>\plugins\com.google.appengine.eclipse.sdkbundle.1.3.0_1.3.0.v200912141120\appengine-java-sdk-1.3.0 directory:

Gwt.preferences2.jpg


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

For more information about play-out, click here.

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 playing in.