Skip to content

Commit

Permalink
Initial version.
Browse files Browse the repository at this point in the history
  • Loading branch information
cps-twinning committed Jan 28, 2018
0 parents commit d4e6f70
Show file tree
Hide file tree
Showing 28 changed files with 4,820 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Eclipse
.project
.pydevproject
7 changes: 7 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright <YEAR> <COPYRIGHT HOLDER>

Permission is hereby granted, free of charge, to any person obtaining a 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.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recursive-include cpstwinning/plcruntime *
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CPS Twinning makefile

LATEST_VERSION = 0.0.1
MININET = sudo -E mn

PYTHON = sudo -E python
PYTHON_OPTS =

# Twinning

twinning:
$(PYTHON) $(PYTHON_OPTS) run.py

clean-mininet:
sudo mn -c

56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# CPS Twinning

CPS Twinning is a framework for generating and executing digital twins that mirror cyber-physical systems (CPSs).

## Installation

CPS Twinning depends on [Mininet](http://mininet.org) and [MatIEC](https://bitbucket.org/mjsousa/matiec).

### Mininet

To install Mininet, follow the instructions provided by the [Mininet installation guide](http://mininet.org/download/).

### MatIEC

First, install the MatIEC dependencies flex and bison.
For example:
```
$ sudo apt-get update
$ sudo apt-get install flex
$ sudo apt-get install bison
```

Then, clone the MatIEC repository and build the two transcompilers:
```
$ hg clone ssh://hg@bitbucket.org/mjsousa/matiec
$ cd matiec
$ autoreconf -i
$ ./configure
$ make
```

After that, set the following environment variables:
```
$ export MATIEC_INCLUDE_PATH=/home/<user>/matiec/lib
$ export MATIEC_C_INCLUDE_PATH=/home/<user>/matiec/lib/C
$ export PATH=/home/<user>/matiec:$PATH
```

### CPS Twinning

Finally, clone this repository and install CPS Twinning:
```
$ git clone https://github.com/cps-twinning/cps-twinning.git
$ cd cps-twinning
$ virtualenv env
$ source env/bin/activate
(env)$ pip install .
```

## Usage

Now, to start CPS Twinning, run `make twinning`. The generation of digital twins from an [AutomationML](https://www.automationml.org) artifact can be initiated by executing `twinning <path_to_aml>`. An exemplary specification can be found at `misc/specification/ConveyorSystem.aml`.

Note that this project is only a proof of concept. As a consequence, there are currently many areas that need improvements. In particular, the functionality of the AutomationML parser is currently limited and may require manual adjustments.


Empty file added cpstwinning/__init__.py
Empty file.
Loading

0 comments on commit d4e6f70

Please # to comment.