Beispiel #1
0
        private void MyManager_DataRxEvent(RequestsEnum request, SIMCONNECT_RECV_SIMOBJECT_DATA_BYTYPE data)
        {
            try
            {
                if (request == RequestsEnum.RefreshDataRequest)
                {
                    RefreshDataStruct receivedData = (RefreshDataStruct)data.dwData[0];
                    tugHeading = receivedData.trueHeading;

                    if (parkingBrakeSet != receivedData.parkingBrakeState)
                    {
                        parkingBrakeSet = receivedData.parkingBrakeState;
                        SetTugVelocity(tugVelocitySet);
                    }

                    if (receivedData.pushbackState == 3)
                    {
                        Status = TugStatus.Disabled;
                    }
                    else if (receivedData.pushbackState == 0 && !TugActive)
                    {
                        Status = TugStatus.Waiting;
                        StartTugMode();
                    }
                }
                else if (request == RequestsEnum.StartTugMode)
                {
                    RefreshDataStruct receivedData = (RefreshDataStruct)data.dwData[0];
                    Status = TugStatus.Waiting;
                }
            }
            catch (Exception) { }
        }
        private void MyManager_DataRxEvent(RequestsEnum request, Microsoft.FlightSimulator.SimConnect.SIMCONNECT_RECV_SIMOBJECT_DATA data)
        {
            try
            {
                if (request == RequestsEnum.RefreshDataRequest)
                {
                    RefreshDataStruct receivedData = (RefreshDataStruct)data.dwData[0];

                    if (ParkingBrakeOn != receivedData.parkingBrakeState)
                    {
                        ParkingBrakeOn = receivedData.parkingBrakeState;
                    }
                }
            }
            catch (Exception) { }
        }
        private void MyManager_DataRxEvent(RequestsEnum request, SIMCONNECT_RECV_SIMOBJECT_DATA data)
        {
            try
            {
                if (request == RequestsEnum.RefreshDataRequest)
                {
                    RefreshDataStruct receivedData = (RefreshDataStruct)data.dwData[0];
                    tugHeading = receivedData.trueHeading;

                    if (parkingBrakeSet != receivedData.parkingBrakeState)
                    {
                        parkingBrakeSet = receivedData.parkingBrakeState;
                        switch (Status)
                        {
                        case TugStatus.Forward:
                            SetTugSpeed(SpeedFactor);
                            break;

                        case TugStatus.Reverse:
                            SetTugSpeed(-SpeedFactor);
                            break;
                        }
                    }

                    if (receivedData.pushbackState == 3)
                    {
                        Status = TugStatus.Disabled;
                    }
                    else if (receivedData.pushbackState == 0 && !TugActive)
                    {
                        Status = TugStatus.Waiting;
                        StartTugMode();
                    }
                }
                else if (request == RequestsEnum.StartTugMode)
                {
                    RefreshDataStruct receivedData = (RefreshDataStruct)data.dwData[0];
                    Status = TugStatus.Waiting;
                }
            }
            catch (Exception) { }
        }