Electrical Calculator

Logo

A comprehensive electrical engineering calculator suite built with Python and QML that provides tools for cable sizing, voltage drop calculations, vector and phase visualisation, basic electrical calculations and more.

Features

Core Calculations

Image Image Image Image Image

Getting Started

Prerequisites

Basic Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/electrical-calculator.git
    cd electrical-calculator
    
  2. Install virtual environment via virtualenv:
virtualenv venv
source venv/bin/activate
  1. Install dependencies:
    pip install -r requirements.txt
    
  2. Generate resources:
    pyside6-rcc resources.qrc -o data/rc_resources.py
    
  3. Run the application:
    python main.py
    

Building From Source

Windows Build

  1. Install build requirements:
    pip install -r build_requirements.txt
    
  2. Run the build script:
    python scripts/windows_build.py
    
  3. Create installer (requires NSIS):
    • Install NSIS from https://nsis.sourceforge.io/
    • Right-click installer/windows_installer.nsi and select “Compile NSIS Script”

The executable will be in the dist folder, and the installer will be created as ElectricalCalculator_Setup.exe.

Build Requirements

Cross-Platform Building

Building Windows Executable from Linux

  1. Install Wine:
    sudo apt install wine64
    
  2. Run cross-platform build script:
    python scripts/cross_build.py
    

The script will automatically:

pip install -r build_requirements.txt
python scripts/windows_build.py

Development

Project Structure

electrical-calculator/
├── qml/components/         # Reusable QML components
├── qml/components/menus/   # Define all menus here
├── qml/pages/              # Main application pages
├── qml/calculators/        # Calculators
├── data/                   # Data files and resources
├── icons/                  # Application icons
├── docs/                   # Documentation
└── scripts/                # Build automation scripts

License

This project is licensed under the MIT License - see the LICENSE file for details.