Skip to content

Blog

ConfigTools Industrial Automation Configurator Overview

🔗 GitLab repository: Utilities/ConfigTools

ConfigTools is a high-performance industrial graphical configuration application written in Qt/C++ (C++17). It is designed for the physical and logical deployment of modular automation systems, such as Siemens TIA Portal scenarios. The project includes a high-fidelity 42U cabinet simulation, intelligent hardware assembly collision detection, an undo/redo command stack, and a one-click engineering report generation engine.

  1. High-fidelity 42U cabinet simulation
    • Built on a precise 1U = 50px grid coordinate system, rendering a virtual cabinet with rulers and physical rails.
    • Supports drag interaction and Magnetic Snapping, with built-in real-time collision detection and physical rebound animation when a placement is invalid.
  2. Strict MVC data and graphics architecture
    • Uses a highly decoupled hierarchical tree structure: “cabinet -> device -> slot -> module”.
    • Supports runtime slot count changes and adaptive layout recalculation.
  3. Undo/redo command system based on QUndoStack
    • Implements the Command Pattern. Add, delete, drag-move, property changes, and slot adjustment actions are all captured by command objects, enabling seamless Undo / Redo.
  4. One-click “four-in-one” automated Excel report
    • Deeply integrates the open source QXlsx library and converts configuration results into expressive professional Excel reports with four worksheets:
      • Topology: intuitive graphical cabinet topology with intelligent cell merging.
      • BOM: lists each device type, physical slot position, quantity, and calculated unit price.
      • I/O Mapping: automatically derives and assigns logical I/O addresses for each signal channel.
      • Cost Analysis: calculates purchase costs for a single cabinet and the overall system, with support for multiple tax rates.
  5. Project lifecycle and packaging protection
    • Supports save validation, unsaved-exit prompts, and shortcut keys such as Ctrl+S / Ctrl+Shift+S.
    • Exports .ctproj compressed project packages with built-in ZIP serialization for collaboration and project archiving.
  6. Polished industrial theme and multilingual support
    • Uses a custom Catppuccin Mocha modern dark industrial QSS stylesheet to reduce eye strain during long configuration sessions.
    • Natively supports seamless runtime switching between Chinese and English.
ConfigTools/ (project root)
├── config/ # Default hardware library and system templates
├── docs/ # 11-phase development roadmap and detailed design docs
├── i18n/ # Translation source files (.ts / .qm)
├── src/ # Core business logic and UI code
│ ├── commands/ # Interaction command classes based on QUndoCommand
│ ├── core/ # Tree data model, configuration management, and ZIP serialization
│ ├── export/ # QXlsx report export and .ctproj read/write logic
│ ├── graphics/ # Cabinet, module, and wiring scene renderers (QGraphicsScene)
│ └── widgets/ # Property editor, device tree, and main window components
├── templates/ # Preset Excel templates for report export
├── tests/ # Unit test suite based on QtTest
└── third_party/ # Bundled dependencies, including QXlsx and miniz

[1]. about/index.md

[2]. README.md

QML-FFmpeg Project Overview and Technical Architecture

🔗 GitLab repository: Utilities/QML-FFmpeg

QML-FFmpeg is a high-performance, multi-threaded video player solution built with Qt Quick/QML, FFmpeg, and SDL2. The project focuses on a smooth migration from the traditional OpenGL/FBO offscreen rendering path to a modern Qt Quick Scene Graph / RHI (Rendering Hardware Interface) compatible rendering pipeline. This reduces the dependency on a specific graphics backend and provides cross-platform hardware-accelerated playback capabilities.

  1. RHI-compatible Scene Graph rendering
    • Replaces the outdated QQuickFramebufferObject path with Qt Quick Scene Graph nodes for video frame rendering, making the player compatible with the Qt 6 RHI rendering architecture.
  2. Decoupled multi-threaded pipeline
    • Separates demuxing, video decoding, and audio playback into independent threads, keeping the UI responsive while preserving smooth playback.
    • Uses SDL2 audio playback as the master clock for AV sync, providing stable audio-video synchronization.
  3. Three-stage smooth hardware acceleration fallback
    • Stage 1 (zero-copy GPU rendering): zero-copy rendering based on Direct3D11 / VA-API, mapping GPU textures directly.
    • Stage 2 (GPU-to-CPU copy rendering): uses av_hwframe_transfer_data() to copy NV12 and other hardware-decoded frames back to system memory, then submits them to the Scene Graph after high-performance color-space conversion. This path has resolved hardware frame pool deadlocks and avfilter filtering issues.
    • Stage 3 (pure CPU software decoding): when hardware acceleration initialization or transfer fails repeatedly, the player reloads within 5 frames and smoothly falls back to CPU decoding, such as YUV420P, without interrupting playback.
  4. Dual integration architecture
    • Supports both direct static integration of the player core in a standalone application and dynamic injection as an independent QML extension plugin.
  5. Ready-to-use deployment and validation
    • Provides CMake presets and automation scripts. On Windows, required FFmpeg/SDL2 DLLs and test videos are copied after build; Linux (Ubuntu) deployment is also designed to remain portable.
