Skip to content

Battery Calculator is a cross-platform desktop application for calculating battery parameters. Supports Windows, macOS, and Linux. Ideal for engineers and developers needing precise battery data.

License

Notifications You must be signed in to change notification settings

MootSeeker/batteryCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battery Life Calculator 🔋

forthebadge forthebadge forthebadge

Overview 🌐

The Battery Life Calculator is a Python application designed to help users calculate the battery life of various devices and configurations. Built with the tkinter library for a graphical user interface (GUI), this tool provides a user-friendly way to input device specifications and view results in a dynamic Treeview table. It supports multiple calculation modes and offers a robust error handling system to ensure accurate calculations.

Features ✨

  • Multiple Calculation Modes:
    • Always ON Mode
    • Log Mode
    • Sleep Mode
  • User Input Fields:
    • Battery voltage and capacity
    • Power consumption for different modes
    • Consumer currents and voltages
    • Booster efficiency and self-discharge rate
  • Dynamic Results Display:
    • Results are shown in a sortable Treeview table
    • Users can filter results based on selected modes and probes
  • Error Handling:
    • Displays error messages for invalid input values

Getting Started 🚀

Prerequisites 📋

  • Python (3.x recommended)
  • Basic knowledge of Python and GUI programming.

Installation 💻

  1. Clone the repository:
    git clone https://github.com/mootseeker/batteryCalculator.git
    cd batteryCalculator
  2. Ensure Python is installed. This project uses tkinter, which is included with most Python installations by default.

Running the Application 🚀

  1. Start the application:

    python calculator.py
  2. Input Data:

    • Enter battery specifications in the provided fields.
    • Choose operating modes and probes from the listboxes.
    • Click the "Calculate" button to perform the calculations.
  3. View Results:

    • Results are displayed in the Treeview table.
    • Sort and filter results by selecting different modes and probes.
  4. Exit the Application:

    • Click the "Exit" button to close the application.

ToDo ✅

Code Overview 🧩

Key Functions

  • treeview_sort_column(tv, col, reverse): Sorts columns in the Treeview widget.
  • berechne_akkulaufzeit(): Calculates battery life based on user inputs.
  • berechne_laufzeit(akkuenergie_wh, leistung_watt, selbstentladung_prozent): Helper function for runtime calculation.
  • berechne_akkulaufzeit_always_on(...): Computes battery life for Always ON Mode.
  • berechne_akkulaufzeit_log_mode(...): Computes battery life for Log Mode.
  • berechne_akkulaufzeit_sleep_mode(...): Computes battery life for Sleep Mode.
  • get_selected_modus(): Retrieves selected modes from the Mode Listbox.
  • get_selected_probe(): Retrieves selected probes from the Probe Listbox.
  • beenden(): Exits the application.

GUI Elements

  • Input Fields: For entering specifications and power details.
  • Listboxes: For selecting modes and probes.
  • Buttons: For calculating and exiting the application.
  • Treeview: Displays results with sortable columns.

Statistics 📊

  • Commits: Commits
  • Open Issues: Open Issues
  • Pull Requests: Pull Requests
  • Stars: Stars
  • Forks: Forks

Languages Used in This Repository

  • Top Langs
  • Languages

License 📜

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

Contributing 🤝

Contributions are welcome! Please fork the repository, create a feature branch, commit your changes, and submit a pull request.

Contact 📧

For questions or feedback, please open an issue on the repository or contact MootSeeker.

Happy coding!

About

Battery Calculator is a cross-platform desktop application for calculating battery parameters. Supports Windows, macOS, and Linux. Ideal for engineers and developers needing precise battery data.

Topics

Resources

License

Stars

Watchers

Forks

Languages