Commit 2998cb53 authored by Adrian Wuillemet's avatar Adrian Wuillemet
Browse files

Deploy version 0.1.0

parent d3ab8448
Pipeline #4515 passed with stage
in 51 seconds
......@@ -171,11 +171,128 @@ $ beads parse machine1.bead controller2.json -l java -v -re -bd ../code/generate
# and placing the generated code from both files which will be java code into ../code/generated
```
Open the GUI:
All commands related to the Graphical User Interface are bound to 'gui':
```shell
$ beads gui [options]
# Options
$ beads gui
-b / --background # Run the gui in the background without opening a window
-p / --port # Run the gui on the specified port. Default: 8000
-v / --verbose # Run the gui in verbose mode. Default: false
--file FILE # Run the gui and load the provided FILE. Needs to be a valid json representation of a state machine.
# Examples
$ beads gui -v -p 11000
# Run the gui in verbose and on localhost:11000
$ beads gui --file ./stateMachine.json
# Open the gui and load the provided stateMachine.json to display upon loading
```
You can set some commandline options as default values that will be considered without having to provide them on the commandline. Providing options via commandline however will overwrite defaults.
```shell
$ beads options [options]
# Options
$ beads options
-s / --set-default OPTION VALUE # Set the default VALUE for OPTION
-u / --unset-default OPTION # Unset the default value for OPTION
--unset-all # Unset all currently saved defaults.
--show # Print a list of available Options and their data type
# Examples
$ beads options --show
# First prints all available options and then the overview of all currently set defaults
$ beads options --set-default language python
# Sets the default language used to generate code to python
$ beads options --unset-default language
# Unsets the default value of language
$ beads options -s port 11000 -s language java -u verbose
# Multiple -s / -u can be provided with one call:
# First unsets --verbose, then sets --port to 11000 and --language to java
$ beads options --unset-all
# Clears all saved default options
```
<br>
<br>
### 4. Using the Graphical User Interface
<a name="gui"></a>
The Graphical User Interface allows the drawing of simple fine state machines. You can draw states and transitions and save the whole graph in different file formats. A tutorial is available within the GUI!
<br>
All further functionality should be self-explanatory and is properly visualized in the gui.
<br>
<br>
### 5. Supported file formats
<a name="formats"></a>
State machines can be provided in textual representations. Currently there are two file formats that are supported by **Beads<sup>©</sup>**:
+ JSON: file.json
+ BEAD: file.bead
<br>
**Json format**
To provide a state machine as a JSON file follow the schema below:
Three attributes are required:
+ A **name** for the machine
+ A list of **nodes** with an "ID" representing the states
+ A list of **transitions** with "from" and "to" referencing nodes, and a "label"
To declare a state as the initial starting state append '"start":true' to the node.
```json
{
"name": "NAME",
"nodes": [
{"id":"ID1", "start":true},
{"id":"ID2"}
],
"transitions": [
{"from":"ID1", "label":"TRANS1", "to":"ID2"},
{"from":"ID2", "label":"TRANS2", "to":"ID1"}
]
}
```
<br>
**Bead format**
As an easy-to-write alternativ to json files we accept **.bead** files that adhere to the following format:
```
#! name:NAME start:ID1
ID1:TRANS1:ID2
ID2:TRANS2:ID1
```
The **.bead** format is transition based. All transitions follow the schema:<br>
FROM_STATE : TRNASITION_NAME : TO_STATE<br>
The name and the starting point are optional and can be declared as key:value pairs in a config comment on the top of the file.
The comment has to start with '#!' and is followed by a whitespace.
Parsing of **.bead** files will extract all referenced states so they do not have to be declared separately.
<br>
<br>
......@@ -188,8 +305,8 @@ We are building an open source lightweight tool for commandline usage with the f
___
![Python](https://img.stackshare.io/service/993/pUBY5pVj.png)
![Click](../documentation/media/click.png)
![Eel](../documentation/media/eel.png)
![Click](https://gitlab.beuth-hochschule.de/s40242/stategen/raw/master/documentation/media/click.png)
![Eel](https://gitlab.beuth-hochschule.de/s40242/stategen/raw/master/documentation/media/eel.png)
<br>
<br>
......
from os import path, listdir
# General
VERSION: str = '0.0.2'
VERSION: str = '0.1.0'
TOOL_NAME: str = 'Beads'
......
......@@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup(
name='Beads',
version='0.0.2',
version='0.1.0',
long_description=README,
long_description_content_type='text/markdown',
packages=find_packages(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment