Hello there, i have a question regarding the offset addresses.
I am developing a small application (.net 3.5 with WPF) which is supposed to be able to accomplish basic tasks, like gather flight information, aircraft information, and so on.
So far i've managed to create an Autopilot Panel, Lights Panel (as the one in the example from the SDK), and some basic info.
I am a bit in a doubt regarding the 0764 address. FSInterrogate says (which i assumed) that the value is 1 if AP is available, 0 if not.
However in code, running the debbugger that offset always returns 1 (i've tried with cessna, feelthere airbus A318, B777, PMDG MD-11 and so forth). Even trying to retrieve the value with FSInterrogate, it is still 1 in all cases.
My question is - is this a) issue caused by my FSUIPC dll, b) issue from FS (someth not configure correctly, as in not setting that value to 0 inside FS itself), c) this isn't really working at all ?
I would need that value in order to make visible or not the Autopilot Panel.
Thanks in advance!
P.S. for whoever is interested, i can make the code available, as long as i don't break any rules :)
Forgot to mention, i am using C#. Here's the code i am using to retrieve the value:
Declaration:
...
public Offset autopilotAvailable = new Offset(FSUIPCGroupProcess.Aircraft, FSConstants.AutopilotAvailable);
... declared as public because i access it from a UserControl
Usage:
public void ProcessAicraftInfo()
{
try
{
_fs.Process(FSUIPCGroupProcess.Aircraft);
lblAicrType.Content = aircraftType.Value;
lblAicrState.Content = aircraftState.Value == 1 ? "On Ground" : "Airborne";
_isAutopilotAvailable = autopilotAvailable.Value == 1 ? true : false;
lblApAvailable.Content = _isAutopilotAvailable ? "Yes" : "No";
}
catch (FSUIPCException ex)
{
if (ex.FSUIPCErrorCode == FSUIPCError.FSUIPC_ERR_SENDMSG)
{
//Force disconnect
Disconnect();
System.Windows.MessageBox.Show("FSUIPC Connection Lost.");
}
}
}
_fs is instance of FSInstance class created by me, which exposes different methods from FSUIPCConnection and so forth. Disconnect() is another method which calls FSUIPConnection.Disconnect() and clears some variables from the current Window and so forth.