svg-processor/project_config.md
2025-05-16 18:15:31 +04:00

2.1 KiB

Project Configuration (LTM)

This file contains the stable, long-term context for the project. It should be updated infrequently, primarily when core goals, tech, or patterns change.


Core Goal

Create a desktop application for extracting SVG elements and converting them to JSON format for automation systems, particularly Ignition SCADA. The tool enables users to process SVG files with customizable configurations and export the results in a standardized format compatible with industrial automation platforms.


Tech Stack

  • Language: Python 3.6+
  • GUI Framework: Tkinter
  • XML Processing: lxml
  • Image Processing: Pillow (PIL)
  • Numerical Operations: NumPy
  • Packaging: PyInstaller
  • Configuration: JSON

Critical Patterns & Conventions

  • Architecture: Modular design with separation between GUI and processing logic
  • Modules:
    • GUI Module: Handles user interface, configuration input, and results display
    • Processing Module: Manages SVG parsing, transformation, and JSON conversion
  • Configuration Management: JSON-based with backward compatibility support
  • Element Mapping System: Label prefix-based configurations for SVG elements
  • Matrix Transformations: Homogeneous coordinate matrices for transform calculations
  • Error Handling: Global exception handling with user-friendly messages
  • Threading: Background processing for UI responsiveness during operations
  • Entry Point: app_runner.py initializes the application

Key Constraints

  • Cross-platform Support: Primary focus on Windows with additional support for macOS and Linux
  • Performance: Must efficiently process complex SVG files with multiple elements
  • Output Format: Must conform to Ignition SCADA JSON schema requirements
  • Error Recovery: Must handle malformed SVG elements gracefully
  • Target Users: Industrial automation engineers with varying technical expertise

Tokenization Settings

  • Estimation Method: Character-based
  • Characters Per Token (Estimate): 4