Example #1
0
        public RadioCommands(SerialTransmitter sTransmitter, RadioConfigurations config)
        {
            this.sTransmitter = sTransmitter;
            this.config       = config;

            this.isSendingData = true;
        }
Example #2
0
        private void LoadRadioSettings()
        {
            this.radioConfig = null;
            if (!string.IsNullOrEmpty(Settings.Default.RadioConfig))
            {
                this.radioConfig = RadioConfigurations.DeSerializeObject(Settings.Default.RadioConfig);
            }

            if (this.radioConfig == null)
            {
                this.radioConfig = new RadioConfigurations()
                {
                    Throtle_MinValue        = 0,
                    Throtle_MaxValue        = 180,
                    Throtle_ChannelCode     = 1,
                    Throtle_ReverseJoystick = true,

                    AileronControl          = AileronMode.DualMode,
                    Aileron_MinValue        = 45,
                    Aileron_MaxValue        = 135,
                    Aileron_ChannelCode1    = 2,
                    Aileron_ChannelCode2    = 3,
                    Aileron_ReverseJoystick = false,
                    Aileron_Offset1         = -5,
                    Aileron_Offset2         = +32,

                    ElevatorControl       = ElevatorMode.DualMode,
                    Elevator_MinValue1    = 97,
                    Elevator_MaxValue1    = 150,
                    Elevator_MinValue2    = 81,  // right elev up
                    Elevator_MaxValue2    = 126, // right elev down
                    Elevator_ChannelCode1 = 4,
                    Elevator_ChannelCode2 = 5,
                    Elevator_Reverse1     = false,
                    Elevator_Reverse2     = true,
                    Elevator_Offset1      = -16,
                    Elevator_Offset2      = +25,
                    Elevator_Curve1       = CurveMode.SymmetricDegree3,
                    Elevator_Curve2       = CurveMode.SymmetricDegree3,

                    RudderControl          = RudderMode.SingleMode,
                    Rudder_MinValue        = 45,
                    Rudder_MaxValue        = 135,
                    Rudder_ChannelCode1    = 6,
                    Rudder_ChannelCode2    = 7,
                    Rudder_ReverseJoystick = false,
                };
            }
        }