public TelemetryValue TelemetryValueByName(string name)
        {
            object data;

            TelemetryValue tv;

            switch (name)
            {
            case "SlipAngle":
                data = SlipAngle;
                break;

            case "Rumble":
                data = Rumble;
                break;

            case "RumbleHz":
                data = RumbleHz;
                break;

            default:
                if (_sdk.VarHeaders.ContainsKey(name))
                {
                    data = _sdk.GetData(name);
                }
                else
                {
                    throw new UnknownTelemetryValueException(name);
                }
                break;
            }

            tv = new iR60TelemetryValue(name, data);
            object value = tv.Value;

            if (value == null)
            {
                throw new UnknownTelemetryValueException(name);
            }
            return(tv);
        }
Пример #2
0
        public TelemetryValue TelemetryValueByName(string name)
        {
            object data;

            TelemetryValue tv;

            switch (name)
            {
            case "SlipAngle":
                data = SlipAngle;
                break;

            case "Rumble":
                data = Rumble;
                break;

            case "RumbleHz":
                data = RumbleHz;
                break;

            case "VertAccel":
                data = VertAccel;
                break;

            case "LongAccel":
                data = LongAccel;
                break;

            case "LatAccel":
                data = LatAccel;
                break;

            case "Pitch":
                data = RadianToDegree("Pitch") * -1;     // invert Pitch
                break;

            case "Roll":
                data = RadianToDegree("Roll");
                break;

            case "Yaw":
                data = RadianToDegree("Yaw");
                break;

            case "PitchRate":
                data = RadianToDegree("PitchRate");
                break;

            case "RollRate":
                data = RadianToDegree("RollRate");
                break;

            case "YawRate":
                data = RadianToDegree("YawRate");
                break;

            default:
                if (_sdk.VarHeaders.ContainsKey(name))
                {
                    data = _sdk.GetData(name);
                }
                else
                {
                    throw new UnknownTelemetryValueException(name);
                }
                break;
            }

            tv = new iR60TelemetryValue(name, data);
            object value = tv.Value;

            if (value == null)
            {
                throw new UnknownTelemetryValueException(name);
            }
            return(tv);
        }