mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #361, own reader to fix unbalanced " issue
* some functions renamed * move some code from .h to .cpp * adjusted samples
This commit is contained in:
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
|
||||
BlackMisc::registerMetadata();
|
||||
|
||||
streamOut << "Run samples:" << endl;
|
||||
streamOut << "1 .. FS common / Simulation" << endl;
|
||||
streamOut << "1 .. FS common / Simulation (with cfg files reading)" << endl;
|
||||
streamOut << "2 .. FSX" << endl;
|
||||
streamOut << "3 .. Mappings" << endl;
|
||||
streamOut << "x .. exit" << endl;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace BlackSimTest
|
||||
return 0;
|
||||
}
|
||||
|
||||
streamOut << "start reading" << endl;
|
||||
streamOut << "start reading, press RETURN" << endl;
|
||||
QString input = streamIn.readLine();
|
||||
Q_UNUSED(input);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace BlackSimTest
|
||||
std::unique_ptr<ISimulatorModelMappings> cvm(new CVPilotModelMappings(true));
|
||||
bool s = cvm->read();
|
||||
streamOut << "directory: " << CVPilotModelMappings::standardMappingsDirectory() << endl;
|
||||
streamOut << "loaded: " << (s ? "yes" : "no") << " size: " << cvm->size() << endl;
|
||||
streamOut << "loaded: " << BlackMisc::boolToYesNo(s) << " size: " << cvm->size() << endl;
|
||||
|
||||
// mapper with rule set, handing over ownership
|
||||
CAircraftMapper mapper(std::move(cvm));
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace BlackGui
|
||||
Q_ASSERT(getIContextNetwork());
|
||||
connect(getIContextSimulator(), &IContextSimulator::installedAircraftModelsChanged, this, &CMappingComponent::ps_onAircraftModelsLoaded);
|
||||
connect(getIContextSimulator(), &IContextSimulator::modelMatchingCompleted, this, &CMappingComponent::ps_onModelMatchingCompleted);
|
||||
connect(getIContextNetwork(), &IContextNetwork::changedRemoteAircraftModel, this, &CMappingComponent::ps_onRenderedAircraftModelChanged);
|
||||
connect(getIContextNetwork(), &IContextNetwork::changedRemoteAircraftModel, this, &CMappingComponent::ps_onRemoteAircraftModelChanged);
|
||||
connect(getIContextNetwork(), &IContextNetwork::changedRemoteAircraftEnabled, this, &CMappingComponent::ps_onChangedAircraftEnabled);
|
||||
connect(getIContextNetwork(), &IContextNetwork::changedFastPositionUpdates, this, &CMappingComponent::ps_onFastPositionUpdatesEnabled);
|
||||
connect(getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMappingComponent::ps_onConnectionStatusChanged);
|
||||
@@ -177,7 +177,8 @@ namespace BlackGui
|
||||
const int MaxHeight = 125;
|
||||
this->ui->lbl_AircraftIconDisplayed->setText("");
|
||||
this->ui->lbl_AircraftIconDisplayed->setToolTip(model.getDescription());
|
||||
CPixmap pm = this->getIContextSimulator()->iconForModel(model.getModelString());
|
||||
QString modelString(model.getModelString());
|
||||
CPixmap pm = this->getIContextSimulator()->iconForModel(modelString);
|
||||
if (pm.isNull())
|
||||
{
|
||||
this->ui->lbl_AircraftIconDisplayed->setPixmap(CIcons::crossWhite16());
|
||||
@@ -301,7 +302,7 @@ namespace BlackGui
|
||||
this->ui->le_AircraftModel->setCompleter(this->m_modelCompleter);
|
||||
}
|
||||
|
||||
void CMappingComponent::ps_onRenderedAircraftModelChanged(const CSimulatedAircraft &aircraft, const QString &originator)
|
||||
void CMappingComponent::ps_onRemoteAircraftModelChanged(const CSimulatedAircraft &aircraft, const QString &originator)
|
||||
{
|
||||
this->updateSimulatedAircraftView();
|
||||
Q_UNUSED(originator);
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace BlackGui
|
||||
void ps_onModelsUpdateRequested();
|
||||
|
||||
//! Rendered aircraft changed in backend
|
||||
void ps_onRenderedAircraftModelChanged(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const QString &originator);
|
||||
void ps_onRemoteAircraftModelChanged(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const QString &originator);
|
||||
|
||||
//! Aircraft enabled, disabled in backend
|
||||
void ps_onChangedAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const QString &originator);
|
||||
|
||||
@@ -64,6 +64,12 @@
|
||||
</item>
|
||||
<item row="0" column="0" colspan="5">
|
||||
<widget class="QTabWidget" name="tw_ListViews">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -86,6 +92,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Views::CSimulatedAircraftView" name="tvp_SimulatedAircraft">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
@@ -118,6 +130,12 @@
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Views::CAircraftModelView" name="tvp_AircraftModels">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user