Skip to content

Commit

Permalink
add stbc / ldpc enable popup, improve UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Consti10 committed Oct 26, 2023
1 parent c55d73e commit bbcca38
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 16 deletions.
2 changes: 0 additions & 2 deletions QOpenHD.pro
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ SOURCES += \
app/osd/altitudeladder.cpp \
app/osd/flightpathvector.cpp \
app/osd/aoagauge.cpp \
app/osd/performancehorizonladder.cpp \

HEADERS += \
app/osd/headingladder.h \
Expand All @@ -144,7 +143,6 @@ HEADERS += \
app/osd/flightpathvector.h \
app/osd/debug_overdraw.hpp \
app/osd/aoagauge.h \
app/osd/performancehorizonladder.h \


RESOURCES += qml/qml.qrc
Expand Down
4 changes: 1 addition & 3 deletions app/osd/altitudeladder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ void AltitudeLadder::paint(QPainter* painter) {
setFillColor(QColor::fromRgb(0,255,0,128));
}

QFont font("sans-serif", 10, QFont::Bold, false);

painter->setFont(m_font);

auto alt = m_altitude;
Expand Down Expand Up @@ -121,6 +119,6 @@ void AltitudeLadder::setAltitudeRange(int altitudeRange) {
void AltitudeLadder::setFontFamily(QString fontFamily) {
m_fontFamily = fontFamily;
emit fontFamilyChanged(m_fontFamily);
m_font = QFont(m_fontFamily, 11, QFont::Bold, false);
m_font = QFont(m_fontFamily, 13, QFont::Bold, false);
update();
}
2 changes: 1 addition & 1 deletion app/telemetry/models/fcmavlinksystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class FCMavlinkSystem : public QObject

// roll, pitch and yaw
L_RO_PROP(double, pitch, set_pitch, 0)
L_RO_PROP(double, roll, set_roll, 0)
L_RO_PROP(double, roll, set_roll, 20)
L_RO_PROP(double, yaw, set_yaw, 0)
// mixed
L_RO_PROP(double, throttle, set_throttle, 0)
Expand Down
2 changes: 1 addition & 1 deletion app/util/qopenhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class QOpenHD : public QObject
// Tries to mimic android toast as much as possible
//
Q_INVOKABLE void show_toast(QString message,bool long_toast=false);
L_RO_PROP(QString,version_string,set_version_string,"2.5.1-alpha");
L_RO_PROP(QString,version_string,set_version_string,"2.5.2-alpha");
public:
L_RO_PROP(QString,toast_text,set_toast_text,"NONE");
L_RO_PROP(bool,toast_visible,set_toast_visible,false);
Expand Down
2 changes: 1 addition & 1 deletion qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
<file>video/ExpMainVideoAndroid.qml</file>
<file>ui/elements/WorkaroundMessageBox.qml</file>
<file>ui/elements/SettingBaseElement.qml</file>
<file>ui/widgets/PerformanceHorizonWidget.qml</file>
<file>ui/widgets/WBLinkRateControlWidget.qml</file>
<file>ui/widgets/BaseWidgetDefaultUiControlElements.qml</file>
<file>resources/cursors/arrow_512_transparent.png</file>
Expand Down Expand Up @@ -259,5 +258,6 @@
<file>ui/configpopup/status/StatusCardRow.qml</file>
<file>ui/configpopup/connect/PaneConnectionMode.qml</file>
<file>ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml</file>
<file>ui/widgets/PerformanceHorizonWidget2.qml</file>
</qresource>
</RCC>
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,10 @@ Rectangle{
Layout.columnSpan: 3
Text{
text:{
"LOSS %:"+_ohdSystemGround.curr_rx_packet_loss_perc;
"LOSS %:"+_ohdSystemGround.curr_rx_packet_loss_perc
}
color: _ohdSystemGround.curr_rx_packet_loss_perc > 5 ? "red" : "black"
verticalAlignment: Qt.AlignVCenter
}
Text{
text: {
Expand Down Expand Up @@ -479,8 +480,9 @@ Rectangle{
Layout.row: 2
Layout.column: 4
text: "EDIT";
enabled: true //_ohdSystemAir.is_alive && _ohdSystemGround.is_alive && (_wbLinkSettingsHelper.ui_rebuild_models>=0) &&
//(_ohdSystemGround.wb_stbc_enabled!=true || _ohdSystemGround.wb_lpdc_enabled!=true || _ohdSystemAir.wb_stbc_enabled!=true || _ohdSystemAir.wb_lpdc_enabled!=true);
//enabled: true
enabled: _ohdSystemAir.is_alive && _ohdSystemGround.is_alive && (_wbLinkSettingsHelper.ui_rebuild_models>=0) &&
(_ohdSystemGround.wb_stbc_enabled!=true || _ohdSystemGround.wb_lpdc_enabled!=true || _ohdSystemAir.wb_stbc_enabled!=true || _ohdSystemAir.wb_lpdc_enabled!=true);
onClicked: {
popup_enable_stbc_ldpc.open()
}
Expand Down
6 changes: 3 additions & 3 deletions qml/ui/configpopup/openhd_settings/PopupEnableSTBCLDPC.qml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Rectangle{
Layout.row: 3
Layout.column: 0
text: "ENABLE"
visible: comboBoxNAntennasAir.currentIndex==2 && comboBoxNAntennasGnd.currentIndex==2;
enabled: comboBoxNAntennasAir.currentIndex==2 && comboBoxNAntennasGnd.currentIndex==2;
font.pixelSize: 14
onClicked: {
if(_wbLinkSettingsHelper.set_param_stbc_ldpc_enable_air_ground()){
Expand All @@ -140,8 +140,8 @@ Rectangle{
Text{
Layout.row: 4
Layout.column: 0
visible: !button_enable.visible
text: "CAN ONLY BE ENABLED IF BOTH AIR AND GN UNIT HAVE 2 RF PATHS / ANTENNAS";
visible: !button_enable.enabled
text: "CAN ONLY BE ENABLED IF BOTH AIR AND GND UNIT HAVE 2 RF PATHS / ANTENNAS";
font.pixelSize: 14
}
// ----------------
Expand Down
20 changes: 18 additions & 2 deletions qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,18 @@ Rectangle{
}
font.pixelSize: 14
}
ButtonIconInfo{
Layout.row: 2
Layout.column: 3
onClicked: {
_messageBoxInstance.set_text_and_show("TX Power applied when FC is disarmed");
}
}

// FILLER
Item{
Layout.row: 2
Layout.column: 3
Layout.column: 4
Layout.fillWidth: true
}
// ----------------
Expand Down Expand Up @@ -355,10 +363,18 @@ Rectangle{
}
font.pixelSize: 14
}
ButtonIconInfo{
Layout.row: 3
Layout.column: 3
onClicked: {
_messageBoxInstance.set_text_and_show("TX Power applied when FC is armed. By default, set to 0 (DISABLE) which means the same tx power (tx power disarmed) is applied regardless"+
"if armed or not.");
}
}
// FILLER
Item{
Layout.row: 3
Layout.column: 3
Layout.column: 4
Layout.fillWidth: true
}
Text{
Expand Down

0 comments on commit bbcca38

Please sign in to comment.