Sunday, June 14, 2015

Although still in its early stages, I have managed to get ElixirFBP talking with NoFlo's Development Environment. This browser-based tool allows one to build flow-based programs and execute them. Below is partial screen shot of the tool showing the graph that I built:



In the picture I have added two components; set the initial values for the Math.Add component; and connected its output to Core.Output's in port. When you press on the start button (in the upper right hand corner), the value of the addition is printed in the console window where ElixirFBP is running.

NoFlo's tool works with any server/runtime that supports the NoFlo Network Protocol. If you recall, I made the decision, early on, to model the underlying architecture of ElixirFBP along the lines of this protocol. So, it wasn't too difficult to make the tool work with ElixirFBP. I haven't implemented all of the protocol, only those commands that allow you to add and remove components, edges and initial values and start the graph.

ElixirFBP now runs as a network server that is listening on a websocket connection for these Network Protocol commands. I'm using the websocket facilities offered by the Cowboy Erlang module described here. I am also using the Elixir Poison library for encoding and decoding the JSON messages. To start ElixirFBP, be in its top level directory and enter iex -S mix at the command prompt. I use the Elixir Logger to display information as the server receives commands.

I'm still learning how to use NoFlo's tool, so the following description of how to set up NoFlo's tool may not be completely accurate. I am running a local version of the development tool rather than the one available online. This version, called the noflo-ui, is available on Github here. I followed the directions found at this page. You will need to have node.js installed.

Once noflo-ui is installed and started, you can open it up in a browser by going to http://localhost:3005/index.html. On the opening page you will see a section entitled Runtimes. You need to let noflo-ui know that the ElixirFBP runtime is available. Click the Register button and in the dialog that shows, click on the Add manually button. Enter elixir-fbp as the Runtime name and for the Type field, choose Custom. Click the Create button and Close the original dialog. The elixir-fbp runtime will appear as a black rectangle. Click the rectangle - you should start seeing activity from the ElixirFBP server. noflo-ui is asking for the list of components that the elixir-fbp has available - only two at this point. The browser will now display a drawing area upon which you can begin assembling your program.

To start creating a flow-based program, click on the area in the upper left hand corner - a noflo-ui-assigned graph name. A list of components should appear - again, only two. Clicking on a component will place it in the drawing area. From this point on, you would add other components, begin connecting out ports to in ports and establishing initial values. Right-clicking on a component provides other facilities. I would suggest that you read the documentation that is available for using NoFlo's Development Environment.

My Github repository has all the code needed for building and running a limited FBP graph using NoFlo's Development Environment. Be warned: things are probably a little fragile!

No comments:

Post a Comment