robertobucher / pysimCoder

Block diagram editor and real time code generator for Python
GNU General Public License v3.0
142 stars 31 forks source link

New file format in pysimCoder and subsystems #54

Closed robertobucher closed 4 months ago

robertobucher commented 2 years ago

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.

ppisa commented 2 years ago

Thnaks for the work on subsystems. This is the real need for larger designs...

Adding of ports and propagating their names to the superblocks would be great but can wait...

robertobucher commented 2 years ago

Hi

I did a lot of test and on my systems it seems that all is working on the right way. Please send me feedback if some problems appear.