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
13 changes: 13 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
[Changelog v0.14.4]
:gear: **Changed Features / Behaviour**
* FPLN - startup requests are now blocked if no runway is set (both "normal" startup and rwy startup)
* request system refactored - requests and rwy requests share the same type now (distinction is now stored with the flight plan)
* other smaller improvements to the request system (mainly startup request related)
* CONF - improved checking for military SIDs (OID) to validate against the .ese file. As per previous version OIDs have to be written like found in the .ese file (there is no mastering like with normal SIDs)
* added a health check to warn about OIDs in the config that haven't been found in the .ese file

:lady_beetle: **Fixes**
* FPLN - Squawks are now also displayed if the departure airport is inactive. Only CTR controllers were affected by this (#401)
* FPLN - rwy request indicators shouldn't be overwritten anymore (#406)
* CONF - military SIDs (OIDs) had to be at the end of the config due to missing reset of special OID/SID numbering (#402)

[Changelog v0.14.3.1]
>[!NOTE]
> This Hotfix is only needed if SIDs without any route (no waypoint after the last ':') is present
Expand Down
2 changes: 1 addition & 1 deletion area.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace vsid
std::vector<Line> lines;

/**
* @brief Creates a decimal position pair // #refacotr - change to utils.h version
* @brief Creates a decimal position pair // #refactor - change to utils.h version
*
* @param pos the fpln position as pair of lat/long coordinates
*/
Expand Down
10 changes: 7 additions & 3 deletions configparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void vsid::ConfigParser::loadAirportConfig(std::map<std::string, vsid::Airport>
aptInfo.requests["taxi"] = {};
aptInfo.requests["departure"] = {};
aptInfo.requests["vfr"] = {};
aptInfo.rwyrequests["rwy startup"] = {};
aptInfo.rwyrequests["startup"] = {};

// customRules

Expand Down Expand Up @@ -603,12 +603,12 @@ void vsid::ConfigParser::loadAirportConfig(std::map<std::string, vsid::Airport>
vsid::tmpSidSettings desSetting;
vsid::tmpSidSettings idSetting;

std::string fixedNumber = "";

// "field level" - iterates over restrictions and sid way points / bases

for (auto &sidField : this->parsedConfig.at(icao).at("sids").items())
{
std::string fixedNumber = "";

if (sidField.key() == "allowDiffNumbers") fieldSetting.allowDiffNumbers = this->parsedConfig.at(icao).at("sids").at(sidField.key());
else if (sidField.key() == "initial") fieldSetting.initial = this->parsedConfig.at(icao).at("sids").at(sidField.key());
else if (sidField.key() == "climbvia") fieldSetting.via = this->parsedConfig.at(icao).at("sids").at(sidField.key());
Expand Down Expand Up @@ -703,10 +703,14 @@ void vsid::ConfigParser::loadAirportConfig(std::map<std::string, vsid::Airport>
else if (!this->isConfigValue(sidField.key()))
{
// special check for possible military SIDs / OIDs (format: XY12)

if (vsid::utils::lastIsDigit(sidField.key()) && vsid::utils::countDigits(sidField.key()) > 1 && sidField.key().length() > 2)
{
fieldSetting.base = sidField.key().substr(0, sidField.key().length() - 1);
fixedNumber = sidField.key().back();

messageHandler->writeMessage("DEBUG", "[" + sidField.key() + "] contained a number - setting as fixed SID number: " +
fixedNumber, vsid::MessageHandler::DebugArea::Conf);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const int MENU_BOTTOM_BAR = 112;
// errors

const std::string ERROR_FPLN_ATCBLOCK = "E010";
const std::string ERROR_FPLN_REQSPLIT = "E010-1";
const std::string ERROR_FPLN_SIDWPT = "E011";
const std::string ERROR_FPLN_SPLITWPT = "E012";
const std::string ERROR_FPLN_EXTFUNC = "E013";
Expand Down
32 changes: 22 additions & 10 deletions display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,30 @@ void vsid::Display::OnRefresh(HDC hDC, int Phase)
this->getZoomLevel() <= sharedPlugin->getConfigParser().getIndicatorDefaultValues().showBelowZoom)
{
std::string adep = target.GetCorrelatedFlightPlan().GetFlightPlanData().GetOrigin();
std::string fplnRwy = target.GetCorrelatedFlightPlan().GetFlightPlanData().GetDepartureRwy(); // # refactor - use rwy from actual flight plan (icao block)
std::string fplnRwy = vsid::fplnhelper::getAtcBlock(target.GetCorrelatedFlightPlan()).second;
std::string reqType = fplnInfo.request;
bool isRwyReq = fplnInfo.request.find("rwy") != std::string::npos;

if (fplnInfo.request != "" && adep != "")
if (isRwyReq)
{
try
{
reqType = vsid::utils::split(reqType, ' ').at(1);
}
catch (std::out_of_range&) {}
}

if (!reqType.empty() && !adep.empty() && sharedPlugin->getActiveApts().contains(adep))
{
EuroScopePlugIn::CPosition offsetPos = this->getIndicatorOffset(targetPos, offset, zoomScale, 180.0);

POINT offsetPx = this->ConvertCoordFromPositionToPixel(offsetPos);

try
if (!isRwyReq)
{
for (auto& [type, req] : sharedPlugin->getActiveApts().at(adep).requests)
{
if (type != fplnInfo.request) continue;
if (type != reqType) continue;

for (std::set<std::pair<std::string, long long>>::iterator it = req.begin(); it != req.end(); ++it)
{
Expand All @@ -188,21 +199,23 @@ void vsid::Display::OnRefresh(HDC hDC, int Phase)
dc.DrawText(reqPos.c_str(), &area, DT_BOTTOM);
}
}

}
else
{
for (auto& [type, rwys] : sharedPlugin->getActiveApts().at(adep).rwyrequests)
{
if (type != fplnInfo.request) continue;
if (type != reqType) continue;

for (auto& [rwy, rwyReq] : rwys)
{
if (fplnRwy == "" || fplnRwy != rwy) continue;
if (fplnRwy.empty() || fplnRwy != rwy) continue;

for (std::set<std::pair<std::string, long long>>::iterator it = rwyReq.begin(); it != rwyReq.end(); ++it)
{
if (it->first != callsign) continue;

size_t pos = std::distance(it, rwyReq.end());
std::string reqPos = vsid::utils::toupper(type).at(0) + std::to_string(pos);
std::string reqPos = "R" + std::to_string(pos);

CRect area;

Expand All @@ -219,8 +232,7 @@ void vsid::Display::OnRefresh(HDC hDC, int Phase)
}
}
}
}
catch (std::out_of_range) {};
}
}
}

Expand Down
Loading
Loading