Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenModelica Smart Runner 🚀

📌 Overview

OpenModelica Smart Runner is a Python-based GUI application built using PyQt6 that allows users to execute OpenModelica-generated simulation executables with custom parameters.

The application:

  • Runs compiled OpenModelica models (.exe)
  • Accepts simulation parameters (start time, stop time)
  • Handles runtime dependencies automatically
  • Provides a simple and user-friendly interface

🧠 Features

  • ✅ Execute OpenModelica simulation executables
  • ✅ Input validation (0 ≤ start < stop < 5)
  • ✅ Automatic runtime environment handling
  • ✅ Works with or without OpenModelica installed
  • ✅ Clean and intuitive GUI

📁 Project Structure

OpenModelica/
│
├── gui.py                      # Main PyQt6 GUI application
├── model/
│   ├── TwoConnectedTanks.exe   # Compiled OpenModelica model
│   └── ...                     # Supporting simulation files
├── dependencies/               # Fallback DLLs (Install from Drive)
│   └── ...                     # Required bin files/DLLs
├── requirements.txt            # Project dependencies
└── README.md                   # Documentation

⚙️ Requirements

  • Python 3.6+
  • PyQt6
  • OpenModelica (optional but recommended)

📦 Installation

1. Clone the repository

git clone https://github.com/Akhileswaran-K-R/OpenModelica.git
cd OpenModelica

2. Create virtual environment (recommended)

python -m venv venv
venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

▶️ How to Run

python gui.py

🧪 Usage Instructions

  1. Click Browse and select the executable from the model/ folder

  2. Enter:

    • Start Time
    • Stop Time
  3. Click Run Simulation

  4. Output (result.mat) will be generated in the model/ folder


🔄 Runtime Dependency Handling

The application intelligently handles runtime dependencies:

✅ Case 1: OpenModelica Installed

  • Uses OPENMODELICAHOME environment variable
  • Automatically adds /bin to PATH

✅ Case 2: OpenModelica NOT Installed

  • Uses DLLs from:
dependencies/

📥 If OpenModelica is NOT installed

You can download dependencies from:

👉 Download Link: Library files

After downloading:

  1. Extract the files to folder dependencies
  2. Copy the folder to the project root

⚠️ Important Notes

  • Ensure required .dll files are present in dependencies/ if OpenModelica is not installed
  • Input condition must satisfy:
0 ≤ start < stop < 5

🧠 How It Works

  • The GUI collects user inputs
  • Builds execution command:
-startTime=<value> -stopTime=<value>
  • Dynamically configures runtime environment
  • Executes the simulation using Python subprocess

🎯 Output

  • Simulation result file:
model/result.mat

📥 Download Desktop Application

You can download the application from:

👉 Desktop App

Steps:

  1. Download ZIP
  2. Extract
  3. Run gui_app.exe

💡 Future Improvements

  • 📊 Graph visualization of simulation results
  • 🧾 Live simulation logs in GUI
  • 🎛️ Variable selection for plotting
  • 🌙 Dark mode UI

👨‍💻 Author

Akhileswaran K.R.


About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages