Skip to content

Commit

Permalink
feat(missed): Electronic missed approach coordination (#346)
Browse files Browse the repository at this point in the history
* Missed approach storage (#344)

* Implement missed approach model

* Store the missed approaches

* Remove old missed approaches

* Missed approach push events (#345)

* Implement missed approach model

* Store the missed approaches

* Remove old missed approaches

* Implement push events for missed approaches

* Missed approach tag functions (#347)

* Implement missed approach model

* Store the missed approaches

* Remove old missed approaches

* Implement push events for missed approaches

* Missed approach api calls

* Start trigger implementation

* Start test

* Style

* build(actions): Stop actions hanging on clang (#350)

* Check for clang clash

* Remove explicit clang install

* Clang check in format

* Missed approach indicators (#352)

* Implement missed approach model

* Store the missed approaches

* Remove old missed approaches

* Implement push events for missed approaches

* Missed approach api calls

* Start trigger implementation

* Start test

* Style

* build(actions): Stop actions hanging on clang (#350)

* Check for clang clash

* Remove explicit clang install

* Clang check in format

* Expand ownership roles

* Change how user callsign is stored

* Get everything working with new roles

* Tests galore

* Add rationale

* Tests

* Format

* Enough for now

* Working renderer

* Format

* Split out options for renderer

* Fix tests and style

* Finish tests

* Global options saving

* Use service provisions to trigger missed approach

* Additional trigger checks

* Add audio alerting service

* Play audio at the right times

* Style

* Start button implementation

* Button settings

* Start toggle

* Button toggles

* Bootstrap dialog

* Style

* Indicators

* Make the dialog work

* Style

* Style

* Docs
  • Loading branch information
AndyTWF committed Nov 7, 2021
1 parent 782a233 commit 844bdf4
Show file tree
Hide file tree
Showing 166 changed files with 7,214 additions and 1,717 deletions.
1 change: 1 addition & 0 deletions docs/TAG_FUNCTIONS.md
Expand Up @@ -20,3 +20,4 @@
9017 - Open Prenote Message Sending Menu
9018 - Trigger Prenote Message Status View
9019 - Acknowledge Prenote Message
9020 - Trigger Missed Approach
1 change: 1 addition & 0 deletions docs/UserGuide/Features/Features.md
Expand Up @@ -24,6 +24,7 @@ dynamically to the plugin.
- Enroute releases
- Stand assignment
- RECAT-EU Wake Categories
- [Electronic Missed Approach Coordination](MissedApproaches.md)
- [VATSIM Nattrak Integration](Nattrak.md)
- [Electronic Departure Releases](DepartureReleases.md)
- [Electronic Prenotes](PrenoteMessages.md)
Expand Down
84 changes: 84 additions & 0 deletions docs/UserGuide/Features/MissedApproaches.md
@@ -0,0 +1,84 @@
# Missed Approaches

The UK Controller Plugin provides functionality to be able to signal to adjacent controllers that an aircraft
has executed a missed approach, without having to through other coordination methods such as TeamSpeak.

## Who can trigger a missed approach?

Only controllers that are logged into a recognised, active, Tower (TWR) position may trigger a missed approach.

## When can a missed approach be triggered?

A missed approach can only be triggered when the aircraft is within a certain distance from its arrival
airfield. Once a missed approach is triggered, another may not be triggered for the next three minutes.

## How do I trigger a missed approach?

There are two methods by which to trigger a missed approach.

- The "Missed Approach Button" on the screen
- The "Trigger Missed Approach" TAG function

When either of these methods are used, the plugin will ask for confirmation and, if confirmed, will trigger
the missed approach.

## The missed approach button

### How do I trigger the button?

The button may be toggled on and off using the "Toggle Missed Approach Button" option in the `OP` menu.

### How does the button work?

To trigger a missed approach using the button, select an aircraft and then click the button.

If the button is `greyed out`, a missed approach cannot be triggered at this time. This may be due
to the aircrafts distance from the airfield or the position you are controlling.

If the button is `green`, a missed approach may be triggered.

If the button is `red`, then a missed approach is active for the selected aircraft.

## How do I know if a missed approach has happened?

There are a number of configurable options for missed approaches in the plugin. These are all configurable
via the "Configure Missed Approaches" option of the `OP` menu.

## General settings

These settings are global, and not specific to a particular radar screen.

### Play missed approach alert sound

When a missed approach occurs that is relevant to you, selecting this option will cause the plugin to play
a short alarm sound, to alert you to the fact that a missed approach has occurred.

### Trigger missed approach alert when I initiate

This option controls whether or not you wish to receive the missed approach alert when it is
you that has initiated the missed approach.

### Service provisions

You may only be interested in missed approaches when you are providing a particular type of
service, e.g. Final Approach. You may select which services you wish to be alerted for,

### Airfields

Only airfields selected from the list will have their missed approaches alerted to you.

## ASR-specific settings

These settings are configurable on a per-ASR basis.

### Draw circle

When this option is selected, a red circle will be drawn around the aircraft performing a missed approach.

### Draw line

When this option is selected, a red line will be drawn from the centre of the screen to the aircraft performing a missed approach.

### Draw duration

This option controls how long any drawings will remain on screen following a missed approach.
40 changes: 40 additions & 0 deletions resource/UKControllerPlugin.rc
Expand Up @@ -58,6 +58,8 @@ WAVE_DEP_RLS_REQ WAVE ".\\sound\\departure_release_req

WAVE_NEW_PRENOTE WAVE "sound\\new_prenote.wav"

WAVE_MISSED_APPROACH WAVE "sound\\missedapproach.wav"


/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -291,6 +293,31 @@ BEGIN
LTEXT "Released At (Z)",IDC_DEPARTURE_RELEASE_APPROVE_RELEASED_AT_STATIC,7,64,51,8
END

IDD_MISSED_APPROACH DIALOGEX 0, 0, 257, 311
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Missed Approach Configuration"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,147,289,50,14
PUSHBUTTON "Cancel",IDCANCEL,201,289,50,14
LTEXT "Global Settings",MISSED_APPROACH_GLOSAL_STATIc,7,7,132,8
CONTROL "Play missed approach alert sound",MISSED_APPROACH_PLAY_SOUND,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,23,123,10
CONTROL "Trigger missed approach alert when I initiate",MISSED_APPROACH_SOUND_USER,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,38,158,10
CONTROL "",MISSED_APPROACH_SERVICE_LIST,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,67,84,60
LTEXT "Alert me to missed approaches when I am providing the following services:",MISSED_APPROACH_ALERT_STATIC,7,52,243,15
LTEXT "ASR Specific Settings",MISSED_APPROACH_ASR_STATIC,7,212,68,8
CONTROL "Draw circle around missed approach aircraft",MISSED_APPROACH_CIRCLE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,229,156,10
CONTROL "Draw line to missed approach aircraft",MISSED_APPROACH_LINE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,243,135,10
LTEXT "Alert me to missed approaches at these airfields:",MISSED_APPROACH_AIRFIELDS,7,133,157,8
CONTROL "",MISSED_APPROACH_AIRFIELD_LIST,"SysListView32",LVS_LIST | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,146,226,62
EDITTEXT MISSED_APPROACH_DRAW_DURATION,7,259,55,14,ES_AUTOHSCROLL | ES_NUMBER
LTEXT "Draw duration in seconds (1-9)",MISSED_APPROACH_DRAW_DURATION_TEXT,69,262,100,8
END


/////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -397,6 +424,14 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 130
END

IDD_MISSED_APPROACH, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 250
TOPMARGIN, 7
BOTTOMMARGIN, 303
END
END
#endif // APSTUDIO_INVOKED

Expand Down Expand Up @@ -466,6 +501,11 @@ BEGIN
0
END

IDD_MISSED_APPROACH AFX_DIALOG_LAYOUT
BEGIN
0
END


/////////////////////////////////////////////////////////////////////////////
//
Expand Down
1 change: 1 addition & 0 deletions resource/UKControllerPluginResource.vcxitems
Expand Up @@ -24,6 +24,7 @@
<Media Include="$(MSBuildThisFileDirectory)sound\departure_release_accepted.wav" />
<Media Include="$(MSBuildThisFileDirectory)sound\departure_release_rejected.wav" />
<Media Include="$(MSBuildThisFileDirectory)sound\departure_release_requested.wav" />
<Media Include="$(MSBuildThisFileDirectory)sound\missedapproach.wav" />
<Media Include="$(MSBuildThisFileDirectory)sound\new_prenote.wav" />
</ItemGroup>
<ItemGroup>
Expand Down
28 changes: 25 additions & 3 deletions resource/resource.h
Expand Up @@ -24,6 +24,9 @@
#define WAVE_DEP_RLS_REQ 133
#define IDR_NEW_PRENOTE 135
#define WAVE_NEW_PRENOTE 135
#define IDR_WAVE2 136
#define WAVE_MISSED_APPROACH 136
#define IDD_MISSED_APPROACH 137
#define IDC_CHECK_DEGRADING 1001
#define IDC_CHECK_FADING 1002
#define IDC_CHECK_AA 1003
Expand All @@ -38,6 +41,7 @@
#define GS_DIALOG_PRENOTE_CHECK 1013
#define TIMER1_ENABLED_CHECK 1013
#define IDC_MINSTACK_DISPLAY_CHECK 1013
#define MISSED_APPROACH_PLAY_SOUND 1013
#define TIMER2_ENABLED_CHECK 1014
#define IDC_MFCBUTTON1 1015
#define TIMER3_ENABLED_CHECK 1015
Expand Down Expand Up @@ -70,6 +74,8 @@
#define IDC_LIST1 1034
#define IDC_MINSTACK_LIST 1034
#define IDC_NOTIFICATIONS_LIST 1034
#define MISSED_APPROACH_SOUND_SERVICE_LIST 1034
#define MISSED_APPROACH_SERVICE_LIST 1034
#define IDC_HOLD_LIST 1036
#define IDC_BUTTON2 1046
#define IDC_ROUTE_COPY 1046
Expand Down Expand Up @@ -120,6 +126,7 @@
#define IDC_READ_NOTIFICATION 1087
#define IDC_DEPARTURE_RELEASE_REQUEST_CALLSIGN 1087
#define IDC_DEPARTURE_RELEASE_APPROVE_CALLSIGN 1087
#define MISSED_APPROACH_DRAW_DURATION 1087
#define IDC_NOTES_STATIC 1088
#define IDC_HOLD_PARAMS_MIN_STATIC 1089
#define IDC_NOTIFICATION_BODY 1089
Expand Down Expand Up @@ -163,16 +170,31 @@
#define IDC_CHECK_FILL 1118
#define IDC_CHECK2 1119
#define IDC_TRAIL_ROTATE 1119
#define MISSED_APPROACH_SOUND_USER 1119
#define IDC_SYSLINK2 1121
#define IDC_SYSLINK3 1122
#define MISSED_APPROACH_GLOSAL_STATIc 1123
#define MISSED_APPROACH_SOUND_STATIC 1126
#define MISSED_APPROACH_ALERT_STATIC 1126
#define MISSED_APPROACH_ASR_STATIC 1127
#define MISSED_APPROACH_CIRCLE 1128
#define MISSED_APPROACH_LINE 1129
#define MISSED_APPROACH_DRAW_AIRFIELDS 1130
#define MISSED_APPROACH_AIRFIELDS 1130
#define MISSED_APPROACH_DRAW_AIRFIELD_LIST 1132
#define MISSED_APPROACH_AIRFIELD_LIST 1132
#define MISSED_APPROACH_DRAW_PROVISIONS 1133
#define IDC_LIST4 1134
#define MISSED_APPROACH_DRAW_SERVICE_LIST 1134
#define MISSED_APPROACH_DRAW_DURATION_TEXT 1135

// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 136
#define _APS_NEXT_RESOURCE_VALUE 139
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1123
#define _APS_NEXT_CONTROL_VALUE 1136
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Binary file added resource/sound/missedapproach.wav
Binary file not shown.
37 changes: 27 additions & 10 deletions src/plugin/CMakeLists.txt
Expand Up @@ -239,6 +239,9 @@ set(src__handoff
controller/HandoffEventHandler.cpp)
source_group("src\\handoff" FILES ${src__handoff})

set(src__headings headings/Heading.h headings/Heading.cpp)
source_group("src\\headings" FILES ${src__headings})

set(src__historytrail
"historytrail/AircraftHistoryTrail.cpp"
"historytrail/AircraftHistoryTrail.h"
Expand Down Expand Up @@ -469,6 +472,24 @@ set(src__minstack
minstack/MinStackLevel.cpp minstack/MinStackRenderedItem.cpp)
source_group("src\\minstack" FILES ${src__minstack})

set(src__missedapproach
missedapproach/MissedApproach.cpp missedapproach/MissedApproach.h
missedapproach/MissedApproachCollection.cpp missedapproach/MissedApproachCollection.h
missedapproach/CompareMissedApproaches.cpp missedapproach/CompareMissedApproaches.h
missedapproach/RemoveExpiredMissedApproaches.cpp missedapproach/RemoveExpiredMissedApproaches.h
missedapproach/MissedApproachModule.cpp missedapproach/MissedApproachModule.h
missedapproach/NewMissedApproachPushEventHandler.cpp missedapproach/NewMissedApproachPushEventHandler.h
missedapproach/TriggerMissedApproach.cpp missedapproach/TriggerMissedApproach.h
missedapproach/MissedApproachRenderer.cpp missedapproach/MissedApproachRenderer.h
missedapproach/MissedApproachRenderMode.h
missedapproach/MissedApproachRenderOptions.cpp missedapproach/MissedApproachRenderOptions.h
missedapproach/MissedApproachConfigurationDialog.cpp missedapproach/MissedApproachConfigurationDialog.h
missedapproach/MissedApproachOptions.cpp missedapproach/MissedApproachOptions.h
missedapproach/MissedApproachAudioAlert.cpp missedapproach/MissedApproachAudioAlert.h
missedapproach/MissedApproachUserSettingHandler.cpp missedapproach/MissedApproachUserSettingHandler.h
missedapproach/MissedApproachButton.cpp missedapproach/MissedApproachButton.h missedapproach/ToggleMissedApproachButton.cpp missedapproach/ToggleMissedApproachButton.h missedapproach/ConfigureMissedApproaches.cpp missedapproach/ConfigureMissedApproaches.h)
source_group("src\\missedapproach" FILES ${src__missedapproach})

set(src__navaids
"navaids/CompareNavaids.cpp"
"navaids/CompareNavaids.h"
Expand Down Expand Up @@ -538,7 +559,9 @@ set(src__ownership
"ownership/AirfieldOwnershipModule.h"
"ownership/AirfieldsOwnedQueryMessage.cpp"
"ownership/AirfieldsOwnedQueryMessage.h"
)
ownership/ServiceProvision.h ownership/ServiceProvision.cpp
ownership/ServiceType.h
ownership/AirfieldServiceProviderCollection.cpp ownership/AirfieldServiceProviderCollection.h)
source_group("src\\ownership" FILES ${src__ownership})

set(src__plugin
Expand Down Expand Up @@ -778,13 +801,6 @@ set(src__tag
)
source_group("src\\tag" FILES ${src__tag})

set(src__task
"task/TaskRunner.cpp"
"task/TaskRunner.h"
"task/TaskRunnerInterface.h"
)
source_group("src\\task" FILES ${src__task})

set(src__time
"time/ParseTimeStrings.cpp"
"time/ParseTimeStrings.h"
Expand Down Expand Up @@ -836,6 +852,7 @@ set(ALL_FILES
${src__flightplan}
${src__graphics}
${src__handoff}
${src__headings}
${src__historytrail}
${src__hold}
${src__initialaltitude}
Expand All @@ -846,6 +863,7 @@ set(ALL_FILES
${src__message}
${src__metar}
${src__minstack}
${src__missedapproach}
${src__navaids}
${src__notifications}
${src__oceanic}
Expand All @@ -864,12 +882,11 @@ set(ALL_FILES
${src__srd}
${src__stands}
${src__tag}
${src__task}
${src__time}
${src__timedevent}
${src__timer}
${src__wake}
)
missedapproach/MissedApproachAudioAlert.cpp missedapproach/MissedApproachAudioAlert.h)

################################################################################
# Target
Expand Down
7 changes: 7 additions & 0 deletions src/plugin/airfield/AirfieldCollection.cpp
Expand Up @@ -64,4 +64,11 @@ namespace UKControllerPlugin::Airfield {
{
return icao.substr(0, 2) == "EG";
}

void AirfieldCollection::ForEach(const std::function<void(const AirfieldModel&)>& callback) const
{
for (const auto& airfieldMapping : this->airfieldMap) {
callback(*airfieldMapping.second);
}
}
} // namespace UKControllerPlugin::Airfield
1 change: 1 addition & 0 deletions src/plugin/airfield/AirfieldCollection.h
Expand Up @@ -19,6 +19,7 @@ namespace UKControllerPlugin::Airfield {
auto operator=(AirfieldCollection&&) noexcept -> AirfieldCollection&;
void AddAirfield(std::unique_ptr<UKControllerPlugin::Airfield::AirfieldModel> airfield);
[[nodiscard]] auto FetchAirfieldByIcao(const std::string& icao) const -> const AirfieldModel&;
void ForEach(const std::function<void(const AirfieldModel& airfield)>& callback) const;
[[nodiscard]] auto GetSize() const -> size_t;

private:
Expand Down
2 changes: 0 additions & 2 deletions src/plugin/bootstrap/CollectionBootstrap.cpp
Expand Up @@ -7,7 +7,6 @@
#include "dependency/DependencyLoaderInterface.h"
#include "flightplan/FlightPlanEventHandlerCollection.h"
#include "flightplan/StoredFlightplanCollection.h"
#include "memory"
#include "metar/MetarEventHandlerCollection.h"
#include "ownership/AirfieldOwnershipManager.h"
#include "radarscreen/RadarRenderableCollection.h"
Expand All @@ -19,7 +18,6 @@ using UKControllerPlugin::Controller::ActiveCallsignCollection;
using UKControllerPlugin::Dependency::DependencyLoaderInterface;
using UKControllerPlugin::Flightplan::StoredFlightplanCollection;
using UKControllerPlugin::Metar::MetarEventHandlerCollection;
using UKControllerPlugin::Ownership::AirfieldOwnershipManager;
using UKControllerPlugin::RadarScreen::RadarRenderableCollection;

namespace UKControllerPlugin::Bootstrap {
Expand Down
3 changes: 2 additions & 1 deletion src/plugin/bootstrap/HelperBootstrap.cpp
Expand Up @@ -37,7 +37,8 @@ namespace UKControllerPlugin::Bootstrap {
persistence.settingsRepository->GetSetting("api-key"));
persistence.api = std::make_unique<ApiHelper>(*persistence.curl, requestBuilder);

persistence.taskRunner = std::make_unique<TaskRunner>(3);
persistence.taskRunner = std::make_shared<TaskRunner>(3);
SetTaskRunner(persistence.taskRunner);
}

/*
Expand Down

0 comments on commit 844bdf4

Please sign in to comment.