Esempio n. 1
0
        public static PidProfile FromXmlElement(System.Xml.Linq.XElement pidProfileElement)
        {
            var profile = new PidProfile()
            {
                DirectionProfile = (DirectionProfile)Enum.Parse(typeof(DirectionProfile), pidProfileElement.Attribute("Direction").Value),
                ProportionalGain = pidProfileElement.Attribute("ProportionalGain").ParseDouble(),
                IntegralGain = pidProfileElement.Attribute("IntegralGain").ParseDouble(),
                DerivativeGain = pidProfileElement.Attribute("DerivativeGain").ParseDouble(),
            };

            return profile;
        }
        private void SetPidValuesFromProfile(PidProfile pidProfile)
        {
            var directionProfile = pidProfile.DirectionProfile;

            SetProportionalGain(directionProfile, pidProfile.ProportionalGain);
            SetIntegralGain(directionProfile, pidProfile.IntegralGain);
            SetDerivativeGain(directionProfile, pidProfile.DerivativeGain);
        }