예제 #1
0
 public void RefreshUnits()
 {
     speedUnit               = PreferencesManager.PlayerPreferences.SpeedUnit;
     accelerationUnit        = PreferencesManager.PlayerPreferences.AccelerationUnit;
     angleUnit               = PreferencesManager.PlayerPreferences.AngleUnit;
     angularVelocityUnit     = PreferencesManager.PlayerPreferences.AngularVelocityUnit;
     angularAccelerationUnit = PreferencesManager.PlayerPreferences.AngularAccelerationUnit;
 }
예제 #2
0
 public CalibrationHelper()
 {
     speedUnit               = PreferencesManager.PlayerPreferences.SpeedUnit;
     accelerationUnit        = PreferencesManager.PlayerPreferences.AccelerationUnit;
     angleUnit               = PreferencesManager.PlayerPreferences.AngleUnit;
     angularVelocityUnit     = PreferencesManager.PlayerPreferences.AngularVelocityUnit;
     angularAccelerationUnit = PreferencesManager.PlayerPreferences.AngularAccelerationUnit;
     calibrator              = calibrationLine;
 }
        private void ImportPreferences()
        {
            deinterlaceByDefault    = PreferencesManager.PlayerPreferences.DeinterlaceByDefault;
            interactiveFrameTracker = PreferencesManager.PlayerPreferences.InteractiveFrameTracker;
            timecodeFormat          = PreferencesManager.PlayerPreferences.TimecodeFormat;
            imageAspectRatio        = PreferencesManager.PlayerPreferences.AspectRatio;
            speedUnit                = PreferencesManager.PlayerPreferences.SpeedUnit;
            accelerationUnit         = PreferencesManager.PlayerPreferences.AccelerationUnit;
            angleUnit                = PreferencesManager.PlayerPreferences.AngleUnit;
            angularVelocityUnit      = PreferencesManager.PlayerPreferences.AngularVelocityUnit;
            angularAccelerationUnit  = PreferencesManager.PlayerPreferences.AngularAccelerationUnit;
            customLengthUnit         = PreferencesManager.PlayerPreferences.CustomLengthUnit;
            customLengthAbbreviation = PreferencesManager.PlayerPreferences.CustomLengthAbbreviation;

            syncLockSpeeds = PreferencesManager.PlayerPreferences.SyncLockSpeed;

            workingZoneSeconds = PreferencesManager.PlayerPreferences.WorkingZoneSeconds;
            workingZoneMemory  = PreferencesManager.PlayerPreferences.WorkingZoneMemory;
        }
예제 #4
0
        public static string AngularVelocityAbbreviation(AngularVelocityUnit unit)
        {
            string abbreviation = "";

            switch (unit)
            {
            case AngularVelocityUnit.DegreesPerSecond:
                abbreviation = "deg/s";
                break;

            case AngularVelocityUnit.RadiansPerSecond:
                abbreviation = "rad/s";
                break;

            case AngularVelocityUnit.RevolutionsPerMinute:
                abbreviation = "rpm";
                break;
            }

            return(abbreviation);
        }
예제 #5
0
        /// <summary>
        /// Takes an angular velocity in radians per second and returns it in angular velocity unit.
        /// </summary>
        public static double ConvertAngularVelocity(double radiansPerSecond, AngularVelocityUnit unit)
        {
            double result = 0;

            switch (unit)
            {
            case AngularVelocityUnit.DegreesPerSecond:
                result = radiansPerSecond * MathHelper.RadiansToDegrees;
                break;

            case AngularVelocityUnit.RadiansPerSecond:
                result = radiansPerSecond;
                break;

            case AngularVelocityUnit.RevolutionsPerMinute:
                double revolutionsPerSecond = radiansPerSecond / (2 * Math.PI);
                result = revolutionsPerSecond * 60;
                break;
            }

            return(result);
        }
