Jump to content
The simFlight Network Forums

michielsweb

Members
  • Posts

    53
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by michielsweb

  1. 
    namespace FSUIPCWinFormsApp2
    {
        public partial class frmMain : Form
        {
            // =====================================
            // DECLARE OFFSETS YOU WANT TO USE HERE
            // =====================================
            private Offset<uint> airspeed = new Offset<uint>(0x02BC);
            private Offset<int> altitude = new Offset<int>(0x3324); 
            private Offset<byte> maincabindoor = new Offset<byte>(0x6C14);
            private Offset<uint> avionicsMaster = new Offset<uint>(0x2E80);
            private Offset<ushort> onGround = new Offset<ushort>(0x0366);         // 2-byte offset - Unsigned short
                                                                                  //private Offset<byte> MainEntry = new Offset<byte>(2^03367);
            private Offset<string> messageWrite = new Offset<string>("message", 0x3380, 128, true);
            private Offset<short> messageDuration = new Offset<short>("message", 0x32FA, true);
    
    
            // between states
            int GroundConnect = 0;
            int Boarding = 0;
            int DeBoarding = 0;
            // =====================================
            // PDMG OFFSETS
            // =====================================
            private Offset<byte> raw_maincabindoor = new Offset<byte>(0x6C14);
            private Offset<byte> raw_maincabindoor_aft = new Offset<byte>(0x6C1E);
            private Offset<byte> raw_cargodoor = new Offset<byte>(0x6C19);
            private Offset<byte> raw_cargodoor_aft = new Offset<byte>(0x6C1D);
            private Offset<byte> raw_servicedoor = new Offset<byte>(0x6C15);
            private Offset<byte> raw_servicedoor_aft = new Offset<byte>(0x6C1F);
            private Offset<byte> raw_parkingbrake = new Offset<byte>(0x65A7);
            private Offset<byte> raw_autobrake = new Offset<byte>(0x6562);
            private Offset<byte> raw_taxilights = new Offset<byte>(0x64FA);
            private Offset<byte> raw_landinglights = new Offset<byte>(0x6503);
            private Offset<byte> raw_seatbelts = new Offset<byte>(0x649F);
            private Offset<byte> raw_gear = new Offset<byte>(0x6576);
            private Offset<byte> raw_groundconnections = new Offset<byte>(0x6576);
            private Offset<float> raw_flapsneedle = new Offset<float>(0x6568);
            private Offset<byte> raw_flap_to = new Offset<byte>(0x65F9);
            private Offset<byte> raw_parkbrake = new Offset<byte>(0x0BC8);
            private PMDG_NGX_CDU_Screen CDU0 =  new PMDG_NGX_CDU_Screen(0x5400);
    
            public frmMain()
            {
                InitializeComponent();
                configureForm(); 
                // Start the connection timer to look for a flight sim
                this.timerConnection.Start();
            }

     

  2. 2 hours ago, Paul Henty said:

    Yes, that's fine. Thanks.

    If you want to experiment with this, the CDU text is quite easy to get with the DLL.

    First, see the PMDG offsets document for an entry you need to add to your .INI file. And for the starting offset of the two CDU screens.

    Declare an instance of the CDU screen class: (Pass the starting offset):

    
    private PMDG_NGX_CDU_Screen CDU0 = new PMDG_NGX_CDU_Screen(0x5400); // CDU 0 in 737

    Hey paul.

    can it be that the offset line is wrong? i copy paste it
    but it gives error over it.:


    invalid token =
    indentifier expected
     

     

     

     

  3. 1 minute ago, Pete Dowson said:

    I suspect that you can only get this information by reading the CDU text and trying to interpret that -- but the information would have to be displayed on one of the CDUs in order for you to receive it.

    There are offsets dedicated to receive the text displayed on the CDUs (if enabled). See the Offset Mapping for PMDG 737NGX pdf in your FSUIPC Documents subfolder. 

    It would be very messy. This data is really provided for you to replicate the CDU display on an external hardware CDU, not for interpreting by program. But it isn't impossible, just messy.

    Pete

     

    wel 🙂 it sounds like its worth looking into it !

     

  4. hehe 🙂 yeah im going there. trying to see if they willing to open 5 lvars 🙂
    doubt it but can try it 😄



    - gonna ask for :  destination and departure icao from fmc.
    and chocks,  and gpu 🙂  and if posseble flight time 🙂

    if i can get  "dest and departure flightime" i can make the welcome announcement  "include expectedflight time announcement.
    if i can get "gpu and chocks" i can turn ground crew to automate this 😄

    to add to realisme 😄

    thnx paul btw  paul henty?clickeble to ure fsuipc net dll site?  for credits? is fine?

     

  5. small update.

    (lack of ground crew sounds.) temp replaced whit "green bar messages"

    all cabin crew sounds are now properly timed til " taxing to runway" 
    yes  all sounds til beboarding complete are done.   just making tweakings  🙂 and timing optimizing 😄

    🙂 sofar i managed whit pauls help.
    to make a watertight  cabin crew  til takeoff 🙂
    even GSX menus are no longer  used.

    running a test  currently how to blind set "pushback direction 😛



     

    • Like 1
  6. i programmed most  already  including sounds playing on right time.
    currently i am implenting the actions  the cabin/ground  crew should do.  on the right timings and commands.

    small example 🙂

    fases 0
    upon loading aircraft.
    it wil automaticly start asking GSX  for  "make the plane connected whit stairs.  aswel setting the "pdmg generator ready"
    it finishes by telling the captain "ground crew is live and connected.

    fase 1: Captain gives permision to board. (here is the fun thing!! this is 1 of 3 times u need to actualy push a button 🙂)  open the main door.
    Ground and cabin wil do the other doors automaticly.   while this is going u can hear the boarding process.

    fase 1.1
    Cabin/Ground wil listen to  GSX when to open and close the doors.
    aswel as catering and fuel is implented automaticly already through GSX

    fase 1.2 boarding  is completed
    GroundCrew wil report boarding ready. 
    Cabincrew wil report Cabin ready.  (and make initial welcome announcement.

    Fase 2 Ground wil work whit the flightdeck to prepare for departure.
    i removed all nasty "ugly menus" by automate it.  it wil only ask which way i want the push.

    fase 3 taxi + safety

    fase 4 is crew prepare for takeoff.

    all of this is done on aircraft, Gsx states and fsuipc offset states

    i am up to 12 stages  🙂 but u get the idea for now 😄

    oh and yes cabin sounds are able to "make ure own " 




     

  7. trick is  load the data in the top
    stop the timers.

    and restart them after the codes. and by adding between variables.
    like "boarding = 1;  i stop the main boarding start proces. on repeat

    i apriciate this help i already put credits in the program 🙂
    as i wil freely make it public . upon completion.

    lightweight opensource CABINCREW /  GroundCrew.    which runs from outside sim 🙂

     

  8. little update:
    okay i totaly failed sofar on the lvar writing. to gsx luckily i can read gsx lvars. 

    pdmg lvars i completly can read or write. sofar i managed work around whit offsets 😄



    stil working on controlling the PDMG737  6 doors.   (so "cabin crew can do their duties and controll them after captain gave permission. ;-))
    Running first Sound Tests and "timing work"  (so the  requirements are pretty spot on. just need little tinkering.

    trying to figure out if i can read the "fmc destination airport and alternate airport"
    for some extra functions

     

  9. sorry last question.
     

    private Offset<byte> maincabindoor = new Offset<byte>(0x6C14);


    its a 1 byte  boolean   (simple check if door is open or not)

    i have been trying to "read the value" of this byte .
    tried convert it  bool  int  string.

     

    bool result = Convert.ToBoolean(maincabindoor);

    this is the only  code i have working sofar where the program wil launch. but it crashes because fsuipc  says its inconvertble

    how can i extract or check the value of maincabindoor?




     

  10. Sorry paul i feel such a idiot 🙂
    trying to get some offsets loaded in a c#  running into a few questions 🙂

    FSUIPCConnection.ReadLVar("Engine1ThrottlePosition").ToString("F2"); 

    is the  F2 just a random name u picked?  to create a string for anything good aslong as its unique?

    and this question:

    3367 1 This byte shows doors that are open, one bit per door: 2^0 = Exit1 ... 2^3 = Exit 4. N.B. FSUIPC4 does handle up to 8 doors, one for each bit 0-7. Whether FSX can actually process Exits 5-8 is unknown however.

    would  i be correct  this is the way to handle this
    private offset<byte> MainEntry = new Offset<byte>(2^03367);

    sorry i am new to bytes. trying to get a basic understanding for a simple if else  loop 🙂
     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.