robertobucher / pysimcoder Goto Github PK
View Code? Open in Web Editor NEWBlock diagram editor and real time code generator for Python
License: GNU General Public License v3.0
Block diagram editor and real time code generator for Python
License: GNU General Public License v3.0
I've modified the files to work with both PyQt5 and PyQt6.
If the try to import he PyQt6 packages fails, pyimCoder starts with the packages of PyQt5.
Due to the new approach of PyQt6 in handling the enum values, it can happens that some errors appears.
Please, let me inform for every problem related to this issue.
I have made a model in pysimCoder, when I click on the "simulate" button and then when the simulation is finished I click on the plot block but the result from the plot does not appear and I got the following message: "This plot is stored under the tmp folder and can be opened with a double click". I am not sure why the plot window does not appear? If any of you have any problem would be nice to share any useful information :)
Second problem I have is, when I run the code from the tmp.py file , I got the following error:
ModuleNotFoundError: No module named 'supsisim'
Any suggestion how can I solve this? What should I install or do to be able to run the code?
I also attached the model.
Thank you in advance.
print.pdf
Every time 'Clone block' is invoked using GUI in editor, the program crashes completely.
Traceback shown below:
Traceback (most recent call last):
File "/home.nfs/beqirdio/Documents/PYTHON/toolbox/supsisim/editor.py", line 165, in cloneBlock
item.clone(QPointF(DP, DP))
File "/home.nfs/beqirdio/Documents/PYTHON/toolbox/supsisim/block.py", line 141, in clone
b = Block(None, self.scene, self.name, self.inp, self.outp,
File "/home.nfs/beqirdio/Documents/PYTHON/toolbox/supsisim/block.py", line 36, in __init__
raise ValueError('Needs 12 or 3 arguments; received %i.' % len(args))
ValueError: Needs 12 or 3 arguments; received 11.
Aborted
Improve export by adding NuttX current target (arch, chip, board) commit to NuttX mainline adds NUTTX_ARCH
, NUTTX_ARCH_CHIP
and NUTTX_BOARD
variables to NuttX export. We could use this to identify the target in export file and even to support multiple exported targets as a subdirectory of nuttx-targets
directory.
Ideally the build for specific target would be selected from GUI, which would also take care of blocks' source code compilation. This way the user would not have to go to CodeGen/nuttx/devices
and run make
manually. Similar approach could be used for other targets including Linux.
/dev/nrt and iopl(3) is not available non-x86 targets and even on x86 ones requires modification
of the system kernel installation by local or laboratory systems administrator.
I suggest to use single Linux linux_main_rt.c for all targets and conditionalize /dev/nrt and iopl(3)
sequence by some define which can be provided in template. Then it would be easy to have one
template without iopl access (i.e. rt.tmf) and another with it (i.e. rt_iopl.tmf).
I prepare pull request, only question is the C processor define name. Some options
I suggest to consider/discuss even some other minor changes.
Installation procedure described in README.md doesn't specify versions of individual dependencies, duplicates installation of certain system packages, like python-scipy
, in ubuntu_dependency_installer.py and in manual procedure, while leaving others, like gfortran
in only one.
Several of the packages, like already mentioned python-scipy
, were at some point renamed to python3-*
, reflecting new version of the python runtime used, and are no longer available under the original name in many distros[0], including recent releases of popular Fedora and Ubuntu distros. Additional, older README file, with different instructions is also an issue.
All things considered, current state of the instructions leads to unnecessary confusion and loss of time on the side of new users.
Potentially deterring contributors that would be otherwise interested in the project.
To improve the situation I'd propose one of the following changes.
pip
.I'd be willing to tackle points 1. trough 4. personally. With a view that rewriting the repo to use poetry might prove not prove worthwhile, depending on exploration of the option.
[0] https://pkgs.org/search/?q=python-scipy
[1] https://python-poetry.org/
Silicon-Heaven (SHV) is an open source communication infrastructure that implements an open protocol for data serialization. Support of SHV in pysimCoder allows the runtime tuning of model parameters and runtime block diagram introspection. This issue is an introduction to upcoming commits bringing SHV support to pysimCoder mainline. The complete manual will be presented on pysimCoder wiki.
The SHV support brings following major changes to code generation files:
New folder ExtLibs was added to pysimCoder root directory. Additional external libraries are downloaded into this folder if required.
LinuxRT and NuttX template makefiles were changed to include header files from SHV related external libraries if libraries are downloaded.
SHV related code is located in new folder CodeGen/Common/shv. The source code consists of four files:
Two additional structures added to pyblock.h for SHV support.
Documentation describing pysimCoder setting for SHV support and compilation of required additional applications can be found on pysimCoder wiki.
SHV can currently only read and write double parameters, integer parameters and lists are not supported.
Could it be possible to install pysimCoder inside an anaconda environement? This module could benefit from the Scipy, Numpy and Control modules already available in that Python distribution.
If it is not possible, could you explain what could I modify during the installation for such purpose?
I've been asked to modify the 2 plots system in order to have the execution/simulation time on the X-axis instead of the sample value.
I've implemented a temporary solution (not yet in repository) where i have this solution:
A better solution is to send the time value in the data exchanged with the block diagram, but in this case there are a lot of blocks to be changed (serial, TCP, and UDP output).
Discussion is open!
The last commit contains support for subsystems. There i s probably a lot of test to do, in order to validate this new feature.
To facilitate the storing of files containing subsystem, I changed the format used to store the ".dgm" files. Instead of the previous XML format, the new files are now saved in json format. This allows to better read the files using for example pprint.
import json
import pprint
fname = 'example.dgm'
f = open(fname,'r')
msg = f.read()
f.close()
fileDict = json.loads(msg)
pprint.pprint(fileDict)
The old file format can still be read and imported in pysimCoder.
In order to get the subsystems, simply chose the blocks (more than 1!) and create it using the right mouse click on one of the blocks.
Subsystems can be reopen with a double click. Modifications should be manually reloaded after closing the superblock window.
It is not possible to add port to superblocks yet.
Make the block flip such that the svg won't flip with it.
Hello! I am trying to run your tests to try generating C-code, but there are errors when I try to run any test file. They are different depending on the test. I would appreciate any help in resolving these issues!
This is using the docker image with the web-based NVC viewer.
Here are a few of the errors. I have a suspicion that I am doing something wrong.
/pysimCoder/Tests/ControlDesign/BallOnWheel
/pysimCoder/Tests/ControlDesign/Disks
The MZ_APO is Xilinx Zynq 7010 based education board used for Computer Architectures and Real-time Systems Programming courses at Czech technical University in Prague.
The VHDL FPGA design implemented for the curse provides multiple peripherals including support to connect two DC motor kits with incremental encoder feedback. Another advanced design includes PMSM motor control peripherals which allows to connect kit to PMSM motor power electronics as well.
The plan is use kits as another target to demonstrate pysimCoder.
@beqirdio (our thesis student) started to work on the inclusion of the MZ_APO support. Due to HW education goals, there is no driver on the Linux kernel side but peripherals are directly accessed by mmap. We decided to use MZ_APO specific MMIO registers sets directly for pysimCoder target. Support for three (red green blue) rotary encoder knobs has been implemented by @beqirdio as the initial demonstration. DC motor peripherals will follow. The pull request is in preparation.
There is initial version to include MZ_APO support provided for the discussion if it is acceptable
https://github.com/beqirdio/pysimCoder/tree/devel
There is one change in the generic code part as well which helps with diagnostic message print when
there is syntactic error in included RCPblk, it is very difficult to to find cause of failure to locate block
generation function import failure is silent. Limitation to *.py files has been required because else there
is reported huge amount of failures to import help files as the Python sources
Comments welcomed.
Dear Roberto:
I have been testing the new code for raspberry pi crosscompiling with pysimcoder. Great work. I am wondering if the spi devices to connect with the ADC/IMU blocks are particular ones or the code is generic and must be tuned depending on the selected chip.
Thanks
This new branch is an attempt to implement "subsystems" in pysimCoder. There are a lot of modifications compared to the previous versions:
A lot of tests are now required (I've implemented the code in this last 2 days...) !
I'm trying to make the block like the block like ±|u|^v.
Under folders "/pysimCoder-master/resources/blocks/blocks/",
with reference to ".xblk blocks",
under folders "/pysimCoder-master/BlockEditor/",
using defBlocks.py or xblk2Blk.py, I'm trying to make the block like the block like ±|u|^v
but I haven't been able to do it.
So I would appreciate it if you could provide samples targeting ±|u|^v.
Best regard.
Hello Roberto,
I am member of the EtherLab team (etherlab.org) and the creator of the EtherCos package (Scicos, EtherLab, EtherCAT) many years ago.
I am quite happy to see your new project.
I have started a new fork
https://github.com/igh-ab/pysimCoder/tree/master
to test several pysimcoder extension
Please feel free to comment or discuss my ideas.
Best regards
Andreas
I've begun to work with docker, in order to produce docker images and try the SW on other platforms (Mac and Windows).
I've tested the generated image under Linux and it correctly works. The file for the generation of the image are now provided in the disctro. The README.md file contains a short description of the steps required to generate the finale image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.