GithubHelp home page GithubHelp logo

robertobucher / pysimcoder Goto Github PK

View Code? Open in Web Editor NEW
137.0 20.0 31.0 23.21 MB

Block diagram editor and real time code generator for Python

License: GNU General Public License v3.0

Python 2.04% TeX 0.59% Makefile 0.21% C 95.78% C++ 0.89% HTML 0.30% Assembly 0.18% Shell 0.01%
python pysimcoder realtime-generator block-diagram-editor hybrid-simulation dynamical-systems

pysimcoder's Introduction

pysimCoder

Screenshot_2021-10-31_08-15-46

pysimCoder is a Rapid Prototyping application, that can be used to generate realtime code for different targets.

At present it is possible to generate code for Linux (with or without preempt-rt) on PC and Raspberry PI, for the BRIKI card (partially on the SAMD21 uC, see www.meteca.org) and for the NuttX RTOS.

The behaviour is similar to other RPC applications like Simulink and XCos.

pysimCoder can run in any Linux environment or in Windows using WSL. (at the bottom of this README is explained how to install pysimCoder in WSL)

Despite the fact that the main purpose of pysimCoder is to generate RT control code, it is also possible to perfom simple simulations mixing continous time and discrete time blocks.

Since 07.09.2022 pysimCoder implements subsystems (more than one block, right mouse click) and a new save format, based on json, which replaces the previous format of the files based on XML. Old files can be loaded and saved in the new format. The new format is better readable, because it can be simply opened by a python script like this:

import json
import pprint

fname = 'example.dgm'

f = open(fname,'r')
msg = f.read()
f.close()
fileDict = json.loads(msg)
pprint.pprint(fileDict)

Screenshot_2021-10-31_07-16-53

More info at the end of this file.

http://robertobucher.dti.supsi.ch/pysimcoder/

23.01.2019 [email protected]

Installation

A complete Makefile to install pysimCoder under Ubuntu or Debian can be found at this link

https://github.com/robertobucher/LinuxLabo

Other distirbution can be installed in similar ways.

Finally you launch the application from the command line. The .bashrc may have to be reloaded beforehand.

pysimCoder

pysimCoder as docker image

It is now possible to pull a docker image to run pysimCoder in a container.

Install docker (see https://docs.docker.com/engine/install/ubuntu/).

Download a pysimCoder image directly from the Docker Container page:

docker pull robertobucher/pysimcoder:latest

The image can be launched with

$ docker run --rm --env="DISPLAY" --net=host -v $XAUTHORITY:/tmp/.XAuthority -e XAUTHORITY=/tmp/.XAuthority robertobucher/pysimcoder:latest

At the prompt launch

psc

More info and the Dockerfile can be found at https://github.com/robertobucher/pysimCoder-Docker

pysimCoder in Windows

pysimCoder can run in Windows using the only decent MS Windows application -> WSL2.

Simply install some additional packages download pysimCoder and istall it.

    sudo apt-get update
    sudo apt-det dist-upgrade

The required packages are the same as in this link

https://github.com/robertobucher/LinuxLabo

The installation of pysimCoder is a little different under Windows because of the impossibility to install the nrt driver.

git clone https://github.com/robertobucher/pysimCoder
cd pysimCoder
make addfiles
make modules
make fmu
sudo make link
make user
make alias
make full_lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.