예제 #6
0
        public void ReadXML(XmlReader reader)
        {
            reader.ReadStartElement();

            while (reader.NodeType == XmlNodeType.Element)
            {
                switch (reader.Name)
                {
                case "TimecodeFormat":
                    timecodeFormat = (TimecodeFormat)Enum.Parse(typeof(TimecodeFormat), reader.ReadElementContentAsString());
                    break;

                case "SpeedUnit":
                    speedUnit = (SpeedUnit)Enum.Parse(typeof(SpeedUnit), reader.ReadElementContentAsString());
                    break;

                case "AccelerationUnit":
                    accelerationUnit = (AccelerationUnit)Enum.Parse(typeof(AccelerationUnit), reader.ReadElementContentAsString());
                    break;

                case "AngleUnit":
                    angleUnit = (AngleUnit)Enum.Parse(typeof(AngleUnit), reader.ReadElementContentAsString());
                    break;

                case "AngularVelocityUnit":
                    angularVelocityUnit = (AngularVelocityUnit)Enum.Parse(typeof(AngularVelocityUnit), reader.ReadElementContentAsString());
                    break;

                case "AngularAccelerationUnit":
                    angularAccelerationUnit = (AngularAccelerationUnit)Enum.Parse(typeof(AngularAccelerationUnit), reader.ReadElementContentAsString());
                    break;

                case "CustomLengthUnit":
                    customLengthUnit = reader.ReadElementContentAsString();
                    break;

                case "CustomLengthAbbreviation":
                    customLengthAbbreviation = reader.ReadElementContentAsString();
                    break;

                case "AspectRatio":
                    aspectRatio = (ImageAspectRatio)Enum.Parse(typeof(ImageAspectRatio), reader.ReadElementContentAsString());
                    break;

                case "DeinterlaceByDefault":
                    deinterlaceByDefault = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "InteractiveFrameTracker":
                    interactiveFrameTracker = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "WorkingZoneSeconds":
                    workingZoneSeconds = reader.ReadElementContentAsInt();
                    break;

                case "WorkingZoneMemory":
                    workingZoneMemory = reader.ReadElementContentAsInt();
                    break;

                case "SyncLockSpeed":
                    syncLockSpeed = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "ImageFormat":
                    imageFormat = (KinoveaImageFormat)Enum.Parse(typeof(KinoveaImageFormat), reader.ReadElementContentAsString());
                    break;

                case "VideoFormat":
                    videoFormat = (KinoveaVideoFormat)Enum.Parse(typeof(KinoveaVideoFormat), reader.ReadElementContentAsString());
                    break;

                case "InfoFading":
                    defaultFading.ReadXml(reader);
                    break;

                case "MaxFading":
                    maxFading = reader.ReadElementContentAsInt();
                    break;

                case "DrawOnPlay":
                    drawOnPlay = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "RecentColors":
                    ParseRecentColors(reader);
                    break;

                case "MaxRecentColors":
                    maxRecentColors = reader.ReadElementContentAsInt();
                    break;

                case "TrackingProfile":
                    trackingProfile.ReadXml(reader);
                    break;

                case "EnableFiltering":
                    enableFiltering = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                case "EnableCustomToolsDebugMode":
                    enableCustomToolsDebugMode = XmlHelper.ParseBoolean(reader.ReadElementContentAsString());
                    break;

                default:
                    reader.ReadOuterXml();
                    break;
                }
            }

            reader.ReadEndElement();
        }
 private void cmbAngularVelocityUnit_SelectedIndexChanged(object sender, EventArgs e)
 {
     angularVelocityUnit = (AngularVelocityUnit)cmbAngularVelocityUnit.SelectedIndex;
 }
예제 #8
0
 public AngularVelocity(double v, AngularVelocityUnit u) : base(value: v, scale: u)
 {
 }
예제 #9
0
 public static Tweener SetOptions(this TweenerCore <Angle, Angle, AngleOptions> t, AngleTweenDirection direction, AngularVelocityUnit angularVelocityUnit = AngularVelocityUnit.Unspecified)
 {
     if (t == null || !t.active)
     {
         return(t);
     }
     t.plugOptions.Direction           = direction;
     t.plugOptions.AngularVelocityUnit = angularVelocityUnit;
     return(t);
 }
예제 #10
0
 public static Tweener SetSpeedBased(this TweenerCore <Angle, Angle, AngleOptions> t, AngularVelocityUnit unit)
 {
     if (t == null || !t.active)
     {
         return(t);
     }
     t.SetSpeedBased();
     t.plugOptions.AngularVelocityUnit = unit;
     return(t);
 }