Difference between revisions of "BP Blockly User Guide"

From BP Wiki
Jump to: navigation, search
(Installation / Getting started)
Line 8: Line 8:
 
= Installation / Getting started =
 
= Installation / Getting started =
 
* Install Firefox browser version 15.0.1 or later.
 
* Install Firefox browser version 15.0.1 or later.
* For online use: open with FireFox the designated [http://www.b-prog.org/BlocklyJS2/BP_Code/apps/BP  Blockly link]
+
* For online use: open with FireFox the designated [../BP_Code/apps/BP  Blockly link]
 
* For offline/local use on your computer:
 
* For offline/local use on your computer:
 
** Download the zip file containing the Blockly and JavaScript package from the download screen;
 
** Download the zip file containing the Blockly and JavaScript package from the download screen;
Line 14: Line 14:
 
** Open with Firefox the file BP_Code\apps\BP\index.html;
 
** Open with Firefox the file BP_Code\apps\BP\index.html;
 
* Look at example projects in the examples drop down, additional examples linked from this site, and the [http://bp-new-blockly.appspot.com/ tutorial]
 
* Look at example projects in the examples drop down, additional examples linked from this site, and the [http://bp-new-blockly.appspot.com/ tutorial]
 +
 +
= User Interface =
 +
 +
== Tabs ==
 +
The BP Blockly interface introduces four tabs: 
 +
* Blocks: In this tab, on the left is the 'pallet' or menu of Blockly blocks to choose from, and on the right is the canvas where the application is developed.
 +
* HTML: In this tab you program the HTML interfaces of your application, especially sensors and actuators.
 +
* Project Blocks: In this tab you can define new application-specific blocks. For example, application specific events.
 +
* JavaScript: This tab, shown in "debug" mode, shows the executable JavaScript generated from the Blockly code
 +
* XML: This tab, shown in "debug" mode, shows the text file where the entire application is stored.
 +
 +
== Navigation ==
 +
* To scroll click and drag the canvas up or down, or use the scroll bar.
 +
* Note that at initial loading parts of an application may be hidden and you may need to scroll up.
 +
* Actions: Right click offers a popup menu
 +
 +
= Programming =
 +
 +
* To create an application drag blocks onto the canvas
 +
* To create sensors and actuators, see <p><a href="../pres/agere2012 - Author Version.pdf"  class="btn primary">AGERE!2012 paper &raquo;</a></p>
 +
* Your application is not required to have its own GUI and HTML – you can experiment with creating interwoven behavioral flow just with events
 +
* B-thread priority:
 +
** Round robin: All b-threads have same priority. Events that are requested and not blocked are chosen from the different b-threads in turn.
 +
** Strict priority: All b-threads are ordered, as determined by their top down and left-to-right placement on the canvas.
 +
 +
* To create

Revision as of 15:01, 16 April 2014

BP Blockly User Guide

Introduction

BP is implemented in Google Blockly by introducing new programming blocks, and by using the co-routines (generators) facility of JavaScript. Behavioral programs written in Blockly are translated into and executed as JavaScript programs.

Installation / Getting started

  • Install Firefox browser version 15.0.1 or later.
  • For online use: open with FireFox the designated [../BP_Code/apps/BP Blockly link]
  • For offline/local use on your computer:
    • Download the zip file containing the Blockly and JavaScript package from the download screen;
    • Extract the zip file, preserving directory structure;
    • Open with Firefox the file BP_Code\apps\BP\index.html;
  • Look at example projects in the examples drop down, additional examples linked from this site, and the tutorial

User Interface

Tabs

The BP Blockly interface introduces four tabs:

  • Blocks: In this tab, on the left is the 'pallet' or menu of Blockly blocks to choose from, and on the right is the canvas where the application is developed.
  • HTML: In this tab you program the HTML interfaces of your application, especially sensors and actuators.
  • Project Blocks: In this tab you can define new application-specific blocks. For example, application specific events.
  • JavaScript: This tab, shown in "debug" mode, shows the executable JavaScript generated from the Blockly code
  • XML: This tab, shown in "debug" mode, shows the text file where the entire application is stored.

Navigation

  • To scroll click and drag the canvas up or down, or use the scroll bar.
  • Note that at initial loading parts of an application may be hidden and you may need to scroll up.
  • Actions: Right click offers a popup menu

Programming

  • To create an application drag blocks onto the canvas
  • To create sensors and actuators, see

    <a href="../pres/agere2012 - Author Version.pdf" class="btn primary">AGERE!2012 paper »</a>

  • Your application is not required to have its own GUI and HTML – you can experiment with creating interwoven behavioral flow just with events
  • B-thread priority:
    • Round robin: All b-threads have same priority. Events that are requested and not blocked are chosen from the different b-threads in turn.
    • Strict priority: All b-threads are ordered, as determined by their top down and left-to-right placement on the canvas.
  • To create