Jump to content
The simFlight Network Forums

request simple c# demo script


michielsweb

Recommended Posts

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
Link to comment
Share on other sites

I can't see an offset either. You could try looking through the LVars to see if there is one for chocks.

It may be that it's not possible to get this information. Developers don't always make everything accessible from outside.

I think PMDG has forums. You could try asking there.

Paul

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

19 minutes ago, michielsweb said:

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 😄

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

 

Link to comment
Share on other sites

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 !

 

Link to comment
Share on other sites

Quote

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

Yes, that's fine. Thanks.

Quote

I suspect that you can only get this information by reading the CDU text

>> wel 🙂 it sounds like its worth looking into it !

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

Then use it like this:

        private void CDUExample()
        {
            this.CDU0.RefreshData(); // Call RefreshData to get the latest text

            string cduText = "";

            // Powered property lets you know if it's on or off:
            if (CDU0.Powered)
            {
                // Get the entire screen in one string.
                // Delimiter passed as parameter. In this case, new line.
                cduText = this.CDU0.ToString("\r\n");
            }
            else
            {
                cduText = "No Power";
            }

            // OR, you can get a specific row of text, use the Rows collection:
            // (First row is row 0)
            string row3Text = this.CDU0.Rows[2].ToString();
            
            // Use normal string functions to search in the row:
            if (row3Text.Substring(5,2) == "ON")
            {
                // do something
            }
            else
            {
                // do something else
            }
        }

Paul

Link to comment
Share on other sites

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
 

 

 

 

Link to comment
Share on other sites


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();
        }

 

Link to comment
Share on other sites

wel to help others 🙂

how to get DEP/ ARR seperated.

 

                FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_CDU_L_RTE, 0x20000000);
                Thread.Sleep(400);
                this.CDU0.RefreshData();
                string fmcrow = this.CDU0.Rows[2].ToString();
                string[] words = fmcrow.Split(' ');

                List<string> y = words.ToList<string>();
                y.RemoveAll(p => string.IsNullOrEmpty(p));
                words = y.ToArray();
                string dep = words[0];
                string arr = words[1];

 

Link to comment
Share on other sites

  • 3 weeks later...

i apologise for not releadsing product yet.  currently more sick then sitting hp
debugging taking more time herefor.

 

@Paul Henty
u ever heard about the needle offsets for the overhead gauges in the pdmg?
im trying to find out how too turn the huge output back to a "degree" 
but i get numbers in the range of 24171003904.0  on 0 and 25022210000  for full temp example.(numbers move so
just wondering

Link to comment
Share on other sites

Those Offsets are marked in the document as 'FLT32'. Those are not integers but floating point values.

You just need to declare those offsets as 'float', i.e. Offset<float>.

No conversion should be required; the 'Value' should just contain the gauge value.

Paul

Link to comment
Share on other sites

a first demo :) a minor control panel for cabin alive.
 

i hope u  like the first screenshot:) right bottom its a simpel  interface that checks if the cabinalive software is working.

 

Quote

i placed it in a diy home pit annoounciator page 🙂  which talks directly whit cabinalive. who is also providing all the data 🙂i have a  small  3 soon 4 box homepit.
2x 28 by 22
one holding all overhead toggles. and  some throtle quadrant switches and rto.
one holding efis, flaps speedbrake and a 7 inch monitor for my gauges
one saitek multipanel.
one radio paneel 28 by 8 is comming soon.



and now i use a old tablet to replace all lamps on overhead 🙂 i sqeeuzed it all in so it allso fit the 5 warnings on the 737 😄
and by utilizing it also provide a minor cabin alive monitor 😄

cabin alive provides: currently including announcements " it is running lighter then 1% cpu and 60mb ram at audioplay

 u wil only need to announce when u ready for boarding or deboarding).
 a full automation working Crew. including boarding  and announcements aswel as  services (pre requirements are documented and normal )
 a full automation of  GSX  no more inflight menus (excluding gate picking at arrival  (gsx wont alow a offset sadly)     pushback is stil manual (buttons wil probaly come soon on the screenshot 😄 for the push)
 a ramp agent wil provide u whit  ground equiptment and cleaning up of this.. 


currently i have all gauges automated 🙂  except for ducts trying to figure out how i can seperate the 2 arrows info 😄


but after all the help i own u a show of progres 🙂 and yes it wil come for free whit cabinalive.exe 🙂
and yes the respect and proper url  to ure site is  included 🙂


edit: 1 duct working other no idea how to seperate the data.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.