Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ jobs:
echo "Versions. version = ${{steps.dllversion.outputs.version}}, short_sha = $SHORT_SHA, new_version = $SHA_VERSION"
sed -i 's/const std::string pluginVersion = ".*";/const std::string pluginVersion = "'$SHA_VERSION'";/' vSIDPlugin.h

- name: Determine release name
id: releasename
shell: bash
run: |
if [[ "${{ steps.prerelease.outputs.prerelease }}" == 'true' ]]; then
echo "Setting pre-release name"
echo "releasename=v${{ steps.commitversion.outputs.shaversion }}" >> $GITHUB_OUTPUT
else
echo "Setting stable name"
echo "releasename=v${{steps.dllversion.outputs.version}}" >> $GITHUB_OUTPUT
fi

- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
with:
Expand Down Expand Up @@ -105,6 +117,18 @@ jobs:
# remove --verbose for less verbosity
run: cmake --build build --config Release --verbose

- name: Rename PDB and MAP files
shell: pwsh
run: |
$releaseName = "${{ steps.releasename.outputs.releasename }}"
Write-Host "Appending $releaseName to .pdb and .map files..."

$files = Get-ChildItem -Path "build\Release" -Include *.pdb, *.map -Recurse
foreach ($file in $files) {
$newName = "{0}-{1}{2}" -f $file.BaseName, $releaseName, $file.Extension
Rename-Item -Path $file.FullName -NewName $newName -PassThru
}

- name: Create PDB and MAP artifact
uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -219,19 +243,6 @@ jobs:
fi
done


- name: Determine release name
id: releasename
shell: bash
run: |
if [[ "${{ steps.prerelease.outputs.prerelease }}" == 'true' ]]; then
echo "Setting pre-release name"
echo "releasename=v${{ steps.commitversion.outputs.shaversion }}" >> $GITHUB_OUTPUT
else
echo "Setting stable name"
echo "releasename=v${{steps.dllversion.outputs.version}}" >> $GITHUB_OUTPUT
fi

