Backport bug fixes from the ipfedor fork#25
Merged
Conversation
- export visualisations as <name>.vis.xml to avoid overwriting a POU of the same name (Main program + Main visualisation collided on Main.xml) - snapshot children before removing in remove_tracked_communication_devices (mutation during iteration skipped entries) - map GUIDs for persistent GVLs and methods without a return type, which were silently skipped on export; name INTERFACE, TASK, IMAGEPOOL, TEXTLIST, GLOBAL_TEXTLIST, PROPERTY_METHOD GUIDs without export mapping - fall back to native export with a warning for unmapped GUIDs instead of silently dropping the object (seen with an LD nested inside a CFC) - use the project parameter instead of scriptengine.projects.primary in project_template.py - normalize DUT declaration whitespace on import for idempotent round-trips Credit: reimplemented from ipfedor/codescribe commits 2e93ff4, 2dbb0939, 7eaec7d, 0dbb093. Refs #24.
This was referenced Jun 12, 2026
Contributor
Author
|
Live validation on CODESYS V3.5 SP11 (CR711s compound test project), automated via --runscript. Passed
Outstanding (GUI-only objects, ScriptEngine cannot create them)
|
Live GUI testing showed that adding a visualisation brings a Visualization Manager whose GUID was unmapped, so the UNKNOWN fallback exported it as Visualization Manager.xml. Importing that file makes CODESYS raise an interactive overwrite dialog on every Import From Files, which cannot be answered from a script. The manager, target/web visualisation and __VisualizationStyle objects are now named in the GUID map without an export function, so they stay in the project template like the other service objects. Visualisations themselves still export as .vis.xml. GUIDs confirmed live on SP11 (4d3fdb8f, 8e687a04) and via the mapping list in 18thCentury/CodeSys export.py (bc63f5fa, 0fdbf158).
Contributor
Author
|
GUI and hardware validation complete. All outstanding items pass. GUI objects (created in CODESYS SP11, exported, round-tripped)
Hardware
Found and fixed during validation (f3cfdea)
Round-trip diffs on the final run are limited to the two known benign classes (fresh object-GUID references in native xml after import recreates objects; one-time trailing-newline normalization on declarations). |
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #24. Reimplements six fixes from https://github.com/ipfedor/codescribe (commits 2e93ff4, 7eaec7d, 0dbb093) to our standards (ASCII source, English comments, no blanket exception swallowing).
Changes
Name.xml, one overwrote the other. Visualisations now export asName.vis.xml; import handles the new suffix, and old plain.xmlfiles still import through the existing bare-xml path. README migration note added.remove_tracked_communication_devices: children are now snapshotted withlist()before removal. Removing while iterating the live collection skips entries.261bd6e6) and methods without a return type (f89f7675) wereUNKNOWNand silently skipped on export. Both now export (as.gvl.xml/.gvl.stand.strespectively).import_gvlaccepts either GVL type when resolving the imported object. INTERFACE, TASK, IMAGEPOOL, TEXTLIST, GLOBAL_TEXTLIST, PROPERTY_METHOD GUIDs are named in the map but deliberately not given export functions yet.export_childnow falls back to a native export and prints a warning naming the object and GUID on failure, then walks the children.project_template.pyusedscriptengine.projects.primary.pathinstead of itsprojectparameter (latent, both callers pass primary today).strip() + "\n"likeimport_st, for byte-identical export/import/export round-trips.Live validation required before merge (CODESYS SP11 + CoDeScribe-test-2.project)
Main.standMain.vis.xmlexist; round-trip import; F11 with 0 errors.261bd6e6-249c-4232-bb6f-84c2fbeef430andf89f7675-27f1-46b3-8abb-b7da8e774ffd(the fork is the claim, not the evidence) and the files appear.OBJECT_TYPE_TO_EXPORT_FUNCTION, soremove_tracked_objectsdoes not remove them before import; importing such a file onto an existing object relies onimport_nativeconflict handling. Worth observing during validation.CI: ascii-check, IronPython compile, and import smoke all pass locally with IronPython 2.7.12.