KasperVaessen / WindReader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WindReader

This application was developed for the Wind Tunnel in the "PWS Lab" from the TU Delft. It should be adoptable for similar projects using Phidget.

Setting the project

Make sure to have the Phidghet22 drivers installed.

To make sure the software works as it supposed to, please use a Virtual Environment.

Go to the root of the project directory and setup a virtual environment. This project was developed in Python 3.9.13. It should also work on other versions, but I have not tested this.

python -m venv venv

Activate the virtual environment.

call venv\Scripts\activate

Install the dependencies using the package manager pip. This should be done inside the virtual environment.

pip install -r requirements.txt

Running the python project

Run the application inside the virtual environment

python src/main_application.py

Creating with Qt (designer)

The GUI of WindReader has been created with PySide6 (A version of PyQT available under the LGPL license.). To edit the GUI follow these steps.

Run the following command in the virtual environment.

pyside6-designer

This will open the designer application of Qt. Here you can open the ui file located in ui/main.ui.

In the editor you can edit the GUI however you want. Save the file after you are done.

To convert the gui to a python file the application can interact with, run the following command.

pyside6-uic ui/main.ui -o src/priv/mainwindow.py

Please do not edit the mainwindow.py file directly This file will be overwritten when the previous command is executed again. Instead edit it via main_application.py.

export to executable with pyinstaller

To compile the application to an executable which can directly be distributed without the user installing python, pyinstaller is used. To prevent windows from detecting the application as a trojan, please follow the following steps (You only have to do this once).

Create python bootloader

Make sure you are in the virtual environment.

Clone the pyinstaller repository

git clone https://github.com/pyinstaller/pyinstaller.git

Go to the root of the repository you just cloned and go the bootloader folder.

cd bootloader

Make the bootloader.

python ./waf all

return back to the root of the repository.

Add the new version of pyinstaller to pip.

pip install .

Create executable

Windows

pyinstaller src/main_application.py -n WindReader -w -i resources/icon.ico

MacOS

pyinstaller src/main_application.py -n WindReader -w -i resources/icon.icns

This will create an executable in the folder dist/WindReader.

Create windows installer with Inno Setup

Finally, for windows users, a installer can be created. For this you can use Inno Setup. The process speaks for itself. Do make sure you include the dist/WindReader/ folder when it asks for other application files.

About

License:MIT License


Languages

Language:Python 100.0%