diff options
author | suchinton2001 <suchinton.2001@gmail.com> | 2023-10-15 23:30:36 +0530 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2023-10-19 16:19:32 +0000 |
commit | 20fe2d131df0041e121eccaf4fc58d4ac88dfbbc (patch) | |
tree | d555cd863e644014e9eb7a3fb9b759de246b6c2e | |
parent | e875973f63fc9a9582e957eb7264a4a589b78a97 (diff) |
agl-demo-control-panel: Refactor Settings, Config and UI scaling
V1:
- Add template to specify new configs in config.ini
- Add drop-down to load all configurations specified in config.ini
- Add new assets and refine UI elements (Scaling issue fixed)
- Add size grip to main window
- Add options in settings to configure port and AGL's CA.pem file
- Removed unused or redundant files
V2:
- Check for user configs agl-demo-control-panel.ini & config.ini
before resorting to default config.ini
- Check for CA.pem and jwt tokens in default paths
- Add new fields in settings for CA.pem file, jwt token path, TLS Server name
- Fix crash in dashboard.py module due to icon.availableSizes()
V3: Add Start/Stop states for the client
V4: Block subscription event updates to the UI when values are changed on the control panel
Bug-AGL: SPEC-4905
Signed-off-by: suchinton2001 <suchinton.2001@gmail.com>
Change-Id: Id7883ba3bc88248dabb58d54e6e931f6d365fd54
-rw-r--r-- | Main_Window.ui | 610 | ||||
-rw-r--r-- | Scripts/reset_tap.sh | 22 | ||||
-rw-r--r-- | Scripts/revert_tap_wireless_int.sh | 53 | ||||
-rw-r--r-- | Scripts/setup_tap.sh | 84 | ||||
-rw-r--r-- | Widgets/Dashboard.py | 13 | ||||
-rw-r--r-- | Widgets/HVACPage.py | 33 | ||||
-rw-r--r-- | Widgets/SteeringCtrlPage.py | 9 | ||||
-rw-r--r-- | Widgets/settings.py | 165 | ||||
-rw-r--r-- | assets/carbon_icons/chevron--down.svg | 10 | ||||
-rw-r--r-- | assets/carbon_icons/chevron--up.svg | 10 | ||||
-rw-r--r-- | assets/carbon_icons/corner.svg | 9 | ||||
-rw-r--r-- | assets/carbon_icons/stop.svg | 1 | ||||
-rw-r--r-- | assets/res.qrc | 4 | ||||
-rw-r--r-- | extras/FeedKuksa.py | 42 | ||||
-rw-r--r-- | extras/Kuksa_Instance.py | 35 | ||||
-rw-r--r-- | extras/UI_Handeler.py | 19 | ||||
-rw-r--r-- | extras/config.ini | 48 | ||||
-rw-r--r-- | extras/config.py | 99 | ||||
-rw-r--r-- | main.py | 22 | ||||
-rw-r--r-- | ui/HVAC.ui | 1005 | ||||
-rw-r--r-- | ui/IC.ui | 1094 | ||||
-rw-r--r-- | ui/Settings_Window.ui | 669 | ||||
-rw-r--r-- | ui/SteeringControls.ui | 540 |
23 files changed, 2496 insertions, 2100 deletions
diff --git a/Main_Window.ui b/Main_Window.ui index 6b8ba83..7bfb0ef 100644 --- a/Main_Window.ui +++ b/Main_Window.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>1297</width> - <height>739</height> + <width>903</width> + <height>705</height> </rect> </property> <property name="palette"> @@ -542,273 +542,8 @@ QStackedWidget{ <property name="autoFillBackground"> <bool>false</bool> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="2"> - <widget class="QWidget" name="BottomMenuContainer" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="styleSheet"> - <string notr="true"/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <item> - <widget class="QWidget" name="BottomMenuSubContainer" native="true"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Ignored"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>70</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item alignment="Qt::AlignLeft"> - <widget class="QFrame" name="frame"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="dashboardButton"> - <property name="font"> - <font> - <family>DejaVu Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/workspace.svg</normaloff>:/Carbon_Icons/carbon_icons/workspace.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>35</width> - <height>35</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Maximum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QFrame" name="navigationFrame"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <item> - <widget class="QPushButton" name="icButton"> - <property name="enabled"> - <bool>true</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <family>DejaVu Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - <kerning>true</kerning> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/meter.svg</normaloff>:/Carbon_Icons/carbon_icons/meter.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>35</width> - <height>35</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="hvacButton"> - <property name="font"> - <font> - <family>DejaVu Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - <kerning>true</kerning> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/windy--strong.svg</normaloff>:/Carbon_Icons/carbon_icons/windy--strong.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>35</width> - <height>35</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="steeringCtrlButton"> - <property name="font"> - <font> - <family>DejaVu Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - <kerning>true</kerning> - </font> - </property> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="assets/res.qrc"> - <normaloff>:/Images/Images/steering-wheel.svg</normaloff>:/Images/Images/steering-wheel.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>35</width> - <height>35</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Maximum</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item alignment="Qt::AlignRight"> - <widget class="QFrame" name="settingsFrame"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <widget class="QPushButton" name="settingsBtn"> - <property name="font"> - <font> - <family>DejaVu Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Configure</string> - </property> - <property name="icon"> - <iconset resource="assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/settings.svg</normaloff>:/Carbon_Icons/carbon_icons/settings.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>35</width> - <height>35</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="2" rowspan="2"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> <widget class="QWidget" name="mainContainer" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> @@ -835,7 +570,7 @@ QStackedWidget{ <item> <widget class="QWidget" name="headerContainer" native="true"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -957,13 +692,6 @@ QStackedWidget{ <number>0</number> </property> <item> - <widget class="Line" name="line"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> - </item> - <item> <widget class="QPushButton" name="minimizeBtn"> <property name="text"> <string/> @@ -1031,6 +759,12 @@ QStackedWidget{ </property> <item> <widget class="QWidget" name="Stackwidget" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <layout class="QHBoxLayout" name="horizontalLayout_6"> <property name="spacing"> <number>0</number> @@ -1049,8 +783,14 @@ QStackedWidget{ </property> <item> <widget class="QStackedWidget" name="stackedWidget"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="currentIndex"> - <number>1</number> + <number>3</number> </property> <widget class="Dashboard" name="Dashboard"/> <widget class="ICWidget" name="ICPage"/> @@ -1065,99 +805,303 @@ QStackedWidget{ </layout> </widget> </item> - <item> - <widget class="QWidget" name="notificationContent" native="true"> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="BottomMenuContainer" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="styleSheet"> + <string notr="true"/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item alignment="Qt::AlignBottom"> + <widget class="QWidget" name="BottomMenuSubContainer" native="true"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Ignored"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="maximumSize"> + <property name="minimumSize"> <size> - <width>16777215</width> - <height>100</height> + <width>0</width> + <height>70</height> </size> </property> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <widget class="QFrame" name="notificationFrame"> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <item alignment="Qt::AlignLeft|Qt::AlignVCenter"> + <widget class="QFrame" name="frame"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QHBoxLayout" name="horizontalLayout_7"> + <layout class="QHBoxLayout" name="horizontalLayout"> <item> - <widget class="QFrame" name="frame_2"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> + <widget class="QPushButton" name="dashboardButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/workspace.svg</normaloff>:/Carbon_Icons/carbon_icons/workspace.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>35</width> + <height>35</height> + </size> </property> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QLabel" name="messageIcon"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap>:/icons/feather/alert-octagon.svg</pixmap> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="message"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Establish Connection to server </string> - </property> - </widget> - </item> - </layout> </widget> </item> - <item alignment="Qt::AlignRight"> - <widget class="QPushButton" name="ackBtn"> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Maximum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QFrame" name="navigationFrame"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <property name="spacing"> + <number>6</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="icButton"> + <property name="enabled"> + <bool>true</bool> + </property> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + <kerning>true</kerning> + </font> + </property> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/meter.svg</normaloff>:/Carbon_Icons/carbon_icons/meter.svg</iconset> + </property> + <property name="iconSize"> <size> - <width>40</width> - <height>0</height> + <width>35</width> + <height>35</height> </size> </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="hvacButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + <kerning>true</kerning> + </font> + </property> <property name="text"> - <string>OK</string> + <string/> + </property> + <property name="icon"> + <iconset resource="assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/windy--strong.svg</normaloff>:/Carbon_Icons/carbon_icons/windy--strong.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>35</width> + <height>35</height> + </size> </property> </widget> </item> <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <widget class="QPushButton" name="steeringCtrlButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + <kerning>true</kerning> + </font> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <property name="text"> + <string/> </property> - <property name="sizeHint" stdset="0"> + <property name="icon"> + <iconset resource="assets/res.qrc"> + <normaloff>:/Images/Images/steering-wheel.svg</normaloff>:/Images/Images/steering-wheel.svg</iconset> + </property> + <property name="iconSize"> <size> - <width>20</width> - <height>20</height> + <width>35</width> + <height>35</height> </size> </property> - </spacer> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Maximum</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item alignment="Qt::AlignRight"> + <widget class="QFrame" name="settingsFrame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <item alignment="Qt::AlignVCenter"> + <widget class="QPushButton" name="settingsBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>DejaVu Sans</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Configure</string> + </property> + <property name="icon"> + <iconset resource="assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/settings.svg</normaloff>:/Carbon_Icons/carbon_icons/settings.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>35</width> + <height>35</height> + </size> + </property> + </widget> </item> </layout> </widget> diff --git a/Scripts/reset_tap.sh b/Scripts/reset_tap.sh deleted file mode 100644 index d8080cd..0000000 --- a/Scripts/reset_tap.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -if [[ $EUID > 0 ]]; then - echo "Run this script as root" - exit -fi - -BRIDGE="br0" -TAP="tap0" - -echo "Removing bridge $BRIDGE" -ip link delete $BRIDGE type bridge - -echo "Removing tap $TAP" -ip link delete $TAP type tap - -echo "Setting $INTERFACE up" -ip link set up dev $INTERFACE - -echo "Starting NetworkManager" -systemctl start NetworkManager - diff --git a/Scripts/revert_tap_wireless_int.sh b/Scripts/revert_tap_wireless_int.sh deleted file mode 100644 index b23cf3a..0000000 --- a/Scripts/revert_tap_wireless_int.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -BRIDGE=br0 -NETWORK=10.10.10.0 -NETMASK=255.255.255.0 -GATEWAY=10.10.10.1 -DHCPRANGE=10.10.10.100,10.10.10.254 - -# Delete the bridge interface -ip link delete dev $BRIDGE type bridge - -# Disable IP forwarding -sysctl -w net.ipv4.ip_forward=0 > /dev/null 2>&1 - -# Flush existing iptables rules and set default policies to ACCEPT -iptables --flush -iptables -t nat -F -iptables -X -iptables -Z -iptables -P OUTPUT ACCEPT -iptables -P INPUT ACCEPT -iptables -P FORWARD ACCEPT - -# Allow DHCP and DNS traffic on the network interface -iptables -A INPUT -i $BRIDGE -p tcp -m tcp --dport 67 -j ACCEPT -iptables -A INPUT -i $BRIDGE -p udp -m udp --dport 67 -j ACCEPT -iptables -A INPUT -i $BRIDGE -p tcp -m tcp --dport 53 -j ACCEPT -iptables -A INPUT -i $BRIDGE -p udp -m udp --dport 53 -j ACCEPT - -# Allow forwarding of packets between the network and the bridge -iptables -A FORWARD -s $NETWORK/$NETMASK -i $BRIDGE -j ACCEPT -iptables -A FORWARD -d $NETWORK/$NETMASK -o $BRIDGE -m state --state RELATED,ESTABLISHED -j ACCEPT - -# Delete the network address translation (NAT) rules -iptables -t nat -D POSTROUTING -s $NETWORK/$NETMASK -d $NETWORK/$NETMASK -j ACCEPT -iptables -t nat -D POSTROUTING -s $NETWORK/$NETMASK -j MASQUERADE - -# Delete the dnsmasq process -pid_file="/var/run/qemu-dnsmasq-$BRIDGE.pid" -if [ -f "$pid_file" ]; then - kill $(cat "$pid_file") - rm "$pid_file" -fi - -# Remove the wireless interface from the forwarding rules -iptables -D FORWARD -i $BRIDGE -o $WIRELESS -j ACCEPT -iptables -t nat -D POSTROUTING -o $WIRELESS -j MASQUERADE - -# Allow known traffic from the wireless interface to return to the network interface -iptables -D FORWARD -i $WIRELESS -o $BRIDGE -m state --state RELATED,ESTABLISHED -j ACCEPT - -echo "Reverted back to default configuration." - diff --git a/Scripts/setup_tap.sh b/Scripts/setup_tap.sh deleted file mode 100644 index 1c71344..0000000 --- a/Scripts/setup_tap.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -if [[ $EUID > 0 ]]; then - echo "Run this script as root" - exit -fi - -BRIDGE="br0" -TAP="tap0" - -echo "Available network interfaces:" -interfaces=$(ip link | awk -F ': ' '{print $2}') -index=0 - -# Array to store interface names -declare -a interface_names - -# Array to store interface types -declare -a interface_types - -# Loop through each interface and display its type -for interface in $interfaces; do - type=$(ip link show $interface | grep -o 'type .*' | awk '{print $2}') - echo "$index: $interface - $type" - - # Store interface name and type in arrays - interface_names[$index]=$interface - interface_types[$index]=$type - - ((index++)) -done - -# Prompt the user to select an interface -read -p "Enter the number of the interface you want to use: " selection - -# Validate the user's input -if [[ ! $selection =~ ^[0-9]+$ || $selection -lt 0 || $selection -ge $index ]]; then - echo "Invalid selection. Exiting." - exit -fi - -INTERFACE=${interface_names[$selection]} -INTERFACE_TYPE=${interface_types[$selection]} - -echo "Selected interface: $INTERFACE - $INTERFACE_TYPE" - -echo "Adding bridge $BRIDGE" -ip link add name $BRIDGE type bridge - -echo "Flushing interface $INTERFACE" -ip addr flush dev $INTERFACE - -echo "Setting $BRIDGE as master of $INTERFACE" -ip link set $INTERFACE master $BRIDGE - -echo "Adding tap $TAP" -ip tuntap add $TAP mode tap - -echo "Setting $BRIDGE as master of $TAP" -ip link set $TAP master $BRIDGE - -echo "Setting $INTERFACE, $BRIDGE, and $TAP up" -ip link set up dev $INTERFACE -ip link set up dev $TAP -ip link set up dev $BRIDGE - -echo "Stopping NetworkManager" -systemctl stop NetworkManager - -echo "Requesting IP for $BRIDGE" -dhclient -1 -v $BRIDGE - -if [ $? -eq 0 ]; then - echo "Requesting IP for $INTERFACE" - dhclient $INTERFACE - echo "Killing dhclient and starting NetworkManager" - pkill -9 dhclient - systemctl start NetworkManager -fi - -# run qemu with the below arguments -# -# qemu-system-x86_64 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0 - diff --git a/Widgets/Dashboard.py b/Widgets/Dashboard.py index 1d77e53..e7e17a6 100644 --- a/Widgets/Dashboard.py +++ b/Widgets/Dashboard.py @@ -84,10 +84,15 @@ class Dashboard(Base, Form): - tile: The tile for which the icon needs to be set. - size: The size of the icon. """ - icon = tile.icon() - scaled_pixmap = icon.pixmap(icon.availableSizes()[0]).scaled(size, size, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation) - tile.setIcon(QtGui.QIcon(scaled_pixmap)) - tile.setIconSize(QtCore.QSize(size, 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)) + except Exception as e: + print(f"Failed to set icon: {e}") def tile_clicked(self, tile): """ diff --git a/Widgets/HVACPage.py b/Widgets/HVACPage.py index 99ee798..312f82b 100644 --- a/Widgets/HVACPage.py +++ b/Widgets/HVACPage.py @@ -42,7 +42,20 @@ class HVAC_Paths(): self.temperatureList = [str(i) + "°C" for i in range(32, 15, -1)] class HVACWidget(Base, Form): + """ + A widget for controlling HVAC settings. + + Inherits from Base and Form. + """ + def __init__(self, parent=None): + """ + Initializes the HVACWidget. + + Args: + - parent: The parent widget. Defaults to None. + """ + super(self.__class__, self).__init__(parent) self.setupUi(self) @@ -83,23 +96,43 @@ class HVACWidget(Base, Form): self.rightFanSpeed_slider.valueChanged.connect(self.rightFanSpeed_sliderChanged) def leftTempListClicked(self): + """ + Handles the event when an item in the left temperature list is clicked. + 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()) def rightTempListClicked(self): + """ + Handles the event when an item in the right temperature list is clicked. + 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()) def leftFanSpeed_sliderChanged(self): + """ + Handles the event when the left fan speed slider is changed. + Sends the selected fan speed value to the feed_kuksa object. + """ + value = self.leftFanSpeed_slider.value() self.feed_kuksa.send_values(self.HVAC.leftFanSpeed, str(value)) print(value) def rightFanSpeed_sliderChanged(self): + """ + Handles the event when the right fan speed slider is changed. + Sends the selected fan speed value to the feed_kuksa object. + """ + value = self.rightFanSpeed_slider.value() self.feed_kuksa.send_values(self.HVAC.rightFanSpeed, str(value)) print(value) diff --git a/Widgets/SteeringCtrlPage.py b/Widgets/SteeringCtrlPage.py index 696c6c9..de3585d 100644 --- a/Widgets/SteeringCtrlPage.py +++ b/Widgets/SteeringCtrlPage.py @@ -18,9 +18,6 @@ import os import sys from PyQt5 import uic from PyQt5.QtWidgets import QApplication, QButtonGroup -from PyQt5.QtCore import QThread - -import time current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -120,6 +117,7 @@ class SteeringCtrlWidget(Base, Form): self.PhoneHangup, self.Voice, self.LaneDeparture, + self.Horn, self.CruiseEnable, self.CruiseSet, self.CruiseResume, @@ -138,13 +136,12 @@ 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"]) # Making sure button state goes back to off feed_can.send_can_signal("021#FFFFFFFF00000000") - print(button_clicked + " button clicked") if __name__ == '__main__': import sys diff --git a/Widgets/settings.py b/Widgets/settings.py index 17ea7f6..a7820fc 100644 --- a/Widgets/settings.py +++ b/Widgets/settings.py @@ -17,12 +17,13 @@ import os import sys import time from PyQt5 import uic -from PyQt5.QtWidgets import QApplication, QLineEdit, QPushButton, QLabel +from PyQt5.QtWidgets import QApplication, QLineEdit, QPushButton, QLabel, QComboBox, QStyledItemDelegate from qtwidgets import AnimatedToggle from PyQt5.QtWidgets import QWidget from PyQt5.QtCore import QThread from PyQt5 import QtGui import logging +import can current_dir = os.path.dirname(os.path.abspath(__file__)) @@ -31,6 +32,7 @@ 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")) @@ -39,6 +41,12 @@ 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. @@ -60,31 +68,34 @@ class settings(Base, Form): """ super(self.__class__, self).__init__(parent) self.setupUi(self) - - self.SSL_toggle = AnimatedToggle( - checked_color="#4BD7D6", - pulse_checked_color="#00ffff", - ) - - self.Protocol_toggle = AnimatedToggle( - checked_color="#4BD7D6", - pulse_checked_color="#00ffff" - ) - self.CAN_Kuksa_toggle = AnimatedToggle( - checked_color="#4BD7D6", - pulse_checked_color="#00ffff" - ) + self.SSL_toggle = create_animated_toggle() + self.Protocol_toggle = create_animated_toggle() + self.CAN_Kuksa_toggle = create_animated_toggle() self.connectionStatus = self.findChild(QLabel, "connectionStatus") self.connectionLogo = self.findChild(QLabel, "connectionLogo") + 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.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.IPAddrInput = self.findChild(QLineEdit, "IPAddrInput") + self.PortInput = self.findChild(QLineEdit, "PortInput") + self.TLS_Server_Name = self.findChild(QLineEdit, "TLS_Server_Name") + self.Auth_Token = self.findChild(QLineEdit, "Auth_Token") + self.CA_File = self.findChild(QLineEdit, "CA_File") self.reconnectBtn = self.findChild(QPushButton, "reconnectBtn") self.startClientBtn = self.findChild(QPushButton, "startClientBtn") + self.startClientBtn.setCheckable(True) - self.startClientBtn.clicked.connect(self.set_instance) + self.startClientBtn.clicked.connect(self.start_stop_client) self.reconnectBtn.clicked.connect(self.reconnectClient) self.SSL_toggle.clicked.connect(self.toggleSSL) self.CAN_Kuksa_toggle.clicked.connect(self.toggle_CAN_Kuksa) @@ -102,7 +113,27 @@ class settings(Base, Form): self.place_holder_toggle_2.deleteLater() self.place_holder_toggle_3.deleteLater() - self.refreshStatus() + self.set_settings(default_config_name) + + def start_stop_client(self): + if self.startClientBtn.isChecked(): + # turn button red and change icon to stop from resources + 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.setText("Stop Client") + else: + self.startClientBtn.setChecked(False) + else: + # turn button green and change icon to start from resources + if self.client is not None: + self.client.stop() + + self.startClientBtn.setStyleSheet("border: 1px solid green;") + self.startClientBtn.setIcon(QtGui.QIcon(":/Carbon_Icons/carbon_icons/play.svg")) + self.startClientBtn.setText("Start Client") + def toggleSSL(self): """ @@ -117,7 +148,14 @@ class settings(Base, Form): """ global Steering_Signal_Type if (self.CAN_Kuksa_toggle.isChecked()): - Steering_Signal_Type = "CAN" + # check if can0 is available + try: + can_bus = can.interface.Bus(channel='can0', bustype='socketcan_native') + can_bus.shutdown() + Steering_Signal_Type = "CAN" + except: + self.CAN_Kuksa_toggle.setChecked(False) + logging.error("CAN Bus not available") else: Steering_Signal_Type = "Kuksa" @@ -132,13 +170,12 @@ class settings(Base, Form): Sets the instance of the Kuksa client. """ self.kuksa = kuksa_instance.KuksaClientSingleton.instance() - self.client = self.kuksa.get_client() - - self.kuksa_config = self.kuksa.get_config() - - self.IPAddrInput.setText(self.kuksa_config["ip"]) - self.SSL_toggle.setChecked(not self.kuksa_config["insecure"]) - self.Protocol_toggle.setChecked(self.kuksa_config["protocol"] == 'grpc') + new_config = self.make_new_config() + if (new_config is None): + logging.error("Invalid configuration") + else: + self.kuksa.reconnect(new_config, self.kuksa_token) + self.client = self.kuksa.get_client() time.sleep(2) @@ -162,7 +199,6 @@ class settings(Base, Form): if (self.client.checkConnection() == True): self.connectionStatus.setText('Connected') self.connectionLogo.setStyleSheet("background-color: green") - # change cnnection logo pixmap to connected.svf from resources self.connectionLogo.setPixmap(QtGui.QPixmap(":/Carbon_Icons/carbon_icons/connection-signal.svg")) self.client.start() return True @@ -180,23 +216,66 @@ class settings(Base, Form): """ Reconnects the client. """ - try: - self.kuksa_config["ip"] = self.IPAddrInput.text() - self.kuksa_config["insecure"] = not self.SSL_toggle.isChecked() - self.kuksa_config["protocol"] = self.get_protocol() - if self.kuksa_config["protocol"] == 'ws': - self.kuksa_config["port"] = "8090" - if self.kuksa_config["protocol"] == 'grpc': - self.kuksa_config["port"] = "55555" - self.client = self.kuksa.reconnect(self.kuksa_config) - self.client.start() - self.refreshStatus() - - self.refreshThread = RefreshThread(self) - self.refreshThread.start() - - except Exception as e: - logging.error(e) + if (self.client is not None): + try: + config = self.make_new_config() + self.client.stop() + self.client = self.kuksa.reconnect(config, self.kuksa_token) + self.client.start() + self.refreshStatus() + + self.refreshThread = RefreshThread(self) + self.refreshThread.start() + + except Exception as e: + logging.error(e) + self.set_instance() + + def make_new_config(self): + """ + Makes a new configuration using fields in the settings widget. + """ + + def validate_and_set_style(self, widget, key=None): + text = widget.text() + if text: + if os.path.exists(text): + widget.setStyleSheet("border: 1px solid #4BD7D6 ; /* light blue */") + if key: + self.new_config[key] = text + else: + self.kuksa_token = text + 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 + 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. + """ + new_config = config.select_config(config_name) + self.kuksa_config_name = new_config[0] + self.kuksa_config = new_config[1] + self.kuksa_token = new_config[2] + + 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.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.Auth_Token.setText(self.kuksa_token) class RefreshThread(QThread): def __init__(self, settings): diff --git a/assets/carbon_icons/chevron--down.svg b/assets/carbon_icons/chevron--down.svg new file mode 100644 index 0000000..eaedea9 --- /dev/null +++ b/assets/carbon_icons/chevron--down.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:none;} +</style> +<polygon points="16,22 6,12 7.4,10.6 16,19.2 24.6,10.6 26,12 " fill="white"/> +<rect id="_x3C_Transparent_Rectangle_x3E_" class="st0" width="32" height="32"/> +</svg> diff --git a/assets/carbon_icons/chevron--up.svg b/assets/carbon_icons/chevron--up.svg new file mode 100644 index 0000000..90d9470 --- /dev/null +++ b/assets/carbon_icons/chevron--up.svg @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 22.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:none;} +</style> +<polygon points="16,10 26,20 24.6,21.4 16,12.8 7.4,21.4 6,20 " fill="white"/> +<rect id="_x3C_Transparent_Rectangle_x3E_" class="st0" width="32" height="32"/> +</svg> diff --git a/assets/carbon_icons/corner.svg b/assets/carbon_icons/corner.svg new file mode 100644 index 0000000..0dc6056 --- /dev/null +++ b/assets/carbon_icons/corner.svg @@ -0,0 +1,9 @@ +<svg id="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"> + <defs> + <style>.cls-1{fill:none;}</style> + </defs> + <title>corner</title> + <path d="M28,9H14V6H6v8H9V28h2V14h3V11H28Z" transform="rotate(180, 16, 16)" fill="white"/> + <rect id="_Transparent_Rectangle_" data-name="<Transparent Rectangle>" class="cls-1" width="32" height="32"/> +</svg> + diff --git a/assets/carbon_icons/stop.svg b/assets/carbon_icons/stop.svg new file mode 100644 index 0000000..f252f90 --- /dev/null +++ b/assets/carbon_icons/stop.svg @@ -0,0 +1 @@ +<svg id="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><defs><style>.cls-1{fill:none;}</style></defs><title>stop</title><path d="M24,8V24H8V8H24m0-2H8A2,2,0,0,0,6,8V24a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2Z" fill="white"/><rect id="_Transparent_Rectangle_" data-name="<Transparent Rectangle>" class="cls-1" width="32" height="32"/></svg> diff --git a/assets/res.qrc b/assets/res.qrc index 3a04df5..a662c76 100644 --- a/assets/res.qrc +++ b/assets/res.qrc @@ -1,5 +1,9 @@ <RCC> <qresource prefix="Carbon_Icons"> + <file>carbon_icons/stop.svg</file> + <file>carbon_icons/chevron--down.svg</file> + <file>carbon_icons/chevron--up.svg</file> + <file>carbon_icons/corner.svg</file> <file>carbon_icons/connection-signal.svg</file> <file>carbon_icons/connection-signal--off.svg</file> <file>carbon_icons/x-axis.svg</file> diff --git a/extras/FeedKuksa.py b/extras/FeedKuksa.py index 56e902e..cda2a30 100644 --- a/extras/FeedKuksa.py +++ b/extras/FeedKuksa.py @@ -14,12 +14,15 @@ limitations under the License. """ -import time import logging from PyQt5.QtCore import QThread +from PyQt5.QtCore import pyqtSignal from . import Kuksa_Instance as kuksa_instance +import threading class FeedKuksa(QThread): + sending_values = pyqtSignal() + finished_sending_values = pyqtSignal() """ A class to handle sending values to Kuksa. @@ -85,20 +88,25 @@ class FeedKuksa(QThread): Exception If there is an error sending values to Kuksa. """ - if self.client is not None: - if self.client.checkConnection(): - try: - if attribute is not None: - self.client.setValue(path, str(value), attribute) - else: - self.client.setValue(path, str(value)) - except Exception as e: - logging.error(f"Error sending values to kuksa {e}") - self.set_instance() - else: - logging.error("Kuksa client is not connected, try reconnecting") - self.set_instance() - else: + + if self.client is None: logging.error("Kuksa client is None, try reconnecting") - time.sleep(2) - self.set_instance()
\ No newline at end of file + return + + if not self.client.checkConnection(): + logging.error("Kuksa client is not connected, try reconnecting") + threading.Thread(target=self.set_instance).start() + return + + try: + if attribute is not None: + self.sending_values.emit() + self.client.setValue(path, value, attribute) + else: + self.sending_values.emit() + self.client.setValue(path, value) + + 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 diff --git a/extras/Kuksa_Instance.py b/extras/Kuksa_Instance.py index 500e039..1ff8056 100644 --- a/extras/Kuksa_Instance.py +++ b/extras/Kuksa_Instance.py @@ -19,8 +19,6 @@ import kuksa_client as kuksa import threading import time -from extras import config - class KuksaClientSingleton: """ A singleton class that provides a single instance of KuksaClientThread. @@ -73,28 +71,11 @@ class KuksaClientSingleton: if KuksaClientSingleton._instance is not None: raise Exception("This class is a singleton!") - self.kuksa_config = config.KUKSA_CONFIG - self.ws_token = config.WS_TOKEN - self.grpc_token = config.GRPC_TOKEN - - if self.kuksa_config["protocol"] == 'ws': - self.token = self.ws_token - if self.kuksa_config["protocol"] == 'grpc': - self.token = self.grpc_token - - try: - self.client = kuksa.KuksaClientThread(self.kuksa_config) - self.client.authorize(self.token) - self.client.start() - time.sleep(2) - if not self.client.checkConnection(): - self.client = None - except Exception as e: - print(e) + self.client = None KuksaClientSingleton._instance = self - def reconnect(self, config): + def reconnect(self, config, token): """ Reconnects the client with the given configuration and token. @@ -107,18 +88,10 @@ class KuksaClientSingleton: """ if self.client: self.client.stop() - - if self.kuksa_config["protocol"] == 'ws': - self.token = self.ws_token - self.kuksa_config["port"] = "8090" - if self.kuksa_config["protocol"] == 'grpc': - self.token = self.grpc_token - self.kuksa_config["port"] = "55555" - self.client = kuksa.KuksaClientThread(self.kuksa_config) - self.client.authorize(self.token) + self.client = kuksa.KuksaClientThread(config) + self.client.authorize(token) self.client.start() - return self.client def get_client(self): """ diff --git a/extras/UI_Handeler.py b/extras/UI_Handeler.py index 2bfcfc4..261df94 100644 --- a/extras/UI_Handeler.py +++ b/extras/UI_Handeler.py @@ -24,16 +24,30 @@ 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): + global block_subscription_updates + block_subscription_updates = True + + def unblock_updates(self): + global block_subscription_updates + block_subscription_updates = False def Hide_Navbar(self, bool_arg): """ @@ -143,9 +157,10 @@ class UI_Handeler(MainWindow): Args: - data: The data received from the signal. """ - global should_execute_callback - if should_execute_callback is False: + global block_subscription_updates + if block_subscription_updates: return + IC_Page = self.stackedWidget.widget(1) HVAC_Page = self.stackedWidget.widget(2) diff --git a/extras/config.ini b/extras/config.ini new file mode 100644 index 0000000..0f64a4f --- /dev/null +++ b/extras/config.ini @@ -0,0 +1,48 @@ +[default] +preferred-config=AGL-kuksa-val-server + +# [cutom-config-template] +# ip=<ip address> +# port=<port number> +# protocol=<ws|grpc> # ws/grpc -> kuksa-val-server, grpc -> databroker +# insecure=<true|false> # Note: Use insecure mode only if server is also running in insecure mode +# cacert=<default|/path/to/CA.pem> +# token=<default|/path/to/token> +# tls_server_name=<name> + +[kuksa-val-server] +ip=localhost +port=8090 +protocol=ws +insecure=false +token=default +tls_server_name= + + +[databroker] +ip=localhost +port=55555 +protocol=grpc +insecure=false +token=default +tls_server_name=Server + + +[AGL-kuksa-val-server] +ip=localhost +port=8090 +protocol=ws +insecure=false +cacert=default +token=default +tls_server_name= + + +[AGL-databroker] +ip=10.42.0.95 +port=55555 +protocol=grpc +insecure=false +cacert=default +token=default +tls_server_name=Server diff --git a/extras/config.py b/extras/config.py index 3309b71..2b92342 100644 --- a/extras/config.py +++ b/extras/config.py @@ -16,19 +16,96 @@ import os import platform +from configparser import ConfigParser python_version = f"python{'.'.join(platform.python_version_tuple()[:2])}" -CA = os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/cert/CA.pem")) +def check_paths(*paths): + return {path: os.path.exists(path) for path in paths} -KUKSA_CONFIG = { - "ip": '127.0.0.1', - "port": "55555", - 'protocol': 'grpc', - 'insecure': False, - 'cacertificate': CA, - 'tls_server_name': "Server", -} +CONFIG_PATHS = check_paths( + "/etc/agl-demo-control-panel.ini", + os.path.join(os.path.expanduser("~"), ".local/share/agl-demo-control-panel/config.ini"), + os.path.abspath(os.path.join(os.path.dirname(__file__), 'config.ini')) +) -WS_TOKEN = os.path.join(os.path.expanduser("~"), f".local/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token") -GRPC_TOKEN = os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/token/grpc/actuate-provide-all.token")) +CA_PATHS = check_paths( + "/etc/kuksa-val/CA.pem", + f"/usr/lib/{python_version}/site-packages/kuksa_certificates/CA.pem", + os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/cert/CA.pem")) +) + +WS_TOKEN_PATHS = check_paths( + f"/usr/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token", + os.path.join(os.path.expanduser("~"), f".local/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token") +) + +GRPC_TOKEN_PATHS = check_paths( + f"/usr/lib/{python_version}/site-packages/kuksa_certificates/jwt/super-admin.json.token", + os.path.abspath(os.path.join(os.path.dirname(__file__), "../assets/token/grpc/actuate-provide-all.token")) +) + +config = ConfigParser() +config_path = next((path for path, exists in CONFIG_PATHS.items() if exists), None) +if config_path: + config.read(config_path) + +CA_PATH = next((path for path, exists in CA_PATHS.items() if exists), None) +WS_TOKEN = next((path for path, exists in WS_TOKEN_PATHS.items() if exists), None) +GRPC_TOKEN = next((path for path, exists in GRPC_TOKEN_PATHS.items() if exists), None) + +KUKSA_CONFIG = {} +KUKSA_TOKEN = None + +def select_config(preferred_config): + """ + Selects a configuration from the config.ini file based on the preferred_config parameter. + + Args: + preferred_config (str): The name of the configuration section to select. + + Returns: + Tuple[str, Dict[str, Union[str, bool]], str]: A tuple containing the name of the selected configuration section, + a dictionary containing the configuration options for the selected section, and the token to use for the selected + protocol. + """ + global KUKSA_CONFIG, KUKSA_TOKEN + KUKSA_CONFIG.clear() + + if config.has_section(preferred_config): + KUKSA_CONFIG['ip'] = config[preferred_config]['ip'] + KUKSA_CONFIG['port'] = config[preferred_config]['port'] + KUKSA_CONFIG['protocol'] = config[preferred_config]['protocol'] + KUKSA_CONFIG['insecure'] = False if config[preferred_config]['insecure'] == 'false' else True + + if config.has_option(preferred_config, 'cacert'): + KUKSA_CONFIG['cacertificate'] = config[preferred_config]['cacert'] if os.path.exists(config[preferred_config]['cacert']) else CA_PATH + else: + KUKSA_CONFIG['cacertificate'] = None + + KUKSA_CONFIG['tls_server_name'] = config[preferred_config]['tls_server_name'] + + if config.has_option(preferred_config, 'token'): + if config[preferred_config]['token'] == 'default': + KUKSA_TOKEN = get_default_token(KUKSA_CONFIG['protocol']) + elif os.path.exists(config[preferred_config]['token']): + KUKSA_TOKEN = config[preferred_config]['token'] + else: + ValueError(f"Token file {config[preferred_config]['token']} not found") + else: + raise ValueError(f"Config section {preferred_config} not found in config.ini") + + return preferred_config, KUKSA_CONFIG , KUKSA_TOKEN + +def get_list_configs(): + return config.sections()[1:] + +def get_default_config(): + defaultConfigName = config.get('default', 'preferred-config') + return defaultConfigName + +def get_default_token(protocol): + if protocol == 'grpc': + return GRPC_TOKEN + else: + return WS_TOKEN
\ No newline at end of file @@ -52,7 +52,7 @@ class MainWindow(Base, Form): 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) @@ -96,7 +96,7 @@ class MainWindow(Base, Form): self.stop_thread_signal.connect(self.stackedWidget.widget(0).feed_kuksa.stop) - self.stackedWidget.setCurrentIndex(0) + self.stackedWidget.setCurrentIndex(0) self.dashboardButton.setChecked(True) UI_Handeler.Hide_Navbar(self,bool_arg=False) @@ -105,6 +105,24 @@ class MainWindow(Base, Form): self.current_page = self.stackedWidget.currentIndex() + 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; + background-image: url(:/Carbon_Icons/carbon_icons/corner.svg); + background-repeat: no-repeat; + background-position: center; + border: none; + } + """) + self.centralwidget.layout().addWidget(self.size_grip, 0, Qt.AlignBottom | Qt.AlignRight) + + def VSS_callback(self,data): + pass + def handleTileClicked(self): """ Handles the tile clicked signal from the Dashboard object. @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>713</width> - <height>527</height> + <width>815</width> + <height>575</height> </rect> </property> <property name="windowTitle"> @@ -66,7 +66,7 @@ QSlider::sub-page:vertical { background-color: #131313 ; /* black */ height: 20px; - width: 18px; + width: 28px; margin: 2px; border: 1px solid #6C6C85 ; /* pastel purple */ border-radius: 8px; @@ -74,7 +74,7 @@ QSlider::sub-page:vertical { QSlider::groove:vertical { border-radius: 8px; - width: 18px; + width: 28px; margin: 2px; border: 1px solid #6C6C85 ; /* pastel purple */ background-color: #4BD7D6 ; /* light blue */ @@ -191,44 +191,6 @@ QListWidget::item:hover { </property> <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <widget class="QFrame" name="frame_2"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>50</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLabel" name="label_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>HVAC</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> <widget class="QScrollArea" name="scrollArea"> <property name="widgetResizable"> <bool>true</bool> @@ -238,8 +200,8 @@ QListWidget::item:hover { <rect> <x>0</x> <y>0</y> - <width>697</width> - <height>409</height> + <width>799</width> + <height>517</height> </rect> </property> <layout class="QVBoxLayout" name="verticalLayout_3"> @@ -248,6 +210,9 @@ QListWidget::item:hover { <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> @@ -271,12 +236,28 @@ QListWidget::item:hover { <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="12"> - <widget class="QFrame" name="rightControls"> + <item row="1" column="3" colspan="2"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="1" colspan="5" alignment="Qt::AlignBottom"> + <widget class="QFrame" name="frame_2"> <property name="minimumSize"> <size> <width>0</width> - <height>0</height> + <height>50</height> </size> </property> <property name="frameShape"> @@ -285,69 +266,15 @@ QListWidget::item:hover { <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="1" column="0" colspan="5"> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="0" rowspan="5"> - <spacer name="horizontalSpacer_9"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="4" rowspan="5"> - <spacer name="horizontalSpacer_8"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="4" column="1"> - <widget class="QListWidget" name="rightTempList"> + <layout class="QVBoxLayout" name="verticalLayout_4"> + <item alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_2"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>152</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>152</height> - </size> - </property> <property name="font"> <font> <weight>75</weight> @@ -355,83 +282,47 @@ QListWidget::item:hover { <bold>true</bold> </font> </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set> - </property> - <property name="showDropIndicator" stdset="0"> - <bool>false</bool> - </property> - <property name="dragDropMode"> - <enum>QAbstractItemView::DragOnly</enum> - </property> - <property name="selectionMode"> - <enum>QAbstractItemView::ContiguousSelection</enum> - </property> - <property name="textElideMode"> - <enum>Qt::ElideMiddle</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <property name="movement"> - <enum>QListView::Snap</enum> - </property> - <property name="resizeMode"> - <enum>QListView::Adjust</enum> - </property> - <property name="layoutMode"> - <enum>QListView::SinglePass</enum> - </property> - <property name="spacing"> - <number>1</number> - </property> - <property name="viewMode"> - <enum>QListView::ListMode</enum> - </property> - <property name="selectionRectVisible"> - <bool>true</bool> - </property> - <property name="itemAlignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="6" column="3" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_4"> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Images/Images/HMI_HVAC_Fan_Icon.svg</pixmap> + <string>HVAC</string> </property> </widget> </item> - <item row="0" column="0" colspan="5" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_6"> + </layout> + </widget> + </item> + <item row="1" column="6"> + <spacer name="horizontalSpacer_3"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="1" colspan="2"> + <widget class="QFrame" name="leftControls"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="0" colspan="5" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label"> <property name="font"> <font> <weight>75</weight> @@ -440,78 +331,223 @@ QListWidget::item:hover { </font> </property> <property name="text"> - <string>Right Controls</string> + <string>Left Controls</string> </property> </widget> </item> - <item row="2" column="2" rowspan="5"> - <spacer name="horizontalSpacer_5"> + <item row="0" column="0" colspan="5"> + <spacer name="verticalSpacer_7"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> <property name="sizeType"> <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> </item> - <item row="2" column="3" rowspan="4" alignment="Qt::AlignHCenter"> - <widget class="QSlider" name="rightFanSpeed_slider"> - <property name="minimumSize"> - <size> - <width>40</width> - <height>0</height> - </size> - </property> + <item row="2" column="0" colspan="5"> + <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> - </widget> - </item> - <item row="6" column="1"> - <widget class="QPushButton" name="rightTempDown"> - <property name="text"> - <string/> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</iconset> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>20</height> + </size> </property> - <property name="iconSize"> + </spacer> + </item> + <item row="3" column="0" rowspan="2"> + <spacer name="horizontalSpacer_6"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> <width>40</width> - <height>40</height> + <height>20</height> </size> </property> - </widget> + </spacer> </item> - <item row="3" column="1" alignment="Qt::AlignTop"> - <widget class="QPushButton" name="rightTempUp"> - <property name="text"> - <string/> + <item row="3" column="2" rowspan="2"> + <spacer name="horizontalSpacer_4"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</iconset> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> - <property name="iconSize"> + <property name="sizeHint" stdset="0"> <size> <width>40</width> - <height>40</height> + <height>20</height> </size> </property> + </spacer> + </item> + <item row="3" column="3" rowspan="2"> + <widget class="QFrame" name="frame_3"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_5"> + <item alignment="Qt::AlignHCenter|Qt::AlignBottom"> + <widget class="QPushButton" name="leftTempUp"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>40</width> + <height>40</height> + </size> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QListWidget" name="leftTempList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>152</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>152</height> + </size> + </property> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="sizeAdjustPolicy"> + <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> + </property> + <property name="editTriggers"> + <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set> + </property> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="dragDropMode"> + <enum>QAbstractItemView::DragOnly</enum> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::SingleSelection</enum> + </property> + <property name="textElideMode"> + <enum>Qt::ElideMiddle</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="movement"> + <enum>QListView::Snap</enum> + </property> + <property name="isWrapping" stdset="0"> + <bool>false</bool> + </property> + <property name="resizeMode"> + <enum>QListView::Adjust</enum> + </property> + <property name="layoutMode"> + <enum>QListView::SinglePass</enum> + </property> + <property name="spacing"> + <number>1</number> + </property> + <property name="viewMode"> + <enum>QListView::ListMode</enum> + </property> + <property name="uniformItemSizes"> + <bool>true</bool> + </property> + <property name="selectionRectVisible"> + <bool>true</bool> + </property> + <property name="itemAlignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignTop"> + <widget class="QPushButton" name="leftTempDown"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>40</width> + <height>40</height> + </size> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="7" column="0" colspan="5"> - <spacer name="verticalSpacer_6"> + <item row="5" column="0" colspan="5"> + <spacer name="verticalSpacer_5"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> @@ -520,27 +556,101 @@ QListWidget::item:hover { </property> </spacer> </item> + <item row="3" column="4" rowspan="2"> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="3" column="1"> + <widget class="QFrame" name="frame_4"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_6"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item alignment="Qt::AlignHCenter"> + <widget class="QSlider" name="leftFanSpeed_slider"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>40</width> + <height>0</height> + </size> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="invertedAppearance"> + <bool>false</bool> + </property> + <property name="invertedControls"> + <bool>false</bool> + </property> + <property name="tickPosition"> + <enum>QSlider::NoTicks</enum> + </property> + <property name="tickInterval"> + <number>0</number> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Images/Images/HMI_HVAC_Fan_Icon.svg</pixmap> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + <property name="alignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> </item> - <item row="0" column="5"> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="13"> - <spacer name="horizontalSpacer_3"> + <item row="1" column="0"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -555,8 +665,8 @@ QListWidget::item:hover { </property> </spacer> </item> - <item row="0" column="2" colspan="2"> - <widget class="QFrame" name="leftControls"> + <item row="1" column="5"> + <widget class="QFrame" name="rightControls"> <property name="minimumSize"> <size> <width>0</width> @@ -569,42 +679,14 @@ QListWidget::item:hover { <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="2" column="1" rowspan="4" alignment="Qt::AlignHCenter"> - <widget class="QSlider" name="leftFanSpeed_slider"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>40</width> - <height>0</height> - </size> - </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="6" column="0" colspan="6"> + <spacer name="verticalSpacer_6"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> - <property name="invertedAppearance"> - <bool>false</bool> - </property> - <property name="invertedControls"> - <bool>false</bool> - </property> - <property name="tickPosition"> - <enum>QSlider::NoTicks</enum> - </property> - <property name="tickInterval"> - <number>0</number> - </property> - </widget> - </item> - <item row="7" column="0" colspan="5"> - <spacer name="verticalSpacer_5"> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <property name="sizeType"> + <enum>QSizePolicy::Preferred</enum> </property> <property name="sizeHint" stdset="0"> <size> @@ -614,44 +696,14 @@ QListWidget::item:hover { </property> </spacer> </item> - <item row="6" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Images/Images/HMI_HVAC_Fan_Icon.svg</pixmap> - </property> - <property name="scaledContents"> - <bool>false</bool> - </property> - <property name="alignment"> - <set>Qt::AlignCenter</set> - </property> - </widget> - </item> - <item row="6" column="3"> - <widget class="QPushButton" name="leftTempDown"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>40</width> - <height>40</height> - </size> - </property> - </widget> - </item> - <item row="2" column="4" rowspan="5"> - <spacer name="horizontalSpacer_7"> + <item row="3" column="5" rowspan="3"> + <spacer name="horizontalSpacer_8"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> @@ -660,125 +712,80 @@ QListWidget::item:hover { </property> </spacer> </item> - <item row="4" column="3" alignment="Qt::AlignHCenter"> - <widget class="QListWidget" name="leftTempList"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>152</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>60</width> - <height>152</height> - </size> - </property> - <property name="font"> - <font> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="focusPolicy"> - <enum>Qt::StrongFocus</enum> - </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="autoFillBackground"> - <bool>false</bool> - </property> + <item row="4" column="4"> + <widget class="QFrame" name="frame_6"> <property name="frameShape"> - <enum>QFrame::NoFrame</enum> + <enum>QFrame::StyledPanel</enum> </property> <property name="frameShadow"> - <enum>QFrame::Plain</enum> - </property> - <property name="verticalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="horizontalScrollBarPolicy"> - <enum>Qt::ScrollBarAlwaysOff</enum> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> - </property> - <property name="editTriggers"> - <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set> - </property> - <property name="showDropIndicator" stdset="0"> - <bool>false</bool> - </property> - <property name="dragDropMode"> - <enum>QAbstractItemView::DragOnly</enum> - </property> - <property name="selectionMode"> - <enum>QAbstractItemView::SingleSelection</enum> - </property> - <property name="textElideMode"> - <enum>Qt::ElideMiddle</enum> - </property> - <property name="verticalScrollMode"> - <enum>QAbstractItemView::ScrollPerPixel</enum> - </property> - <property name="movement"> - <enum>QListView::Snap</enum> - </property> - <property name="isWrapping" stdset="0"> - <bool>false</bool> - </property> - <property name="resizeMode"> - <enum>QListView::Adjust</enum> - </property> - <property name="layoutMode"> - <enum>QListView::SinglePass</enum> - </property> - <property name="spacing"> - <number>1</number> - </property> - <property name="viewMode"> - <enum>QListView::ListMode</enum> - </property> - <property name="uniformItemSizes"> - <bool>true</bool> - </property> - <property name="selectionRectVisible"> - <bool>true</bool> - </property> - <property name="itemAlignment"> - <set>Qt::AlignCenter</set> - </property> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_8"> + <property name="spacing"> + <number>4</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>0</number> + </property> + <item alignment="Qt::AlignHCenter"> + <widget class="QSlider" name="rightFanSpeed_slider"> + <property name="minimumSize"> + <size> + <width>40</width> + <height>0</height> + </size> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Images/Images/HMI_HVAC_Fan_Icon.svg</pixmap> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="0" colspan="5"> - <spacer name="verticalSpacer_3"> + <item row="3" column="2" rowspan="3" colspan="2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> </property> <property name="sizeType"> <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> + <width>40</width> <height>20</height> </size> </property> </spacer> </item> - <item row="2" column="0" rowspan="5"> - <spacer name="horizontalSpacer_6"> + <item row="3" column="0" rowspan="3"> + <spacer name="horizontalSpacer_9"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>40</width> @@ -787,25 +794,24 @@ QListWidget::item:hover { </property> </spacer> </item> - <item row="3" column="3"> - <widget class="QPushButton" name="leftTempUp"> - <property name="text"> - <string/> + <item row="2" column="0" colspan="6"> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</iconset> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> - <property name="iconSize"> + <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>40</height> + <width>20</width> + <height>20</height> </size> </property> - </widget> + </spacer> </item> - <item row="0" column="0" colspan="5" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label"> + <item row="1" column="0" colspan="6" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_6"> <property name="font"> <font> <weight>75</weight> @@ -814,45 +820,167 @@ QListWidget::item:hover { </font> </property> <property name="text"> - <string>Left Controls</string> + <string>Right Controls</string> </property> </widget> </item> - <item row="2" column="2" rowspan="5"> - <spacer name="horizontalSpacer_4"> + <item row="0" column="0" colspan="6"> + <spacer name="verticalSpacer_8"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> </property> <property name="sizeType"> <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> </item> + <item row="4" column="1"> + <widget class="QFrame" name="frame_5"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout_7"> + <item alignment="Qt::AlignHCenter|Qt::AlignBottom"> + <widget class="QPushButton" name="rightTempUp"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--frigid.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>40</width> + <height>40</height> + </size> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QListWidget" name="rightTempList"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>152</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>60</width> + <height>152</height> + </size> + </property> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="focusPolicy"> + <enum>Qt::StrongFocus</enum> + </property> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Plain</enum> + </property> + <property name="verticalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="horizontalScrollBarPolicy"> + <enum>Qt::ScrollBarAlwaysOff</enum> + </property> + <property name="sizeAdjustPolicy"> + <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> + </property> + <property name="editTriggers"> + <set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set> + </property> + <property name="showDropIndicator" stdset="0"> + <bool>false</bool> + </property> + <property name="dragDropMode"> + <enum>QAbstractItemView::DragOnly</enum> + </property> + <property name="selectionMode"> + <enum>QAbstractItemView::ContiguousSelection</enum> + </property> + <property name="textElideMode"> + <enum>Qt::ElideMiddle</enum> + </property> + <property name="verticalScrollMode"> + <enum>QAbstractItemView::ScrollPerPixel</enum> + </property> + <property name="movement"> + <enum>QListView::Snap</enum> + </property> + <property name="resizeMode"> + <enum>QListView::Adjust</enum> + </property> + <property name="layoutMode"> + <enum>QListView::SinglePass</enum> + </property> + <property name="spacing"> + <number>1</number> + </property> + <property name="viewMode"> + <enum>QListView::ListMode</enum> + </property> + <property name="selectionRectVisible"> + <bool>true</bool> + </property> + <property name="itemAlignment"> + <set>Qt::AlignCenter</set> + </property> + </widget> + </item> + <item alignment="Qt::AlignHCenter|Qt::AlignTop"> + <widget class="QPushButton" name="rightTempDown"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</normaloff>:/Carbon_Icons/carbon_icons/temperature--hot.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>40</width> + <height>40</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> </item> - <item row="0" column="0"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </item> @@ -865,6 +993,9 @@ QListWidget::item:hover { <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>724</width> - <height>720</height> + <width>920</width> + <height>800</height> </rect> </property> <property name="windowTitle"> @@ -42,14 +42,15 @@ QPushButton:pressed { } QSlider::groove:horizontal { + background-color: #131313 ; /* black */ border: 1px solid #6C6C85 ; /* pastel purple */ - height: 15px; + height: 28px; border-radius: 8px; } QSlider::sub-page:horizontal { background-color: #4BD7D6 ; /* light blue */ - height: 15px; + height: 28px; border-radius: 5px; } @@ -66,16 +67,16 @@ QSlider::handle:horizontal { QSlider::sub-page:vertical { background-color: #131313 ; /* black */ height: 20px; - width: 18px; - margin: 2px; + width: 28px; + margin: 4px; border: 1px solid #6C6C85 ; /* pastel purple */ border-radius: 8px; } QSlider::groove:vertical { border-radius: 8px; - width: 18px; - margin: 2px; + width: 28px; + margin: 4px; border: 1px solid #6C6C85 ; /* pastel purple */ background-color: #4BD7D6 ; /* light blue */ } @@ -152,7 +153,7 @@ QLCDNumber { <item> <widget class="QFrame" name="centralwidget"> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -164,6 +165,32 @@ QLCDNumber { <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout_3"> + <item row="0" column="0" rowspan="3"> + <spacer name="horizontalSpacer_12"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="2" rowspan="3"> + <spacer name="horizontalSpacer_13"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> <item row="1" column="1"> <widget class="QScrollArea" name="scrollArea"> <property name="widgetResizable"> @@ -174,42 +201,33 @@ QLCDNumber { <rect> <x>0</x> <y>0</y> - <width>664</width> - <height>652</height> + <width>684</width> + <height>782</height> </rect> </property> <layout class="QGridLayout" name="gridLayout_4"> - <item row="0" column="0"> - <spacer name="verticalSpacer_6"> + <item row="2" column="0"> + <spacer name="verticalSpacer_4"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> - <height>40</height> + <height>20</height> </size> </property> </spacer> </item> - <item row="1" column="0"> - <widget class="QFrame" name="frame_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item row="0" column="0" alignment="Qt::AlignBottom"> + <widget class="QFrame" name="header_frame"> <property name="minimumSize"> <size> <width>0</width> - <height>0</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>150</height> + <height>50</height> </size> </property> <property name="frameShape"> @@ -218,139 +236,70 @@ QLCDNumber { <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="4"> - <widget class="QPushButton" name="rightIndicatorBtn"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Images/Images/right.png</normaloff>:/Images/Images/right.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>60</width> - <height>60</height> - </size> - </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QFrame" name="frame_4"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_3"> + <item> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <family>Open Sans Extrabold</family> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Instrument Cluster</string> + </property> + </widget> + </item> + </layout> </widget> </item> - <item row="1" column="1"> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="3"> - <spacer name="horizontalSpacer_4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="leftIndicatorBtn"> - <property name="acceptDrops"> - <bool>false</bool> - </property> - <property name="autoFillBackground"> - <bool>false</bool> + <item> + <widget class="QLabel" name="label_6"> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> </property> <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Images/Images/left.png</normaloff>:/Images/Images/left.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>60</width> - <height>60</height> - </size> - </property> - <property name="checkable"> - <bool>false</bool> - </property> - <property name="checked"> - <bool>false</bool> + <string>Demo Mode</string> </property> </widget> </item> - <item row="1" column="2"> - <widget class="QPushButton" name="hazardBtn"> + <item> + <widget class="QCheckBox" name="demoToggle"> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Images/Images/hazard.png</normaloff>:/Images/Images/hazard.png</iconset> - </property> - <property name="iconSize"> - <size> - <width>60</width> - <height>60</height> - </size> - </property> </widget> </item> </layout> </widget> </item> - <item row="2" column="0"> - <spacer name="verticalSpacer_4"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="0" alignment="Qt::AlignTop"> - <widget class="QFrame" name="frame_1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> + <item row="7" column="0" alignment="Qt::AlignTop"> + <widget class="QFrame" name="gearSelector"> <property name="minimumSize"> <size> <width>0</width> - <height>200</height> - </size> - </property> - <property name="maximumSize"> - <size> - <width>16777215</width> - <height>150</height> + <height>80</height> </size> </property> <property name="frameShape"> @@ -359,200 +308,255 @@ QLCDNumber { <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0"> - <spacer name="horizontalSpacer_10"> + <layout class="QHBoxLayout" name="horizontalLayout_4"> + <item> + <spacer name="horizontalSpacer"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> <property name="sizeHint" stdset="0"> <size> - <width>10</width> + <width>167</width> <height>20</height> </size> </property> </spacer> </item> - <item row="1" column="6" rowspan="2"> - <widget class="QLCDNumber" name="RPM_monitor"> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="digitCount"> - <number>4</number> - </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> - </property> - </widget> - </item> - <item row="1" column="8" alignment="Qt::AlignHCenter"> - <widget class="QSlider" name="fuelLevel_slider"> + <item> + <widget class="QPushButton" name="parkBtn"> <property name="minimumSize"> <size> - <width>60</width> - <height>0</height> + <width>50</width> + <height>50</height> </size> </property> <property name="font"> <font> - <kerning>true</kerning> + <family>Open Sans</family> + <pointsize>20</pointsize> + <weight>75</weight> + <italic>false</italic> + <bold>true</bold> </font> </property> - <property name="sliderPosition"> - <number>0</number> + <property name="text"> + <string>P</string> </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> + <property name="iconSize"> + <size> + <width>16</width> + <height>16</height> + </size> </property> - <property name="invertedAppearance"> - <bool>false</bool> + <property name="checkable"> + <bool>true</bool> </property> - <property name="invertedControls"> + <property name="checked"> <bool>false</bool> </property> - <property name="tickPosition"> - <enum>QSlider::NoTicks</enum> - </property> </widget> </item> - <item row="1" column="1" alignment="Qt::AlignHCenter"> - <widget class="QSlider" name="coolantTemp_slider"> - <property name="minimumSize"> + <item> + <spacer name="horizontalSpacer_7"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>60</width> - <height>0</height> + <width>40</width> + <height>20</height> </size> </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - </widget> + </spacer> </item> - <item row="4" column="3" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_4"> + <item> + <widget class="QPushButton" name="reverseBtn"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>50</height> + </size> + </property> <property name="font"> <font> <family>Open Sans</family> + <pointsize>20</pointsize> <weight>75</weight> - <italic>true</italic> + <italic>false</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>Speed (Kmph)</string> + <string>R</string> + </property> + <property name="checkable"> + <bool>true</bool> </property> </widget> </item> - <item row="1" column="5" rowspan="4"> - <widget class="Line" name="line"> + <item> + <spacer name="horizontalSpacer_8"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> </property> - </widget> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> </item> - <item row="3" column="8" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="label_3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> + <item> + <widget class="QPushButton" name="neutralBtn"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>50</height> + </size> </property> <property name="font"> <font> - <pointsize>12</pointsize> + <family>Open Sans</family> + <pointsize>20</pointsize> + <weight>75</weight> + <italic>false</italic> + <bold>true</bold> </font> </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/rain-drop.svg</pixmap> + <string>N</string> </property> - <property name="scaledContents"> - <bool>false</bool> + <property name="checkable"> + <bool>true</bool> </property> </widget> </item> - <item row="0" column="1" colspan="8"> - <spacer name="verticalSpacer_5"> + <item> + <spacer name="horizontalSpacer_9"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> </property> <property name="sizeType"> <enum>QSizePolicy::Fixed</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>10</height> + <width>40</width> + <height>20</height> </size> </property> </spacer> </item> - <item row="1" column="3" rowspan="2" colspan="2"> - <widget class="QLCDNumber" name="Speed_monitor"> + <item> + <widget class="QPushButton" name="driveBtn"> + <property name="minimumSize"> + <size> + <width>50</width> + <height>50</height> + </size> + </property> <property name="font"> <font> - <weight>50</weight> + <family>Open Sans</family> + <pointsize>20</pointsize> + <weight>75</weight> <italic>false</italic> - <bold>false</bold> + <bold>true</bold> </font> </property> - <property name="layoutDirection"> - <enum>Qt::LeftToRight</enum> - </property> - <property name="frameShape"> - <enum>QFrame::NoFrame</enum> - </property> - <property name="smallDecimalPoint"> - <bool>false</bool> - </property> - <property name="digitCount"> - <number>3</number> + <property name="text"> + <string>D</string> </property> - <property name="segmentStyle"> - <enum>QLCDNumber::Flat</enum> + <property name="checkable"> + <bool>true</bool> </property> </widget> </item> - <item row="3" column="3"> - <widget class="QSlider" name="Speed_slider"> - <property name="minimumSize"> + <item> + <spacer name="horizontalSpacer_2"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> <size> - <width>0</width> - <height>60</height> + <width>168</width> + <height>20</height> </size> </property> - <property name="font"> - <font> - <weight>50</weight> - <bold>false</bold> - </font> - </property> - <property name="maximum"> - <number>240</number> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + </spacer> + </item> + </layout> + </widget> + </item> + <item row="4" column="0"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0" alignment="Qt::AlignTop"> + <widget class="QFrame" name="frame_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>150</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="4"> + <widget class="QPushButton" name="rightIndicatorBtn"> + <property name="text"> + <string/> </property> - <property name="tickPosition"> - <enum>QSlider::NoTicks</enum> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Images/Images/right.png</normaloff>:/Images/Images/right.png</iconset> </property> - <property name="tickInterval"> - <number>0</number> + <property name="iconSize"> + <size> + <width>60</width> + <height>60</height> + </size> </property> </widget> </item> - <item row="1" column="2"> - <spacer name="horizontalSpacer_5"> + <item row="1" column="1"> + <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -567,8 +571,8 @@ QLCDNumber { </property> </spacer> </item> - <item row="1" column="7"> - <spacer name="horizontalSpacer_6"> + <item row="1" column="3"> + <spacer name="horizontalSpacer_4"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -583,65 +587,57 @@ QLCDNumber { </property> </spacer> </item> - <item row="3" column="6"> - <widget class="QSlider" name="RPM_slider"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>60</height> - </size> + <item row="1" column="0"> + <widget class="QPushButton" name="leftIndicatorBtn"> + <property name="acceptDrops"> + <bool>false</bool> </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="autoFillBackground"> + <bool>false</bool> </property> - </widget> - </item> - <item row="1" column="9"> - <spacer name="horizontalSpacer_11"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> + <property name="text"> + <string/> </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Images/Images/left.png</normaloff>:/Images/Images/left.png</iconset> </property> - <property name="sizeHint" stdset="0"> + <property name="iconSize"> <size> - <width>10</width> - <height>20</height> + <width>60</width> + <height>60</height> </size> </property> - </spacer> - </item> - <item row="3" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string/> + <property name="checkable"> + <bool>false</bool> </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/temperature--water.svg</pixmap> + <property name="checked"> + <bool>false</bool> </property> </widget> </item> - <item row="4" column="6" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_5"> - <property name="font"> - <font> - <family>Open Sans</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> + <item row="1" column="2"> + <widget class="QPushButton" name="hazardBtn"> <property name="text"> - <string>Engine RPM</string> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Images/Images/hazard.png</normaloff>:/Images/Images/hazard.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>60</width> + <height>60</height> + </size> </property> </widget> </item> </layout> </widget> </item> - <item row="4" column="0"> - <spacer name="verticalSpacer_2"> + <item row="6" column="0"> + <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> @@ -667,6 +663,12 @@ QLCDNumber { <layout class="QVBoxLayout" name="verticalLayout_3"> <item alignment="Qt::AlignTop"> <widget class="QPushButton" name="accelerationBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> <width>0</width> @@ -697,31 +699,27 @@ QLCDNumber { </property> </widget> </item> - <item> - <spacer name="verticalSpacer_3"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </item> - <item row="6" column="0" alignment="Qt::AlignTop"> - <widget class="QFrame" name="gearSelector"> + <item row="3" column="0" alignment="Qt::AlignTop"> + <widget class="QFrame" name="frame_1"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> <width>0</width> - <height>80</height> + <height>200</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>16777215</width> + <height>150</height> </size> </property> <property name="frameShape"> @@ -730,56 +728,106 @@ QLCDNumber { <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <spacer name="horizontalSpacer"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>167</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="parkBtn"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> + <layout class="QGridLayout" name="gridLayout"> + <item row="4" column="8" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_5"> <property name="font"> <font> <family>Open Sans</family> - <pointsize>20</pointsize> <weight>75</weight> - <italic>false</italic> + <italic>true</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>P</string> + <string>Engine RPM</string> </property> - <property name="iconSize"> - <size> - <width>16</width> - <height>16</height> - </size> + </widget> + </item> + <item row="1" column="5" rowspan="2" colspan="2"> + <widget class="QLCDNumber" name="Speed_monitor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> - <property name="checkable"> - <bool>true</bool> + <property name="font"> + <font> + <weight>50</weight> + <italic>false</italic> + <bold>false</bold> + </font> </property> - <property name="checked"> + <property name="layoutDirection"> + <enum>Qt::LeftToRight</enum> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="smallDecimalPoint"> <bool>false</bool> </property> + <property name="digitCount"> + <number>3</number> + </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_7"> + <item row="1" column="1" rowspan="4" colspan="2"> + <widget class="QFrame" name="frame"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="spacing"> + <number>0</number> + </property> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/temperature--water.svg</pixmap> + </property> + </widget> + </item> + <item> + <widget class="QSlider" name="coolantTemp_slider"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="0" rowspan="4"> + <spacer name="horizontalSpacer_10"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -788,39 +836,30 @@ QLCDNumber { </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>10</width> <height>20</height> </size> </property> </spacer> </item> - <item> - <widget class="QPushButton" name="reverseBtn"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - <property name="font"> - <font> - <family>Open Sans</family> - <pointsize>20</pointsize> - <weight>75</weight> - <italic>false</italic> - <bold>true</bold> - </font> + <item row="0" column="3" colspan="8"> + <spacer name="verticalSpacer_5"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> - <property name="text"> - <string>R</string> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> </property> - <property name="checkable"> - <bool>true</bool> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>10</height> + </size> </property> - </widget> + </spacer> </item> - <item> - <spacer name="horizontalSpacer_8"> + <item row="1" column="12" rowspan="4"> + <spacer name="horizontalSpacer_11"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -829,39 +868,34 @@ QLCDNumber { </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>10</width> <height>20</height> </size> </property> </spacer> </item> - <item> - <widget class="QPushButton" name="neutralBtn"> + <item row="3" column="8"> + <widget class="QSlider" name="RPM_slider"> <property name="minimumSize"> <size> - <width>50</width> - <height>50</height> + <width>0</width> + <height>60</height> </size> </property> - <property name="font"> - <font> - <family>Open Sans</family> - <pointsize>20</pointsize> - <weight>75</weight> - <italic>false</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>N</string> + <property name="orientation"> + <enum>Qt::Horizontal</enum> </property> - <property name="checkable"> - <bool>true</bool> + </widget> + </item> + <item row="1" column="7" rowspan="4"> + <widget class="Line" name="line"> + <property name="orientation"> + <enum>Qt::Vertical</enum> </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_9"> + <item row="1" column="3" rowspan="4" colspan="2"> + <spacer name="horizontalSpacer_5"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -870,168 +904,178 @@ QLCDNumber { </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> + <width>20</width> <height>20</height> </size> </property> </spacer> </item> - <item> - <widget class="QPushButton" name="driveBtn"> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> + <item row="1" column="8" rowspan="2"> + <widget class="QLCDNumber" name="RPM_monitor"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="digitCount"> + <number>4</number> </property> + <property name="segmentStyle"> + <enum>QLCDNumber::Flat</enum> + </property> + </widget> + </item> + <item row="4" column="5" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_4"> <property name="font"> <font> <family>Open Sans</family> - <pointsize>20</pointsize> <weight>75</weight> - <italic>false</italic> + <italic>true</italic> <bold>true</bold> </font> </property> <property name="text"> - <string>D</string> + <string>Speed (Kmph)</string> </property> - <property name="checkable"> - <bool>true</bool> + </widget> + </item> + <item row="3" column="5"> + <widget class="QSlider" name="Speed_slider"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>60</height> + </size> + </property> + <property name="font"> + <font> + <weight>50</weight> + <bold>false</bold> + </font> + </property> + <property name="maximum"> + <number>240</number> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="tickPosition"> + <enum>QSlider::NoTicks</enum> + </property> + <property name="tickInterval"> + <number>0</number> </property> </widget> </item> - <item> - <spacer name="horizontalSpacer_2"> + <item row="1" column="9" rowspan="4"> + <spacer name="horizontalSpacer_6"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> <property name="sizeHint" stdset="0"> <size> - <width>168</width> + <width>20</width> <height>20</height> </size> </property> </spacer> </item> + <item row="1" column="11" rowspan="4"> + <widget class="QFrame" name="frame_5"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_5"> + <property name="spacing"> + <number>0</number> + </property> + <property name="bottomMargin"> + <number>4</number> + </property> + <item> + <widget class="QSlider" name="fuelLevel_slider"> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <kerning>true</kerning> + </font> + </property> + <property name="sliderPosition"> + <number>0</number> + </property> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="invertedAppearance"> + <bool>false</bool> + </property> + <property name="invertedControls"> + <bool>false</bool> + </property> + <property name="tickPosition"> + <enum>QSlider::NoTicks</enum> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="label_3"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> + </property> + <property name="frameShape"> + <enum>QFrame::NoFrame</enum> + </property> + <property name="text"> + <string/> + </property> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/rain-drop.svg</pixmap> + </property> + <property name="scaledContents"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> </item> - <item row="7" column="0"> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </widget> </item> - <item row="0" column="1"> - <widget class="QFrame" name="header_frame"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>50</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QFrame" name="frame_4"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QLabel" name="label"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <family>Open Sans Extrabold</family> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Instrument Cluster</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QLabel" name="label_6"> - <property name="font"> - <font> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>Demo Mode</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="demoToggle"> - <property name="text"> - <string/> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="2" rowspan="2"> - <spacer name="horizontalSpacer_13"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="0" column="0" rowspan="2"> - <spacer name="horizontalSpacer_12"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> </layout> </widget> </item> diff --git a/ui/Settings_Window.ui b/ui/Settings_Window.ui index 477fa40..e1a6b81 100644 --- a/ui/Settings_Window.ui +++ b/ui/Settings_Window.ui @@ -16,7 +16,7 @@ <property name="styleSheet"> <string notr="true">*{ border: none; - background-color: transparent; + /* background-color: transparent; */ background: none; padding: 0; margin: 0; @@ -33,6 +33,7 @@ QPushButton{ padding: 5px 10px; border: 1px solid #4BD7D6 ; /* light blue */ border-radius: 10px; + margin: 3px; } QPushButton:pressed { @@ -44,6 +45,48 @@ QPushButton:pressed { padding: 5px 10px; border: 1px solid #4BD7D6 ; /* light blue */ border-radius: 10px; + margin: 3px; +} + +QComboBox{ + background-color: transparent; + padding: 5px 10px; + border: 1px solid #4BD7D6 ; /* light blue */ + border-radius: 10px; + margin: 3px; +} + +QComboBox::drop-down { + image: url(:/Carbon_Icons/carbon_icons/chevron--down.svg); +} + +QComboBox::down-arrow { + image: url(:/Carbon_Icons/carbon_icons/chevron--down.svg); +} + +QComboBox::up-arrow { + image: url(:/Carbon_Icons/carbon_icons/chevron--up.svg); +} + +QComboBox QAbstractItemView { + color: #4BD7D6; /* light blue */ + background-color: #131313; /* black */ + border: 1px solid #4BD7D6; /* light blue */ + border-radius: 10px; /* rounded corners */ +} + +QComboBox QAbstractItemView::item { + color: #4BD7D6; /* light blue */ + background-color: #131313; /* black */ + border: 1px solid #4BD7D6; /* light blue */ + border-radius: 10px; /* rounded corners */ + padding: 5px 10px; + margin: 3px; +} + +QComboBox QAbstractItemView::item:selected { + background-color: #6C6C85 ; /* pastel purple */ + border-radius: 10px; /* rounded corners */ } QCheckBox { @@ -67,11 +110,74 @@ QCheckBox:disabled { QCheckBox:indicator:disabled { background-color: #cccccc; /* Grayed out background */ +} + +#divider_1{ + background-color: #00ffff; /* Neon blue */ + border: 1px solid; +} +#divider_2{ + background-color: #00ffff; /* Neon blue */ + border: 1px solid; }</string> </property> <widget class="QWidget" name="centralwidget"> <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="0" colspan="4"> + <item row="2" column="3"> + <widget class="QLabel" name="label_2"> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Page Settings</string> + </property> + <property name="margin"> + <number>6</number> + </property> + </widget> + </item> + <item row="3" column="1"> + <widget class="QFrame" name="divider_1"> + <property name="frameShape"> + <enum>QFrame::HLine</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QLabel" name="label_19"> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Client Settings</string> + </property> + </widget> + </item> + <item row="1" column="5" rowspan="6"> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item row="0" column="0" colspan="6"> <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -84,80 +190,88 @@ QCheckBox:indicator:disabled { </property> </spacer> </item> - <item row="1" column="0" rowspan="5"> - <spacer name="horizontalSpacer_2"> + <item row="6" column="1" colspan="4"> + <spacer name="verticalSpacer"> <property name="orientation"> - <enum>Qt::Horizontal</enum> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>40</width> - <height>20</height> + <width>20</width> + <height>40</height> </size> </property> </spacer> </item> - <item row="3" column="1" colspan="2"> - <widget class="QFrame" name="frame_general_settings"> + <item row="1" column="1" colspan="4"> + <widget class="QFrame" name="frame_2"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> <property name="frameShadow"> <enum>QFrame::Raised</enum> </property> - <layout class="QGridLayout" name="gridLayout_2"> - <item row="1" column="5" colspan="2" alignment="Qt::AlignLeft"> - <widget class="QLabel" name="connectionLogo"> + <layout class="QGridLayout" name="gridLayout_4"> + <item row="0" column="0"> + <widget class="QPushButton" name="startClientBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="text"> - <string/> + <string>Start client</string> </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/connection-signal--off.svg</pixmap> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/play.svg</normaloff>:/Carbon_Icons/carbon_icons/play.svg</iconset> </property> - </widget> - </item> - <item row="2" column="0" colspan="4"> - <widget class="QLabel" name="IPAddr"> - <property name="text"> - <string>IP Address *</string> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> </property> </widget> </item> - <item row="4" column="7" alignment="Qt::AlignHCenter"> - <widget class="QCheckBox" name="place_holder_toggle_2"> - <property name="toolTip"> - <string>Default: WS</string> - </property> + <item row="0" column="1" colspan="2" alignment="Qt::AlignRight"> + <widget class="QPushButton" name="reconnectBtn"> <property name="text"> - <string/> + <string>Reconnect</string> </property> - </widget> - </item> - <item row="4" column="0" colspan="3"> - <widget class="QLabel" name="label_11"> - <property name="toolTip"> - <string>Default: WS</string> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/renew.svg</normaloff>:/Carbon_Icons/carbon_icons/renew.svg</iconset> </property> - <property name="text"> - <string>Protocol</string> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> </property> </widget> </item> - <item row="4" column="10" alignment="Qt::AlignLeft"> - <widget class="QLabel" name="label_13"> + <item row="3" column="1" alignment="Qt::AlignRight"> + <widget class="QLabel" name="connectionLogo"> <property name="text"> - <string>grpc</string> + <string/> </property> - </widget> - </item> - <item row="1" column="0" colspan="4"> - <widget class="QLabel" name="status"> - <property name="text"> - <string>Status</string> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/connection-signal--off.svg</pixmap> </property> </widget> </item> - <item row="1" column="7"> + <item row="3" column="2" alignment="Qt::AlignLeft"> <widget class="QLabel" name="connectionStatus"> <property name="sizePolicy"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> @@ -170,124 +284,14 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="5" column="1" rowspan="2"> - <widget class="QFrame" name="PageIcons"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - </layout> - </widget> - </item> - <item row="3" column="5"> - <widget class="QLabel" name="label_9"> - <property name="text"> - <string/> - </property> - <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/security-services.svg</pixmap> - </property> - </widget> - </item> - <item row="1" column="4" rowspan="4"> - <spacer name="horizontalSpacer_3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="0" colspan="4"> - <widget class="QLabel" name="label"> - <property name="toolTip"> - <string>Default: Secure</string> - </property> - <property name="text"> - <string>Secure Mode</string> - </property> - </widget> - </item> - <item row="5" column="2" rowspan="2"> - <widget class="QFrame" name="PageLabels"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - </layout> - </widget> - </item> - <item row="4" column="5" alignment="Qt::AlignRight"> - <widget class="QLabel" name="label_12"> - <property name="text"> - <string>ws</string> - </property> - </widget> - </item> - <item row="2" column="5" colspan="7"> - <widget class="QLineEdit" name="IPAddrInput"> - <property name="placeholderText"> - <string>Default: localhost</string> - </property> - </widget> - </item> - <item row="3" column="6" colspan="3" alignment="Qt::AlignHCenter"> - <widget class="QCheckBox" name="place_holder_toggle_1"> - <property name="toolTip"> - <string>Default: Secure</string> - </property> + <item row="3" column="0"> + <widget class="QLabel" name="status"> <property name="text"> - <string/> - </property> - <property name="checked"> - <bool>false</bool> + <string>Status</string> </property> </widget> </item> - <item row="0" column="0" colspan="11"> + <item row="4" column="0" colspan="3"> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> @@ -306,76 +310,21 @@ QCheckBox:indicator:disabled { </layout> </widget> </item> - <item row="1" column="1" colspan="2"> - <widget class="QFrame" name="frame_2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QPushButton" name="startClientBtn"> - <property name="text"> - <string>Start client</string> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/play.svg</normaloff>:/Carbon_Icons/carbon_icons/play.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="reconnectBtn"> - <property name="text"> - <string>Reconnect</string> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/renew.svg</normaloff>:/Carbon_Icons/carbon_icons/renew.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="5" column="1" colspan="2"> - <spacer name="verticalSpacer"> + <item row="1" column="0" rowspan="6"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> + <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>40</height> + <width>40</width> + <height>20</height> </size> </property> </spacer> </item> - <item row="1" column="3" rowspan="5"> - <spacer name="horizontalSpacer"> + <item row="2" column="2" rowspan="4"> + <spacer name="horizontalSpacer_3"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -387,12 +336,12 @@ QCheckBox:indicator:disabled { </property> </spacer> </item> - <item row="4" column="1" colspan="2"> + <item row="4" column="3" rowspan="2" colspan="2" alignment="Qt::AlignTop"> <widget class="QFrame" name="frame_page_settings"> <property name="minimumSize"> <size> - <width>300</width> - <height>300</height> + <width>0</width> + <height>0</height> </size> </property> <property name="frameShape"> @@ -402,7 +351,21 @@ QCheckBox:indicator:disabled { <enum>QFrame::Raised</enum> </property> <layout class="QGridLayout" name="gridLayout_3"> - <item row="7" column="4"> + <item row="3" column="1" colspan="3"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>HVAC</string> + </property> + </widget> + </item> + <item row="5" column="3" alignment="Qt::AlignHCenter"> + <widget class="QCheckBox" name="place_holder_toggle_3"> + <property name="text"> + <string/> + </property> + </widget> + </item> + <item row="4" column="4"> <widget class="QPushButton" name="pushButton_3"> <property name="text"> <string/> @@ -419,25 +382,39 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="5" column="4"> - <widget class="QPushButton" name="pushButton"> + <item row="2" column="1" colspan="3"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Instrument Cluster</string> + </property> + </widget> + </item> + <item row="4" column="1" colspan="3"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Steering Controls</string> + </property> + </widget> + </item> + <item row="5" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QLabel" name="label_15"> <property name="text"> <string/> </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/view.svg</normaloff>:/Carbon_Icons/carbon_icons/view.svg</iconset> + <property name="pixmap"> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/x-axis.svg</pixmap> </property> - <property name="iconSize"> - <size> - <width>30</width> - <height>30</height> - </size> + </widget> + </item> + <item row="5" column="2" alignment="Qt::AlignRight|Qt::AlignVCenter"> + <widget class="QLabel" name="label_14"> + <property name="text"> + <string>Kuksa</string> </property> </widget> </item> - <item row="6" column="4"> - <widget class="QPushButton" name="pushButton_2"> + <item row="2" column="4"> + <widget class="QPushButton" name="pushButton"> <property name="text"> <string/> </property> @@ -453,14 +430,7 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="7" column="1" colspan="3"> - <widget class="QLabel" name="label_5"> - <property name="text"> - <string>Steering Controls</string> - </property> - </widget> - </item> - <item row="6" column="0"> + <item row="3" column="0"> <widget class="QLabel" name="label_7"> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> @@ -485,24 +455,34 @@ QCheckBox:indicator:disabled { </property> </widget> </item> - <item row="0" column="0" colspan="5" alignment="Qt::AlignHCenter"> - <widget class="QLabel" name="label_2"> + <item row="5" column="4" alignment="Qt::AlignLeft"> + <widget class="QLabel" name="label_10"> <property name="text"> - <string>Page Settings</string> + <string>CAN</string> </property> </widget> </item> - <item row="6" column="1" colspan="3"> - <widget class="QLabel" name="label_4"> + <item row="3" column="4"> + <widget class="QPushButton" name="pushButton_2"> <property name="text"> - <string>HVAC</string> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/view.svg</normaloff>:/Carbon_Icons/carbon_icons/view.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>30</width> + <height>30</height> + </size> </property> </widget> </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_6"> + <item row="4" column="0"> + <widget class="QLabel" name="label_8"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Ignored"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -517,24 +497,17 @@ QCheckBox:indicator:disabled { <string/> </property> <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/meter.svg</pixmap> + <pixmap resource="../assets/res.qrc">:/Images/Images/steering-wheel.svg</pixmap> </property> <property name="scaledContents"> <bool>true</bool> </property> </widget> </item> - <item row="5" column="1" colspan="3"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Instrument Cluster</string> - </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="label_8"> + <item row="2" column="0"> + <widget class="QLabel" name="label_6"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Fixed" vsizetype="Ignored"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -549,44 +522,186 @@ QCheckBox:indicator:disabled { <string/> </property> <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Images/Images/steering-wheel.svg</pixmap> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/meter.svg</pixmap> </property> <property name="scaledContents"> <bool>true</bool> </property> </widget> </item> - <item row="8" column="4" alignment="Qt::AlignLeft"> - <widget class="QLabel" name="label_10"> + </layout> + </widget> + </item> + <item row="3" column="3" colspan="2"> + <widget class="QFrame" name="divider_2"> + <property name="acceptDrops"> + <bool>false</bool> + </property> + <property name="autoFillBackground"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>QFrame::HLine</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Sunken</enum> + </property> + </widget> + </item> + <item row="5" column="1"> + <widget class="QFrame" name="frame_general_settings"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="3" colspan="6"> + <widget class="QLineEdit" name="IPAddrInput"> + <property name="placeholderText"> + <string/> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_16"> <property name="text"> - <string>CAN</string> + <string>Port</string> </property> </widget> </item> - <item row="8" column="3" alignment="Qt::AlignHCenter"> - <widget class="QCheckBox" name="place_holder_toggle_3"> + <item row="4" column="4" colspan="3" alignment="Qt::AlignHCenter"> + <widget class="QCheckBox" name="place_holder_toggle_2"> + <property name="toolTip"> + <string>Default: WS</string> + </property> <property name="text"> <string/> </property> </widget> </item> - <item row="8" column="2" alignment="Qt::AlignRight|Qt::AlignVCenter"> - <widget class="QLabel" name="label_14"> + <item row="5" column="3" colspan="6"> + <widget class="QLineEdit" name="TLS_Server_Name"/> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label_18"> <property name="text"> - <string>Kuksa</string> + <string>Default Config</string> </property> </widget> </item> - <item row="8" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter"> - <widget class="QLabel" name="label_15"> + <item row="1" column="0" colspan="3"> + <widget class="QLabel" name="IPAddr"> + <property name="text"> + <string>IP Address</string> + </property> + </widget> + </item> + <item row="3" column="0" colspan="3"> + <widget class="QLabel" name="label"> + <property name="toolTip"> + <string>Default: Secure</string> + </property> + <property name="text"> + <string>Secure Mode</string> + </property> + </widget> + </item> + <item row="2" column="3" colspan="6"> + <widget class="QLineEdit" name="PortInput"/> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_21"> + <property name="text"> + <string>Auth Token</string> + </property> + </widget> + </item> + <item row="6" column="3" colspan="6"> + <widget class="QLineEdit" name="Auth_Token"/> + </item> + <item row="4" column="3" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_12"> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>ws</string> + </property> + </widget> + </item> + <item row="5" column="0"> + <widget class="QLabel" name="label_20"> + <property name="text"> + <string>TLS Server Name</string> + </property> + </widget> + </item> + <item row="3" column="5" colspan="4" alignment="Qt::AlignLeft"> + <widget class="QCheckBox" name="place_holder_toggle_1"> + <property name="toolTip"> + <string>Default: Secure</string> + </property> + <property name="text"> + <string/> + </property> + <property name="checked"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="4" column="0" colspan="2"> + <widget class="QLabel" name="label_11"> + <property name="toolTip"> + <string>Default: WS</string> + </property> + <property name="text"> + <string>Protocol</string> + </property> + </widget> + </item> + <item row="0" column="3" colspan="6"> + <widget class="QComboBox" name="List_Configs_ComboBox"/> + </item> + <item row="3" column="3" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_9"> <property name="text"> <string/> </property> <property name="pixmap"> - <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/x-axis.svg</pixmap> + <pixmap resource="../assets/res.qrc">:/Carbon_Icons/carbon_icons/security-services.svg</pixmap> </property> </widget> </item> + <item row="4" column="7" colspan="2" alignment="Qt::AlignHCenter"> + <widget class="QLabel" name="label_13"> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>grpc</string> + </property> + </widget> + </item> + <item row="7" column="0"> + <widget class="QLabel" name="label_17"> + <property name="text"> + <string>CA.pem File</string> + </property> + </widget> + </item> + <item row="7" column="3" colspan="6"> + <widget class="QLineEdit" name="CA_File"/> + </item> </layout> </widget> </item> diff --git a/ui/SteeringControls.ui b/ui/SteeringControls.ui index c46a00d..6d4a4d2 100644 --- a/ui/SteeringControls.ui +++ b/ui/SteeringControls.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>1388</width> - <height>793</height> + <width>1034</width> + <height>600</height> </rect> </property> <property name="windowTitle"> @@ -16,13 +16,13 @@ <property name="styleSheet"> <string notr="true">*{ border: none; + border-radius: 8px; background-color: transparent; - background: none; + background: none; padding: 0; margin: 0; color: #fff; } - QPushButton { background-color: #6C6C85 ; /* pastel purple */ padding: 50px 50px; @@ -67,12 +67,216 @@ QPushButton:checked { </property> <widget class="QWidget" name="centralwidget"> <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="2" rowspan="3"> + <item row="2" column="1" rowspan="4" alignment="Qt::AlignRight|Qt::AlignVCenter"> + <widget class="QFrame" name="LeftControls"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item alignment="Qt::AlignHCenter|Qt::AlignVCenter"> + <widget class="QFrame" name="TopLeftControls"> + <property name="minimumSize"> + <size> + <width>200</width> + <height>0</height> + </size> + </property> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QGridLayout" name="gridLayout_3"> + <item row="2" column="2"> + <widget class="QPushButton" name="NextTrack"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/skip--forward--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/skip--forward--filled.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + </widget> + </item> + <item row="3" column="0" colspan="3"> + <widget class="QPushButton" name="VolumeDown"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + </widget> + </item> + <item row="2" column="1"> + <widget class="QPushButton" name="Mode"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="font"> + <font> + <weight>75</weight> + <italic>true</italic> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>MODE</string> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QPushButton" name="PreviousTrack"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/skip--back--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/skip--back--filled.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + </widget> + </item> + <item row="1" column="0" colspan="3"> + <widget class="QPushButton" name="VolumeUp"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + <property name="flat"> + <bool>false</bool> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeType"> + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item alignment="Qt::AlignBottom"> + <widget class="QFrame" name="BottomLeftControls"> + <property name="frameShape"> + <enum>QFrame::StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>QFrame::Raised</enum> + </property> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QPushButton" name="Info"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/information.svg</normaloff>:/Carbon_Icons/carbon_icons/information.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="VolumeMute"> + <property name="text"> + <string/> + </property> + <property name="icon"> + <iconset resource="../assets/res.qrc"> + <normaloff>:/Carbon_Icons/carbon_icons/volume--mute--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--mute--filled.svg</iconset> + </property> + <property name="iconSize"> + <size> + <width>45</width> + <height>45</height> + </size> + </property> + </widget> + </item> + </layout> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="2" rowspan="3" alignment="Qt::AlignVCenter"> <widget class="QFrame" name="frame"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="minimumSize"> <size> - <width>500</width> - <height>500</height> + <width>0</width> + <height>0</height> </size> </property> <property name="frameShape"> @@ -97,10 +301,10 @@ QPushButton:checked { <property name="spacing"> <number>0</number> </property> - <item row="1" column="0"> + <item row="1" column="0" alignment="Qt::AlignVCenter"> <widget class="QPushButton" name="Horn"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -114,7 +318,7 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>200</width> + <width>250</width> <height>250</height> </size> </property> @@ -123,20 +327,7 @@ QPushButton:checked { </layout> </widget> </item> - <item row="2" column="5" rowspan="4"> - <spacer name="horizontalSpacer_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>40</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="4" rowspan="4" alignment="Qt::AlignVCenter"> + <item row="2" column="3" rowspan="4" alignment="Qt::AlignVCenter"> <widget class="QFrame" name="RightControls"> <property name="minimumSize"> <size> @@ -204,10 +395,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> + <property name="checkable"> + <bool>false</bool> + </property> </widget> </item> </layout> @@ -240,10 +434,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> + <property name="checkable"> + <bool>false</bool> + </property> </widget> </item> <item row="0" column="1" colspan="2"> @@ -264,10 +461,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> + <property name="checkable"> + <bool>false</bool> + </property> </widget> </item> <item row="1" column="1"> @@ -281,14 +481,20 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> </widget> </item> <item row="1" column="2"> <widget class="QPushButton" name="CruiseCancel"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="font"> <font> <weight>75</weight> @@ -305,10 +511,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> + <property name="checkable"> + <bool>false</bool> + </property> </widget> </item> </layout> @@ -333,8 +542,8 @@ QPushButton:checked { </layout> </widget> </item> - <item row="2" column="0" rowspan="4"> - <spacer name="horizontalSpacer"> + <item row="2" column="4" rowspan="4"> + <spacer name="horizontalSpacer_2"> <property name="orientation"> <enum>Qt::Horizontal</enum> </property> @@ -346,8 +555,27 @@ QPushButton:checked { </property> </spacer> </item> - <item row="5" column="2"> + <item row="6" column="0" colspan="5"> + <spacer name="verticalSpacer_4"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="5" column="2" alignment="Qt::AlignBottom"> <widget class="QFrame" name="ExtraControls"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> <property name="frameShape"> <enum>QFrame::StyledPanel</enum> </property> @@ -355,7 +583,7 @@ QPushButton:checked { <enum>QFrame::Raised</enum> </property> <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> + <item alignment="Qt::AlignBottom"> <widget class="QPushButton" name="PhoneCall"> <property name="text"> <string/> @@ -366,13 +594,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> </widget> </item> - <item> + <item alignment="Qt::AlignBottom"> <widget class="QPushButton" name="PhoneHangup"> <property name="text"> <string/> @@ -383,13 +611,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> </widget> </item> - <item> + <item alignment="Qt::AlignBottom"> <widget class="QPushButton" name="Voice"> <property name="text"> <string/> @@ -400,13 +628,13 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> </widget> </item> - <item> + <item alignment="Qt::AlignBottom"> <widget class="QPushButton" name="LaneDeparture"> <property name="text"> <string/> @@ -417,8 +645,8 @@ QPushButton:checked { </property> <property name="iconSize"> <size> - <width>50</width> - <height>50</height> + <width>45</width> + <height>45</height> </size> </property> </widget> @@ -426,210 +654,27 @@ QPushButton:checked { </layout> </widget> </item> - <item row="1" column="1" colspan="4"> - <spacer name="verticalSpacer_3"> + <item row="2" column="0" rowspan="4"> + <spacer name="horizontalSpacer"> <property name="orientation"> - <enum>Qt::Vertical</enum> + <enum>Qt::Horizontal</enum> </property> <property name="sizeHint" stdset="0"> <size> - <width>20</width> - <height>40</height> + <width>40</width> + <height>20</height> </size> </property> </spacer> </item> - <item row="2" column="1" rowspan="4" alignment="Qt::AlignVCenter"> - <widget class="QFrame" name="LeftControls"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QFrame" name="TopLeftControls"> - <property name="minimumSize"> - <size> - <width>200</width> - <height>0</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QGridLayout" name="gridLayout_3"> - <item row="0" column="0" colspan="3"> - <widget class="QPushButton" name="VolumeUp"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--up--filled--alt.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="PreviousTrack"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/skip--back--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/skip--back--filled.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="Mode"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>70</height> - </size> - </property> - <property name="font"> - <font> - <weight>75</weight> - <italic>true</italic> - <bold>true</bold> - </font> - </property> - <property name="text"> - <string>MODE</string> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="NextTrack"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/skip--forward--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/skip--forward--filled.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - <item row="2" column="0" colspan="3"> - <widget class="QPushButton" name="VolumeDown"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--down--filled--alt.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <spacer name="verticalSpacer"> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Fixed</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>40</height> - </size> - </property> - </spacer> - </item> - <item alignment="Qt::AlignBottom"> - <widget class="QFrame" name="BottomLeftControls"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QPushButton" name="Info"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/information.svg</normaloff>:/Carbon_Icons/carbon_icons/information.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="VolumeMute"> - <property name="text"> - <string/> - </property> - <property name="icon"> - <iconset resource="../assets/res.qrc"> - <normaloff>:/Carbon_Icons/carbon_icons/volume--mute--filled.svg</normaloff>:/Carbon_Icons/carbon_icons/volume--mute--filled.svg</iconset> - </property> - <property name="iconSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item row="6" column="0" colspan="6"> - <spacer name="verticalSpacer_4"> + <item row="0" column="0" colspan="5"> + <spacer name="verticalSpacer_3"> <property name="orientation"> <enum>Qt::Vertical</enum> </property> + <property name="sizeType"> + <enum>QSizePolicy::Expanding</enum> + </property> <property name="sizeHint" stdset="0"> <size> <width>20</width> @@ -638,17 +683,6 @@ QPushButton:checked { </property> </spacer> </item> - <item row="0" column="0" colspan="6"> - <widget class="QWidget" name="Header" native="true"> - <property name="minimumSize"> - <size> - <width>0</width> - <height>70</height> - </size> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_4"/> - </widget> - </item> </layout> </widget> </widget> |