项目作者: robertobucher

项目描述 :
Simulink like editor for Python
高级语言: C
项目地址: git://github.com/robertobucher/pysimCoder.git
创建时间: 2019-01-07T09:30:00Z
项目社区:https://github.com/robertobucher/pysimCoder

开源协议:GNU General Public License v3.0

下载


" class="reference-link">pysimCoder pysimCoder

image

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:

  1. import json
  2. import pprint
  3. fname = 'example.dgm'
  4. f = open(fname,'r')
  5. msg = f.read()
  6. f.close()
  7. fileDict = json.loads(msg)
  8. pprint.pprint(fileDict)

image

More info at the end of this file.

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

23.01.2019 roberto.bucher@supsi.ch

Installation

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

  1. 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.

  1. 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:

  1. docker pull robertobucher/pysimcoder:latest

The image can be launched with

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

At the prompt launch

  1. 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.

  1. sudo apt-get update
  2. sudo apt-det dist-upgrade
  3. sudo usermod -aG sudo <your_username>
  4. touch /home/<your_username>/.bash_aliases
  5. sudo apt-get update && sudo apt-get upgrade -y

Otherway pip inside Makefile will not work

  1. export PIP_BREAK_SYSTEM_PACKAGES=1

python and pip

  1. sudo apt install make python3 python3-venv pip python3-pyqt5 python3-pyqt6

required to run uic

  1. sudo apt install pyqt6-dev pyqt6-dev-tools
  2. sudo apt-get install python3-pyqt5.qtsvg

headers

  1. sudo apt install linux-headers-rt-amd64 linux-image-rt-amd64

compilers

  1. sudo apt install build-essential gdb gcc gfortran cmake

required to build fmu

  1. sudo apt install libxml2-dev libxslt1-dev

required to build slycot

  1. sudo apt install -y libopenblas-dev

required to build full_lib

  1. sudo apt install libcomedi-dev

double check if everything installed

  1. pip install -r requirements.txt

The required packages are the same as in this link

  1. https://github.com/robertobucher/LinuxLabo

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

  1. git clone https://github.com/robertobucher/pysimCoder
  2. cd pysimCoder
  3. make addfiles
  4. make modules
  5. make fmu
  6. sudo make link
  7. make user
  8. make alias
  9. make full_lib