Skip to content

Commit

Permalink
fix status panel in sidebar (was filled with dummy)
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Feb 23, 2024
1 parent 7b44437 commit a452a5a
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 178 deletions.
1 change: 1 addition & 0 deletions qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,6 @@
<file>ui/elements/NewSwitch.qml</file>
<file>ui/elements/NewSpinBox.qml</file>
<file>ui/elements/NewSlider.qml</file>
<file>ui/sidebar/InfoElement2.qml</file>
</qresource>
</RCC>
36 changes: 36 additions & 0 deletions qml/ui/sidebar/InfoElement2.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.12
import QtGraphicalEffects 1.12
import QtQuick.Shapes 1.0
import QtQuick.Controls.Material 2.0

import Qt.labs.settings 1.0

import OpenHD 1.0

import "../elements"

RowLayout {
property string override_text_left: "TODO"
property string override_text_right: "TODO"

Text {
width: 150
text: override_text_left
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: override_text_right
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
197 changes: 19 additions & 178 deletions qml/ui/sidebar/Panel7Status.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,188 +16,29 @@ SideBarBasePanel{

Column {
anchors.top: parent.top
anchors.topMargin: secondaryUiHeight/8
spacing: 5

RowLayout {
Text {
text: "Status:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Connected"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Screen:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: applicationWindow.width + "x" + applicationWindow.height
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}

RowLayout {
Text {
text: "Frequency:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: _ohdSystemGround.curr_channel_mhz + "Mhz"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Wifi-Adapter:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
id: wifiMessage
property int wifiCode: _ohdSystemAir.ohd_wifi_type

function wifiName(code) {
switch (code) {
case 11: return "Asus AC56";
case 12: return "8812AU CUSTOM";
case 21: return "88XXBU";
default: return "unknown";
}
anchors.topMargin: secondaryUiHeight/8 + 20
anchors.leftMargin: 10
spacing: 10

InfoElement2{
override_text_left: "Connection:"
override_text_right: {
if(_ohdSystemAir.is_alive && _ohdSystemGround.is_alive){
return "Connected";
}

text: wifiName(wifiCode) + "("+_ohdSystemAir.ohd_wifi_type+")"
Layout.leftMargin: 12
}
}
RowLayout {
Text {
text: "Format:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "1080p 60fps"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Version:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Todo"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

}
}
RowLayout {
Text {
text: "Hardware Air:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
id: platformMessage
property int platformCode: _ohdSystemAir.ohd_platform_type

function platformName(code) {
switch (code) {
case 0: return "unknown";
case 10: return "X20";
case 20: return "x86";
case 30: return "rpi";
case 31: return "rpi 4";
case 32: return "rpi 3";
case 33: return "rpi 2";
case 34: return "rpi 1";
case 35: return "rpi 0";
case 40: return "rock";
case 41: return "rk3566";
case 42: return "rock5a";
case 43: return "rock5b";
default: return "unknown";
}
if(_ohdSystemAir.is_alive){
return "AIR only";
}

text: platformName(platformCode) + "("+_ohdSystemAir.ohd_platform_type+")"
Layout.leftMargin: 12
}
}
RowLayout {
Text {
text: "Hardware Ground:"
font.pixelSize: 14
font.bold: true
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true
}

Text {
text: "Todo"
font.pixelSize: 14
font.family: "AvantGarde-Medium"
color: "#ffffff"
smooth: true

if(_ohdSystemGround.is_alive){
return "GND only"
}
return "NOT CONNECTED";
}
}
/*InfoElement2{
override_text_left: "TODO"
override_text_right:"TODO"
}*/

Button {
id: button
Expand Down

0 comments on commit a452a5a

Please sign in to comment.