- name: Create GitHub Release and Upload Assets
id: create_release
uses: softprops/action-gh-release@v2
Expand Down
6 changes: 6 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ SID evaluation slightly changed due to the bug fixing of restrictions overruling
* CONF - add color values for the handover flag
* "hovNeutral" (default: orange) - caution / information color
* "hovWarning" (default: red) - warning color
* ATC - FMP stations are skipped in controller detection (#410)
* ATC - if a controller disconnects that was on the list for failed SI determination the callsign will be removed to enable new evaluation upon new connection

:gear: **Changed Features / Behaviour**
* ATC - after too many tries (10) evaluation for SI is stopped as it probably cannot be matched anymore (not reported by ES / the network and not present in the .ese file)
* GEN - debugging console cannot be closed via the 'X' anymore (as this would also close ES)

:lady_beetle: **Fixes**
* CONF - fix crash during coordinate conversion while parsing the .ese file for atc stations and vis points
Expand Down
13 changes: 13 additions & 0 deletions messageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ void vsid::MessageHandler::openConsole()
try
{
AllocConsole();

// disable close button to prevent ES closing
HWND hwnd = GetConsoleWindow();
if (hwnd != NULL)
{
HMENU hMenu = GetSystemMenu(hwnd, FALSE);
if (hMenu != NULL)
{
DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND);
}
SetWindowTextA(hwnd, "Console Logger");
}

freopen_s(&this->consoleFile, "CONOUT$", "w", stdout);
}
catch (std::exception& e)
Expand Down
65 changes: 50 additions & 15 deletions vSIDPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1831,8 +1831,8 @@ bool vsid::VSIDPlugin::atcFreqMatch(const EuroScopePlugIn::CController& other, c
{
if (other.GetPrimaryFrequency() != local.freq)
{
messageHandler->writeMessage("DEBUG", "[FREQ Match] other: " + std::to_string(other.GetPrimaryFrequency()) +
" is NOT local: " + std::to_string(local.freq), vsid::MessageHandler::DebugArea::Dev);
/*messageHandler->writeMessage("DEBUG", "[FREQ Match] other (" + std::string(other.GetCallsign()) + "): " + std::to_string(other.GetPrimaryFrequency()) +
" is NOT local (section ATC): " + std::to_string(local.freq), vsid::MessageHandler::DebugArea::Dev);*/
return false;
}

Expand Down Expand Up @@ -1877,14 +1877,16 @@ bool vsid::VSIDPlugin::atcFreqMatch(const EuroScopePlugIn::CController& other, c
") IS local: " + myCallsign + "(" + std::to_string(local.freq) + ")", vsid::MessageHandler::DebugArea::Dev);
return true;
}
else if (other.GetFacility() != local.facility) // #dev - debugging purpose

if (other.GetFacility() != local.facility) // #dev - debugging purpose
{
messageHandler->writeMessage("DEBUG", "[FREQ Match] other fac: " + atcCallsign + "(" + std::to_string(other.GetFacility()) +
") is NOT local fac: " + myCallsign + "(" + std::to_string(local.facility) + ")", vsid::MessageHandler::DebugArea::Dev);
return false;

}
else return false;

return false; // default fallback state
}
/*
* END OWN FUNCTIONS
Expand Down Expand Up @@ -4930,6 +4932,10 @@ void vsid::VSIDPlugin::OnControllerPositionUpdate(EuroScopePlugIn::CController C
const double atcFreq = Controller.GetPrimaryFrequency();
std::string atcIcao;

if (atcCallsign == ControllerMyself().GetCallsign()) return;
if (this->actAtc.contains(atcSI) || this->ignoreAtc.contains(atcSI)) return;
if (this->atcSiFailCounter.contains(atcCallsign) && this->atcSiFailCounter[atcCallsign] >= 10) return;

try
{
atcIcao = vsid::utils::split(atcCallsign, '_').at(0);
Expand All @@ -4945,9 +4951,6 @@ void vsid::VSIDPlugin::OnControllerPositionUpdate(EuroScopePlugIn::CController C
}
}

if (atcCallsign == ControllerMyself().GetCallsign()) return;
if (this->actAtc.contains(atcSI) || this->ignoreAtc.contains(atcSI)) return;

// maximum 3 attempts to try and match the callsign or frequency against ese stored atc stations

if (this->atcSiFailCounter.contains(atcCallsign) && this->atcSiFailCounter[atcCallsign] > 2 && this->atcSiFailCounter[atcCallsign] < 6)
Expand Down Expand Up @@ -4983,13 +4986,41 @@ void vsid::VSIDPlugin::OnControllerPositionUpdate(EuroScopePlugIn::CController C
return;
}

if (atcCallsign.ends_with("FMP"))
{
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Skipping FMP station.",
vsid::MessageHandler::DebugArea::Atc
);
return;
}

if (atcFreq < 0.1 || atcFreq > 199.0)
{
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Skipping ATC because the freq. is invalid (" + std::to_string(atcFreq) + ").",
vsid::MessageHandler::DebugArea::Atc
);
return;
}

if (atcFac < 2)
{
if (!std::all_of(atcSI.begin(), atcSI.end(), [](char c) { return std::isdigit(static_cast<unsigned char>(c)); }))
{
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Adding SI to ignore list because the facility is below 2 (usually FIS)",
vsid::MessageHandler::DebugArea::Atc
);

this->ignoreAtc.insert(atcSI);

return;
}

messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Skipping ATC because the facility is below 2 (usually FIS) and SI cannot be stored (SI: " + atcSI + ").",
vsid::MessageHandler::DebugArea::Atc
);

return;
}

if (atcSI.empty())
{
Expand All @@ -5009,6 +5040,10 @@ void vsid::VSIDPlugin::OnControllerPositionUpdate(EuroScopePlugIn::CController C
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Skipping ATC because the SI contains a number (SI: " + atcSI +
"). Failed SI count: " + std::to_string(this->atcSiFailCounter[atcCallsign]), vsid::MessageHandler::DebugArea::Atc);

if (this->atcSiFailCounter[atcCallsign] == 10)
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Failed to get valid SI after 10 attempts. No more evaluation.",
vsid::MessageHandler::DebugArea::Atc);

return;
}
else if (this->atcSiFailCounter.contains(atcCallsign))
Expand All @@ -5018,14 +5053,6 @@ void vsid::VSIDPlugin::OnControllerPositionUpdate(EuroScopePlugIn::CController C

this->atcSiFailCounter.erase(atcCallsign);
}

if (atcFac < 2)
{
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] Skipping ATC because the facility is below 2 (usually FIS).",
vsid::MessageHandler::DebugArea::Atc
);
return;
}

EuroScopePlugIn::CController atcMyself = ControllerMyself();
std::set<std::string> atcIcaos;
Expand Down Expand Up @@ -5111,6 +5138,14 @@ void vsid::VSIDPlugin::OnControllerDisconnect(EuroScopePlugIn::CController Contr
);
this->ignoreAtc.erase(atcSI);
}

if (this->atcSiFailCounter.contains(atcCallsign))
{
messageHandler->writeMessage("DEBUG", "[" + atcCallsign + "] disconnected. Removing from SI fail counter list.",
vsid::MessageHandler::DebugArea::Atc
);
this->atcSiFailCounter.erase(atcCallsign);
}
}

void vsid::VSIDPlugin::OnAirportRunwayActivityChanged()
Expand Down
Loading