-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
49 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,84 @@ | ||
# **OpenModelica GUI Application** | ||
|
||
This project involves two parts: | ||
1. **Compiling a model** using OpenModelica to create an executable program. | ||
This project involves two parts: | ||
|
||
1. **Compiling a model** using OpenModelica to create an executable program. | ||
2. **Building a Python-based GUI application** to run the executable with specified parameters. | ||
|
||
--- | ||
|
||
## **Features** | ||
- Intuitive and functional GUI. | ||
- Input fields for: | ||
|
||
- **Intuitive and functional GUI**: Easy-to-use interface for running simulations. | ||
- **Input fields for**: | ||
- **Executable File**: The compiled model. | ||
- **Start Time**: The simulation start time (integer). | ||
- **Stop Time**: The simulation stop time (integer). | ||
- User specified `start time` and `stop time`. | ||
- Pythonic and PEP 8-compliant code. | ||
- Well-structured and modular design. | ||
- Proper input validation and meaningful error messages. | ||
--- | ||
|
||
## **Technologies Used** | ||
Python 3.12.6 | ||
- `PyQt6 for GUI` | ||
- `PyQt6==6.8.0` | ||
- `PyQt6-Qt6==6.8.1` | ||
- `PyQt6_sip==13.9.1` | ||
|
||
- Testing and Linting Tools | ||
- `black==24.10.0` | ||
- `flake8==7.1.1` | ||
- `pylint==3.3.3` | ||
- **User-specified time constraints**: Allows users to set `start time` and `stop time`. | ||
- **Pythonic and PEP 8-compliant code**: Ensures readability and maintainability. | ||
- **Well-structured and modular design**: Organized codebase for easy navigation and modification. | ||
- **Proper input validation and meaningful error messages**: Ensures robust and user-friendly experience. | ||
|
||
--- | ||
|
||
## **Installation Guide** | ||
## **Technologies Used** | ||
|
||
### **1. Prerequisites** | ||
- **Install Python 3.6+**: Download and install from [Python.org](https://www.python.org/). | ||
- **Install PyQt6**: | ||
```bash | ||
pip install PyQt6 | ||
``` | ||
- **Install OpenModelica**: Download and install from [OpenModelica.org](https://www.openmodelica.org/). | ||
- **Python 3.12.6** | ||
- **PyQt6 for GUI**: | ||
- `PyQt6==6.8.0` | ||
- `PyQt6-Qt6==6.8.1` | ||
- **OpenModelica**: For compiling the model into an executable. | ||
|
||
--- | ||
|
||
### **2. Steps to Compile the Model** | ||
1. **Download OpenModelica** and install it on a Windows 10/11 machine. | ||
2. Open the **OMEdit (OpenModelica Connection Editor)**. | ||
3. Download the **TwoConnectedTanks** model package from the provided link. | ||
4. **Load the model** in OMEdit: | ||
- Go to `File > Open Model/Library File` and select the model file. | ||
5. **Build (Compile) the Model**: | ||
- Select the `TwoConnectedTanks` model and click the **Simulate** button. | ||
- The compiled executable and its dependent files will be saved in the working directory. | ||
## **Installation** | ||
|
||
--- | ||
1. **Clone the repository**: | ||
|
||
### **3. Run the Python GUI** | ||
1. Fork the repo. | ||
2. Clone this repository: | ||
```bash | ||
git clone https://github.com/user_name/OpenModelica-GUI | ||
git clone https://github.com/yourusername/OpenModelica-GUI.git | ||
cd OpenModelica-GUI | ||
``` | ||
3. Run the Python application: | ||
```bash | ||
python main.py | ||
``` | ||
|
||
--- | ||
2. **Create a virtual environment**: | ||
|
||
## **Usage** | ||
1. Launch the GUI application. | ||
2. Use the **Browse** button to select the compiled executable. | ||
3. Enter valid `start time` and `stop time` (integer values, ensuring `0 <= start time < stop time < 5`). | ||
4. Click the **Run** button. | ||
```bash | ||
python -m venv venv | ||
source venv/bin/activate # On Windows use `venv\Scripts\activate` | ||
``` | ||
|
||
--- | ||
Here’s the **Testing** section in Markdown format: | ||
3. **Install the required packages**: | ||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
--- | ||
|
||
## **Testing the Code** | ||
## **Usage** | ||
|
||
This project uses **Flake8**, **Black**, and **Pylint** to ensure high code quality, proper formatting, and adherence to PEP 8 guidelines. | ||
1. **Run the GUI application**: | ||
|
||
### **1. Install Linters and Formatters** | ||
First, ensure all necessary testing dependencies are installed: | ||
```bash | ||
pip install -r requirements_test.txt | ||
``` | ||
```bash | ||
python main.py | ||
``` | ||
|
||
### **2. Testing Tools** | ||
2. **Using the GUI**: | ||
- **Browse**: Select the compiled executable file. | ||
- **Set Start Time**: Enter the simulation start time. | ||
- **Set Stop Time**: Enter the simulation stop time. | ||
- **Run**: Click the "Run" button to start the simulation. | ||
|
||
#### **a. Code Formatting with Black** | ||
Run Black to format your code automatically: | ||
```bash | ||
black . | ||
``` | ||
--- | ||
|
||
#### **b. Code Linting with Flake8** | ||
Use Flake8 to check for PEP 8 violations and other linting issues: | ||
```bash | ||
flake8 . | ||
``` | ||
## **License** | ||
|
||
#### **c. Static Analysis with Pylint** | ||
Run Pylint for an in-depth code analysis and suggestions: | ||
```bash | ||
pylint main.py | ||
``` | ||
This project is licensed under the MIT License. See the LICENSE file for details. | ||
|
||
--- | ||
## **Adherence to Requirements**: | ||
- Handles `0 <= start time < stop time < 5` validation correctly. | ||
- Successfully executes the model via the GUI. | ||
|
||
--- | ||
## **Acknowledgements** | ||
|
||
## **References** | ||
- [OpenModelica User's Guide](https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/simulationflags.html#simflag-override) | ||
- [Python PEP 8 Guidelines](https://peps.python.org/pep-0008/) | ||
- **OpenModelica**: For providing the tools to compile the model. | ||
- **PyQt6**: For the GUI framework. | ||
|
||
--- | ||
|
||
Made by [Garima](https://github.com/techy4shri)👩💻 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.