mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T515, context menus for re-matching
* added re-matching for single aircraft * re-ordered
This commit is contained in:
committed by
Mat Sutcliffe
parent
a90d4465a2
commit
a0c8f3778b
@@ -953,7 +953,7 @@ namespace BlackCore
|
|||||||
resetAircraft.resetToNetworkModel();
|
resetAircraft.resetToNetworkModel();
|
||||||
this->xCtxAddedRemoteAircraftReadyForModelMatching(resetAircraft);
|
this->xCtxAddedRemoteAircraftReadyForModelMatching(resetAircraft);
|
||||||
});
|
});
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CContextSimulator::onSimulatorStarted(const CSimulatorPluginInfo &info)
|
void CContextSimulator::onSimulatorStarted(const CSimulatorPluginInfo &info)
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace BlackGui
|
|||||||
this->tabBar()->setUsesScrollButtons(true);
|
this->tabBar()->setUsesScrollButtons(true);
|
||||||
ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
|
ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
|
||||||
ui->tvp_AircraftInRange->setAircraftMode(CSimulatedAircraftListModel::NetworkMode);
|
ui->tvp_AircraftInRange->setAircraftMode(CSimulatedAircraftListModel::NetworkMode);
|
||||||
ui->tvp_AircraftInRange->configureMenu(true, false, true, true);
|
ui->tvp_AircraftInRange->configureMenu(true, true, false, true, true);
|
||||||
|
|
||||||
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::modelDataChangedDigest, this, &CAircraftComponent::onRowCountChanged);
|
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::modelDataChangedDigest, this, &CAircraftComponent::onRowCountChanged);
|
||||||
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget);
|
connect(ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget);
|
||||||
|
|||||||
@@ -315,8 +315,8 @@ namespace BlackGui
|
|||||||
void CMappingComponent::doMatchingsAgain()
|
void CMappingComponent::doMatchingsAgain()
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->getIContextSimulator() || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; }
|
if (!sGui || !sGui->getIContextSimulator() || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; }
|
||||||
const int reMatchedNo = sGui->getIContextSimulator()->doMatchingsAgain();
|
const int rematchedNumber = sGui->getIContextSimulator()->doMatchingsAgain();
|
||||||
CLogMessage(this).info(u"Triggered re-apping of %1 aircraft") << reMatchedNo;
|
CLogMessage(this).info(u"Triggered re-matching of %1 aircraft") << rematchedNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMappingComponent::onSaveAircraft()
|
void CMappingComponent::onSaveAircraft()
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
const CMenuAction &CMenuAction::subMenuDisplayModels()
|
const CMenuAction &CMenuAction::subMenuDisplayModels()
|
||||||
{
|
{
|
||||||
static const CMenuAction subdir(CIcons::appAircraft16(), "Display models", CMenuAction::pathClientSimulationDisplay());
|
static const CMenuAction subdir(CIcons::appAircraft16(), "Display and render models", CMenuAction::pathClientSimulationDisplay());
|
||||||
return subdir;
|
return subdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
using namespace BlackConfig;
|
using namespace BlackConfig;
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Aviation;
|
||||||
using namespace BlackMisc::Simulation;
|
using namespace BlackMisc::Simulation;
|
||||||
using namespace BlackCore::Context;
|
using namespace BlackCore::Context;
|
||||||
using namespace BlackGui::Models;
|
using namespace BlackGui::Models;
|
||||||
@@ -45,12 +46,13 @@ namespace BlackGui
|
|||||||
this->setSortIndicator();
|
this->setSortIndicator();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatedAircraftView::configureMenu(bool menuHighlightAndFollow, bool menuEnableAircraft, bool menuFastPositionUpdates, bool menuGndFlag)
|
void CSimulatedAircraftView::configureMenu(bool menuRecalculate, bool menuHighlightAndFollow, bool menuEnableAircraft, bool menuFastPositionUpdates, bool menuGndFlag)
|
||||||
{
|
{
|
||||||
m_withMenuEnableAircraft = menuEnableAircraft;
|
m_withRecalculate = menuRecalculate;
|
||||||
m_withMenuFastPosition = menuFastPositionUpdates;
|
m_withMenuEnableAircraft = menuEnableAircraft;
|
||||||
|
m_withMenuFastPosition = menuFastPositionUpdates;
|
||||||
m_withMenuHighlightAndFollow = menuHighlightAndFollow;
|
m_withMenuHighlightAndFollow = menuHighlightAndFollow;
|
||||||
m_withMenuEnableGndFlag = menuGndFlag;
|
m_withMenuEnableGndFlag = menuGndFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatedAircraftView::configureMenuFastPositionUpdates(bool menuFastPositionUpdates)
|
void CSimulatedAircraftView::configureMenuFastPositionUpdates(bool menuFastPositionUpdates)
|
||||||
@@ -65,17 +67,26 @@ namespace BlackGui
|
|||||||
menuActions.addMenuDisplayModels();
|
menuActions.addMenuDisplayModels();
|
||||||
menuActions.addMenuDataTransfer();
|
menuActions.addMenuDataTransfer();
|
||||||
|
|
||||||
menuActions.addAction(CIcons::appInterpolation16(), "Recalculate all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::recalculateAllAircraft });
|
if (m_menus.testFlag(MenuDisableModelsTemp) && this->hasSelection())
|
||||||
|
{
|
||||||
|
menuActions.addAction(CIcons::delete16(), "Temp.disable model from set", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::requestTempDisable });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_withRecalculate)
|
||||||
|
{
|
||||||
|
menuActions.addAction(CIcons::appInterpolation16(), "Re-calculate all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::recalculateAllAircraft });
|
||||||
|
menuActions.addAction(CIcons::appInterpolation16(), "Re-matching all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::doMatchingsAgain });
|
||||||
|
if (this->hasSelection())
|
||||||
|
{
|
||||||
|
menuActions.addAction(CIcons::appInterpolation16(), "Re-matching selected", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::doMatchingsAgainForSelected });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_withMenuEnableAircraft && !this->isEmpty())
|
if (m_withMenuEnableAircraft && !this->isEmpty())
|
||||||
{
|
{
|
||||||
menuActions.addAction(CIcons::appAircraft16(), "Enable all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::enableAllDisabledAircraft });
|
menuActions.addAction(CIcons::appAircraft16(), "Enable all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::enableAllDisabledAircraft });
|
||||||
menuActions.addAction(CIcons::appAircraft16(), "Disable all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::disableAllEnabledAircraft });
|
|
||||||
menuActions.addAction(CIcons::appAircraft16(), "Re-enable unrendered aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::reEnableAllUnrenderedAircraft });
|
menuActions.addAction(CIcons::appAircraft16(), "Re-enable unrendered aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::reEnableAllUnrenderedAircraft });
|
||||||
if (m_menus.testFlag(MenuDisableModelsTemp) && this->hasSelection())
|
menuActions.addAction(CIcons::appAircraft16(), "Disable all aircraft", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::disableAllEnabledAircraft });
|
||||||
{
|
|
||||||
menuActions.addAction(CIcons::delete16(), "Temp.disable model", CMenuAction::pathModel(), { this, &CSimulatedAircraftView::requestTempDisable });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->hasSelection())
|
if (this->hasSelection())
|
||||||
@@ -241,6 +252,26 @@ namespace BlackGui
|
|||||||
simContext->recalculateAllAircraft();
|
simContext->recalculateAllAircraft();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatedAircraftView::doMatchingsAgain()
|
||||||
|
{
|
||||||
|
IContextSimulator *simContext = simulatorContext();
|
||||||
|
if (!simContext) { return; }
|
||||||
|
const int rematchedNumber = simContext->doMatchingsAgain();
|
||||||
|
CLogMessage(this).info(u"Triggered re-matching of %1 aircraft") << rematchedNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSimulatedAircraftView::doMatchingsAgainForSelected()
|
||||||
|
{
|
||||||
|
IContextSimulator *simContext = simulatorContext();
|
||||||
|
if (!simContext) { return; }
|
||||||
|
if (!this->hasSelection()) { return; }
|
||||||
|
const CCallsign cs = this->selectedObject().getCallsign();
|
||||||
|
if (simContext->doMatchingAgain(cs))
|
||||||
|
{
|
||||||
|
CLogMessage(this).info(u"Triggered re-matching of '%1'") << cs.asString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatedAircraftView::enableFastPositionUpdates(const CSimulatedAircraft &aircraft)
|
void CSimulatedAircraftView::enableFastPositionUpdates(const CSimulatedAircraft &aircraft)
|
||||||
{
|
{
|
||||||
IContextNetwork *nwContext = networkContext();
|
IContextNetwork *nwContext = networkContext();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace BlackGui
|
|||||||
void setAircraftMode(Models::CSimulatedAircraftListModel::AircraftMode mode);
|
void setAircraftMode(Models::CSimulatedAircraftListModel::AircraftMode mode);
|
||||||
|
|
||||||
//! Configure the menu
|
//! Configure the menu
|
||||||
void configureMenu(bool menuHighlightAndFollow, bool menuEnableAircraft, bool menuFastPositionUpdates, bool menuGndFlag);
|
void configureMenu(bool menuRecalculate, bool menuHighlightAndFollow, bool menuEnableAircraft, bool menuFastPositionUpdates, bool menuGndFlag);
|
||||||
|
|
||||||
//! Configure fast position updates menu
|
//! Configure fast position updates menu
|
||||||
void configureMenuFastPositionUpdates(bool menuFastPositionUpdates);
|
void configureMenuFastPositionUpdates(bool menuFastPositionUpdates);
|
||||||
@@ -113,6 +113,12 @@ namespace BlackGui
|
|||||||
//! Fully recalculate all aircraft
|
//! Fully recalculate all aircraft
|
||||||
void recalculateAllAircraft();
|
void recalculateAllAircraft();
|
||||||
|
|
||||||
|
//! Match all aircraft again
|
||||||
|
void doMatchingsAgain();
|
||||||
|
|
||||||
|
//! Match all aircraft again
|
||||||
|
void doMatchingsAgainForSelected();
|
||||||
|
|
||||||
//! Enable fast position updates
|
//! Enable fast position updates
|
||||||
void enableFastPositionUpdates(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
void enableFastPositionUpdates(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
|
||||||
|
|
||||||
@@ -128,6 +134,7 @@ namespace BlackGui
|
|||||||
//! Network context
|
//! Network context
|
||||||
static BlackCore::Context::IContextNetwork *networkContext();
|
static BlackCore::Context::IContextNetwork *networkContext();
|
||||||
|
|
||||||
|
bool m_withRecalculate = true;
|
||||||
bool m_withMenuHighlightAndFollow = true;
|
bool m_withMenuHighlightAndFollow = true;
|
||||||
bool m_withMenuEnableAircraft = true;
|
bool m_withMenuEnableAircraft = true;
|
||||||
bool m_withMenuEnableGndFlag = true;
|
bool m_withMenuEnableGndFlag = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user