Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I have been trying to get the screen data out off the dll using c# and .net6.

I had some luck to get whole display text but I saw that there should be a option to get each screen cell with the flags color and font size type. But can't find out how to get to this data.

Posted

There are a number of ways to get the data from the CDU, depending on what level of detail you want. Here are the options:

            cdu0 = new PMDG_NGX_CDU_Screen(0x5400);
            cdu0.RefreshData();

            // Entire screen
            this.txtCDU.Text = cdu0.ToString("\r\n");

            // Individual Rows:
            string row3Text = cdu0.Rows[2].ToString(); // Rows are 0 based. Third row has index 2

            // Individual Cells:
            // e.g. Character in Row 3 (Index 2), First Character (Index 0):
            char R3C1Char = cdu0.Rows[2].Cells[0].Symbol;
            // Same but as a string:
            string R3C1String = cdu0.Rows[2].Cells[0].ToString();

            // Get cell colour:
            PMDG_NGX_CDU_COLOR R3C1Colour = cdu0.Rows[2].Cells[0].Color;

            // Get cell Flag:
            PMDG_NGX_CDU_FLAG R3C1Flags = cdu0.Rows[2].Cells[0].Flags;
            // Flags values can be combined (e.g. Small and Reversed). To check if a certain bit is set use the HasFlag method:
            bool cellIsReversed = R3C1Flags.HasFlag(PMDG_NGX_CDU_FLAG.REVERSE);

Paul

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.