Ejemplo n.º 1
0
 bool RegisterToSimConnect(SimvarRequest request)
 {
     if (simConnect == null)
     {
         return(false);
     }
     /// Define a data structure
     simConnect.AddToDataDefinition((DEFINITION)request.define, request.name, request.units, SIMCONNECT_DATATYPE.FLOAT64, 0.0f, SimConnect.SIMCONNECT_UNUSED);
     /// IMPORTANT: Register it with the simconnect managed wrapper marshaller
     /// If you skip this step, you will only receive a uint in the .dwData field.
     simConnect.RegisterDataDefineStruct <double>((DEFINITION)request.define);
     return(true);
 }
Ejemplo n.º 2
0
        public SimvarRequest CreateSimvarRequest(string name, string units, uint requestId, uint definitionId)
        {
            var request = new SimvarRequest
            {
                define  = definitionId,
                request = requestId,
                name    = name,
                units   = units
            };

            requests.Add(request);

            currentDefinition++;
            currentRequest++;

            return(request);
        }
Ejemplo n.º 3
0
 void RemoveSimvarRequest(SimvarRequest request)
 {
     requests.Remove(request);
 }