QML-FFmpeg (project root)
├── QML-FFmpeg.pro # Main subdirs project file, directly openable in Qt Creator
├── docs/ # Hardware/software validation checklists and technical design notes
├── QMLVideoPlayer-OpenGL/ # Standalone app mode: statically compiled player core and QML HUD
├── VideoPlugin-OpenGL/ # QML plugin module: dynamically loaded C++ plugin with shader resources
├── Video-QML/ # Plugin test shell: pure QML test app importing VideoPlugin 1.0
└── ThirdParty/ # Third-party dependencies: prebuilt FFmpeg & SDL2 binary SDKs via Git LFS

According to the upstream platform_hwa_checklist.md, the current validation status is:

  • Windows (NVIDIA physical machine): Stage 2 (GPU-to-CPU NV12 copy rendering) and Stage 3 software decoding have been fully validated, providing strong stability and fault tolerance. D3D11 zero-copy rendering is still pending final closure.
  • Linux (Ubuntu virtual machine): because there is no GPU passthrough, VA-API hardware decoding is unavailable. The application successfully falls back to Stage 3 pure software decoding, and playback plus the control UI work normally.
  • ARM / embedded platforms: planned work includes Rockchip MPP and Raspberry Pi V4L2 M2M hardware decoding, plus DRM / GLES zero-copy rendering.

[1]. about/index.md

[2]. platform_hwa_checklist.md

GitLab CI-CD Push to Repository

On gitlab-runner push changes to repository.

We assume that accessing repository with HTTPS method.

1. Add Personal Access Token (PAT) for Project

Section titled “1. Add Personal Access Token (PAT) for Project”

Ensure this token have the authority write_repository.

We assume that the variable name is GITLAB_PRIVATE_TOKEN, and value is the token created in first step.

Update git url with proper authority: git remote set-url origin "https://${GITLAB_PRIVATE_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"

The .gitlab-ci.yml looks like:

stages:
- build
- deploy
build:
stage: build
script:
- echo "Building your application..."
deploy:
stage: deploy
before_script:
- git remote set-url origin "https://${GITLAB_PRIVATE_TOKEN}@gitlab.com/${CI_PROJECT_PATH}.git"
script:
- echo "Deploying your application..."
- git add .
- git commit -m "Automated commit by GitLab CI/CD"
- git push origin

[1]. GitLab-CI-CD-with-GitLab-Runner

[2]. Git-Configuration

Anaconda Commands

  • conda update conda Update conda itself.
  • conda update anaconda Update Anaconda itself.
  • conda update --all Update all packages.

gcc-g++ parameters1. Compilation steps

  1. Preprocess and generate .i file 2. Convert the preprocessed files into assembly language and generate .s files 3. From assembly to object code, generate .o file 4. Connect the target code and generate an executable program2. Common parameters
  2. -c
    Only activate preprocessing, compilation, and assembly, do not connect, and generate obj (*.o) files
  3. -o
    Specify target file name
  4. -S
    Preprocessing + compilation, no assembly connection
  5. -E
    Only preprocessing
  6. -O0/-O1/-O2/-O3
    There are 4 levels of compiler optimization, -O0 has no optimization, -O1 is the default value, and -O3 has the highest optimization level.
  7. -g
    Generate debugging information at compile time
  8. -ggdb
    Generate debugging information that gdb can use when possible
  9. -w
    Does not generate any warning message
  10. -Wall
    Generate all warning messages
  11. -Wl,-options1,-options2
    Connection options
  12. -LLIBRARY
    Search the specified function library when connecting
  13. -IDIRECTORY (this is a capital i)
    Specify additional header file search paths
  14. -nostartfiles -nostdlib
    It is necessary to run bare metal without Linux. -nostartfiles does not connect to the system standard startup files. -nostdlib includes -nostartfiles and standard libraries.
  15. -static
    Static linking shared library files
  16. -shared
    Connect multiple target files to generate a shared library file ending in .a