Skip to content

Backport fixes and features from the ipfedor fork #24

Description

@gsokoll

The fork https://github.com/ipfedor/codescribe (@ipfedor) is 13 commits ahead of main and contains several genuine fixes and features developed against non-IFM hardware (Xinje XS Studio OEM CODESYS) and large CFC/LD projects. After review, we plan to adopt the following by reimplementation, with credit to the fork in each PR:

Bug fixes (one PR)

  • Visualisation/POU name collision: a visualisation named like a POU exports to the same Name.xml and one overwrites the other. Fix: export visualisations as Name.vis.xml (fork commit 2e93ff4).
  • Mutation during iteration in remove_tracked_communication_devices.
  • Missing GUID mappings: persistent GVLs (261bd6e6) and methods without a return type (f89f7675) are currently skipped silently on export. Plus named entries for INTERFACE, TASK, IMAGEPOOL, TEXTLIST, GLOBAL_TEXTLIST, PROPERTY_METHOD.
  • Silent skip of objects with unmapped GUIDs during export (fork hit this with an LD nested inside a CFC, commit 7eaec7d): add a native-export fallback with a warning.
  • project_template.py uses scriptengine.projects.primary instead of its project parameter.
  • DUT import whitespace normalization for idempotent round-trips.

Staging-folder export (one PR)
Export to a staging folder and swap on success instead of rmtree up front, so a locked folder (Explorer, git, antivirus) or a mid-export failure no longer destroys the on-disk copy (fork commits bc6ec89, 1141d7d).

Device-tree siblings export/import (one PR)
Track Ethernet/Modbus/fieldbus devices that sit next to Plc Logic in the device tree (standard CODESYS layout, vs the IFM-style Communication node we already handle), exported to Device/devices/<name>.xml (fork commit 6e08a99).

Library export command (one PR)
Export Lib To Files for library projects, where objects hang off the project root rather than under a Device (fork commit a90c84a).

Not adopting for now: the external XML to ST converter integration, mojibake path repair, OEM install detection, and the gc/retry OutOfMemoryException workarounds. Reasons in the PRs.

@ipfedor thank you for the work in your fork. We are reimplementing rather than merging directly because our CI requires ASCII-only source and the on-disk formats have diverged, but review and testing of the PRs referencing this issue would be very welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions