Пример #1
0
        protected virtual void OnActivityRecieved(SimVar simVar, string data)
        {
            EventHandler handler = ActionReceived;

            var eventArgs = new SimActivityEventArgs(data, simVar);

            handler?.Invoke(this, eventArgs);
        }
Пример #2
0
        private void AddRequest(SimVar simVar)
        {
            Debug.WriteLine($"AddRequest: {simVar.SimConnectVariable} {simVar.SimConnectUnit}");

            SimvarRequest request = new SimvarRequest(simVar, (DEFINITION)_currentDefinition, (REQUEST)_currentRequest);

            RegisterWithSimConnect(request);

            _simvarRequests.Add(request);

            ++_currentDefinition;
            ++_currentRequest;

            _simConnect?.RequestDataOnSimObject(
                request.eRequest,
                request.eDef,
                SimConnect.SIMCONNECT_OBJECT_ID_USER,
                SIMCONNECT_PERIOD.VISUAL_FRAME,
                SIMCONNECT_DATA_REQUEST_FLAG.CHANGED, 0, 0, 0);
        }
Пример #3
0
 public SimvarRequest(SimVar variable, DEFINITION eDef, REQUEST eRequest)
 {
     this.Variable = variable;
     this.eDef     = eDef;
     this.eRequest = eRequest;
 }
Пример #4
0
 public SimActivityEventArgs(string data, SimVar simVar)
 {
     this.Variable = simVar;
     this.Data     = data;
 }