introduction to bitreactive

24
Building Blocks for Smart Applications Présenté par Ghassen Chaieb

Upload: ghassen-chaieb

Post on 09-Jan-2017

45 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Introduction to Bitreactive

Building Blocks for Smart Applications

Présenté par Ghassen Chaieb

Page 2: Introduction to Bitreactive

Ready-to-use Building Blocks!Why spend hours trying to understand a protocol or piece of hardware? Others may have already done the work for you,

Inside Reactive Blocks you will find a comprehensive library of building blocks ready-to-use in your application

Page 3: Introduction to Bitreactive

Reactive Blocks is a professional tool to build robust IoT

applications: Simpler, faster and safer.

Reactive Blocks is an     plugin

Page 4: Introduction to Bitreactive

How Reactive Blocks Works:

1. Discover existing

building blocks.

2. Build your application by combining the

blocks.

3. Deploy the automatically built

application package.

Page 5: Introduction to Bitreactive

Building Blocks for EverythingsAnything that can be writtenin code, can be encapsulated in a block. A block can represent a component, a function, parts of a system or a protocol.

Building blocks are available for many IoT standards, like MQTT, Kura, CoAP, Modbus and OPC UA.

Page 6: Introduction to Bitreactive

Building Blocks are Similar to APIsIn addition they contain a behavioral contract. This contract covers information about the sequence in which parameters must be provided, when parameters are expected and simple but effective timing information. The contracts ensures that building blocks are used and reused correctly.

Page 7: Introduction to Bitreactive

Make Applications from Building Blocks

You can use blocks from existing libraries by simply dropping them into  a new application.

Page 8: Introduction to Bitreactive

Applications are Structured in a Hierarchy of Building BlocksApplication

Blocks

SubBlock

Page 9: Introduction to Bitreactive

Analyze Applications AutomaticallyThe automatic analysis finds intricate design errors that a normal compiler cannot find. With the analysis, you can detect deadlocks, errors in synchronizations, race conditions and other behavior you did not think of. The analysis runs automatically on all building blocks, without any extra effort.

Page 10: Introduction to Bitreactive

Compile Executable Code from the Building BlocksThe compiler generates complete and executable applications from the building blocks. Again, this works completely automated, and you don't have to change anything in the generated code. The resulting code is event-driven and highly concurrent by construction, and runs efficiently.  

Building blocks The complete application

Page 11: Introduction to Bitreactive

InstallationReactive Blocks is an plugin, so installing it means installing a JDK (Java Developer Kit), then Eclipse and then Reactive Blocks.

To download or share building blocks and build applications, you will also need to register.

Step 1: Install Java

Step 2: Install Eclipse

Page 12: Introduction to Bitreactive

Step 3: Install Reactive Blocks In Eclipse, select Help / Eclipse Marketplace... The Marketplace Wizard should open. Search for "Reactive Blocks" Click on Install

Page 13: Introduction to Bitreactive

The Marketplace Wizard will ask you for the features to install:

By default, only the required Reactive Blocks base feature is selected. It allows you to build code on Java SE. In case you already know that you want to develop for OSGi or Eclipse Kura, select these features as well. If you are not sure, just install the required base feature.

Page 14: Introduction to Bitreactive

Step 4: Restart EclipseAfter the installation, restart Eclipse

Open the Reactive Blocks: Window → Open Perspective → Other... → Reactive Blocks

Page 15: Introduction to Bitreactive

Further Steps

• Import Examples or Reference Systems.

• Have a look at the Tutorials within the Documentation.http://reference.bitreactive.com/tutorials/http://reference.bitreactive.com/

• Read Essentials: Reactive Blocks in a Nutshell. http://reference.bitreactive.com/reference/essentials.html

Page 16: Introduction to Bitreactive

Getting Started

Page 17: Introduction to Bitreactive

Tutorial: Take a SelfieThis tutorial explains how to import, extend and run the example Selfie. This example uses speech synthesis to let you know when the picture will be taken so that you are preparedStep 1: Import the ExampleThe example is called (Level 1) Getting started: Take a Selfie and you can import it from within Reactive Blocks.• The imported project (Level 1) Getting started: Take a Selfie can be found within

tabProjects within the Blocks view to the left.• Double-click on the block Selfie Basic to open it.

Page 18: Introduction to Bitreactive
Page 19: Introduction to Bitreactive

Step 3: Build the Application

Before you can start the application, you need to generate it's code:• Right-click on the block Selfie Basic in the Blocks View to show the

menu.• Select Build → Select Build Target Platform …• In the platform dialog, select Java Standard Edition - J2SE as platform.• In the parameter dialog, leave the default values.• After the generation, the Package Explorer View will open with a new

project, called com.bitreactive.tutorial.selfie.selfiebasic_exe.

Page 20: Introduction to Bitreactive

It should look something like this:

Page 21: Introduction to Bitreactive

• This _exe project is a pure Java project, not dependent on anything from Reactive Blocks.• The generated code is based upon the graphical specification of

concurrent behavior and the java code within operations.• In principle, you may alter code in this project as you want. Just notice

that every time you build the system again, these changes are overwritten.

Step 4: Start the Application:• Since the application uses speech synthesis: Turn up your volume!• Right-click on file SelfieBasic.launch in the generated _exe project• Select Run As → 1 SelfieBasic

Page 22: Introduction to Bitreactive

Step 5: Extend the Application• Once the example is running, you may change it, just to play with

it. For example:• Save the taken picture to disk:• Drag and drop the block Image To JPEG (from the Camera and

utilities library) into the application block.• Add a fork and an activity edge to provide the added block with the taken

photo.• Give notice once the picture has been taken:• Add another instance of block Speak from the Speech (FreeTTS) library.• Add another operation, e.g. notice• Connect the new elements so that the user will be notified after the

picture has been taken.

Page 23: Introduction to Bitreactive

To make sure that everything is fine, analyse the new system! Choose Analyze from the blocks context menu:

Analysis is a powerful tool fro automatic verification making sure that all involved blocks are used as intended.

Page 24: Introduction to Bitreactive

Merci!