Skip to content
Yoan Mollard edited this page Sep 20, 2016 · 2 revisions

Tools and meta applications

Meta applications, like any other Arbalet applications, work with an Arbalet table but provide services rather than being an actual game or program. There are distinguished from casual apps by being in arbalet.tools instead of arbalet.apps.

Arbasnap

Arbasnap is a bridge for the Snap! visual programming language. The programming interface of Snap! runs in a web browser. The Arbasnap app is a server that receives queries from the web programming interface and forwards them to the table.

1. Start the server

Run Arbasnap, it only opens a server listening to a port:

$ python -m arbalet.tools.snap

Bottle v0.12.8 server starting up (using WSGIRefServer())...
Listening on http://localhost:33450/
Hit Ctrl-C to quit.

As usual, you might want to disable the simulation and connect to the hardware with arguments -w -ng. Leave the server running in background.

2. Open the generic Snap! programming interface

Open the programming interface. This page is hosted by the University of Berkeley. Alternatively, you might want to download the Snap! server, this is only useful if you intend to program offline, running the online version works perfectly, even to create new blocks.

3. Load the XML file to program Arbalet from there

In the Snap! programming interface, select File > Import, and open the file arbapps/arbalet/tools/snap/xml/arbalet.xml. This file describes custom blocks dedicated to Arbalet as well as an example program lightening pixels.

4. You're done!

Click on the green flag (top right) to start the program. Then click on the "When I am clicked" panel, which triggers the execution of the blocks below it. You should see your simulation/table lightening each pixel progressively to cyan.

How can I go further with Snap?

As of October 2015, Arbasnap is a starting prototype and does not yet illustrate all the power of the Snap! programming language by defining high-level custom blocks to facilitate programming, e.g. draw geometric forms via sprites or regular blocks.

The basic blocks dedicated to Arbalet currently only allow to switch on or fade on pixels individually. You will find these blocks in the Motion category.

Sequencer

The sequencer is an application sequencing other yet other applications for demonstration purposes. In practice, it will launch and close applications according to a desired sequence file (JSON).

The JSON describes for each app, its parameters, a timeout in seconds, and/or whether it can be interrupted from a joystick.

The default sequence (i.e. the default JSON) showcases all existing applications.

Try:

$ python -m arbalet.tools.sequencer
$ python -m arbalet.tools.sequencer -h --sequence some_sequence.json  # Find all sequences in [this folder](https://github.com/arbalet-project/arbapps/tree/master/arbalet/tools/sequencer/sequences)

Arbaserver

Arbaserver is a server allowing to share hardware between several clients over the network to share, for instance, a single table among several students in a classroom.

It is currently only a draft and connecting several clients will result into conflicts. A full command-line server as well as its graphical user interface are on the TODO list.

$ python -m arbalet.tools.server