Flow Blocks Help
Summary
Flow Blocks is a work in progress.
This page is developed with the intention of introducing programming via a traditional flow chart.
A flow chart allows connecting blocks that have different shapes for different purposes.
Blocks
-
Assign allows creating equations like SUM = A + B.
-
Choose allows choosing a path to take based on comparing variables.
-
Display (to be implemented) allows printing to the device output.
-
Input (to be implemented) allows getting characters from the device input.
-
Label is a place holder for connecting multiple blocks.
-
Library (to be implemented) allows calling built-in library functions.
-
Method (to be implemented) allows creating and calling user defined functions.
-
Set allows setting the value of variables.
-
Start is the start point of a program and allows adding variables being used.
-
Stop is the stop point of a program and allows setting an exit code variable.
Tab Controls
Block Tab
Choosing the Block tab will allow adding, deleting, and connecting blocks.
-
Adding blocks:
Click and drag a block from the left side into the workspace.
When other blocks are in the workspace, match the top circle (input) of the
new block with the bottom (output) of an existing block.
-
Deleting blocks:
Click and drag an existing block to the black garbage can.
-
Connecting blocks:
Click and drag match the top circle (input) of a block to the bottom circle
(output) of another block.
Edit Tab
Choosing the Edit tab will allow changing the properties of blocks.
Blocks and property descriptions are listed below.
-
Assign Block:
Allows assigning expressions to a variable. An expression is like 1 + 2.
Any expression can be seen in the form "A operator B"
where A and B are numbers or variables.
Assign produces an equation of the form "V = A operator B".
-
The assign top left list box allows setting the variable to assign.
If there are no variables listed, then use the Start Block to
add a variable.
-
The assign top right list box allows setting the operator to use
in the expression.
For example select "+" to set V = 1 + 2.
-
The assign middle left list box allows setting the expression A
side type or variable.
-
The assign middle right value box allows setting the value of the
A side.
-
The assign bottom left list box allows setting the expression B
side type or variable.
-
The assign bottom right value box allows setting the value of the
B side.
The rules for numbers are the same as mentioned in the Set Block below.
Type selectors will show ERROR if there is a problem with the input.
Any ERROR must be corrected before the properties box can be closed.
Variables must be added to the Start block before they will show on this block.
-
Choose Block:
Allows making decisions based on comparing the contents of variables.
A choice is made based on the form "A comparison B".
-
The choose top left list box will set the left side variable used in
the comparison. If the list is empty, variables should be added to the
Start Block.
-
The choose top right list box sets the condition for comparison.
-
The choose bottom left list box will set the right side variable used in
the comparison. If the list is empty, variables should be added to the
Start Block.
-
The choose bottom right list box sets the path to take if the
comparison is true. The "Yes" path should be connected to a
Label Block or some other block.
The type selector will show ERROR if there is a problem with the input.
Any ERROR must be corrected before the properties box can be closed.
Variables must be added to the Start block before they will show on this block.
-
Label Block:
Allows connecting more than one block to a path.
The label block does not have any properties.
It is typically the destination of a Choose Block.
-
Set Block:
Allows setting a single variable to a value or another variable.
Variable types are VALUE, FLOAT, LETTER, STRING, and ERROR.
Selecting a new type will cause the value to be cleared.
Types are set automatically based on the value entered.
-
A VALUE is an integer like 14 or -2 or a HEX value like 0x1b.
Hex values must have 0x plus one more character.
Other characters will show an ERROR.
-
A FLOAT is a decimal floating point number such as 3.14.
Other characters will show an ERROR.
-
A LETTER is a character like a,b,c,A,B,C, etc....
A LETTER can also be a symbol like !,@,#,$,%, etc....
-
A STRING is a series of LETTERs enclosed in quotes (")
such as "Hello, World".
Just one quote is not good enough and will show an ERROR.
The type selector will show ERROR if there is a problem with the input.
Any ERROR must be corrected before the properties box can be closed.
Variables must be added to the Start block before they will show on this block.
-
Start Block:
Allows adding variables to the program and deleting variables.
If no variables are provided, the other blocks will not be of any value.
A Start (and a Stop) block must be added to the workspace before code can be created.
-
Stop Block:
Allows setting the return code for the program.
If no variable is selected, the return code will be the "rc" variable,
A Stop block must be added to the workspace before code can be created.
Code Tab
Displays the result of a Flow Blocks chart.
This lets a user "Select All" then Copy/Paste to their IDE.
Theoretically any language can be supported, but C is the only one at the moment.
It would be very useful to integrate this with programming a device.
Help Tab
Choosing the Help tab shows this page.
Future Enhancements
Would like to:
-
Add functionality to the blocks not yet implemented.
-
Define a way to save and load block descriptions.
-
Document the block action - code generator interface.
-
Add customized libraries for different use environments.
-
Add a simulation of micro-controlled devices.
-
Add more code generators for more languages.
-
Finish the help description and make it easier to read.
Copyright
Copyright (C) 2013 by John Steven Denson
All rights governed by the MIT license.
TERMS OF USE: MIT License
Permission is hereby granted, free of charge, to any person obtaining
copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.