How thiagoralves/openplc_editor works
This repo is a cross-platform desktop IDE (“OpenPLC Editor”) used to author PLC programs for the OpenPLC Runtime. It is a curated/modified distribution of:
• Beremiz (PLC IDE framework, PLCopen tooling, UI/editor workflow)
• MatIEC (IEC 61131-3 compiler toolchain)
Key architectural implication: this is not a client/server web app; it’s a local application that embeds/ships tooling (compiler) and produces artifacts consumed by an external runtime (OpenPLC Runtime).
• The desktop application as the primary system boundary
• The compiler toolchain (MatIEC) as an internal/packaged subsystem invoked by the IDE
• The outputs/artifacts produced (e.g., generated code, PLCopen project files) and where they go (OpenPLC Runtime / deployment target)
• The update/install flows (install scripts + optional “check for updates” cloning this repo)
File structure (what to map into components)
Top-level structure:
• editor/ → the IDE application (Beremiz-derived, Python3 + wxPython Phoenix per README)
• matiec/ → the IEC 61131-3 compiler (toolchain invoked by the editor)
• install.sh, install-gentoo.sh → Linux install orchestration (dependencies, setup)
• update.sh, update.cmd → update automation; implies “self-update / pull latest” mechanics
• distclean.sh → build/cleanup; suggests generated artifacts/cache
• revision → versioning/build metadata
• .gitmodules → vendored submodules (likely upstream Beremiz/MatIEC origins or dependencies)
What the README adds (architecture signals)
• Updated to Python3 + wxPython Phoenix → clearly indicates GUI layer + Python application logic.
• Windows/macOS installer downloaded from autonomylogic.com → external distribution channel.
• “Check for updates … clone this repository into your installed Editor” → an update subsystem that uses Git operations and network access to a repo origin.
Desktop GUI Application (Python3 + wxPython Phoenix)
• Lives under editor/
• Responsible for UI, project workflow, invoking toolchain
Compiler Toolchain (MatIEC executable/library)
• Lives under matiec/
• Invoked by the GUI application (likely as a subprocess / CLI tool, or via bindings—confirm by searching editor/ for calls into matiec)
Local File System / Workspace (Projects + Generated Artifacts)
• PLCopen project files, generated code, build outputs, temporary files
Install/Update Scripts
• install.sh, install-gentoo.sh, update.sh, update.cmd, distclean.sh
• These are “ops tooling containers” (not runtime, but essential to lifecycle)
Key interactions:
• GUI App ↔ File System: reads/writes project files and generated outputs
• GUI App → MatIEC: compile/build (pass source/intermediate files, receive artifacts/logs)
• Update tooling ↔ Git origin: fetch latest code
• Install scripts → OS/package manager: install dependencies (wxPython, Python deps, compiler deps)
You label where each runs: all local on the developer machine, but with optional network access for updates.
Goal: Show major internal modules. This is where you “separate into as many components as possible”.
• UI Layer (wxPython Views/Frames/Dialogs)
• Project Model / PLCopen Model
• In Beremiz-style IDEs, there’s typically a PLCopen XML model and project tree representation
• Editors
• Build/Compile Orchestrator
• Converts project model into compilable form
• Invokes MatIEC
• Collects diagnostics/errors and maps them back to editor locations
• Code Generation / Export
• Emits C code or runtime-specific artifacts (depending on MatIEC integration)
• Runtime/Deployment Integration (if present)
• Update Manager
• “Check for updates” feature that clones/pulls repo into installation
For MatIEC (matiec/), show pipeline components (verify by looking at MatIEC docs/source):
• Parser / Frontend
• Semantic analysis
• IR/AST
• Code generator (often to C)
• Compiler outputs (C files, headers, logs)
• UI → Project Model (commands, editing operations)
• Project Model → Build Orchestrator (build request)
• Build Orchestrator → MatIEC (compile)
• MatIEC → Build Orchestrator (errors, outputs)
• Build Orchestrator → UI (diagnostics panel)
• All modules → File System (read/write)
Technologies to annotate (only the ones that materially affect architecture)
• editor/: Python 3, wxPython Phoenix, (Beremiz-derived)
• matiec/: MatIEC (IEC 61131-3 compiler) (implementation language likely C/C++; confirm in subtree)
• OS targets: Windows / Linux / macOS
• Update mechanism: Git (clone/pull), scripts: bash, cmd
Practical “make it accurate” checklist (what to verify from the repo before finalizing)
• Where/how the editor invokes MatIEC (subprocess call? embedded lib? wrapper script?)
• What the artifact types are (C code? XML? binary? runtime package?)
• Any direct integration with OpenPLC Runtime (network deploy vs manual export)
• Where update feature points (remote URL, git remote, branching/tagging)
• Any additional internal services (e.g., symbol browser, plugin system, device config)