From 9af16ad7272f4e1d068004fc4443db5d14f89b3c Mon Sep 17 00:00:00 2001 From: suchinton2001 Date: Fri, 20 Oct 2023 15:50:09 +0530 Subject: agl-demo-control-panel: Fix Svg icons scaling on Dashboard V1: - Use QtSvg to set icons for dashboard icons - Update Readme and install_package script for docker image V2: Clean up code and improve formatting V3: - Increase font size for UI files - Fix HVAC bug, Control panel no longer crashes when Temp goes out of range - Refactor blocking subscription updates when CP in use Bug-AGL: SPEC-4939 Signed-off-by: suchinton2001 Change-Id: I4f256d29fac614dd3e3c4193c2a08b230359906e --- README.md | 2 +- Widgets/Dashboard.py | 62 +- Widgets/HVACPage.py | 58 +- Widgets/ICPage.py | 71 +- Widgets/SteeringCtrlPage.py | 67 +- Widgets/settings.py | 65 +- docker/install_packages.sh | 3 +- extras/FeedCAN.py | 11 +- extras/FeedKuksa.py | 23 +- extras/Kuksa_Instance.py | 7 +- extras/UI_Handeler.py | 58 +- main.py | 94 ++- ui/Dashboard.ui | 293 ++++---- ui/HVAC.ui | 1558 +++++++++++++++++++------------------- ui/IC.ui | 1751 ++++++++++++++++++++++--------------------- ui/Settings_Window.ui | 154 +++- ui/SteeringControls.ui | 759 +++++++++++-------- 17 files changed, 2687 insertions(+), 2349 deletions(-) diff --git a/README.md b/README.md index 6256ccc..fb01471 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A PyQt5 application to simulate CAN Bus signals using Kuksa.val for the AGL Demo ```bash $ nano requirements.txt # -> Comment pyqt5 dependency using "#" - $ sudo apt install python3-pyqt5 python3-qtpy pyqt5-dev-tools + $ sudo apt install python3-pyqt5 python3-qtpy pyqt5-dev-tools python3-pyqt5.qtsvg -y ``` and skip to step 2 diff --git a/Widgets/Dashboard.py b/Widgets/Dashboard.py index e7e17a6..8b6a11f 100644 --- a/Widgets/Dashboard.py +++ b/Widgets/Dashboard.py @@ -14,12 +14,18 @@ limitations under the License. """ +from PyQt5 import QtCore, QtGui, QtWidgets +from extras.FeedKuksa import FeedKuksa import os import sys from PyQt5 import uic -from PyQt5 import QtWidgets +from PyQt5 import QtWidgets +from PyQt5.QtWidgets import * +from PyQt5.QtSvg import * from PyQt5.QtCore import pyqtSignal -from PyQt5 import QtCore, QtGui +from PyQt5.QtGui import QIcon +from PyQt5 import QtCore +from PyQt5 import QtSvg current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -27,14 +33,11 @@ current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(current_dir)) -from extras.FeedKuksa import FeedKuksa Form, Base = uic.loadUiType(os.path.join(current_dir, "../ui/Dashboard.ui")) # ======================================== -from PyQt5 import QtCore, QtGui, QtWidgets -from PyQt5.QtCore import pyqtSignal class Dashboard(Base, Form): """ @@ -64,33 +67,34 @@ class Dashboard(Base, Form): self.feed_kuksa = FeedKuksa() Dashboard_tiles = (self.DB_IC_Tile, - self.DB_HVAC_Tile, - self.DB_Steering_Tile, - self.DB_Settings_Tile) + self.DB_HVAC_Tile, + self.DB_Steering_Tile, + self.DB_Settings_Tile) DashboardTiles = QtWidgets.QButtonGroup(self) - + DashboardTiles.buttonClicked.connect(self.tile_clicked) for i, tile in enumerate(Dashboard_tiles): - self.set_icon(tile, 55) + self.set_icon(tile, 90) DashboardTiles.addButton(tile) - def set_icon(self, tile, size): - """ - Sets the icon for the given tile. - - Parameters: - - tile: The tile for which the icon needs to be set. - - size: The size of the icon. - """ + def set_icon(self, tile, icon_size): try: - icon = tile.icon() - if icon.availableSizes(): - pixmap = icon.pixmap(icon.availableSizes()[0]) - scaled_pixmap = pixmap.scaled(size, size, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - tile.setIcon(QtGui.QIcon(scaled_pixmap)) - tile.setIconSize(QtCore.QSize(size, size)) + if tile == self.DB_IC_Tile: + file = ":/Carbon_Icons/carbon_icons/meter.svg" + if tile == self.DB_HVAC_Tile: + file = ":/Carbon_Icons/carbon_icons/windy--strong.svg" + if tile == self.DB_Steering_Tile: + file = ":/Images/Images/steering-wheel.svg" + if tile == self.DB_Settings_Tile: + file = ":/Carbon_Icons/carbon_icons/settings.svg" + getsize = QtSvg.QSvgRenderer(file) + svg_widget = QtSvg.QSvgWidget(file) + svg_widget.setFixedSize(getsize.defaultSize()*2) + svg_widget.setStyleSheet("background-color: transparent;") + tile.setIcon(QIcon(svg_widget.grab())) + tile.setIconSize(QtCore.QSize(icon_size, icon_size)) except Exception as e: print(f"Failed to set icon: {e}") @@ -110,4 +114,12 @@ class Dashboard(Base, Form): elif tile == self.DB_Settings_Tile: self.parent().setCurrentIndex(4) - self.tileClickedSignal.emit() \ No newline at end of file + self.tileClickedSignal.emit() + + +if __name__ == '__main__': + import sys + app = QApplication(sys.argv) + w = Dashboard() + w.show() + sys.exit(app.exec_()) \ No newline at end of file diff --git a/Widgets/HVACPage.py b/Widgets/HVACPage.py index 312f82b..56d7f8b 100644 --- a/Widgets/HVACPage.py +++ b/Widgets/HVACPage.py @@ -14,6 +14,7 @@ limitations under the License. """ +from extras.FeedKuksa import FeedKuksa import os import sys from PyQt5 import uic @@ -25,12 +26,12 @@ current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(current_dir)) -from extras.FeedKuksa import FeedKuksa Form, Base = uic.loadUiType(os.path.join(current_dir, "../ui/HVAC.ui")) # ======================================== + class HVAC_Paths(): def __init__(self): self.leftTemp = "Vehicle.Cabin.HVAC.Station.Row1.Left.Temperature" @@ -38,9 +39,10 @@ class HVAC_Paths(): self.rightTemp = "Vehicle.Cabin.HVAC.Station.Row1.Right.Temperature" self.rightFanSpeed = "Vehicle.Cabin.HVAC.Station.Row1.Right.FanSpeed" - # temperatureList contains values from 32 to 16 + # temperatureList contains values from 32 to 16 self.temperatureList = [str(i) + "°C" for i in range(32, 15, -1)] + class HVACWidget(Base, Form): """ A widget for controlling HVAC settings. @@ -58,42 +60,52 @@ class HVACWidget(Base, Form): super(self.__class__, self).__init__(parent) self.setupUi(self) - + self.HVAC = HVAC_Paths() self.feed_kuksa = FeedKuksa() - + self.leftTempList = self.findChild(QListWidget, "leftTempList") self.leftTempList.addItems(self.HVAC.temperatureList) self.leftTempList.setCurrentRow(0) self.leftTempList.itemClicked.connect(self.leftTempListClicked) - self.leftTempList.itemSelectionChanged.connect(self.leftTempListClicked) + self.leftTempList.itemSelectionChanged.connect( + self.leftTempListClicked) self.leftTempList.wheelEvent = lambda event: None self.rightTempList = self.findChild(QListWidget, "rightTempList") self.rightTempList.addItems(self.HVAC.temperatureList) self.rightTempList.setCurrentRow(0) self.rightTempList.itemClicked.connect(self.rightTempListClicked) - self.rightTempList.itemSelectionChanged.connect(self.rightTempListClicked) + self.rightTempList.itemSelectionChanged.connect( + self.rightTempListClicked) self.rightTempList.wheelEvent = lambda event: None self.leftTempUp = self.findChild(QPushButton, "leftTempUp") - self.leftTempUp.clicked.connect(lambda: self.leftTempList.setCurrentRow(self.leftTempList.currentRow() - 1)) + self.leftTempUp.clicked.connect( + lambda: self.leftTempList.setCurrentRow(self.leftTempList.currentRow() - 1)) self.leftTempDown = self.findChild(QPushButton, "leftTempDown") - self.leftTempDown.clicked.connect(lambda: self.leftTempList.setCurrentRow(self.leftTempList.currentRow() + 1)) + self.leftTempDown.clicked.connect( + lambda: self.leftTempList.setCurrentRow(self.leftTempList.currentRow() + 1)) self.rightTempUp = self.findChild(QPushButton, "rightTempUp") - self.rightTempUp.clicked.connect(lambda: self.rightTempList.setCurrentRow(self.rightTempList.currentRow() - 1)) + self.rightTempUp.clicked.connect( + lambda: self.rightTempList.setCurrentRow(self.rightTempList.currentRow() - 1)) self.rightTempDown = self.findChild(QPushButton, "rightTempDown") - self.rightTempDown.clicked.connect(lambda: self.rightTempList.setCurrentRow(self.rightTempList.currentRow() + 1)) + self.rightTempDown.clicked.connect( + lambda: self.rightTempList.setCurrentRow(self.rightTempList.currentRow() + 1)) - self.leftFanSpeed_slider = self.findChild(QSlider, "leftFanSpeed_slider") - self.leftFanSpeed_slider.valueChanged.connect(self.leftFanSpeed_sliderChanged) + self.leftFanSpeed_slider = self.findChild( + QSlider, "leftFanSpeed_slider") + self.leftFanSpeed_slider.valueChanged.connect( + self.leftFanSpeed_sliderChanged) - self.rightFanSpeed_slider = self.findChild(QSlider, "rightFanSpeed_slider") - self.rightFanSpeed_slider.valueChanged.connect(self.rightFanSpeed_sliderChanged) + self.rightFanSpeed_slider = self.findChild( + QSlider, "rightFanSpeed_slider") + self.rightFanSpeed_slider.valueChanged.connect( + self.rightFanSpeed_sliderChanged) def leftTempListClicked(self): """ @@ -101,10 +113,7 @@ class HVACWidget(Base, Form): Sends the selected temperature value to the feed_kuksa object. """ - item = self.leftTempList.currentItem() - self.leftTempList.scrollToItem(item, 1) - self.feed_kuksa.send_values(self.HVAC.leftTemp, item.text()[:-2]) - print(item.text()) + self.setTemperature(self.leftTempList, self.HVAC.leftTemp) def rightTempListClicked(self): """ @@ -112,10 +121,14 @@ class HVACWidget(Base, Form): Sends the selected temperature value to the feed_kuksa object. """ - item = self.rightTempList.currentItem() - self.rightTempList.scrollToItem(item, 1) - self.feed_kuksa.send_values(self.HVAC.rightTemp, item.text()[:-2]) - print(item.text()) + self.setTemperature(self.rightTempList, self.HVAC.rightTemp) + + def setTemperature(self, list_widget, path): + item = list_widget.currentItem() + if item is not None: + list_widget.scrollToItem(item, 1) + self.feed_kuksa.send_values(path, item.text()[:-2]) + print(item.text()) def leftFanSpeed_sliderChanged(self): """ @@ -137,6 +150,7 @@ class HVACWidget(Base, Form): self.feed_kuksa.send_values(self.HVAC.rightFanSpeed, str(value)) print(value) + if __name__ == '__main__': import sys app = QApplication(sys.argv) diff --git a/Widgets/ICPage.py b/Widgets/ICPage.py index 2d11cdf..d4d6592 100644 --- a/Widgets/ICPage.py +++ b/Widgets/ICPage.py @@ -14,6 +14,7 @@ limitations under the License. """ +from extras.FeedKuksa import FeedKuksa import os import sys from PyQt5 import uic, QtCore, QtWidgets @@ -24,6 +25,7 @@ import time from PyQt5.QtWidgets import QWidget from qtwidgets import AnimatedToggle import threading +import logging current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -31,7 +33,6 @@ current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(current_dir)) -from extras.FeedKuksa import FeedKuksa Form, Base = uic.loadUiType(os.path.join(current_dir, "../ui/IC.ui")) @@ -65,9 +66,9 @@ class ICWidget(Base, Form): """ super(self.__class__, self).__init__(parent) self.setupUi(self) - + self.IC = IC_Paths() - #self.vehicle_simulator = VehicleSimulator(self) + # self.vehicle_simulator = VehicleSimulator(self) self.feed_kuksa = FeedKuksa() self.feed_kuksa.start() @@ -142,8 +143,10 @@ class ICWidget(Base, Form): """ speed = int(self.Speed_slider.value()) self.Speed_monitor.display(speed) - try: self.feed_kuksa.send_values(self.IC.speed, str(speed), 'value') - except Exception as e: print(e) + try: + self.feed_kuksa.send_values(self.IC.speed, str(speed), 'value') + except Exception as e: + logging.error(f"Error sending values to kuksa {e}") def update_RPM_monitor(self): """ @@ -151,24 +154,31 @@ class ICWidget(Base, Form): """ rpm = int(self.RPM_slider.value()) self.RPM_monitor.display(rpm) - try: self.feed_kuksa.send_values(self.IC.engineRPM, str(rpm), 'value') - except Exception as e: print(e) + try: + self.feed_kuksa.send_values(self.IC.engineRPM, str(rpm), 'value') + except Exception as e: + logging.error(f"Error sending values to kuksa {e}") def update_coolantTemp_monitor(self): """ Updates the coolant temperature monitor with the current coolant temperature value. """ coolantTemp = int(self.coolantTemp_slider.value()) - try: self.feed_kuksa.send_values(self.IC.coolantTemp, str(coolantTemp), 'value') - except Exception as e: print(e) + try: + self.feed_kuksa.send_values( + self.IC.coolantTemp, str(coolantTemp), 'value') + except Exception as e: + logging.error(f"Error sending values to kuksa {e}") def update_fuelLevel_monitor(self): """ Updates the fuel level monitor with the current fuel level value. """ fuelLevel = int(self.fuelLevel_slider.value()) - try: self.feed_kuksa.send_values(self.IC.fuelLevel, str(fuelLevel)) - except Exception as e: print(e) + try: + self.feed_kuksa.send_values(self.IC.fuelLevel, str(fuelLevel)) + except Exception as e: + logging.error(f"Error sending values to kuksa {e}") def hazardBtnClicked(self): """ @@ -192,13 +202,12 @@ class ICWidget(Base, Form): self.leftIndicatorBtn.setChecked(self.hazardBtn.isChecked()) self.rightIndicatorBtn.setChecked(self.hazardBtn.isChecked()) - try: + try: self.feed_kuksa.send_values(self.IC.leftIndicator, value) self.feed_kuksa.send_values(self.IC.rightIndicator, value) self.feed_kuksa.send_values(self.IC.hazard, value) except Exception as e: - print(e) - + logging.error(f"Error sending values to kuksa {e}") def leftIndicatorBtnClicked(self): """ @@ -219,8 +228,10 @@ class ICWidget(Base, Form): painter.end() self.leftIndicatorBtn.setIcon(QIcon(leftIndicatorIcon)) - try: self.feed_kuksa.send_values(self.IC.leftIndicator, value) - except Exception as e: print(e) + try: + self.feed_kuksa.send_values(self.IC.leftIndicator, value) + except Exception as e: + logging.error(f"Error sending values to kuksa {e}") def rightIndicatorBtnClicked(self): """ @@ -241,11 +252,10 @@ class ICWidget(Base, Form): painter.end() self.rightIndicatorBtn.setIcon(QIcon(rightIndicatorIcon)) - try: + try: self.feed_kuksa.send_values(self.IC.rightIndicator, value) except Exception as e: - print(e) - + logging.error(f"Error sending values to kuksa {e}") def accelerationBtnPressed(self): """ @@ -309,9 +319,9 @@ class ICWidget(Base, Form): self.reverseBtn: "-1", self.neutralBtn: "0" } - + checked_button = self.driveGroupBtns.checkedButton() - + if checked_button in gear_mapping: gear_value = gear_mapping[checked_button] self.accelerationBtn.setEnabled(True) @@ -320,10 +330,11 @@ class ICWidget(Base, Form): try: self.feed_kuksa.send_values(self.IC.selectedGear, gear_value) except Exception as e: - print(e) + logging.error(f"Error sending values to kuksa {e}") else: print("Unknown button checked!") + class AccelerationFns(): def calculate_speed(time, acceleration) -> int: # acceleration = 60 / 5 # acceleration from 0 to 60 in 5 seconds @@ -353,7 +364,8 @@ class AccelerationFns(): engine_rpm = wheel_rps * gear_ratios[current_gear - 1] * 60 return int(engine_rpm) - + + class VehicleSimulator(QObject): # Define signals for updating speed and rpm speed_changed = pyqtSignal(int) @@ -399,11 +411,11 @@ class VehicleSimulator(QObject): self.brake(40, 2000, 4) self.accelerate(90, 3000, 5) self.brake(1, 650, 5) - + # Ensure reset is called when not in cruise mode if not self.running: self.reset() - + time.sleep(5) def accelerate(self, target_speed, target_rpm, duration): @@ -432,19 +444,19 @@ class VehicleSimulator(QObject): self.rpm_changed.emit(int(self.engine_speed)) time.sleep(1 / self.freq) - def increase(self, bycruise = True): + def increase(self, bycruise=True): if self.CRUISEACTIVE: target_speed = self.vehicle_speed + 5 target_rpm = self.engine_speed * 1.1 self.accelerate(target_speed, target_rpm, 2, bycruise) - def decrease(self, bycruise = True): + def decrease(self, bycruise=True): if self.CRUISEACTIVE: target_speed = self.vehicle_speed - 5 target_rpm = self.engine_speed * 0.9 self.brake(target_speed, target_rpm, 2, bycruise) - def resume(self, bycruise = True): + def resume(self, bycruise=True): target_speed = self.CRUISESPEED target_rpm = self.CRUISERPM current_speed = self.get_vehicle_speed() @@ -453,8 +465,9 @@ class VehicleSimulator(QObject): else: self.brake(target_speed, target_rpm, 2, bycruise) + if __name__ == '__main__': app = QApplication(sys.argv) w = ICWidget() w.show() - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/Widgets/SteeringCtrlPage.py b/Widgets/SteeringCtrlPage.py index de3585d..a610f9b 100644 --- a/Widgets/SteeringCtrlPage.py +++ b/Widgets/SteeringCtrlPage.py @@ -14,6 +14,9 @@ limitations under the License. """ +from . import settings +import extras.FeedCAN as feed_can +from extras.FeedKuksa import FeedKuksa import os import sys from PyQt5 import uic @@ -25,78 +28,78 @@ current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(current_dir)) -from extras.FeedKuksa import FeedKuksa -import extras.FeedCAN as feed_can -from . import settings -Form, Base = uic.loadUiType(os.path.join(current_dir, "../ui/SteeringControls.ui")) +Form, Base = uic.loadUiType(os.path.join( + current_dir, "../ui/SteeringControls.ui")) # ======================================== + class Steering_Paths(): def __init__(self): self.switches = { "VolumeUp": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeUp", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeUp", "CAN": "021#FFFFFFFF40000000"}, "VolumeDown": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeDown", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeDown", "CAN": "021#FFFFFFFF10000000"}, "VolumeMute": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeMute", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.VolumeMute", "CAN": "021#FFFFFFFF01000000"}, "Mode": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Mode", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Mode", "CAN": "021#FFFFFFFF20000000"}, "NextTrack": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Next", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Next", "CAN": "021#FFFFFFFF08000000"}, "PreviousTrack": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Previous", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Previous", "CAN": "021#FFFFFFFF80000000"}, "Info": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Info", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Info", "CAN": "021#FFFFFFFF02000000"}, "PhoneCall": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.PhoneCall", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.PhoneCall", "CAN": "021#FFFFFFFF00010000"}, "PhoneHangup": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.PhoneHangup", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.PhoneHangup", "CAN": "021#FFFFFFFF00020000"}, "Voice": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Voice", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Voice", "CAN": "021#FFFFFFFF00040000"}, "LaneDeparture": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.LaneDepartureWarning", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.LaneDepartureWarning", "CAN": "021#FFFFFFFF00000001"}, "Horn": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Horn", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.Horn", "CAN": "021#FFFFFFFF00000080"}, "CruiseEnable": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseEnable", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseEnable", "CAN": "021#FFFFFFFF00008000"}, "CruiseSet": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseSet", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseSet", "CAN": "021#FFFFFFFF00001000"}, "CruiseResume": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseResume", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseResume", "CAN": "021#FFFFFFFF00004000"}, "CruiseCancel": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseCancel", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseCancel", "CAN": "021#FFFFFFFF00000800"}, "CruiseLimit": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseLimit", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseLimit", "CAN": "021#FFFFFFFF00000200"}, "CruiseDistance": { - "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseDistance", + "Kuksa": "Vehicle.Cabin.SteeringWheel.Switches.CruiseDistance", "CAN": "021#FFFFFFFF00000100"} } - + + class SteeringCtrlWidget(Base, Form): def __init__(self, parent=None): super(self.__class__, self).__init__(parent) self.setupUi(self) - + self.Steering = Steering_Paths() self.feed_kuksa = FeedKuksa() self.settings = settings @@ -113,9 +116,9 @@ class SteeringCtrlWidget(Base, Form): self.NextTrack, self.PreviousTrack, self.Info, - self.PhoneCall, + self.PhoneCall, self.PhoneHangup, - self.Voice, + self.Voice, self.LaneDeparture, self.Horn, self.CruiseEnable, @@ -136,16 +139,20 @@ class SteeringCtrlWidget(Base, Form): button_clicked = button.objectName() signal_type = settings.Steering_Signal_Type if signal_type == "Kuksa": - self.feed_kuksa.send_values(self.Steering.switches[button_clicked]["Kuksa"], "1") - self.feed_kuksa.send_values(self.Steering.switches[button_clicked]["Kuksa"], "0") + self.feed_kuksa.send_values( + self.Steering.switches[button_clicked]["Kuksa"], "1") + self.feed_kuksa.send_values( + self.Steering.switches[button_clicked]["Kuksa"], "0") elif signal_type == "CAN": - feed_can.send_can_signal(self.Steering.switches[button_clicked]["CAN"]) + feed_can.send_can_signal( + self.Steering.switches[button_clicked]["CAN"]) # Making sure button state goes back to off feed_can.send_can_signal("021#FFFFFFFF00000000") + if __name__ == '__main__': import sys app = QApplication(sys.argv) w = SteeringCtrlWidget() w.show() - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/Widgets/settings.py b/Widgets/settings.py index a7820fc..f1eed41 100644 --- a/Widgets/settings.py +++ b/Widgets/settings.py @@ -13,6 +13,8 @@ # limitations under the License. +from extras import config +import extras.Kuksa_Instance as kuksa_instance import os import sys import time @@ -31,8 +33,6 @@ current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.dirname(current_dir)) -import extras.Kuksa_Instance as kuksa_instance -from extras import config Form, Base = uic.loadUiType(os.path.join( current_dir, "../ui/Settings_Window.ui")) @@ -41,12 +41,14 @@ Form, Base = uic.loadUiType(os.path.join( Steering_Signal_Type = "Kuksa" + def create_animated_toggle(): return AnimatedToggle( checked_color="#4BD7D6", pulse_checked_color="#00ffff", ) + class settings(Base, Form): """ A class representing the settings widget of the AGL Demo Control Panel. @@ -61,14 +63,14 @@ class settings(Base, Form): - refreshBtn: A QPushButton object representing the refresh button. - startClientBtn: A QPushButton object representing the start client button. """ - + def __init__(self, parent=None): """ Initializes the settings widget of the AGL Demo Control Panel. """ super(self.__class__, self).__init__(parent) self.setupUi(self) - + self.SSL_toggle = create_animated_toggle() self.Protocol_toggle = create_animated_toggle() self.CAN_Kuksa_toggle = create_animated_toggle() @@ -79,11 +81,13 @@ class settings(Base, Form): list_of_configs = config.get_list_configs() default_config_name = config.get_default_config() - self.List_Configs_ComboBox = self.findChild(QComboBox, "List_Configs_ComboBox") + self.List_Configs_ComboBox = self.findChild( + QComboBox, "List_Configs_ComboBox") self.List_Configs_ComboBox.setItemDelegate(QStyledItemDelegate()) self.List_Configs_ComboBox.addItems(list_of_configs) self.List_Configs_ComboBox.setCurrentText(default_config_name) - self.List_Configs_ComboBox.currentTextChanged.connect(lambda: self.set_settings(self.List_Configs_ComboBox.currentText())) + self.List_Configs_ComboBox.currentTextChanged.connect( + lambda: self.set_settings(self.List_Configs_ComboBox.currentText())) self.IPAddrInput = self.findChild(QLineEdit, "IPAddrInput") self.PortInput = self.findChild(QLineEdit, "PortInput") @@ -99,16 +103,18 @@ class settings(Base, Form): self.reconnectBtn.clicked.connect(self.reconnectClient) self.SSL_toggle.clicked.connect(self.toggleSSL) self.CAN_Kuksa_toggle.clicked.connect(self.toggle_CAN_Kuksa) - + Frame_GS = self.findChild(QWidget, "frame_general_settings") Frame_PS = self.findChild(QWidget, "frame_page_settings") GS_layout = Frame_GS.layout() PS_layout = Frame_PS.layout() - + GS_layout.replaceWidget(self.place_holder_toggle_1, self.SSL_toggle) - GS_layout.replaceWidget(self.place_holder_toggle_2, self.Protocol_toggle) - PS_layout.replaceWidget(self.place_holder_toggle_3, self.CAN_Kuksa_toggle) - + GS_layout.replaceWidget( + self.place_holder_toggle_2, self.Protocol_toggle) + PS_layout.replaceWidget( + self.place_holder_toggle_3, self.CAN_Kuksa_toggle) + self.place_holder_toggle_1.deleteLater() self.place_holder_toggle_2.deleteLater() self.place_holder_toggle_3.deleteLater() @@ -121,7 +127,8 @@ class settings(Base, Form): self.set_instance() if self.client is not None: self.startClientBtn.setStyleSheet("border: 1px solid red;") - self.startClientBtn.setIcon(QtGui.QIcon(":/Carbon_Icons/carbon_icons/stop.svg")) + self.startClientBtn.setIcon(QtGui.QIcon( + ":/Carbon_Icons/carbon_icons/stop.svg")) self.startClientBtn.setText("Stop Client") else: self.startClientBtn.setChecked(False) @@ -131,9 +138,9 @@ class settings(Base, Form): self.client.stop() self.startClientBtn.setStyleSheet("border: 1px solid green;") - self.startClientBtn.setIcon(QtGui.QIcon(":/Carbon_Icons/carbon_icons/play.svg")) + self.startClientBtn.setIcon(QtGui.QIcon( + ":/Carbon_Icons/carbon_icons/play.svg")) self.startClientBtn.setText("Start Client") - def toggleSSL(self): """ @@ -150,7 +157,8 @@ class settings(Base, Form): if (self.CAN_Kuksa_toggle.isChecked()): # check if can0 is available try: - can_bus = can.interface.Bus(channel='can0', bustype='socketcan_native') + can_bus = can.interface.Bus( + channel='can0', bustype='socketcan_native') can_bus.shutdown() Steering_Signal_Type = "CAN" except: @@ -193,13 +201,15 @@ class settings(Base, Form): if (self.client is None): self.connectionStatus.setText('Not Connected') self.connectionLogo.setStyleSheet("background-color: red") - self.connectionLogo.setPixmap(QtGui.QPixmap(":/Carbon_Icons/carbon_icons/connection-signal--off.svg")) + self.connectionLogo.setPixmap(QtGui.QPixmap( + ":/Carbon_Icons/carbon_icons/connection-signal--off.svg")) return None if (self.client.checkConnection() == True): self.connectionStatus.setText('Connected') self.connectionLogo.setStyleSheet("background-color: green") - self.connectionLogo.setPixmap(QtGui.QPixmap(":/Carbon_Icons/carbon_icons/connection-signal.svg")) + self.connectionLogo.setPixmap(QtGui.QPixmap( + ":/Carbon_Icons/carbon_icons/connection-signal.svg")) self.client.start() return True @@ -207,7 +217,8 @@ class settings(Base, Form): self.client.stop() self.connectionStatus.setText('Disconnected') self.connectionLogo.setStyleSheet("background-color: yellow") - self.connectionLogo.setPixmap(QtGui.QPixmap(":/Carbon_Icons/carbon_icons/connection-signal--off.svg")) + self.connectionLogo.setPixmap(QtGui.QPixmap( + ":/Carbon_Icons/carbon_icons/connection-signal--off.svg")) return False except: pass @@ -240,7 +251,8 @@ class settings(Base, Form): text = widget.text() if text: if os.path.exists(text): - widget.setStyleSheet("border: 1px solid #4BD7D6 ; /* light blue */") + widget.setStyleSheet( + "border: 1px solid #4BD7D6 ; /* light blue */") if key: self.new_config[key] = text else: @@ -248,18 +260,19 @@ class settings(Base, Form): else: widget.setStyleSheet("border: 1px solid red;") return None - + new_config = {} new_config["ip"] = self.IPAddrInput.text() new_config["port"] = self.PortInput.text() new_config["protocol"] = self.get_protocol() new_config["insecure"] = not self.SSL_toggle.isChecked() - new_config["tls_server_name"] = self.TLS_Server_Name.text() if self.Protocol_toggle.isChecked() else None + new_config["tls_server_name"] = self.TLS_Server_Name.text( + ) if self.Protocol_toggle.isChecked() else None validate_and_set_style(self, self.CA_File, "cacertificate") validate_and_set_style(self, self.Auth_Token) return new_config - + def set_settings(self, config_name): """ Reloads the parameters of settings widget. @@ -272,11 +285,14 @@ class settings(Base, Form): self.IPAddrInput.setText(self.kuksa_config["ip"]) self.PortInput.setText(self.kuksa_config["port"]) self.SSL_toggle.setChecked(not self.kuksa_config["insecure"]) - self.Protocol_toggle.setChecked(self.kuksa_config["protocol"] == 'grpc') + self.Protocol_toggle.setChecked( + self.kuksa_config["protocol"] == 'grpc') self.CA_File.setText(self.kuksa_config["cacertificate"]) - self.TLS_Server_Name.setText(self.kuksa_config["tls_server_name"] if self.kuksa_config["tls_server_name"] is not None else "") + self.TLS_Server_Name.setText( + self.kuksa_config["tls_server_name"] if self.kuksa_config["tls_server_name"] is not None else "") self.Auth_Token.setText(self.kuksa_token) + class RefreshThread(QThread): def __init__(self, settings): QThread.__init__(self) @@ -286,6 +302,7 @@ class RefreshThread(QThread): time.sleep(2) self.settings.refreshStatus() + if __name__ == '__main__': import sys app = QApplication(sys.argv) diff --git a/docker/install_packages.sh b/docker/install_packages.sh index 4e94a37..7fdb621 100755 --- a/docker/install_packages.sh +++ b/docker/install_packages.sh @@ -21,7 +21,8 @@ apt-get install --yes \ python3-pip \ python3-pyqt5 \ python3-qtpy \ - pyqt5-dev-tools + pyqt5-dev-tools \ + python3-pyqt5.qtsvgqq # Set bash as default shell echo "dash dash/sh boolean false" | debconf-set-selections - && dpkg-reconfigure dash diff --git a/extras/FeedCAN.py b/extras/FeedCAN.py index 9cd01d5..1282e61 100644 --- a/extras/FeedCAN.py +++ b/extras/FeedCAN.py @@ -17,6 +17,7 @@ import can import logging + def send_can_signal(frame): """ Sends a CAN signal to the CAN bus using the given frame. @@ -26,7 +27,7 @@ def send_can_signal(frame): None """ msg = separate_can_frame(frame) - + try: bus = can.interface.Bus(channel='can0', bustype='socketcan') except Exception as e: @@ -38,7 +39,7 @@ def send_can_signal(frame): print("CAN signal sent successfully:") print("CAN ID:", hex(msg.arbitration_id)) print("Data:", msg.data) - if frame!="021#FFFFFFFF00000000": + if frame != "021#FFFFFFFF00000000": # Turn off signal send_can_signal("021#FFFFFFFF00000000") @@ -47,13 +48,14 @@ def send_can_signal(frame): finally: bus.shutdown() + def separate_can_frame(frame): """ Separates a CAN frame into its arbitration ID and data parts. - + Args: frame (str): A string representing the CAN frame in the format "ARBID#DATA". - + Returns: can.Message: A can.Message object with the arbitration ID and data extracted from the input frame. """ @@ -68,5 +70,6 @@ def main(): frame = "021#FFFFFFFF10000000" send_can_signal(frame) + if __name__ == "__main__": main() diff --git a/extras/FeedKuksa.py b/extras/FeedKuksa.py index cda2a30..75846d5 100644 --- a/extras/FeedKuksa.py +++ b/extras/FeedKuksa.py @@ -16,13 +16,12 @@ import logging from PyQt5.QtCore import QThread -from PyQt5.QtCore import pyqtSignal +from PyQt5.QtCore import pyqtSignal, QObject from . import Kuksa_Instance as kuksa_instance +from . import UI_Handeler import threading class FeedKuksa(QThread): - sending_values = pyqtSignal() - finished_sending_values = pyqtSignal() """ A class to handle sending values to Kuksa. @@ -35,6 +34,9 @@ class FeedKuksa(QThread): client : kuksa_instance.KuksaClientSingleton.instance().client A client object to interact with the Kuksa server. """ + + sending_values = pyqtSignal() + finished_sending_values = pyqtSignal() def __init__(self, parent=None): """ @@ -45,9 +47,12 @@ class FeedKuksa(QThread): parent : QObject The parent object of the FeedKuksa object. """ - QThread.__init__(self,parent) + QThread.__init__(self, parent) self.stop_flag = False + self.sending_values.connect(UI_Handeler.UI_Handeler.block_updates) + self.finished_sending_values.connect(UI_Handeler.UI_Handeler.unblock_updates) + def run(self): """ Starts the thread and sets the instance of the Kuksa client. @@ -60,7 +65,7 @@ class FeedKuksa(QThread): Stops the thread. """ self.stop_flag = True - + logging.info("Stopping thread") def set_instance(self): @@ -88,7 +93,7 @@ class FeedKuksa(QThread): Exception If there is an error sending values to Kuksa. """ - + if self.client is None: logging.error("Kuksa client is None, try reconnecting") return @@ -102,11 +107,11 @@ class FeedKuksa(QThread): if attribute is not None: self.sending_values.emit() self.client.setValue(path, value, attribute) + self.finished_sending_values.emit() else: self.sending_values.emit() self.client.setValue(path, value) - - self.finished_sending_values.emit() + self.finished_sending_values.emit() except Exception as e: logging.error(f"Error sending values to kuksa {e}") - threading.Thread(target=self.set_instance).start() \ No newline at end of file + threading.Thread(target=self.set_instance).start() diff --git a/extras/Kuksa_Instance.py b/extras/Kuksa_Instance.py index 1ff8056..cda539e 100644 --- a/extras/Kuksa_Instance.py +++ b/extras/Kuksa_Instance.py @@ -19,6 +19,7 @@ import kuksa_client as kuksa import threading import time + class KuksaClientSingleton: """ A singleton class that provides a single instance of KuksaClientThread. @@ -88,7 +89,7 @@ class KuksaClientSingleton: """ if self.client: self.client.stop() - + self.client = kuksa.KuksaClientThread(config) self.client.authorize(token) self.client.start() @@ -104,7 +105,7 @@ class KuksaClientSingleton: return self.client else: return None - + def get_config(self): """ Returns the configuration. @@ -128,4 +129,4 @@ class KuksaClientSingleton: Stops the client instance. """ if self.client: - self.client.stop() \ No newline at end of file + self.client.stop() diff --git a/extras/UI_Handeler.py b/extras/UI_Handeler.py index 261df94..3e653e4 100644 --- a/extras/UI_Handeler.py +++ b/extras/UI_Handeler.py @@ -20,32 +20,26 @@ from PyQt5.QtCore import QPropertyAnimation from PyQt5.QtWidgets import QWidget from PyQt5.QtCore import QEasingCurve from PyQt5.QtWidgets import QGraphicsOpacityEffect -from PyQt5.QtWidgets import QDesktopWidget import logging import json -from . import FeedKuksa as feed_kuksa from . import Kuksa_Instance as kuksa_instance # Global variables subscribed = False -should_execute_callback = True block_subscription_updates = False + class UI_Handeler(MainWindow): - """ - This class handles the UI of the AGL Demo Control Panel application. - """ - def __init__(self): - self.feed_kuksa = feed_kuksa.FeedKuksa() - self.feed_kuksa.sending_values.connect(self.block_updates) - self.feed_kuksa.finished_sending_values.connect(self.unblock_updates) - - def block_updates(self): + + def display_sending_message(self): + print("message sent") + + def block_updates(): global block_subscription_updates block_subscription_updates = True - def unblock_updates(self): + def unblock_updates(): global block_subscription_updates block_subscription_updates = False @@ -59,7 +53,8 @@ class UI_Handeler(MainWindow): height = self.BottomMenuSubContainer.height() heightExtended = 75 if bool_arg else 0 - self.animation = QPropertyAnimation(self.BottomMenuSubContainer, b"minimumHeight") + self.animation = QPropertyAnimation( + self.BottomMenuSubContainer, b"minimumHeight") self.animation.setDuration(400) self.animation.setStartValue(height) self.animation.setEndValue(heightExtended) @@ -73,7 +68,8 @@ class UI_Handeler(MainWindow): Args: - index: The index of the page to switch to. """ - self.fader_widget = FaderWidget(self.stackedWidget.currentWidget(), self.stackedWidget.widget(index)) + self.fader_widget = FaderWidget( + self.stackedWidget.currentWidget(), self.stackedWidget.widget(index)) self.stackedWidget.setCurrentIndex(index) def toggleMaximized(self): @@ -96,30 +92,28 @@ class UI_Handeler(MainWindow): self.move(self.pos() + event.globalPos() - self.clickPosition) self.clickPosition = event.globalPos() event.accept() - + def mousePressEvent(self, event): self.clickPosition = event.globalPos() event.accept() - + def mouseReleaseEvent(self, event): self.clickPosition = None event.accept() - - def set_instance(self): - """ - This method sets the instance of the Kuksa client. - Returns: - - True if the client is connected to Kuksa, False otherwise. - """ + def set_instance(self): self.kuksa = kuksa_instance.KuksaClientSingleton.instance() self.client = self.kuksa.get_client() if self.client is not None and self.client.checkConnection(): return True else: - print("No connection to Kuksa") + logging.error("Kuksa client is not connected, try reconnecting") return False + def stop_client(self): + if self.client is not None and self.client.checkConnection(): + self.client.stop() + def subscribe_VSS_Signals(self): """ This method subscribes to the VSS signals from Kuksa. @@ -144,13 +138,15 @@ class UI_Handeler(MainWindow): "Vehicle.Cabin.HVAC.Station.Row1.Right.FanSpeed"] for signal in signals: - self.client.subscribe(signal, lambda data: UI_Handeler.VSS_callback(self,data), 'value') + self.client.subscribe( + signal, lambda data: UI_Handeler.VSS_callback(self, data), 'value') subscribed = True else: subscribed = False - print("No connection to Kuksa") + logging.error( + "Kuksa client is not connected, try reconnecting") - def VSS_callback(self,data): + def VSS_callback(self, data): """ This method is the callback function for the VSS signals from Kuksa. @@ -160,7 +156,7 @@ class UI_Handeler(MainWindow): global block_subscription_updates if block_subscription_updates: return - + IC_Page = self.stackedWidget.widget(1) HVAC_Page = self.stackedWidget.widget(2) @@ -219,7 +215,7 @@ class UI_Handeler(MainWindow): class FaderWidget(QWidget): def __init__(self, old_widget, new_widget): super().__init__(new_widget) - + self.old_widget = old_widget self.new_widget = new_widget @@ -241,4 +237,4 @@ class FaderWidget(QWidget): def close(self): self.old_widget.close() self.new_widget.show() - super().close() \ No newline at end of file + super().close() diff --git a/main.py b/main.py index c4185f6..9fe799e 100644 --- a/main.py +++ b/main.py @@ -14,6 +14,8 @@ limitations under the License. """ +from Widgets.Dashboard import Dashboard +from extras.UI_Handeler import * import sys import os @@ -22,12 +24,13 @@ from PyQt5.QtWidgets import QApplication, QPushButton, QWidget from functools import partial from PyQt5 import QtGui from PyQt5.QtCore import Qt +from PyQt5 import QtSvg +from PyQt5.QtSvg import * +from PyQt5.QtGui import QIcon current_dir = os.path.dirname(os.path.abspath(__file__)) Form, Base = uic.loadUiType(os.path.join(current_dir, "Main_Window.ui")) -from extras.UI_Handeler import * -from Widgets.Dashboard import Dashboard class MainWindow(Base, Form): """ @@ -50,22 +53,28 @@ class MainWindow(Base, Form): self.setupUi(self) self.setWindowFlags(QtCore.Qt.FramelessWindowHint) self.setAttribute(QtCore.Qt.WA_TranslucentBackground) - self.setStyle(QtWidgets.QStyleFactory.create('Fusion')) - #self.resize(1400,840) - self.headerContainer = self.findChild(QWidget, 'headerContainer') - self.headerContainer.DoubleClickMaximize = lambda: UI_Handeler.toggleMaximized(self) - self.headerContainer.mouseMoveEvent = lambda event: UI_Handeler.moveWindow(self, event) - self.headerContainer.mousePressEvent = lambda event: UI_Handeler.mousePressEvent(self, event) - self.headerContainer.mouseReleaseEvent = lambda event: UI_Handeler.mouseReleaseEvent(self, event) - self.leftMenuSubContainer = self.findChild(QWidget, 'leftMenuSubContainer') + self.headerContainer = self.findChild(QWidget, 'headerContainer') + self.headerContainer.DoubleClickMaximize = lambda: UI_Handeler.toggleMaximized( + self) + self.headerContainer.mouseMoveEvent = lambda event: UI_Handeler.moveWindow( + self, event) + self.headerContainer.mousePressEvent = lambda event: UI_Handeler.mousePressEvent( + self, event) + self.headerContainer.mouseReleaseEvent = lambda event: UI_Handeler.mouseReleaseEvent( + self, event) + + self.leftMenuSubContainer = self.findChild( + QWidget, 'leftMenuSubContainer') self.dashboardButton = self.findChild(QPushButton, 'dashboardButton') - UI_Handeler.Hide_Navbar(self,bool_arg=True) + UI_Handeler.Hide_Navbar(self, bool_arg=True) - self.stackedWidget.currentChanged.connect(lambda: UI_Handeler.subscribe_VSS_Signals(self) if UI_Handeler.set_instance(self) else None) + self.stackedWidget.currentChanged.connect(lambda: UI_Handeler.subscribe_VSS_Signals( + self) if UI_Handeler.set_instance(self) else None) - self.notificationContent = self.findChild(QWidget, 'notificationContent') + self.notificationContent = self.findChild( + QWidget, 'notificationContent') # Window Controls closeButton = self.findChild(QPushButton, 'closeBtn') @@ -73,17 +82,26 @@ class MainWindow(Base, Form): maximizeButton = self.findChild(QPushButton, 'maximizeBtn') # make the close button also end all threads - closeButton.clicked.connect(lambda: [self.close(), self.stop_thread_signal.emit()]) + closeButton.clicked.connect( + lambda: [self.close(), self.stop_thread_signal.emit()]) minimizeButton.clicked.connect(self.showMinimized) - maximizeButton.clicked.connect(lambda: UI_Handeler.toggleMaximized(self)) + maximizeButton.clicked.connect( + lambda: UI_Handeler.toggleMaximized(self)) # Widget Navigation - Navigation_buttons = ( self.dashboardButton, - self.icButton, - self.hvacButton, - self.steeringCtrlButton, - self.settingsBtn) - + Navigation_buttons = (self.dashboardButton, + self.icButton, + self.hvacButton, + self.steeringCtrlButton, + self.settingsBtn) + + steering_icon = ":/Images/Images/steering-wheel.svg" + getsize = QtSvg.QSvgRenderer(steering_icon) + svg_widget = QtSvg.QSvgWidget(steering_icon) + svg_widget.setFixedSize(getsize.defaultSize()) + svg_widget.setStyleSheet("background-color: transparent;") + self.steeringCtrlButton.setIcon(QIcon(svg_widget.grab())) + NavigationButtons = QtWidgets.QButtonGroup(self) NavigationButtons.setExclusive(True) @@ -93,12 +111,13 @@ class MainWindow(Base, Form): button.clicked.connect(partial(UI_Handeler.animateSwitch, self, i)) self.stackedWidget.currentChanged.connect(self.handleChangedPage) - - self.stop_thread_signal.connect(self.stackedWidget.widget(0).feed_kuksa.stop) - self.stackedWidget.setCurrentIndex(0) + self.stop_thread_signal.connect( + self.stackedWidget.widget(0).feed_kuksa.stop) + + self.stackedWidget.setCurrentIndex(0) self.dashboardButton.setChecked(True) - UI_Handeler.Hide_Navbar(self,bool_arg=False) + UI_Handeler.Hide_Navbar(self, bool_arg=False) self.Dashboard = Dashboard() self.Dashboard.tileClickedSignal.connect(self.handleTileClicked) @@ -108,7 +127,7 @@ class MainWindow(Base, Form): self.centralwidget = self.findChild(QWidget, 'centralwidget') self.size_grip = QtWidgets.QSizeGrip(self) self.size_grip.setFixedSize(20, 20) - #self.size_grip.setStyleSheet("QSizeGrip { background-color: transparent; }") + # self.size_grip.setStyleSheet("QSizeGrip { background-color: transparent; }") self.size_grip.setStyleSheet(""" QSizeGrip { background-color: transparent; @@ -118,9 +137,10 @@ class MainWindow(Base, Form): border: none; } """) - self.centralwidget.layout().addWidget(self.size_grip, 0, Qt.AlignBottom | Qt.AlignRight) + self.centralwidget.layout().addWidget( + self.size_grip, 0, Qt.AlignBottom | Qt.AlignRight) - def VSS_callback(self,data): + def VSS_callback(self, data): pass def handleTileClicked(self): @@ -128,7 +148,7 @@ class MainWindow(Base, Form): Handles the tile clicked signal from the Dashboard object. Shows the navbar. """ - UI_Handeler.Hide_Navbar(self,bool_arg=False) + UI_Handeler.Hide_Navbar(self, bool_arg=False) def handleChangedPage(self, index): """ @@ -137,11 +157,12 @@ class MainWindow(Base, Form): If the index is 0, the navbar is not hidden. Otherwise, it is hidden. """ if index == 0: - UI_Handeler.Hide_Navbar(self,bool_arg=False) + UI_Handeler.Hide_Navbar(self, bool_arg=False) else: - UI_Handeler.Hide_Navbar(self,bool_arg=True) + UI_Handeler.Hide_Navbar(self, bool_arg=True) try: - self.stop_thread_signal.connect(self.stackedWidget.widget(self.current_page).feed_kuksa.stop) + self.stop_thread_signal.connect( + self.stackedWidget.widget(self.current_page).feed_kuksa.stop) self.stop_thread_signal.emit() except: pass @@ -149,15 +170,18 @@ class MainWindow(Base, Form): self.current_page = self.stackedWidget.currentIndex() try: - self.start_thread_signal.connect(self.stackedWidget.widget(self.current_page).feed_kuksa.start) + self.start_thread_signal.connect( + self.stackedWidget.widget(self.current_page).feed_kuksa.start) self.start_thread_signal.emit() except: pass + if __name__ == '__main__': app = QApplication(sys.argv) app.setApplicationName("AGL Demo Control Panel") - app.setWindowIcon(QtGui.QIcon(':/Images/Images/Automotive_Grade_Linux_logo.svg')) + app.setWindowIcon(QtGui.QIcon( + ':/Images/Images/Automotive_Grade_Linux_logo.svg')) window = MainWindow() window.show() - sys.exit(app.exec_()) \ No newline at end of file + sys.exit(app.exec_()) diff --git a/ui/Dashboard.ui b/ui/Dashboard.ui index ef30cf6..f8c8938 100644 --- a/ui/Dashboard.ui +++ b/ui/Dashboard.ui @@ -16,25 +16,17 @@ *{ border: none; + border-radius: 8px; background-color: transparent; - background: none; + background: none; padding: 0; margin: 0; color: #fff; } - -#scrollAreaWidgetContents{ - background-color: #131313 ; /* black */ -} - -#centralwidget{ - background-color: #131313 ; /* black */ -} - -QPushButton{ +QPushButton { background-color: #6C6C85 ; /* pastel purple */ - border-radius: 10px; - margin: 5px; + padding: 50px 50px; + border-radius: 20px; } QPushButton:pressed { @@ -50,10 +42,7 @@ QPushButton:pressed { QFrame::Raised - - - 0 - + 0 @@ -66,139 +55,149 @@ QPushButton:pressed { 0 - - + + + + + 0 + 0 + + + + + 16 + 75 + true + true + + Qt::LeftToRight - - true - - - - - 0 - 0 - 703 - 451 - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - HVAC - - - - :/Carbon_Icons/carbon_icons/windy--strong.svg:/Carbon_Icons/carbon_icons/windy--strong.svg - - - - 50 - 50 - - - - false - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Steering Controls - - - - :/Images/Images/steering-wheel.svg:/Images/Images/steering-wheel.svg - - - - 50 - 50 - - - - false - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Configure - - - - :/Carbon_Icons/carbon_icons/settings.svg:/Carbon_Icons/carbon_icons/settings.svg - - - - 50 - 50 - - - - false - - - - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Instrument Cluster - - - - :/Carbon_Icons/carbon_icons/meter.svg:/Carbon_Icons/carbon_icons/meter.svg - - - - 50 - 50 - - - - - - + + Configure + + + + :/Carbon_Icons/carbon_icons/settings.svg:/Carbon_Icons/carbon_icons/settings.svg + + + + 45 + 45 + + + + false + + + + + + + + 0 + 0 + + + + + 16 + 75 + true + true + + + + Qt::LeftToRight + + + Instrument Cluster + + + + :/Carbon_Icons/carbon_icons/meter.svg:/Carbon_Icons/carbon_icons/meter.svg + + + + 45 + 45 + + + + + + + + + 0 + 0 + + + + + 16 + 75 + true + true + + + + Qt::LeftToRight + + + HVAC + + + + :/Carbon_Icons/carbon_icons/windy--strong.svg:/Carbon_Icons/carbon_icons/windy--strong.svg + + + + 45 + 45 + + + + false + + + + + + + + 0 + 0 + + + + + 16 + 75 + true + true + + + + Qt::LeftToRight + + + Steering Controls + + + + :/Images/Images/steering-wheel.svg:/Images/Images/steering-wheel.svg + + + + 45 + 45 + + + + false + diff --git a/ui/HVAC.ui b/ui/HVAC.ui index 8779962..eff65e0 100644 --- a/ui/HVAC.ui +++ b/ui/HVAC.ui @@ -189,821 +189,775 @@ QListWidget::item:hover { QFrame::Raised - - - - - true + + + + + + 0 + 300 + - - - - 0 - 0 - 799 - 517 - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - - 0 - 300 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 0 - 50 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - 75 - true - true - - - - HVAC - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 20 - 20 - + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + + 0 + 50 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + 18 + 75 + true + true + + + + HVAC + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 16 + 75 + true + true + + + + Left Controls + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + :/Carbon_Icons/carbon_icons/temperature--frigid.svg:/Carbon_Icons/carbon_icons/temperature--frigid.svg + + + + 40 + 40 + + + + + + + + + 0 + 0 + + + + + 0 + 152 + + + + + 60 + 152 + + + + + 14 + 75 + true + true + + + + Qt::StrongFocus + + + Qt::LeftToRight + + + false + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContentsOnFirstShow + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + false + + + QAbstractItemView::DragOnly + + + QAbstractItemView::SingleSelection + + + Qt::ElideMiddle + + + QAbstractItemView::ScrollPerPixel + + + QListView::Snap + + + false + + + QListView::Adjust + + + QListView::SinglePass + + + 1 + + + QListView::ListMode + + + true + + + true + + + Qt::AlignCenter + + + + + + + + + + + :/Carbon_Icons/carbon_icons/temperature--hot.svg:/Carbon_Icons/carbon_icons/temperature--hot.svg + + + + 40 + 40 + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 4 - - - - - - - 0 - 0 - + + 0 - - QFrame::StyledPanel + + 0 - - QFrame::Raised + + 0 - - - - - - 75 - true - true - - - - Left Controls - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - :/Carbon_Icons/carbon_icons/temperature--frigid.svg:/Carbon_Icons/carbon_icons/temperature--frigid.svg - - - - 40 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 152 - - - - - 60 - 152 - - - - - 75 - true - true - - - - Qt::StrongFocus - - - Qt::LeftToRight - - - false - - - QFrame::NoFrame - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractScrollArea::AdjustToContentsOnFirstShow - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - false - - - QAbstractItemView::DragOnly - - - QAbstractItemView::SingleSelection - - - Qt::ElideMiddle - - - QAbstractItemView::ScrollPerPixel - - - QListView::Snap - - - false - - - QListView::Adjust - - - QListView::SinglePass - - - 1 - - - QListView::ListMode - - - true - - - true - - - Qt::AlignCenter - - - - - - - - - - - :/Carbon_Icons/carbon_icons/temperature--hot.svg:/Carbon_Icons/carbon_icons/temperature--hot.svg - - - - 40 - 40 - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 4 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 0 - 0 - - - - - 40 - 0 - - - - Qt::Vertical - - - false - - - false - - - QSlider::NoTicks - - - 0 - - - - - - - - - - :/Images/Images/HMI_HVAC_Fan_Icon.svg - - - false - - - Qt::AlignCenter - - - - - - - - - - - - - Qt::Horizontal + + 0 - - QSizePolicy::Expanding + + + + + 0 + 0 + + + + + 40 + 0 + + + + Qt::Vertical + + + false + + + false + + + QSlider::NoTicks + + + 0 + + + + + + + + + + :/Images/Images/HMI_HVAC_Fan_Icon.svg + + + false + + + Qt::AlignCenter + + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 4 - - - 20 - 20 - + + 0 - - - - - - - 0 - 0 - + + 0 - - QFrame::StyledPanel + + 0 - - QFrame::Raised + + 0 - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 4 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - 40 - 0 - - - - Qt::Vertical - - - - - - - - - - :/Images/Images/HMI_HVAC_Fan_Icon.svg - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 75 - true - true - - - - Right Controls - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - :/Carbon_Icons/carbon_icons/temperature--frigid.svg:/Carbon_Icons/carbon_icons/temperature--frigid.svg - - - - 40 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 152 - - - - - 60 - 152 - - - - - 75 - true - true - - - - Qt::StrongFocus - - - Qt::LeftToRight - - - false - - - QFrame::NoFrame - - - QFrame::Plain - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractScrollArea::AdjustToContentsOnFirstShow - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - false - - - QAbstractItemView::DragOnly - - - QAbstractItemView::ContiguousSelection - - - Qt::ElideMiddle - - - QAbstractItemView::ScrollPerPixel - - - QListView::Snap - - - QListView::Adjust - - - QListView::SinglePass - - - 1 - - - QListView::ListMode - - - true - - - Qt::AlignCenter - - - - - - - - - - - :/Carbon_Icons/carbon_icons/temperature--hot.svg:/Carbon_Icons/carbon_icons/temperature--hot.svg - - - - 40 - 40 - - - - - - - - - - - - - - - + + + + + 40 + 0 + + + + Qt::Vertical + + + + + + + + + + :/Images/Images/HMI_HVAC_Fan_Icon.svg + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 16 + 75 + true + true + + + + Right Controls + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + :/Carbon_Icons/carbon_icons/temperature--frigid.svg:/Carbon_Icons/carbon_icons/temperature--frigid.svg + + + + 40 + 40 + + + + + + + + + 0 + 0 + + + + + 0 + 152 + + + + + 60 + 152 + + + + + 14 + 75 + true + true + + + + Qt::StrongFocus + + + Qt::LeftToRight + + + false + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContentsOnFirstShow + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + false + + + QAbstractItemView::DragOnly + + + QAbstractItemView::ContiguousSelection + + + Qt::ElideMiddle + + + QAbstractItemView::ScrollPerPixel + + + QListView::Snap + + + QListView::Adjust + + + QListView::SinglePass + + + 1 + + + QListView::ListMode + + + true + + + Qt::AlignCenter + + + + + + + + + + + :/Carbon_Icons/carbon_icons/temperature--hot.svg:/Carbon_Icons/carbon_icons/temperature--hot.svg + + + + 40 + 40 + + + + + + + + + + + - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - diff --git a/ui/IC.ui b/ui/IC.ui index 4452564..b337ef6 100644 --- a/ui/IC.ui +++ b/ui/IC.ui @@ -165,7 +165,7 @@ QLCDNumber { QFrame::Raised - + Qt::Horizontal @@ -178,7 +178,7 @@ QLCDNumber { - + Qt::Horizontal @@ -191,889 +191,890 @@ QLCDNumber { - - - - true + + + + + 500 + 0 + - - - - 0 - 0 - 684 - 782 - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - 0 - 50 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - Open Sans Extrabold - 75 - true - true - - - - Instrument Cluster - - - - - - - - - - - 75 - true - true - - - - Demo Mode - - - - - - - - - - - - - - - - - - 0 - 80 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Qt::Horizontal - - - - 167 - 20 - - - - - - - - - 50 - 50 - - - - - Open Sans - 20 - 75 - false - true - - - - P - - - - 16 - 16 - - - - true - - - false - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 50 - 50 - - - - - Open Sans - 20 - 75 - false - true - - - - R - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 50 - 50 - - - - - Open Sans - 20 - 75 - false - true - - - - N - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 40 - 20 - - - - - - - - - 50 - 50 - - - - - Open Sans - 20 - 75 - false - true - - - - D - - - true - - - - - - - Qt::Horizontal - - - - 168 - 20 - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 150 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - - - - :/Images/Images/right.png:/Images/Images/right.png - - - - 60 - 60 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - false - - - false - - - - - - - :/Images/Images/left.png:/Images/Images/left.png - - - - 60 - 60 - - - - false - - - false - - - - - - - - - - - :/Images/Images/hazard.png:/Images/Images/hazard.png - - - - 60 - 60 - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - 0 - 80 - - - - - Open Sans - 18 - 75 - true - true - - - - Accelerate - - - - :/Misc_icons/Misc_icons/speed-up-fill.svg:/Misc_icons/Misc_icons/speed-up-fill.svg - - - - 60 - 60 - - - - - - - - - - - - 0 - 0 - - - - - 0 - 200 - - - - - 16777215 - 150 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - Open Sans - 75 - true - true - - - - Engine RPM - - - - - - - - 0 - 0 - - - - - 50 - false - false - - - - Qt::LeftToRight - - - QFrame::NoFrame - - - false - - - 3 - - - QLCDNumber::Flat - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - 4 - - - - - - - - :/Carbon_Icons/carbon_icons/temperature--water.svg - - - - - - - - 60 - 0 - - - - Qt::Vertical - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 10 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - - 0 - 60 - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 50 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + Open Sans Extrabold + 18 + 75 + true + true + + + + Instrument Cluster + + + + + + + + + + + 18 + 75 + true + true + + + + Demo Mode + + + + + + + + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + :/Images/Images/right.png:/Images/Images/right.png + + + + 60 + 60 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + false + + + false + + + + + + + :/Images/Images/left.png:/Images/Images/left.png + + + + 60 + 60 + + + + false + + + false + + + + + + + + + + + :/Images/Images/hazard.png:/Images/Images/hazard.png + + + + 60 + 60 + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 200 + + + + + 16777215 + 150 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + Open Sans + 75 + true + true + + + + Engine RPM + + + + + + + + 0 + 0 + + + + + 50 + false + false + + + + Qt::LeftToRight + + + QFrame::NoFrame + + + false + + + 3 + + + QLCDNumber::Flat + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 - - - - - - - 0 - 0 - + + 0 - - - 50 - false - + + 0 - - QFrame::NoFrame + + 0 - + 4 - - QLCDNumber::Flat - - - - - - - - Open Sans - 75 - true - true - - - - Speed (Kmph) - - - - - - - - 0 - 60 - - - - - 50 - false - - - - 240 - - - Qt::Horizontal - - - QSlider::NoTicks - - + + + + + + + :/Carbon_Icons/carbon_icons/temperature--water.svg + + + + + + + + 60 + 0 + + + + Qt::Vertical + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 60 + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 50 + false + + + + QFrame::NoFrame + + + 4 + + + QLCDNumber::Flat + + + + + + + + Open Sans + 75 + true + true + + + + Speed (Kmph) + + + + + + + + 0 + 60 + + + + + 50 + false + + + + 240 + + + Qt::Horizontal + + + QSlider::NoTicks + + + 0 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + 0 - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised + + 4 - - - 0 - - - 4 - - - - - - 60 - 0 - - - - - true - - - - 0 - - - Qt::Vertical - - - false - - - false - - - QSlider::NoTicks - - - - - - - - 0 - 0 - - - - - 12 - - - - QFrame::NoFrame - - - - - - :/Carbon_Icons/carbon_icons/rain-drop.svg - - - false - - - - - - - - - - - + + + + + 60 + 0 + + + + + true + + + + 0 + + + Qt::Vertical + + + false + + + false + + + QSlider::NoTicks + + + + + + + + 0 + 0 + + + + + 12 + + + + QFrame::NoFrame + + + + + + :/Carbon_Icons/carbon_icons/rain-drop.svg + + + false + + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + 0 + 80 + + + + + Open Sans + 16 + 75 + true + true + + + + Accelerate + + + + :/Misc_icons/Misc_icons/speed-up-fill.svg:/Misc_icons/Misc_icons/speed-up-fill.svg + + + + 60 + 60 + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 80 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + Qt::Horizontal + + + + 167 + 20 + + + + + + + + + 50 + 50 + + + + + Open Sans + 20 + 75 + false + true + + + + P + + + + 16 + 16 + + + + true + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + 50 + 50 + + + + + Open Sans + 20 + 75 + false + true + + + + R + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + 50 + 50 + + + + + Open Sans + 20 + 75 + false + true + + + + N + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + + 50 + 50 + + + + + Open Sans + 20 + 75 + false + true + + + + D + + + true + + + + + + + Qt::Horizontal + + + + 168 + 20 + + + + + + + + diff --git a/ui/Settings_Window.ui b/ui/Settings_Window.ui index e1a6b81..e4d5c52 100644 --- a/ui/Settings_Window.ui +++ b/ui/Settings_Window.ui @@ -127,6 +127,7 @@ QCheckBox:indicator:disabled { + 16 75 true true @@ -154,6 +155,7 @@ QCheckBox:indicator:disabled { + 16 75 true true @@ -229,6 +231,14 @@ QCheckBox:indicator:disabled { 0 + + + 16 + 75 + true + true + + Start client @@ -246,6 +256,14 @@ QCheckBox:indicator:disabled { + + + 16 + 75 + true + true + + Reconnect @@ -279,6 +297,13 @@ QCheckBox:indicator:disabled { 0 + + + 14 + 75 + true + + Disconnected @@ -286,6 +311,13 @@ QCheckBox:indicator:disabled { + + + 14 + 75 + true + + Status @@ -353,6 +385,11 @@ QCheckBox:indicator:disabled { + + + 14 + + HVAC @@ -384,6 +421,11 @@ QCheckBox:indicator:disabled { + + + 14 + + Instrument Cluster @@ -391,6 +433,11 @@ QCheckBox:indicator:disabled { + + + 14 + + Steering Controls @@ -408,6 +455,14 @@ QCheckBox:indicator:disabled { + + + 14 + 75 + true + true + + Kuksa @@ -457,6 +512,14 @@ QCheckBox:indicator:disabled { + + + 14 + 75 + true + true + + CAN @@ -559,6 +622,11 @@ QCheckBox:indicator:disabled { + + + 14 + + @@ -566,6 +634,11 @@ QCheckBox:indicator:disabled { + + + 14 + + Port @@ -582,10 +655,21 @@ QCheckBox:indicator:disabled { - + + + + 14 + + + + + + 14 + + Default Config @@ -593,6 +677,11 @@ QCheckBox:indicator:disabled { + + + 14 + + IP Address @@ -600,6 +689,11 @@ QCheckBox:indicator:disabled { + + + 14 + + Default: Secure @@ -609,34 +703,57 @@ QCheckBox:indicator:disabled { - + + + + 14 + + + + + + 14 + + Auth Token - + + + + 14 + + + + 14 75 true true - ws + WS + + + 14 + + TLS Server Name @@ -657,6 +774,11 @@ QCheckBox:indicator:disabled { + + + 14 + + Default: WS @@ -666,7 +788,13 @@ QCheckBox:indicator:disabled { - + + + + 14 + + + @@ -682,25 +810,37 @@ QCheckBox:indicator:disabled { + 14 75 true true - grpc + gRPC + + + 14 + + CA.pem File - + + + + 14 + + + diff --git a/ui/SteeringControls.ui b/ui/SteeringControls.ui index 6d4a4d2..26f40e0 100644 --- a/ui/SteeringControls.ui +++ b/ui/SteeringControls.ui @@ -6,7 +6,7 @@ 0 0 - 1034 + 1190 600 @@ -67,22 +67,49 @@ QPushButton:checked { - - + + + + + 0 + 0 + + + + + 250 + 0 + + QFrame::StyledPanel QFrame::Raised - - - - - - 200 - 0 - + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + QFrame::StyledPanel @@ -90,45 +117,40 @@ QPushButton:checked { QFrame::Raised - - - - - - - - - :/Carbon_Icons/carbon_icons/skip--forward--filled.svg:/Carbon_Icons/carbon_icons/skip--forward--filled.svg + + + + + + 0 + 0 + - + - 45 - 45 + 0 + 70 - - - - - - + + + 75 + true + true + - - - :/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg + + - - - 45 - 45 - + + CRUISE LIMIT - - + + - + 0 0 @@ -136,7 +158,7 @@ QPushButton:checked { 0 - 0 + 70 @@ -146,8 +168,15 @@ QPushButton:checked { true + + Qt::LeftToRight + - MODE + + + + + :/Images/Images/cruise-distance.svg:/Images/Images/cruise-distance.svg @@ -160,14 +189,39 @@ QPushButton:checked { - - + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 75 + true + true + + - + SET - :/Carbon_Icons/carbon_icons/skip--back--filled.svg:/Carbon_Icons/carbon_icons/skip--back--filled.svg + :/Carbon_Icons/carbon_icons/subtract--alt.svg:/Carbon_Icons/carbon_icons/subtract--alt.svg @@ -175,16 +229,26 @@ QPushButton:checked { 45 + + false + - - + + + + + 75 + true + true + + - + RES - :/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg + :/Carbon_Icons/carbon_icons/add--alt.svg:/Carbon_Icons/carbon_icons/add--alt.svg @@ -192,47 +256,19 @@ QPushButton:checked { 45 - + false - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 40 - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - + + - :/Carbon_Icons/carbon_icons/information.svg:/Carbon_Icons/carbon_icons/information.svg + :/Images/Images/AGL_Icons_CruiseControl_white.svg:/Images/Images/AGL_Icons_CruiseControl_white.svg @@ -242,14 +278,33 @@ QPushButton:checked { - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 75 + true + true + + - + CANCEL - :/Carbon_Icons/carbon_icons/volume--mute--filled.svg:/Carbon_Icons/carbon_icons/volume--mute--filled.svg + :/Carbon_Icons/carbon_icons/misuse--outline.svg:/Carbon_Icons/carbon_icons/misuse--outline.svg @@ -257,54 +312,52 @@ QPushButton:checked { 45 + + false + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 40 + + + + - - + + - + 0 0 - - - 0 - 0 - - QFrame::StyledPanel QFrame::Raised - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - + + + - + 0 0 @@ -314,12 +367,81 @@ QPushButton:checked { - :/Images/Images/logo_agl.png:/Images/Images/logo_agl.png + :/Carbon_Icons/carbon_icons/phone--filled.svg:/Carbon_Icons/carbon_icons/phone--filled.svg - 250 - 250 + 45 + 45 + + + + + + + + + 0 + 0 + + + + + + + + :/Carbon_Icons/carbon_icons/phone--off--filled.svg:/Carbon_Icons/carbon_icons/phone--off--filled.svg + + + + 45 + 45 + + + + + + + + + 0 + 0 + + + + + + + + :/Carbon_Icons/carbon_icons/voice.svg:/Carbon_Icons/carbon_icons/voice.svg + + + + 45 + 45 + + + + + + + + + 0 + 0 + + + + + + + + :/Images/Images/AGL_Icons_LaneDeparture_white.svg:/Images/Images/AGL_Icons_LaneDeparture_white.svg + + + + 45 + 45 @@ -327,11 +449,30 @@ QPushButton:checked { - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + - 200 + 250 0 @@ -341,96 +482,68 @@ QPushButton:checked { QFrame::Raised - - - + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 200 + 0 + + QFrame::StyledPanel QFrame::Raised - - - - - - 0 - 70 - - - - - 75 - true - true - - - - - - - CRUISE LIMIT - - - - - - - - 75 - true - true - - - - Qt::LeftToRight - + + + - :/Images/Images/cruise-distance.svg:/Images/Images/cruise-distance.svg - - - - 45 - 45 - - - - false - - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 75 - true - true - + :/Carbon_Icons/carbon_icons/skip--forward--filled.svg:/Carbon_Icons/carbon_icons/skip--forward--filled.svg + + + 45 + 45 + + + + + + - SET + - :/Carbon_Icons/carbon_icons/subtract--alt.svg:/Carbon_Icons/carbon_icons/subtract--alt.svg + :/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg @@ -438,13 +551,22 @@ QPushButton:checked { 45 - - false - - - + + + + + 0 + 0 + + + + + 80 + 0 + + 75 @@ -453,11 +575,7 @@ QPushButton:checked { - RES - - - - :/Carbon_Icons/carbon_icons/add--alt.svg:/Carbon_Icons/carbon_icons/add--alt.svg + MODE @@ -470,14 +588,14 @@ QPushButton:checked { - - + + - :/Images/Images/AGL_Icons_CruiseControl_white.svg:/Images/Images/AGL_Icons_CruiseControl_white.svg + :/Carbon_Icons/carbon_icons/skip--back--filled.svg:/Carbon_Icons/carbon_icons/skip--back--filled.svg @@ -487,27 +605,14 @@ QPushButton:checked { - - - - - 0 - 0 - - - - - 75 - true - true - - + + - CANCEL + - :/Carbon_Icons/carbon_icons/misuse--outline.svg:/Carbon_Icons/carbon_icons/misuse--outline.svg + :/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg @@ -515,7 +620,7 @@ QPushButton:checked { 45 - + false @@ -523,8 +628,8 @@ QPushButton:checked { - - + + Qt::Vertical @@ -539,14 +644,97 @@ QPushButton:checked { + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 70 + + + + + + + + :/Carbon_Icons/carbon_icons/information.svg:/Carbon_Icons/carbon_icons/information.svg + + + + 45 + 45 + + + + + + + + + 0 + 70 + + + + + + + + :/Carbon_Icons/carbon_icons/volume--mute--filled.svg:/Carbon_Icons/carbon_icons/volume--mute--filled.svg + + + + 45 + 45 + + + + + + + - + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + Qt::Horizontal + + QSizePolicy::Expanding + 40 @@ -555,7 +743,7 @@ QPushButton:checked { - + Qt::Vertical @@ -568,85 +756,61 @@ QPushButton:checked { - - + + 0 0 + + + 0 + 0 + + QFrame::StyledPanel QFrame::Raised - - - - - - - - - :/Carbon_Icons/carbon_icons/phone--filled.svg:/Carbon_Icons/carbon_icons/phone--filled.svg - - - - 45 - 45 - - - - - - - - - - - - :/Carbon_Icons/carbon_icons/phone--off--filled.svg:/Carbon_Icons/carbon_icons/phone--off--filled.svg - - - - 45 - 45 - - - - - - - - - - - - :/Carbon_Icons/carbon_icons/voice.svg:/Carbon_Icons/carbon_icons/voice.svg - - - - 45 - 45 - + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + - - - - - :/Images/Images/AGL_Icons_LaneDeparture_white.svg:/Images/Images/AGL_Icons_LaneDeparture_white.svg + :/Images/Images/logo_agl.png:/Images/Images/logo_agl.png - 45 - 45 + 350 + 250 @@ -654,31 +818,18 @@ QPushButton:checked { - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + Qt::Vertical - QSizePolicy::Expanding + QSizePolicy::Fixed 20 - 40 + 50 -- cgit 1.2.3-korg