Skip to content

Commit

Permalink
fix(squawks): assign squawks with C-Mode correlation when aircraft co…
Browse files Browse the repository at this point in the history
…nnect (#287)

* fix(squawks): assign squawks when aircraft connect during C-Mode correlation

When an aircraft connects with a flightplan in C-Mode correlation, the data ES presents to the
plugin can sometimes be invalid - e.g. exactly 0ft at exactly 0.0nm from origin. This prevents
squawks from assigning. This change adds a regular poll to squawks, initial altitudes and initial
headings to check for required updates - which apparently works as during these polls ES returns us
complete data.

fix #284 #285 #286

* refactor(deferred-events): remove old deferred events code
  • Loading branch information
AndyTWF committed Jul 3, 2021
1 parent de50349 commit 464de37
Show file tree
Hide file tree
Showing 34 changed files with 442 additions and 776 deletions.
8 changes: 0 additions & 8 deletions msvc/UKControllerPlugin/UKControllerPlugin.vcxproj
Expand Up @@ -98,7 +98,6 @@
<ClInclude Include="..\..\src\euroscope\UserSettingProviderInterface.h" />
<ClInclude Include="..\..\src\flightinformationservice\FlightInformationServiceModule.h" />
<ClInclude Include="..\..\src\flightinformationservice\FlightInformationServiceTagItem.h" />
<ClInclude Include="..\..\src\flightplan\DeferredFlightplanEvent.h" />
<ClInclude Include="..\..\src\flightplan\FlightPlanEventHandlerCollection.h" />
<ClInclude Include="..\..\src\flightplan\FlightPlanEventHandlerInterface.h" />
<ClInclude Include="..\..\src\flightplan\FlightplanStorageBootstrap.h" />
Expand Down Expand Up @@ -317,8 +316,6 @@
<ClInclude Include="..\..\src\task\TaskRunner.h" />
<ClInclude Include="..\..\src\task\TaskRunnerInterface.h" />
<ClInclude Include="..\..\src\timedevent\AbstractTimedEvent.h" />
<ClInclude Include="..\..\src\timedevent\DeferredEvent.h" />
<ClInclude Include="..\..\src\timedevent\DeferredEventBootstrap.h" />
<ClInclude Include="..\..\src\timedevent\TimedEventCollection.h" />
<ClInclude Include="..\..\src\timer\TimerDisplay.h" />
<ClInclude Include="..\..\src\time\ParseTimeStrings.h" />
Expand Down Expand Up @@ -396,7 +393,6 @@
<ClCompile Include="..\..\src\euroscope\UserSettingAwareCollection.cpp" />
<ClCompile Include="..\..\src\flightinformationservice\FlightInformationServiceModule.cpp" />
<ClCompile Include="..\..\src\flightinformationservice\FlightInformationServiceTagItem.cpp" />
<ClCompile Include="..\..\src\flightplan\DeferredFlightplanEvent.cpp" />
<ClCompile Include="..\..\src\flightplan\FlightPlanEventHandlerCollection.cpp" />
<ClCompile Include="..\..\src\flightplan\FlightplanStorageBootstrap.cpp" />
<ClCompile Include="..\..\src\flightplan\StoredFlightplan.cpp" />
Expand Down Expand Up @@ -585,17 +581,13 @@
<ClCompile Include="..\..\src\tag\TagFunction.cpp" />
<ClCompile Include="..\..\src\tag\TagItemCollection.cpp" />
<ClCompile Include="..\..\src\task\TaskRunner.cpp" />
<ClCompile Include="..\..\src\timedevent\DeferredEventBootstrap.cpp" />
<ClCompile Include="..\..\src\timedevent\TimedEventCollection.cpp" />
<ClCompile Include="..\..\src\timer\TimerDisplay.cpp" />
<ClCompile Include="..\..\src\time\ParseTimeStrings.cpp" />
<ClCompile Include="..\..\src\wake\CreateWakeMappings.cpp" />
<ClCompile Include="..\..\src\wake\WakeCategoryEventHandler.cpp" />
<ClCompile Include="..\..\src\wake\WakeCategoryMapper.cpp" />
<ClCompile Include="..\..\src\wake\WakeModule.cpp" />
<ClInclude Include="..\..\src\timedevent\DeferredEventHandler.h" />
<ClCompile Include="..\..\src\timedevent\DeferredEventHandler.cpp" />
<ClInclude Include="..\..\src\timedevent\DeferredEventRunnerInterface.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UKControllerPluginUtils\UKControllerPluginUtils.vcxproj">
Expand Down
32 changes: 4 additions & 28 deletions msvc/UKControllerPlugin/UKControllerPlugin.vcxproj.filters
Expand Up @@ -549,21 +549,6 @@
<ClInclude Include="..\..\src\offblock\EstimatedOffBlockTimeBootstrap.h">
<Filter>src\offblock</Filter>
</ClInclude>
<ClInclude Include="..\..\src\timedevent\DeferredEventHandler.h">
<Filter>src\timedevent</Filter>
</ClInclude>
<ClInclude Include="..\..\src\timedevent\DeferredEventBootstrap.h">
<Filter>src\timedevent</Filter>
</ClInclude>
<ClInclude Include="..\..\src\timedevent\DeferredEventRunnerInterface.h">
<Filter>src\timedevent</Filter>
</ClInclude>
<ClInclude Include="..\..\src\timedevent\DeferredEvent.h">
<Filter>src\timedevent</Filter>
</ClInclude>
<ClInclude Include="..\..\src\flightplan\DeferredFlightplanEvent.h">
<Filter>src\flightplan</Filter>
</ClInclude>
<ClInclude Include="..\..\resource\resource.h">
<Filter>resource</Filter>
</ClInclude>
Expand Down Expand Up @@ -1031,7 +1016,7 @@
<ClInclude Include="..\..\src\timer\TimerDisplay.h">
<Filter>src\timer</Filter>
</ClInclude>
<ClInclude Include="..\..\src\push\PushEventProcessorCollection.h">
<ClInclude Include="..\..\src\push\PushEventProcessorCollection.h">
<Filter>src\push</Filter>
</ClInclude>
<ClInclude Include="..\..\src\push\PushEventProcessorInterface.h">
Expand Down Expand Up @@ -1067,7 +1052,7 @@
<ClInclude Include="..\..\src\push\PushEventConnectionInterface.h">
<Filter>src\push</Filter>
</ClInclude>
<ClInclude Include="..\..\src\releases\CompareDepartureReleases.h">
<ClInclude Include="..\..\src\releases\CompareDepartureReleases.h">
<Filter>src\releases</Filter>
</ClInclude>
<ClInclude Include="..\..\src\releases\ApproveDepartureReleaseDialog.h">
Expand Down Expand Up @@ -1428,15 +1413,6 @@
<ClCompile Include="..\..\src\euroscope\RadarTargetEventHandlerCollection.cpp">
<Filter>src\euroscope</Filter>
</ClCompile>
<ClCompile Include="..\..\src\timedevent\DeferredEventHandler.cpp">
<Filter>src\timedevent</Filter>
</ClCompile>
<ClCompile Include="..\..\src\timedevent\DeferredEventBootstrap.cpp">
<Filter>src\timedevent</Filter>
</ClCompile>
<ClCompile Include="..\..\src\flightplan\DeferredFlightplanEvent.cpp">
<Filter>src\flightplan</Filter>
</ClCompile>
<ClCompile Include="..\..\src\pch\stdafx.cpp">
<Filter>src\pch</Filter>
</ClCompile>
Expand Down Expand Up @@ -1857,7 +1833,7 @@
<ClCompile Include="..\..\src\push\PushEventProcessorCollection.cpp">
<Filter>src\push</Filter>
</ClCompile>
<ClCompile Include="..\..\src\releases\ApproveDepartureReleaseDialog.cpp">
<ClCompile Include="..\..\src\releases\ApproveDepartureReleaseDialog.cpp">
<Filter>src\releases</Filter>
</ClCompile>
<ClCompile Include="..\..\src\releases\CompareDepartureReleases.cpp">
Expand Down Expand Up @@ -1885,4 +1861,4 @@
<Filter>src\releases</Filter>
</ClCompile>
</ItemGroup>
</Project>
</Project>
6 changes: 0 additions & 6 deletions msvc/UKControllerPluginTest/UKControllerPluginTest.vcxproj
Expand Up @@ -82,7 +82,6 @@
<ClCompile Include="..\..\test\test\euroscope\UserSettingAwareCollectionTest.cpp" />
<ClCompile Include="..\..\test\test\flightinformationservice\FlightInformationServiceModuleTest.cpp" />
<ClCompile Include="..\..\test\test\flightinformationservice\FlightInformationServiceTagItemTest.cpp" />
<ClCompile Include="..\..\test\test\flightplan\DeferredFlightplanEventTest.cpp" />
<ClCompile Include="..\..\test\test\flightplan\FlightPlanEventHandlerCollectionTest.cpp" />
<ClCompile Include="..\..\test\test\flightplan\FlightplanStorageBootstrapTest.cpp" />
<ClCompile Include="..\..\test\test\flightplan\StoredFlightplanCollectionTest.cpp" />
Expand Down Expand Up @@ -252,8 +251,6 @@
<ClCompile Include="..\..\test\test\tag\TagFunctionTest.cpp" />
<ClCompile Include="..\..\test\test\tag\TagItemCollectionTest.cpp" />
<ClCompile Include="..\..\test\test\task\TaskRunnerTest.cpp" />
<ClCompile Include="..\..\test\test\timedevent\DeferredEventBootstrapTest.cpp" />
<ClCompile Include="..\..\test\test\timedevent\DeferredEventHandlerTest.cpp" />
<ClCompile Include="..\..\test\test\timedevent\TimedEventCollectionTest.cpp" />
<ClCompile Include="..\..\test\test\timer\TimerDisplayTest.cpp" />
<ClCompile Include="..\..\test\test\time\ParseTimeStringsTest.cpp" />
Expand All @@ -275,7 +272,6 @@
<ClInclude Include="..\..\test\mock\MockConfigurableDisplay.h" />
<ClInclude Include="..\..\test\mock\MockControllerStatusEventHandlerInterface.h" />
<ClInclude Include="..\..\test\mock\MockCurlApi.h" />
<ClInclude Include="..\..\test\mock\MockDeferredEventRunner.h" />
<ClInclude Include="..\..\test\mock\MockDependencyLoader.h" />
<ClInclude Include="..\..\test\mock\MockDialogProvider.h" />
<ClInclude Include="..\..\test\mock\MockEuroScopeCControllerInterface.h" />
Expand All @@ -292,7 +288,6 @@
<ClInclude Include="..\..\test\mock\MockGraphicsInterface.h" />
<ClInclude Include="..\..\test\mock\MockHistoryTrailDialog.h" />
<ClInclude Include="..\..\test\mock\MockHistoryTrailRepository.h" />
<ClInclude Include="..\..\test\mock\MockInitialAltitudeEventHandler.h" />
<ClInclude Include="..\..\test\mock\MockMinStack.h" />
<ClInclude Include="..\..\test\mock\MockRadarRendererableInterface.h" />
<ClInclude Include="..\..\test\mock\MockRadarTargetEventHandlerInterface.h" />
Expand All @@ -303,7 +298,6 @@
<ClInclude Include="..\..\test\mock\MockPushEventConnection.h" />
<ClInclude Include="..\..\test\mock\MockWinApi.h" />
<ClInclude Include="..\..\test\pch\pch.h" />
<ClCompile Include="..\..\test\test\timedevent\DeferredEventTest.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
Expand Down
Expand Up @@ -419,18 +419,6 @@
<ClCompile Include="..\..\test\test\offblock\EstimatedOffBlockTimeBootstrapTest.cpp">
<Filter>test\offblock</Filter>
</ClCompile>
<ClCompile Include="..\..\test\test\timedevent\DeferredEventTest.cpp">
<Filter>test\timedevent</Filter>
</ClCompile>
<ClCompile Include="..\..\test\test\timedevent\DeferredEventHandlerTest.cpp">
<Filter>test\timedevent</Filter>
</ClCompile>
<ClCompile Include="..\..\test\test\timedevent\DeferredEventBootstrapTest.cpp">
<Filter>test\timedevent</Filter>
</ClCompile>
<ClCompile Include="..\..\test\test\flightplan\DeferredFlightplanEventTest.cpp">
<Filter>test\flightplan</Filter>
</ClCompile>
<ClCompile Include="..\..\test\helper\InitTests.cpp">
<Filter>helper</Filter>
</ClCompile>
Expand Down Expand Up @@ -924,9 +912,6 @@
<ClInclude Include="..\..\test\mock\MockHistoryTrailRepository.h">
<Filter>mock</Filter>
</ClInclude>
<ClInclude Include="..\..\test\mock\MockInitialAltitudeEventHandler.h">
<Filter>mock</Filter>
</ClInclude>
<ClInclude Include="..\..\test\mock\MockMinStack.h">
<Filter>mock</Filter>
</ClInclude>
Expand All @@ -949,9 +934,6 @@
<Filter>mock</Filter>
</ClInclude>
<ClInclude Include="..\..\test\pch\pch.h" />
<ClInclude Include="..\..\test\mock\MockDeferredEventRunner.h">
<Filter>mock</Filter>
</ClInclude>
<ClInclude Include="..\..\test\helper\TestEnvironment.h">
<Filter>helper</Filter>
</ClInclude>
Expand Down Expand Up @@ -980,4 +962,4 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
</Project>
4 changes: 0 additions & 4 deletions src/bootstrap/EventHandlerCollectionBootstrap.cpp
Expand Up @@ -9,7 +9,6 @@
#include "timedevent/TimedEventCollection.h"
#include "plugin/FunctionCallEventHandler.h"
#include "metar/MetarEventHandlerCollection.h"
#include "timedevent/DeferredEventHandler.h"
#include "euroscope/UserSettingAwareCollection.h"
#include "plugin/UKPlugin.h"
#include "command/CommandHandlerCollection.h"
Expand All @@ -23,7 +22,6 @@ using UKControllerPlugin::Controller::ControllerStatusEventHandlerCollection;
using UKControllerPlugin::TimedEvent::TimedEventCollection;
using UKControllerPlugin::Plugin::FunctionCallEventHandler;
using UKControllerPlugin::Metar::MetarEventHandlerCollection;
using UKControllerPlugin::TimedEvent::DeferredEventHandler;
using UKControllerPlugin::Euroscope::UserSettingAwareCollection;
using UKControllerPlugin::Command::CommandHandlerCollection;
using UKControllerPlugin::Euroscope::RunwayDialogAwareCollection;
Expand All @@ -44,11 +42,9 @@ namespace UKControllerPlugin {
persistence.timedHandler.reset(new TimedEventCollection);
persistence.pluginFunctionHandlers.reset(new FunctionCallEventHandler);
persistence.metarEventHandler.reset(new MetarEventHandlerCollection);
persistence.deferredHandlers.reset(new DeferredEventHandler);
persistence.userSettingHandlers.reset(new UserSettingAwareCollection);
persistence.commandHandlers.reset(new CommandHandlerCollection);
persistence.runwayDialogEventHandlers.reset(new RunwayDialogAwareCollection);
persistence.timedHandler->RegisterEvent(persistence.deferredHandlers, 3);
persistence.controllerHandoffHandlers.reset(new HandoffEventHandlerCollection);
}
} // namespace Bootstrap
Expand Down
3 changes: 0 additions & 3 deletions src/bootstrap/InitialisePlugin.cpp
Expand Up @@ -42,7 +42,6 @@
#include "squawk/SquawkModule.h"
#include "srd/SrdModule.h"
#include "stands/StandModule.h"
#include "timedevent/DeferredEventBootstrap.h"
#include "update/PluginVersion.h"
#include "wake/WakeModule.h"
#include "push/PushEventBootstrap.h"
Expand Down Expand Up @@ -76,7 +75,6 @@ using UKControllerPlugin::Prenote::PrenoteModule;
using UKControllerPlugin::Message::UserMessagerBootstrap;
using UKControllerPlugin::Euroscope::PluginUserSettingBootstrap;
using UKControllerPlugin::Duplicate::DuplicatePlugin;
using UKControllerPlugin::TimedEvent::DeferredEventBootstrap;
using UKControllerPlugin::Datablock::EstimatedDepartureTimeBootstrap;
using UKControllerPlugin::Euroscope::GeneralSettingsConfigurationBootstrap;
using UKControllerPlugin::Dependency::DependencyLoader;
Expand Down Expand Up @@ -207,7 +205,6 @@ namespace UKControllerPlugin {

Wake::BootstrapPlugin(*this->container, loader);
LoginModule::BootstrapPlugin(*this->container);
DeferredEventBootstrap(*this->container->timedHandler);
SectorFile::BootstrapPlugin(*this->container);

// General settings config bootstrap
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/PersistenceContainer.h
Expand Up @@ -32,7 +32,6 @@
#include "message/UserMessager.h"
#include "euroscope/UserSetting.h"
#include "command/CommandHandlerCollection.h"
#include "timedevent/DeferredEventHandler.h"
#include "login/Login.h"
#include "hold/HoldManager.h"
#include "euroscope/UserSettingAwareCollection.h"
Expand Down Expand Up @@ -87,8 +86,7 @@ namespace UKControllerPlugin {
std::unique_ptr<UKControllerPlugin::Metar::MetarEventHandlerCollection> metarEventHandler;
std::unique_ptr<UKControllerPlugin::RadarScreen::ScreenControls> screenControls;
std::unique_ptr<UKControllerPlugin::Command::CommandHandlerCollection> commandHandlers;
std::shared_ptr<UKControllerPlugin::TimedEvent::DeferredEventHandler> deferredHandlers;
std::shared_ptr<UKControllerPlugin::Euroscope::UserSettingAwareCollection> userSettingHandlers;
std::shared_ptr<Euroscope::UserSettingAwareCollection> userSettingHandlers;
std::unique_ptr<UKControllerPlugin::Euroscope::RunwayDialogAwareCollection> runwayDialogEventHandlers;
std::unique_ptr<UKControllerPlugin::Controller::HandoffEventHandlerCollection> controllerHandoffHandlers;
std::shared_ptr<UKControllerPlugin::Integration::ExternalMessageEventHandler> externalEventHandler;
Expand Down

0 comments on commit 464de37

Please sign in to comment.