Author Topic: Catering Door Toggle Lvars while boarding  (Read 1986 times)

FwFreak

  • Newbie
  • *
  • Posts: 9
Catering Door Toggle Lvars while boarding
« on: July 03, 2019, 11:11:42 pm »
Hi Umberto,

after the new update I've noticed a strange behavior when calling GSX for boarding.

I'm reading the door toggle Lvars for an automatic door control.

When the Crew/Passenger Boarding starts at a non jetway position it seems that the FSDT_GSX_AIRCRAFT_SERVICE_1_TOGGLE and FSDT_GSX_AIRCRAFT_SERVICE_2_TOGGLE are set to 1 together with the passenger door variables.


Is there a way for me to check this or can you confirm this behavior?



Best regards

Karsten

virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51439
    • VIRTUALI Sagl
Re: Catering Door Toggle Lvars while boarding
« Reply #1 on: July 04, 2019, 01:14:07 pm »
I just checked for it right now, and no, the FSDT_GSX_AIRCRAFT_SERVICE_1_TOGGLE and FSDT_GSX_AIRCRAFT_SERVICE_2_TOGGLE variables are set to 1 only after the Catering platform has raised, and go back to 0 after the last catering cart has been pulled back from the plane.

How are you checking for the variables ?

FwFreak

  • Newbie
  • *
  • Posts: 9
Re: Catering Door Toggle Lvars while boarding
« Reply #2 on: July 04, 2019, 09:52:47 pm »
I use the FSUIPCClient.dll by Paul Henty for .net Framework (C#) for an Instructor station. I don't know if you know that library. It has a function to read LVars out of FSUIPC:


Code: [Select]

        private double getLvar(string name)
        {
            try
            {
                double value = FSUIPCConnection.ReadLVar(name);

                return value;
            }
            catch(FSUIPCException ex)
            {
                write_log("LVar", "ERROR:  " + ex.ToString());
            }

            return 0;
        }


My code runs this function for every LVar to get the values:

Code: [Select]
  gsx_doors_exit_1        = getLvar("FSDT_GSX_AIRCRAFT_EXIT_1_TOGGLE");
  gsx_doors_exit_2        = getLvar("FSDT_GSX_AIRCRAFT_EXIT_4_TOGGLE");

  gsx_doors_service_1     = getLvar("FSDT_GSX_AIRCRAFT_SERVICE_1_TOGGLE");
  gsx_doors_service_2     = getLvar("FSDT_GSX_AIRCRAFT_SERVICE_2_TOGGLE");

  gsx_doors_cargo_1       = getLvar("FSDT_GSX_AIRCRAFT_CARGO_1_TOGGLE");
  gsx_doors_cargo_2       = getLvar("FSDT_GSX_AIRCRAFT_CARGO_2_TOGGLE");


For debugging I write the values to into a log file and this is the output (with comments):

Code: [Select]
2019-07-04 09-28-39-186 : Monitor - DEBUG: E1: 0 | E2: 0 | C1: 0 | C2: 0 | S1: 0 | S2: 0  <--- Idle state (Cargo Doors are allready opened for Cargo loading)
2019-07-04 09-28-39-729 : Monitor - DEBUG: E1: 0 | E2: 0 | C1: 0 | C2: 0 | S1: 0 | S2: 0
2019-07-04 09-28-40-130 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1  <--- Toggle Door request by the LVars when the bus arrives (E = Exit, C = Cargo, S = Service)
2019-07-04 09-28-40-135 : Monitor - GSX Door Trigger: Exit 1                              <--- Trigger for Exit 1 (1L) recognized by the Monitor
2019-07-04 09-28-40-151 : Simulator - Toggle Aircraft Exit: 1                             <--- Program sends command to open Exit 1
2019-07-04 09-28-40-156 : Monitor - GSX Door Trigger: Exit 2                              <--- Trigger for Exit 2 (4L) recognized by the Monitor
2019-07-04 09-28-40-171 : Simulator - Toggle Aircraft Exit: 2                             <--- Program sends command to open Exit 2
2019-07-04 09-28-40-176 : Monitor - GSX Door Trigger: Service 1 & 2                       <--- Trigger for both Service doors (1R/4R) recognized by the Monitor
2019-07-04 09-28-40-191 : Simulator - Toggle Aircraft Exit: 4                             <--- Program sends command to open Exit 4 (both Service Doors)
2019-07-04 09-28-40-196 : Simulator - Set -> Message: JLIS - Operate doors for GSX
2019-07-04 09-28-40-201 : Simulator - Start Send -> message
2019-07-04 09-28-40-755 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1  <--- Waiting for the doors to finish opening process
2019-07-04 09-28-41-186 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1
2019-07-04 09-28-41-784 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1
2019-07-04 09-28-42-206 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1
2019-07-04 09-28-42-750 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1
2019-07-04 09-28-43-188 : Monitor - DEBUG: E1: 1 | E2: 1 | C1: 0 | C2: 0 | S1: 1 | S2: 1
2019-07-04 09-28-43-748 : Monitor - DEBUG: E1: 0 | E2: 0 | C1: 0 | C2: 0 | S1: 0 | S2: 0  <--- Doors are open now, LVars return to 0
2019-07-04 09-28-44-230 : Monitor - DEBUG: E1: 0 | E2: 0 | C1: 0 | C2: 0 | S1: 0 | S2: 0
2019-07-04 09-28-44-784 : Monitor - DEBUG: E1: 0 | E2: 0 | C1: 0 | C2: 0 | S1: 0 | S2: 0


Best regards

Karsten


virtuali

  • Administrator
  • Hero Member
  • *****
  • Posts: 51439
    • VIRTUALI Sagl
Re: Catering Door Toggle Lvars while boarding
« Reply #3 on: July 05, 2019, 03:46:56 pm »
I'm sorry but, if you use 3rd party libraries for read variables, I cannot tell you what might be wrong. You have TWO levels of abstraction between your code and the real SDK, the C# library, which calls FSUIPC, and FSUIPC itself, which calls the actual SDK, so it's very difficult to know what's going on.

As explained in the GSX manual at the end, variables sometime can change their ID between sessions, and depending which program has defined them first so, in order to be sure the variable is read or written correctly, the ID should always be checked first. However, you can be sure you are doing that only if you write your own code in C++, using the Gauges SDK or, in P3D4, the Panel interface of PDK.

I can only guarantee, because I know how our code works in reading and writing, the variables ARE correctly updated.
« Last Edit: July 05, 2019, 03:48:50 pm by virtuali »