mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T275, Ref T280 improved interpolation log and allow to disable all aircraft
* show when interpolation log updates its views (LED) * allow to disable all aircraft (one can disable all, then just enable one aircraft which is useful for debugging)
This commit is contained in:
@@ -47,6 +47,7 @@ namespace BlackGui
|
||||
ui->led_Situation->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Situation received", "", 14);
|
||||
ui->led_Elevation->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Elevation received", "", 14);
|
||||
ui->led_Running->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Running", "Stopped", 14);
|
||||
ui->led_Updating->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Just updating", "Idle", 14);
|
||||
|
||||
m_callsign = ui->comp_CallsignCompleter->getCallsign();
|
||||
|
||||
@@ -100,7 +101,12 @@ namespace BlackGui
|
||||
|
||||
void CInterpolationLogDisplay::updateLog()
|
||||
{
|
||||
if (!this->checkLogPrerequisites()) { return; }
|
||||
ui->led_Updating->blink(250);
|
||||
if (!this->checkLogPrerequisites())
|
||||
{
|
||||
ui->le_SimulatorSpecific->setText(m_simulatorCommon->getStatisticsSimulatorSpecific());
|
||||
return;
|
||||
}
|
||||
|
||||
// only display visible tab
|
||||
if (ui->tw_LogTabs->currentWidget() == ui->tb_TextLog)
|
||||
|
||||
@@ -72,6 +72,16 @@
|
||||
<item>
|
||||
<widget class="BlackGui::CLedWidget" name="led_Running" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="lbl_Updating">
|
||||
<property name="text">
|
||||
<string>Updating</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="BlackGui::CLedWidget" name="led_Updating" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="hs_LedBar">
|
||||
<property name="orientation">
|
||||
@@ -235,13 +245,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lbl_UpdateNumber">
|
||||
<property name="text">
|
||||
<string>Upd.#:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QLabel" name="lbl_UpdateAircraftReqTime">
|
||||
<property name="toolTip">
|
||||
@@ -252,30 +255,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="11">
|
||||
<widget class="QLineEdit" name="le_SimulatorSpecific">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="9" colspan="3">
|
||||
<widget class="QLineEdit" name="le_Limited">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>limited?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5" colspan="7">
|
||||
<widget class="QLineEdit" name="le_Elevation">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>elevation</string>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="lbl_UpdateNumber">
|
||||
<property name="text">
|
||||
<string>Upd.#:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -289,6 +272,26 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="5" colspan="7">
|
||||
<widget class="QLineEdit" name="le_Elevation">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>elevation</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="9" colspan="3">
|
||||
<widget class="QLineEdit" name="le_Limited">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>limited?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="le_CG">
|
||||
<property name="readOnly">
|
||||
@@ -299,6 +302,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" colspan="11">
|
||||
<widget class="QLineEdit" name="le_SimulatorSpecific">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_CG">
|
||||
<property name="text">
|
||||
@@ -320,23 +330,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_ElevationReqRec">
|
||||
<property name="text">
|
||||
<string>Req/rec:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="7">
|
||||
<widget class="QLineEdit" name="le_SceneryOffset">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>offset from changes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="9">
|
||||
<widget class="QLineEdit" name="le_SceneryOffsetCG">
|
||||
<property name="readOnly">
|
||||
@@ -347,13 +340,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lbl_SceneryOffsetCG">
|
||||
<property name="text">
|
||||
<string>Off-CG:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="le_UpdateReqTime">
|
||||
<property name="readOnly">
|
||||
@@ -364,13 +350,34 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="5" colspan="3">
|
||||
<widget class="QLineEdit" name="le_UpdateTimes">
|
||||
<item row="0" column="7">
|
||||
<widget class="QLineEdit" name="le_SceneryOffset">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>time min, max, ..</string>
|
||||
<string>offset from changes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_ElevationReqRec">
|
||||
<property name="text">
|
||||
<string>Req/rec:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="8">
|
||||
<widget class="QLabel" name="lbl_SceneryOffsetCG">
|
||||
<property name="text">
|
||||
<string>Off-CG:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_ReqTime">
|
||||
<property name="text">
|
||||
<string>Req. time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -384,13 +391,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lbl_Offset">
|
||||
<property name="text">
|
||||
<string>Offset:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="8">
|
||||
<widget class="QLabel" name="lbl_Limitited">
|
||||
<property name="text">
|
||||
@@ -398,27 +398,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_ReqTime">
|
||||
<property name="text">
|
||||
<string>Req. time:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QLabel" name="lbl_Elevation">
|
||||
<property name="text">
|
||||
<string>Elevation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLineEdit" name="le_GndFlag">
|
||||
<item row="1" column="5" colspan="3">
|
||||
<widget class="QLineEdit" name="le_UpdateTimes">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>gnd.flag?</string>
|
||||
<string>time min, max, ..</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="6">
|
||||
<widget class="QLabel" name="lbl_Offset">
|
||||
<property name="text">
|
||||
<string>Offset:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -429,16 +422,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="le_Parts">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>parts?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" colspan="3">
|
||||
<widget class="QLineEdit" name="le_ElevationReqRec">
|
||||
<property name="toolTip">
|
||||
@@ -452,6 +435,33 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QLineEdit" name="le_GndFlag">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>gnd.flag?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="4">
|
||||
<widget class="QLabel" name="lbl_Elevation">
|
||||
<property name="text">
|
||||
<string>Elevation:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLineEdit" name="le_Parts">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>parts?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -28,20 +28,22 @@ namespace BlackGui
|
||||
{
|
||||
this->addTimestampOffsetColumns();
|
||||
|
||||
m_columns.addColumn(CColumn::standardString("situations", CAircraftSituationChange::IndexSituationsCount));
|
||||
m_columns.addColumn(CColumn::standardString("s#", "situations", CAircraftSituationChange::IndexSituationsCount));
|
||||
|
||||
m_columns.addColumn(CColumn("alt.mean", CAircraftSituationChange::IndexAltitudeMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("alt.dev.", CAircraftSituationChange::IndexAltitudeStdDev, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.mean", CAircraftSituationChange::IndexElevationMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.dev.", CAircraftSituationChange::IndexElevationStdDev, new CAltitudeFormatter()));
|
||||
|
||||
m_columns.addColumn(CColumn("null", CAircraftSituationChange::IndexIsNull, new CBoolIconFormatter("null", "not null")));
|
||||
m_columns.addColumn(CColumn("gnd.", CAircraftSituationChange::IndexConstOnGround, new CBoolIconFormatter("const on gnd.", "not const on gnd.")));
|
||||
m_columns.addColumn(CColumn("not gnd.", CAircraftSituationChange::IndexConstNotOnGround, new CBoolIconFormatter("const not on gnd.", "not const not on gnd.")));
|
||||
m_columns.addColumn(CColumn("n.g.", CAircraftSituationChange::IndexConstNotOnGround, new CBoolIconFormatter("const not on gnd.", "not const not on gnd.")));
|
||||
m_columns.addColumn(CColumn("asc.", CAircraftSituationChange::IndexConstAscending, new CBoolIconFormatter("const ascending", "not const ascending")));
|
||||
m_columns.addColumn(CColumn("desc", CAircraftSituationChange::IndexConstDescending, new CBoolIconFormatter("const decending", "not const decending")));
|
||||
m_columns.addColumn(CColumn("push", CAircraftSituationChange::IndexContainsPushBack, new CBoolIconFormatter("contains pushback", "no pushback")));
|
||||
m_columns.addColumn(CColumn("to.", CAircraftSituationChange::IndexJustTakingOff, new CBoolIconFormatter("just takeoff", "no takeoff")));
|
||||
m_columns.addColumn(CColumn("td.", CAircraftSituationChange::IndexJustTouchingDown, new CBoolIconFormatter("just touching down", "no touchdown")));
|
||||
|
||||
m_columns.addColumn(CColumn("alt.mean", CAircraftSituationChange::IndexAltitudeMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("alt.dev.", CAircraftSituationChange::IndexAltitudeStdDev, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.mean", CAircraftSituationChange::IndexElevationMean, new CAltitudeFormatter()));
|
||||
m_columns.addColumn(CColumn("elv.dev.", CAircraftSituationChange::IndexElevationStdDev, new CAltitudeFormatter()));
|
||||
}
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/models/listmodeltimestampobjects.h"
|
||||
#include "blackmisc/aviation/aircraftsituationchangelist.h"
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
class QModelIndex;
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace BlackGui
|
||||
if (m_withMenuEnableAircraft)
|
||||
{
|
||||
menuActions.addAction(CIcons::appAircraft16(), "Enable all aircraft", CMenuAction::pathClientSimulation(), { this, &CSimulatedAircraftView::enableAllDisabledAircraft });
|
||||
menuActions.addAction(CIcons::appAircraft16(), "Disable all aircraft", CMenuAction::pathClientSimulation(), { this, &CSimulatedAircraftView::disableAllEnabledAircraft });
|
||||
menuActions.addAction(CIcons::appAircraft16(), "Re-enable unrendered aircraft", CMenuAction::pathClientSimulation(), { this, &CSimulatedAircraftView::reEnableAllUnrenderedAircraft });
|
||||
}
|
||||
|
||||
@@ -152,26 +153,25 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
const CSimulatedAircraftList aircraft = this->container().findByEnabled(false);
|
||||
if (aircraft.isEmpty()) { return; }
|
||||
this->enableOrDisableAircraft(aircraft, true);
|
||||
}
|
||||
|
||||
const QPointer<CSimulatedAircraftView> myself(this);
|
||||
for (const CSimulatedAircraft &sa : aircraft)
|
||||
{
|
||||
QTimer::singleShot(10, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
CSimulatedAircraft enabledAircraft(sa);
|
||||
enabledAircraft.setEnabled(true);
|
||||
emit this->requestEnableAircraft(enabledAircraft);
|
||||
});
|
||||
}
|
||||
void CSimulatedAircraftView::disableAllEnabledAircraft()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
const CSimulatedAircraftList aircraft = this->container().findByEnabled(true);
|
||||
this->enableOrDisableAircraft(aircraft, false);
|
||||
}
|
||||
|
||||
void CSimulatedAircraftView::reEnableAllUnrenderedAircraft()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
const CSimulatedAircraftList aircraft = this->container().findByRendered(false);
|
||||
this->enableOrDisableAircraft(aircraft, true);
|
||||
}
|
||||
|
||||
void CSimulatedAircraftView::enableOrDisableAircraft(const CSimulatedAircraftList &aircraft, bool newEnabled)
|
||||
{
|
||||
if (aircraft.isEmpty()) { return; }
|
||||
|
||||
const QPointer<CSimulatedAircraftView> myself(this);
|
||||
@@ -182,7 +182,7 @@ namespace BlackGui
|
||||
if (!myself) { return; }
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
CSimulatedAircraft enabledAircraft(sa);
|
||||
enabledAircraft.setEnabled(true);
|
||||
enabledAircraft.setEnabled(newEnabled);
|
||||
emit this->requestEnableAircraft(enabledAircraft);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -99,9 +99,15 @@ namespace BlackGui
|
||||
//! Enable all disabled aircraft
|
||||
void enableAllDisabledAircraft();
|
||||
|
||||
//! Disable all enabled aircraft
|
||||
void disableAllEnabledAircraft();
|
||||
|
||||
//! Enable all unrendered aircraft
|
||||
void reEnableAllUnrenderedAircraft();
|
||||
|
||||
//! Enable or disable aircraft
|
||||
void enableOrDisableAircraft(const BlackMisc::Simulation::CSimulatedAircraftList &aircraft, bool newEnabled);
|
||||
|
||||
bool m_withMenuHighlightAndFollow = true;
|
||||
bool m_withMenuEnableAircraft = true;
|
||||
bool m_withMenuEnableGndFlag = true;
|
||||
|
||||
Reference in New Issue
Block a user