mtm-x / OpenModelica-GUI

OpenModelica Model Launcher (OML)

Repository from Github https://github.commtm-x/OpenModelica-GUIRepository from Github https://github.commtm-x/OpenModelica-GUI

πŸš€ OpenModelica Model Launcher (OML)

πŸ“š Contents


πŸ” Overview

The OpenModelica Model Launcher (OML) is a graphical user interface (GUI) application designed to simplify the execution of Modelica simulations. This launcher allows you to:

  • Select Modelica model executables.
  • Configure simulation parameters such as start time and stop time.
  • Execute the selected model and generate output files in .mat format.
  • Visualize the simulation results using Matplotlib for detailed analysis.

✨ Features

  • User-Friendly GUI:

    • Simple design using PyQt6 for smooth user interaction.
    • Seamless integration of widgets for parameter configuration and model selection.
  • 🌐 Platform Support:

    • Linux
    • Windows
  • πŸŽ›οΈ Simulation Control:

    • Configure simulation start and stop times.
    • Execute Modelica models using the specified parameters.
    • Plot the model output when the "Plot the Output" button is pressed.
    • Receive real-time status updates during execution.
  • ⚠️ Error Handling and Notifications:

    • Real-time feedback on simulation success or failure with detailed logs.
    • Display user-friendly error and status messages via popups.
  • πŸ“ Logging:

    • Detailed logging system for debugging and analysis (log files and console output).
    • Configurable logging to ensure ease of troubleshooting.

πŸ› οΈ Technology Used

πŸ–₯️ Development & Tools

Python
PyQt6
OpenModelica
Matplotlib
SciPy
GitHub

🎨 Design & Assets

Flaticon

πŸ“œ Attribution

Icons from Flaticon.


🚦 Getting Started

πŸ”§ Prerequisites

The following software and dependencies must be installed on your system:

  1. Python 3.12.0 or higher.
  2. The following Python libraries installed using pip:
    • PyQt6 (for GUI development)
    • logging (for logging functionality)
    • matplotlib (for plotting results)
    • scipy (for handling .mat files)
    • qdarktheme (for dark theme support)
  3. OpenModelica simulation executable.

To install the required Python packages:( Only needed for GitHub installation)

pip install -r requirements.txt

or

pip3 install -r requirements.txt

πŸ› οΈ Installation

Installation via Executables

  1. Download the Executable:

    • Navigate to the Releases section of this repository.
    • Find the latest version and download the appropriate executable file for your operating system (e.g., .exe for Windows or a binary for Linux/Mac).
  2. Run the Executable:

    • For Windows:
      • Double-click the .exe file to launch the application.
    • For Linux:
      • Open a terminal in the directory containing the executable.
      • Run the file using:
        ./ModelLauncher_Lin_V1.0.0

Installation via GitHub

  1. Clone this repository to your local system:
    git clone https://github.com/mtm-x/OpenModelica-GUI
    cd OpenModelica-GUI
  2. The following Python libraries installed using pip:
    • PyQt6 (for GUI development)
    • logging (for logging functionality)
    • matplotlib (for plotting results)
    • scipy (for handling .mat files)
    • qdarktheme (for dark theme support)

To install the required Python packages: bash pip install -r requirements.txt or bash pip3 install -r requirements.txt

  1. Run the application:
    python ModelLauncher.py
    or
    python3 ModelLauncher.py

πŸ“– Usage Instructions

▢️ Step 1: Launching the Application

Run the script ModelLauncher.py using Python or launch the application.

βš™οΈ Step 2: Setting up the Simulation

  1. Select Model File: Click "Choose File" and browse for the Modelica model executable file.
  2. Set Start and Stop Time:
    • Enter the start and stop times for your simulation in the respective fields.
    • Ensure that the stop time is greater than the start time.
  3. Validate Parameters:
    • Once your parameters are set, click "Set" to validate the inputs.

πŸƒ Step 3: Running the Simulation

  • To generate a plot, ensure you check the "Plot the O/p" button before launching.
  • Click the "Launch" button to start the simulation.
  • The simulation will execute in the background with real-time progress tracking.
  • Notifications will display the results, indicating success or failure.

❓ Step 4: Additional Help

  • Click the "History" button to view recent simulation logs.
  • Use the "Docs" button to access detailed information about the application and relevant links.

πŸ› οΈ Example Workflow

  1. Model Selection: Choose a Modelica model executable (*.exe for Windows).
  2. Define Parameters:
    • Enter values for:
      • Start Time: 0
      • Stop Time: 5
  3. Simulation Launch:
    • Check the "Plot the O/p" option if you need to generate plots.
    • Click "Launch" to start the execution.
    • Check logs and notification pop-ups for results.

πŸ“ Logging

The application uses a centralized logging system to provide detailed analysis and debugging:

  • Console output for real-time monitoring.
  • Recent simulation data can be viewed using the "History" button.
  • Log files are saved as OPLauncher.log for deeper diagnostics.

πŸ“· Screenshot

  1. Home screen

Screenshot 2025-01-23 221824

  1. Themes

Screenshot 2025-01-23 221847

  1. Log History

Screenshot 2025-01-23 221901

  1. Docs

Screenshot 2025-01-23 222606

  1. Plot

Screenshot 2025-01-23 224410


πŸŽ₯ Demo

OML_Demo.mp4

For additional questions, contact: mahasel.1969@gmail.com.

About

OpenModelica Model Launcher (OML)


Languages

Language:Python 100.0%Language:Batchfile 0.0%