예제 #1
0
 void mySimconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
 {
     if (ObjectIdArrived != null)
     {
         ObjectIdArrived(data.dwRequestID, data.dwObjectID);
     }
 }
예제 #2
0
        void simconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
        {
            switch ((DATA_REQUESTS)data.dwRequestID)
            {
            case DATA_REQUESTS.REQUEST_DOUGLAS:

                DouglasID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Douglas ID");
                break;

            case DATA_REQUESTS.REQUEST_Extra300S:

                Extra300SID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Extra 300S ID");
                break;

            case DATA_REQUESTS.REQUEST_TRUCK:
                TruckID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Truck ID");
                break;

            default:
                displayText("Unknown Request ID received: " + (DATA_REQUESTS)data.dwRequestID);
                break;
            }
        }
예제 #3
0
        void simconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
        {
            switch ((DATA_REQUESTS)data.dwRequestID)
            {
            case DATA_REQUESTS.REQUEST_MOONEY:

                MooneyBravoID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Mooney Bravo ID");
                break;

            case DATA_REQUESTS.REQUEST_MAULE:

                MauleID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Maule M7 ID");
                break;

            case DATA_REQUESTS.REQUEST_TRUCK:
                TruckID = (uint)(DATA_REQUESTS)data.dwObjectID;
                displayText("Received Truck ID");
                break;

            default:
                displayText("Unknown Request ID received: " + (DATA_REQUESTS)data.dwRequestID);
                break;
            }
        }
예제 #4
0
 void sc_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
 {
     if (data.dwRequestID >= (uint)Requests.AICreateBase && data.dwRequestID < (uint)Requests.AICreateBase + maximumRequests)
     {
         ObjectsInSimulation[data.dwRequestID - (uint)Requests.AICreateBase].ObjectID = data.dwObjectID;
         log.Info("OnRecvAssignedObjectId (Requests.CreateAI): " + data.dwObjectID);
         OnPropertyChanged("CreatedSimObjectsCount");
         OnPropertyChanged("ObjectsCreated");
     }
 }
예제 #5
0
        private static void Sim_OnRecvAssignedObjectId(
            SimConnect sender,
            SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
        {
            TaskCompletionSource <int> task;

            objectIdTasks.TryGetValue((int)data.dwRequestID, out task);

            if (task != null)
            {
                task.TrySetResult((int)data.dwObjectID);
            }
        }
예제 #6
0
        void simconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
        {
            if (data.dwRequestID >= (int)SIMCONNECT_EVENTS.EVENTID_SETAIAC)
            {
                // Remember simconnect object id

                var aicounter = data.dwRequestID - (uint)SIMCONNECT_EVENTS.EVENTID_SETAIAC;
                var planeObjectId = data.dwObjectID;
                var callsign = AICounterToCallsignMap[aicounter];

                CallsignToAIPlaneMap[callsign].SimConnectObjectId = data.dwObjectID;

                // Set AI plane in slew mode and subscribe to 1 second pos.reps
                simconnect.AIReleaseControl(planeObjectId, SIMCONNECT_EVENTS.EVENTID_AIRELEASEATC);
                simconnect.TransmitClientEvent(planeObjectId, SIMCONNECT_EVENTS.EVENTID_SLEW_ON, 1, null, SIMCONNECT_EVENT_FLAG.DEFAULT);
                simconnect.TransmitClientEvent(planeObjectId, SIMCONNECT_EVENTS.EVENTID_STROBES_ON, 0, null, SIMCONNECT_EVENT_FLAG.DEFAULT);
                simconnect.TransmitClientEvent(planeObjectId, SIMCONNECT_EVENTS.EVENTID_TOGGLE_BEACON_LIGHTS, 0, null, SIMCONNECT_EVENT_FLAG.DEFAULT);
                simconnect.TransmitClientEvent(planeObjectId, SIMCONNECT_EVENTS.EVENTID_TOGGLE_TAXI_LIGHTS, 0, null, SIMCONNECT_EVENT_FLAG.DEFAULT);
                simconnect.TransmitClientEvent(planeObjectId, SIMCONNECT_EVENTS.EVENTID_TOGGLE_WING_LIGHTS, 0, null, SIMCONNECT_EVENT_FLAG.DEFAULT);
                simconnect.RequestDataOnSimObject((SIMCONNECT_EVENTS)((uint)SIMCONNECT_EVENTS.EVENTID_POSITIONREPORT_FOR_AIUPDATE + aicounter), DEFINITIONS.AIPositionUpdateStruct, planeObjectId, SIMCONNECT_PERIOD.SECOND, SIMCONNECT_DATA_REQUEST_FLAG.DEFAULT, 0, 1, 0);
                AICounterToCallsignMap.Remove(aicounter);
            }
        }
예제 #7
0
 void mySimconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
 {
     if (ObjectIdArrived != null)
     {
         ObjectIdArrived(data.dwRequestID, data.dwObjectID);
     }
 }
예제 #8
0
        void simconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
        {
            switch ((DATA_REQUESTS)data.dwRequestID)
            {
                case DATA_REQUESTS.REQUEST_DOUGLAS:

                    DouglasID = (uint) (DATA_REQUESTS)data.dwObjectID;
                    displayText("Received Douglas ID");
                    break;

                case DATA_REQUESTS.REQUEST_Extra300S:

                    Extra300SID = (uint) (DATA_REQUESTS)data.dwObjectID;
                    displayText("Received Extra 300S ID");
                    break;

                case DATA_REQUESTS.REQUEST_TRUCK:
                    TruckID = (uint) (DATA_REQUESTS)data.dwObjectID;
                    displayText("Received Truck ID");
                    break;

                default:
                    displayText("Unknown Request ID received: " + (DATA_REQUESTS)data.dwRequestID);
                    break;

            }
        }
예제 #9
0
파일: Form1.cs 프로젝트: mazzn/FSXGliderTow
 private void simconnect_OnRecvAssignedObjectId(SimConnect sender, SIMCONNECT_RECV_ASSIGNED_OBJECT_ID data)
 {
     MessageBox.Show("OnRecvAssignedObjectId: " + data.dwObjectID);
 }