Skip to content

Commit aaa1f8f

Browse files
committed
Jetway Check on Depature / Insta-Board fixed
1 parent bc8e2b4 commit aaa1f8f

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

Fenix2GSX/Fenix2GSX.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<ApplicationIcon>phoenix.ico</ApplicationIcon>
1010
<PlatformTarget>x64</PlatformTarget>
1111
<Title>Fenix2GSX</Title>
12-
<Version>0.2.5</Version>
12+
<Version>0.2.6</Version>
1313
<Authors>Fragtality</Authors>
1414
<Copyright>Copyright © 2023</Copyright>
1515
<Description>GSX Integration and Automation for the Fenix A320</Description>

Fenix2GSX/FenixController.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,22 @@ private void BoardPassengers(int num)
178178
Logger.Log(LogLevel.Debug, "FenixContoller:BoardPassengers", $"Passenger Num was below 0!");
179179
return;
180180
}
181+
else if (num > 15)
182+
{
183+
Logger.Log(LogLevel.Debug, "FenixContoller:BoardPassengers", $"Passenger Num was above 15!");
184+
return;
185+
}
186+
else
187+
Logger.Log(LogLevel.Debug, "FenixContoller:BoardPassengers", $"(num {num}) (current {GetPaxCurrent()}) (planned ({GetPaxPlanned()}))");
181188

189+
int n = 0;
182190
for (int i = paxLast; i < paxLast + num && i < GetPaxPlanned(); i++)
183191
{
184192
paxCurrent[paxSeats[i]] = true;
193+
n++;
185194
}
186195

187-
if (num > 0)
196+
if (n > 0)
188197
SendSeatString();
189198
}
190199

Fenix2GSX/GsxController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,8 @@ public void RunServices()
401401
if (equipmentRemoved)
402402
{
403403
Logger.Log(LogLevel.Information, "GsxController:RunServices", $"Preparing for Pushback - removing Equipment");
404-
//WORKAROUND
405-
if (SimConnect.ReadLvar("FSDT_GSX_JETWAY") != 2)
404+
int departState = (int)SimConnect.ReadLvar("FSDT_GSX_DEPARTURE_STATE");
405+
if (SimConnect.ReadLvar("FSDT_GSX_JETWAY") != 2 && departState < 4)
406406
{
407407
MenuOpen();
408408
Logger.Log(LogLevel.Information, "GsxController:RunServices", $"Removing Jetway");
@@ -645,10 +645,10 @@ private int IsOperatorSelectionActive()
645645
string[] lines = File.ReadLines(menuFile).ToArray();
646646
if (lines.Length > 1)
647647
{
648-
if (lines[1] != "Request Deboarding")
649-
result = 1;
650-
else
648+
if (lines[1] == "Request Deboarding" || string.IsNullOrEmpty(lines[1]))
651649
result = 0;
650+
else
651+
result = 1;
652652
}
653653
}
654654

0 commit comments

Comments
 (0)