Coder Social home page Coder Social logo

harshitahusts / pysimcoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robertobucher/pysimcoder

0.0 0.0 0.0 21.75 MB

Block diagram editor and real time code generator for Python

License: GNU General Public License v3.0

Shell 0.01% C++ 0.89% Python 1.80% C 96.00% Assembly 0.18% TeX 0.61% Makefile 0.21% HTML 0.31%

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

A Virtual Machine (Virtual Box) is available. Please write to me to get the address and password to download it.

It is also possible to get a docker image with pysimCoder using

docker pull robertobucher/pysimcoder

More info at the end of this file.

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

23.01.2019 [email protected]

Installation

Project requires Python 3.9 runtime to be present on the system. Installation instructions and scripts expect Debian derived distibution and may require adjustements on other systems.

Superuser privileges are necessary for installation of the compiled drivers.

In cases when environment doesn't fulfill the aforementioned conditions, a containerized deployment with one of the provided images is preferrable.

Install system dependencies and python libraries


sudo apt install gcc gfortran git cmake binutils emacs python3.9 python3-numpy \
    python3-scipy python3-sympy python3-matplotlib python3-pip jupyter-qtconsole \
    python3-lxml python3-pyqtgraph libopenblas-dev liblapack-dev libxml2-dev \
    libcomedi-dev python3-pyqt5

sudo pip install -r requirements.txt

Alternatively the dependencies can be installed with provided scripts:

sudo python3 ubuntu_dependency_installer.py
sudo python3 python_libs_install.py

Build and install the code as a superuser with:

sudo make

Set environment variables in user .bashrc

make user

You may also install modules for different targets as a normal user with:

make <target>

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 under WSL.

Simply install some additional packages download pysimCoder and istall it.

sudo apt-get install \
	gcc \
	gfortran \
	git \
	cmake \
	binutils \
	emacs \
	python3 \
	python3-numpy \
	python3-scipy \
	python3-sympy \
	python3-matplotlib \
	python3-pip \
	jupyter-qtconsole \
	python3-lxml \
	python3-pyqtgraph \
	libopenblas-dev \
	liblapack-dev \
	libxml2-dev \
	libcomedi-dev \
	python3-pyqt5 \
	python3-qwt \
	python3-serial \
	qt6-svg-dev

Then move to a directory where to install pysimCoder and do

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

pysimcoder's People

Contributors

robertobucher avatar michallenc avatar chiff avatar ppisa avatar beqirdio avatar oytis avatar jpodivin avatar

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.