Skip to content

Commit

Permalink
Version 1.3.0 OUT!
Browse files Browse the repository at this point in the history
Get the complete SID or only the first waypoint from the xml.
  • Loading branch information
rogerpuig11 committed Sep 17, 2021
1 parent a153fd1 commit 5dd9bd9
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 18 deletions.
Binary file modified Debug/InitialC.0ED612D6.tlog/CL.command.1.tlog
Binary file not shown.
Binary file modified Debug/InitialC.0ED612D6.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified Debug/InitialC.0ED612D6.tlog/CL.write.1.tlog
Binary file not shown.
Binary file not shown.
Binary file modified Debug/InitialClimbPlugin.ilk
Binary file not shown.
4 changes: 3 additions & 1 deletion Debug/InitialClimbPlugin.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
 analyzeFP.cpp
 InitialClimbPlugin.cpp
analyzeFP.cpp
Generating Code...
InitialClimbPlugin.vcxproj -> C:\Users\Casa\source\repos\rpuig2001\InitialClimbPlugin\Debug\InitialClimbPlugin.dll
Binary file modified Debug/InitialClimbPlugin.pdb
Binary file not shown.
Binary file modified Debug/vc142.idb
Binary file not shown.
Binary file modified Debug/vc142.pdb
Binary file not shown.
49 changes: 33 additions & 16 deletions analyzeFP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@ void InitialClimbPlugin::OnFunctionCall(int FunctionId, const char* ItemString,
string depRwy = fp.GetFlightPlanData().GetDepartureRwy(); boost::to_upper(depRwy);
string sid = fp.GetFlightPlanData().GetSidName(); boost::to_upper(sid);

string txt = getInitialClimbFromFile(origin, depRwy, sid);
if (txt.length() > 0) {
fp.GetControllerAssignedData().SetClearedAltitude(std::stoi(txt) * 100);
string Sidtxt = getInitialClimbFromFile(origin, depRwy, sid);
if (Sidtxt.length() > 0) {
fp.GetControllerAssignedData().SetClearedAltitude(std::stoi(Sidtxt) * 100);
}
else {
string first_wp = sid.substr(0, sid.find_first_of("0123456789"));
if (0 != first_wp.length())
boost::to_upper(first_wp);
string FirstWptxt = getInitialClimbFromFile(origin, depRwy, first_wp);
if (FirstWptxt.length() > 0) {
fp.GetControllerAssignedData().SetClearedAltitude(std::stoi(FirstWptxt) * 100);
}
}
}
}
Expand Down Expand Up @@ -120,17 +129,25 @@ void InitialClimbPlugin::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget Radar
boost::to_upper(sid_suffix);
}
//Get data from the xml function and if has value add it when checking the correct itemCode.
string txt = getInitialClimbFromFile(origin, depRwy, sid);
string txt;
string Sidtxt = getInitialClimbFromFile(origin, depRwy, sid);
string FirstWptxt = getInitialClimbFromFile(origin, depRwy, first_wp);
bool hasInitialClimbSet = false;
const char* initialAlt = "";

if (txt.length() > 0)
if (Sidtxt.length() > 0)
{
initialAlt = txt.c_str();
initialAlt = Sidtxt.c_str();
hasInitialClimbSet = true;
txt = Sidtxt;
}
else if (FirstWptxt.length() > 0) {
initialAlt = FirstWptxt.c_str();
hasInitialClimbSet = true;
txt = FirstWptxt;
}
else {
hasInitialClimbSet = false;
hasInitialClimbSet = false;
}

if (ItemCode == TAG_ITEM_INITIALCLIMB)
Expand All @@ -147,15 +164,15 @@ void InitialClimbPlugin::OnGetTagItem(CFlightPlan FlightPlan, CRadarTarget Radar
else {
if (hasInitialClimbSet)
{
if (FlightPlan.GetControllerAssignedData().GetClearedAltitude() == std::stoi(txt) * 100)
{
*pRGB = TAG_GREEN;
strcpy_s(sItemString, 16, initialAlt);
}
else {
*pRGB = TAG_RED;
strcpy_s(sItemString, 16, initialAlt);
}
if (FlightPlan.GetControllerAssignedData().GetClearedAltitude() == std::stoi(txt) * 100)
{
*pRGB = TAG_GREEN;
strcpy_s(sItemString, 16, initialAlt);
}
else {
*pRGB = TAG_RED;
strcpy_s(sItemString, 16, initialAlt);
}

}
else {
Expand Down
2 changes: 1 addition & 1 deletion analyzeFP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "rapidjson/stringbuffer.h"

#define MY_PLUGIN_NAME "Initial Climb"
#define MY_PLUGIN_VERSION "1.2.0"
#define MY_PLUGIN_VERSION "1.3.0"
#define MY_PLUGIN_DEVELOPER "Roger Puig"
#define MY_PLUGIN_COPYRIGHT "GPL v3"
#define MY_PLUGIN_VIEW_AVISO "Euroscope Intial climb"
Expand Down

0 comments on commit 5dd9bd9

Please sign in to comment.