2025-05-16 10:18:55 +04:00

2.5 KiB

SCADA vs DWG Manifest Comparison Tool

A Flask web application to compare and reconcile mechanical manifest data (chutes and conveyors) against extracted device data from DWG files and SCADA object metadata.

Features

  • Upload Excel files containing manifest and DWG data
  • Specify a GitHub repository URL containing SCADA JSON files
  • Compare names across all three data sources
  • Normalize names for consistent comparison (uppercase, strip whitespace)
  • View discrepancies in a user-friendly tabbed interface
  • Re-upload updated files for comparison against the same repository
  • Persistent storage of repository clones

Installation

  1. Clone this repository:

    git clone <repository-url>
    cd <repository-directory>
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    

Usage

  1. Start the Flask application:

    flask run
    
  2. Open your web browser and navigate to http://127.0.0.1:5000/

  3. On the homepage:

    • Enter the GitHub repository URL containing SCADA JSON files
    • Upload your Excel file containing the manifest data (must include a "Name" column)
    • Upload your Excel file containing the DWG data (must include a "Name" column)
    • Click "Compare" to proceed
  4. View the comparison results in the tabbed interface:

    • SCADA vs DWG: Compare SCADA names with DWG names
    • DWG vs Manifest: Compare DWG names with manifest names
    • SCADA vs Manifest: Compare SCADA names with manifest names
  5. To update files for re-comparison:

    • Use the form at the bottom of the results page
    • Upload new versions of the manifest and/or DWG files
    • The application will automatically pull the latest changes from the repository

Data Normalization

All names from the three sources are normalized for consistent comparison:

  • Leading and trailing whitespace is removed
  • All text is converted to uppercase
  • Duplicate names are removed from each source

Directory Structure

project/
├─ app.py                 # Main Flask application
├─ requirements.txt       # Python dependencies
├─ README.md              # This documentation
├─ clones/                # Repository clones storage
├─ templates/             # HTML templates
│  ├─ base.html           # Base template with common layout
│  ├─ index.html          # Homepage with upload form
│  └─ results.html        # Results page with comparison tabs
└─ static/                # Static assets
   ├─ css/                # CSS stylesheets
   └─ js/                 # JavaScript files