mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 10:25:36 +08:00
Ref T609, change COM transmission values in UI/emulated driver
This commit is contained in:
committed by
Mat Sutcliffe
parent
b9afe63511
commit
0596782926
@@ -224,6 +224,15 @@ namespace BlackSimPlugin
|
|||||||
return this->updateCockpit(aircraft, this->identifier());
|
return this->updateCockpit(aircraft, this->identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSimulatorEmulated::changeInternalCom(const CComSystem &comSystem, CComSystem::ComUnit unit)
|
||||||
|
{
|
||||||
|
if (m_myAircraft.getComSystem(unit) == comSystem) { return false; }
|
||||||
|
m_myAircraft.setComSystem(comSystem, unit);
|
||||||
|
const bool c = this->updateCockpit(m_myAircraft, this->identifier());
|
||||||
|
if (c) { emit this->internalAircraftChanged(); }
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
bool CSimulatorEmulated::changeInternalSelcal(const CSelcal &selcal)
|
bool CSimulatorEmulated::changeInternalSelcal(const CSelcal &selcal)
|
||||||
{
|
{
|
||||||
if (m_myAircraft.getSelcal() == selcal) { return false; }
|
if (m_myAircraft.getSelcal() == selcal) { return false; }
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#define BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
#define BLACKSIMPLUGIN_EMULATED_SIMULATOREMULATED_H
|
||||||
|
|
||||||
#include "../plugincommon/simulatorplugincommon.h"
|
#include "../plugincommon/simulatorplugincommon.h"
|
||||||
|
#include "blackmisc/aviation/comsystem.h"
|
||||||
#include "blackmisc/simulation/interpolatormulti.h"
|
#include "blackmisc/simulation/interpolatormulti.h"
|
||||||
#include "blackmisc/simulation/interpolationrenderingsetup.h"
|
#include "blackmisc/simulation/interpolationrenderingsetup.h"
|
||||||
#include "blackmisc/simulation/interpolationlogger.h"
|
#include "blackmisc/simulation/interpolationlogger.h"
|
||||||
@@ -97,6 +98,10 @@ namespace BlackSimPlugin
|
|||||||
//! \remark normally used by corresponding BlackSimPlugin::Emulated::CSimulatorEmulatedMonitorDialog
|
//! \remark normally used by corresponding BlackSimPlugin::Emulated::CSimulatorEmulatedMonitorDialog
|
||||||
bool changeInternalCom(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
bool changeInternalCom(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||||
|
|
||||||
|
//! Simulator internal change of COM values
|
||||||
|
//! \remark normally used by corresponding BlackSimPlugin::Emulated::CSimulatorEmulatedMonitorDialog
|
||||||
|
bool changeInternalCom(const BlackMisc::Aviation::CComSystem &comSystem, BlackMisc::Aviation::CComSystem::ComUnit unit);
|
||||||
|
|
||||||
//! Simulator internal change of SELCAL
|
//! Simulator internal change of SELCAL
|
||||||
//! \remark normally used by corresponding BlackSimPlugin::Emulated::CSimulatorEmulatedMonitorDialog
|
//! \remark normally used by corresponding BlackSimPlugin::Emulated::CSimulatorEmulatedMonitorDialog
|
||||||
bool changeInternalSelcal(const BlackMisc::Aviation::CSelcal &selcal);
|
bool changeInternalSelcal(const BlackMisc::Aviation::CSelcal &selcal);
|
||||||
|
|||||||
@@ -7,8 +7,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "simulatoremulatedmonitordialog.h"
|
#include "simulatoremulatedmonitordialog.h"
|
||||||
#include "simulatoremulated.h"
|
|
||||||
#include "ui_simulatoremulatedmonitordialog.h"
|
#include "ui_simulatoremulatedmonitordialog.h"
|
||||||
|
#include "simulatoremulated.h"
|
||||||
|
#include "blackgui/components/cockpitcomtransmissioncomponent.h"
|
||||||
#include "blackmisc/logmessage.h"
|
#include "blackmisc/logmessage.h"
|
||||||
|
|
||||||
#include <QIntValidator>
|
#include <QIntValidator>
|
||||||
@@ -18,6 +19,7 @@ using namespace BlackMisc;
|
|||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Simulation;
|
using namespace BlackMisc::Simulation;
|
||||||
using namespace BlackGui;
|
using namespace BlackGui;
|
||||||
|
using namespace BlackGui::Components;
|
||||||
using namespace BlackGui::Editors;
|
using namespace BlackGui::Editors;
|
||||||
|
|
||||||
namespace BlackSimPlugin
|
namespace BlackSimPlugin
|
||||||
@@ -49,14 +51,15 @@ namespace BlackSimPlugin
|
|||||||
connect(m_simulator, &CSimulatorEmulated::internalAircraftChanged, this, &CSimulatorEmulatedMonitorDialog::setInternalAircraftUiValues, Qt::QueuedConnection);
|
connect(m_simulator, &CSimulatorEmulated::internalAircraftChanged, this, &CSimulatorEmulatedMonitorDialog::setInternalAircraftUiValues, Qt::QueuedConnection);
|
||||||
connect(&m_uiUpdateTimer, &QTimer::timeout, this, &CSimulatorEmulatedMonitorDialog::timerBasedUiUpdates);
|
connect(&m_uiUpdateTimer, &QTimer::timeout, this, &CSimulatorEmulatedMonitorDialog::timerBasedUiUpdates);
|
||||||
|
|
||||||
connect(ui->cb_Connected, &QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Connected, & QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
||||||
connect(ui->cb_Paused, &QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Paused, &QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
||||||
connect(ui->cb_Simulating, &QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Simulating, &QCheckBox::released, this, &CSimulatorEmulatedMonitorDialog::onSimulatorValuesChanged);
|
||||||
|
|
||||||
connect(ui->editor_Situation, &CSituationForm::changeAircraftSituation, this, &CSimulatorEmulatedMonitorDialog::changeSituationFromUi, Qt::QueuedConnection);
|
connect(ui->editor_Situation, &CSituationForm::changeAircraftSituation, this, &CSimulatorEmulatedMonitorDialog::changeSituationFromUi, Qt::QueuedConnection);
|
||||||
connect(ui->editor_AircraftParts, &CAircraftPartsForm::changeAircraftParts, this, &CSimulatorEmulatedMonitorDialog::changePartsFromUi, Qt::QueuedConnection);
|
connect(ui->editor_AircraftParts, &CAircraftPartsForm::changeAircraftParts, this, &CSimulatorEmulatedMonitorDialog::changePartsFromUi, Qt::QueuedConnection);
|
||||||
connect(ui->editor_Com, &CCockpitComForm::changedCockpitValues, this, &CSimulatorEmulatedMonitorDialog::changeComFromUi, Qt::QueuedConnection);
|
connect(ui->editor_Com, &CCockpitComForm::changedCockpitValues, this, &CSimulatorEmulatedMonitorDialog::changeComFromUi, Qt::QueuedConnection);
|
||||||
connect(ui->editor_Com, &CCockpitComForm::changedSelcal, this, &CSimulatorEmulatedMonitorDialog::changeSelcalFromUi, Qt::QueuedConnection);
|
connect(ui->editor_Com, &CCockpitComForm::changedSelcal, this, &CSimulatorEmulatedMonitorDialog::changeSelcalFromUi, Qt::QueuedConnection);
|
||||||
|
connect(ui->comp_ComTransmissions, &CCockpitComTransmissionComponent::changedValues, this, &CSimulatorEmulatedMonitorDialog::onSavedComTransmissionValues, Qt::QueuedConnection);
|
||||||
|
|
||||||
connect(ui->pb_ResetStatistics, &QPushButton::clicked, this, &CSimulatorEmulatedMonitorDialog::resetStatistics);
|
connect(ui->pb_ResetStatistics, &QPushButton::clicked, this, &CSimulatorEmulatedMonitorDialog::resetStatistics);
|
||||||
connect(ui->pb_InterpolatorStopLog, &QPushButton::clicked, this, &CSimulatorEmulatedMonitorDialog::interpolatorLogButton);
|
connect(ui->pb_InterpolatorStopLog, &QPushButton::clicked, this, &CSimulatorEmulatedMonitorDialog::interpolatorLogButton);
|
||||||
@@ -159,6 +162,15 @@ namespace BlackSimPlugin
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatorEmulatedMonitorDialog::onSavedComTransmissionValues(CComSystem::ComUnit unit)
|
||||||
|
{
|
||||||
|
if (!m_simulator) { return; }
|
||||||
|
const CSimulatedAircraft ownAircraft = m_simulator->getOwnAircraft();
|
||||||
|
CComSystem com = ownAircraft.getComSystem(unit);
|
||||||
|
ui->comp_ComTransmissions->updateComSystem(com, unit);
|
||||||
|
m_simulator->changeInternalCom(com, unit);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatorEmulatedMonitorDialog::changeComFromUi(const CSimulatedAircraft &aircraft)
|
void CSimulatorEmulatedMonitorDialog::changeComFromUi(const CSimulatedAircraft &aircraft)
|
||||||
{
|
{
|
||||||
if (!m_simulator) { return; }
|
if (!m_simulator) { return; }
|
||||||
@@ -201,6 +213,7 @@ namespace BlackSimPlugin
|
|||||||
ui->editor_Situation->setSituation(internal.getSituation());
|
ui->editor_Situation->setSituation(internal.getSituation());
|
||||||
ui->editor_AircraftParts->setAircraftParts(internal.getParts());
|
ui->editor_AircraftParts->setAircraftParts(internal.getParts());
|
||||||
ui->editor_Com->setValue(internal);
|
ui->editor_Com->setValue(internal);
|
||||||
|
ui->comp_ComTransmissions->setComSystems(internal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorEmulatedMonitorDialog::timerBasedUiUpdates()
|
void CSimulatorEmulatedMonitorDialog::timerBasedUiUpdates()
|
||||||
|
|||||||
@@ -74,6 +74,9 @@ namespace BlackSimPlugin
|
|||||||
//! UI values changed
|
//! UI values changed
|
||||||
void onSimulatorValuesChanged();
|
void onSimulatorValuesChanged();
|
||||||
|
|
||||||
|
//! Transmission values (COM unit volume etc.)
|
||||||
|
void onSavedComTransmissionValues(BlackMisc::Aviation::CComSystem::ComUnit unit);
|
||||||
|
|
||||||
//! Cockpit COM values changed
|
//! Cockpit COM values changed
|
||||||
void changeComFromUi(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
void changeComFromUi(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user