Skip to content

azkikr316/Generator_Efficiency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🔧 Generator Efficiency Calculator

A simple Windows GUI application to calculate Diesel Generator parameters:

  • Electrical Output (kWe)
  • Mechanical Input (kWm)
  • Efficiency (%)

Built with Python Tkinter for educational and engineering purposes.


📊 Functions Available

Option Input Output
Calculate kWe Mechanical Input (kWm), Efficiency (%) Electrical Output (kWe)
Calculate kWm Electrical Output (kWe), Efficiency (%) Mechanical Input (kWm)
Calculate Efficiency Electrical Output (kWe), Mechanical Input (kWm) Efficiency (%)

💻 How to Run

1️⃣ Install Python 3.11+

Download Python


2️⃣ Install Dependencies

No external dependencies needed beyond standard Python.
Tkinter is included in standard Python distributions.


3️⃣ Run the App (Python Script)

python Alternator_Efficiency_kWm_to_kWe_GUI.py

📦 Build .exe with PyInstaller

Requires PyInstaller:

pip install pyinstaller

✅ Safer Build (Recommended)

pyinstaller --noconfirm --windowed --onedir ^
  --icon=black.ico ^
  --version-file=version.txt ^
  Alternator_Efficiency_kWm_to_kWe_GUI.py

The .exe will appear in the dist/Alternator_Efficiency_kWm_to_kWe_GUI/ directory.
This method avoids antivirus false positives caused by temp file unpacking in --onefile.


🔐 Self-Sign the EXE (Optional)

You can self-sign the executable to reduce security warnings using OpenSSL and osslsigncode.

🛠 1. Generate Self-Signed Certificate

openssl req -new -newkey rsa:2048 -nodes -x509 -days 365 \
  -keyout my_private.key -out my_cert.crt

🔐 2. Create .p12 Package

openssl pkcs12 -export -out my_cert.p12 \
  -inkey my_private.key -in my_cert.crt

✍️ 3. Sign the Executable

osslsigncode sign \
  -pkcs12 my_cert.p12 \
  -pass your_password \
  -n "Alternator Efficiency GUI" \
  -i "https://daikai.com" \
  -t http://timestamp.digicert.com \
  -in dist/Alternator_Efficiency_kWm_to_kWe_GUI/Alternator_Efficiency_kWm_to_kWe_GUI.exe \
  -out dist/Alternator_Efficiency_kWm_to_kWe_GUI/Alternator_Efficiency_kWm_to_kWe_signed.exe

✅ Verify the Signature (Linux)

osslsigncode verify dist/.../your_signed.exe

✅ Verify on Windows

Get-AuthenticodeSignature .\your_signed.exe

If Status shows UnknownError, import the my_cert.crt into the Windows Trusted Root Certification Authorities to trust the self-signed cert.


📂 Project Structure

/your-folder/
├─ Alternator_Efficiency_kWm_to_kWe_GUI.py
├─ black.ico
├─ version.txt
├─ my_cert.crt
├─ my_cert.p12
├─ my_private.key
└─ README.md

🖼️ Sample Screenshot

image

🛠 Features

✅ Simple & Lightweight
✅ GUI-based (No terminal needed)
✅ Engineering-friendly
✅ Includes version info, icon, and metadata
✅ Optionally signed .exe for improved trustworthiness


👤 Author

Romel Mendoza
Created for learning and practical engineering tools.


📝 License

Feel free to modify and distribute for educational or non-commercial use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages