Exemplo n.º 1
0
 internal async Task Execute(SimConnectWrapper.SimConnectWrapper simConnect)
 {
     var data = new ExecuteCalculatorCodeRequestData()
     {
         RequestId  = NextRequestId,
         HEventName = HEventName,
     };
     await simConnect.SetClientData(DataAreaModuleInput.Id, DefineId, SIMCONNECT_CLIENT_DATA_SET_FLAG.DEFAULT, data).ConfigureAwait(false);
 }
Exemplo n.º 2
0
        internal async Task <double> Execute(SimConnectWrapper.SimConnectWrapper simConnect)
        {
            var data = new ReadLVarRequestData()
            {
                RequestId = MyRequestId,
                LVarName  = LVarName,
            };
            await simConnect.SetClientData(DataAreaModuleInput.Id, DefineId, SIMCONNECT_CLIENT_DATA_SET_FLAG.DEFAULT, data).ConfigureAwait(false);

            return(await WaitForFinish(TimeSpan.FromSeconds(2)).ConfigureAwait(false));
        }
Exemplo n.º 3
0
        internal static async Task SetupChannels(SimConnectWrapper.SimConnectWrapper simConnect)
        {
            await simConnect.AddToClientDataDefinition <ReadLVarRequestData>(DefineId).ConfigureAwait(false);

            await simConnect.AddToClientDataDefinition <ReadLVarResponseData>(DefineId + 100).ConfigureAwait(false);

            await simConnect.MapClientDataNameToID(DataAreaModuleInput.Name, DataAreaModuleInput.Id).ConfigureAwait(false);

            await simConnect.MapClientDataNameToID(DataAreaModuleOutput.Name, DataAreaModuleOutput.Id).ConfigureAwait(false);

            await simConnect.RequestClientData(DataAreaModuleOutput.Id, RequestId, DefineId + 100, SIMCONNECT_CLIENT_DATA_PERIOD.ON_SET).ConfigureAwait(false);
        }
Exemplo n.º 4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Log.Debug("Loading form ...");

            _simConnectWrapper = new SimConnectWrapper.SimConnectWrapper(Name, Handle, this,
                                                                         new[] {
                SimConnectProperties.PlaneLongitude,
                SimConnectProperties.PlaneLatitude,
                SimConnectProperties.PlaneAltitude,
                SimConnectProperties.PlaneHeadingDegreesTrue,
                SimConnectProperties.GpsGroundSpeed,
                SimConnectProperties.AtcId
            });
            _simConnectWrapper.OnError += _simConnectWrapper_OnError;

            _timer          = new Timer();
            _timer.Interval = 1000;
            _timer.Tick    += CheckForData;
            _timer.Start();

            chkBroadcast.Checked = Properties.Settings.Default.UdpBroadcast;
            txtHost.Text         = Properties.Settings.Default.UdpTargetHost;
        }
Exemplo n.º 5
0
        internal static async Task SetupChannels(SimConnectWrapper.SimConnectWrapper simConnect)
        {
            await simConnect.AddToClientDataDefinition <ExecuteCalculatorCodeRequestData>(DefineId).ConfigureAwait(false);

            await simConnect.MapClientDataNameToID(DataAreaModuleInput.Name, DataAreaModuleInput.Id).ConfigureAwait(false);
        }
Exemplo n.º 6
0
 internal static async Task RegisterDataDefinition(SimConnectWrapper.SimConnectWrapper simConnect)
 {
     await simConnect.AddToClientDataDefinition <ReadLVarRequestData>(DefineId);
 }