• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Print a message on screen

Messages
8
Country
brazil
Do you know how to print a message on FSX screen using the C# API of SimConnect? The message could have the ATIS style.

Best regards
Rodrigo
 
Code:
// request event 
mMySimConnect.MapClientEventToSimEvent(EVENT_ID.ITEM_1
, "SELECT_1");
                    mMySimConnect.AddClientEventToNotificationGroup(GROUP_ID.GROUP0, EVENT_ID.ITEM_1, false);
                    mMySimConnect.SetNotificationGroupPriority(GROUP_ID.GROUP0, SimConnect.SIMCONNECT_GROUP_PRIORITY_HIGHEST);
                    // handler for events
                    mMySimConnect.OnRecvEvent += new SimConnect.RecvEventEventHandler(ReceiveEvent);



Code:
        String[] line = new String[300];
        int Index=0;
        int MaxIndex = 0;
        private void ReceiveEvent(SimConnect sender, SIMCONNECT_RECV_EVENT data)
        {
            switch (data.uEventID)
            {
                case (uint)EVENT_ID.ITEM_1:
                    if (Index != MaxIndex)
                    {
                        if (line[Index] != "*")
                        {
                            mMySimConnect.Text(SIMCONNECT_TEXT_TYPE.PRINT_CYAN, 0, EVENT_ID.TEXT_OUTPUT, line[Index]);
                        }
                        else
                        {
                            mMySimConnect.Text(SIMCONNECT_TEXT_TYPE.PRINT_CYAN, 1, EVENT_ID.TEXT_OUTPUT," ");
                        }
                        ++Index;
                    }
                    else
                    {
                        Index = 0;
                    }
                    break;
            }
        }

Something like this should work.
 
Thank you jcboliveira! It is exactly what I needed.

Do you know how to embed in FSX GUI another one made with C#? C# Forms are not visible on full screen mode. Besides, when we switch to them, FSX becomes mute. I would like to be able to build a GUI such FSInn one with C# and SimConnect. Is it possible?

All the best
Rodrigo
 
You mean a non modal one? Personally I don't know. In FS9 tried to do in DirectX since I believe that is the proper approach but lost interest in the project.

However MCDU team had some thoughts about delivering an API that could do what you want in managed code. Don't know how it is everything.

José
 
Já agora um pouco da nossa lingua :D

Não é muito fácil nem me parece que seja eficiente realizar código em managed dentro do FS. As coisas funcionam bem em exe separados. Pode sempre tentar utilizar a janela de atc como menu. tipo

[1]- opção ...
[2]-opção...
 
Obrigado outra vez, José!

Eu preciso de uma interface mais elaborada para o projeto FlightInstructor. Graças à sua dica, consegui elaborar algo bem simplificado. Mandarei alguns screenshots.

Abraços
Rodrigo
 
Back
Top