diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-12-02 13:36:55 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2024-12-02 13:36:55 +0100 |
| commit | 822fff770e80b427908de348000f6d43306089cc (patch) | |
| tree | 17e44350bc7b7436cb72e2372224441f14505a2b /source | |
| parent | 35b476a90b585186161ab91ef9b73d029a2ee834 (diff) | |
small file system bug fix
Diffstat (limited to 'source')
| -rw-r--r-- | source/main.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/main.py b/source/main.py index 62e47b2..20cc29b 100644 --- a/source/main.py +++ b/source/main.py | |||
| @@ -1,16 +1,25 @@ | |||
| 1 | from PySide6.QtWidgets import QApplication, QLabel, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget | 1 | from PySide6.QtWidgets import ( |
| 2 | QApplication, | ||
| 3 | QLabel, | ||
| 4 | QMainWindow, | ||
| 5 | QPushButton, | ||
| 6 | QLabel, | ||
| 7 | QVBoxLayout, | ||
| 8 | QWidget, | ||
| 9 | ) | ||
| 2 | from PySide6.QtCore import Qt | 10 | from PySide6.QtCore import Qt |
| 3 | from hardware_driver import lcd | 11 | import hardware_driver as lcd |
| 4 | import sys | 12 | import sys |
| 5 | 13 | ||
| 6 | 14 | ||
| 7 | L = lcd() | 15 | L = lcd() |
| 8 | 16 | ||
| 17 | |||
| 9 | class mainWindow(QMainWindow): | 18 | class mainWindow(QMainWindow): |
| 10 | def __init__(self): | 19 | def __init__(self): |
| 11 | super().__init__() | 20 | super().__init__() |
| 12 | self.setWindowTitle("I2C CONTROLLER") | 21 | self.setWindowTitle("I2C CONTROLLER") |
| 13 | self.setGeometry(200,100,800,300) | 22 | self.setGeometry(200, 100, 800, 300) |
| 14 | self.mainUI() | 23 | self.mainUI() |
| 15 | 24 | ||
| 16 | def mainUI(self): | 25 | def mainUI(self): |
| @@ -22,7 +31,7 @@ class mainWindow(QMainWindow): | |||
| 22 | 31 | ||
| 23 | self.button = QPushButton("Clear Screen", self) | 32 | self.button = QPushButton("Clear Screen", self) |
| 24 | self.button.clicked.connect(self.clear_screen) | 33 | self.button.clicked.connect(self.clear_screen) |
| 25 | 34 | ||
| 26 | layout = QVBoxLayout() | 35 | layout = QVBoxLayout() |
| 27 | layout.addWidget(self.label) | 36 | layout.addWidget(self.label) |
| 28 | layout.addWidget(self.button) | 37 | layout.addWidget(self.button) |
| @@ -33,9 +42,9 @@ class mainWindow(QMainWindow): | |||
| 33 | lcd.clear() | 42 | lcd.clear() |
| 34 | self.label.setText("Cleared the LCD screen", self) | 43 | self.label.setText("Cleared the LCD screen", self) |
| 35 | 44 | ||
| 45 | |||
| 36 | if __name__ == "__main__": | 46 | if __name__ == "__main__": |
| 37 | app = QApplication(sys.argv) | 47 | app = QApplication(sys.argv) |
| 38 | window = mainWindow() | 48 | window = mainWindow() |
| 39 | window.show() | 49 | window.show() |
| 40 | sys.exit(app.exec()) | 50 | sys.exit(app.exec()) |
| 41 | |||
