Esempio n. 1
0
        public void GivenANumericCast_WhenToStringCalled_AppropriateValue()
        {
            AccelerationUnit au = (AccelerationUnit)167.168d;

            var actual = au.ToString();

            Assert.Equal("167.168m/s2", actual);
        }
Esempio n. 2
0
        public void GivenANumericCastAndDefaultG_WhenToStringCalled_AppropriateValue()
        {
            DefaultUnitOfMeasures.Acceleration = AccelerationUnit.AccelerationUnitOfMeasure.gForce;
            AccelerationUnit au = (AccelerationUnit)167.168d;

            var actual = au.ToString();

            Assert.Equal("167.168G", actual);
        }
Esempio n. 3
0
        public void WriteXML(XmlWriter writer)
        {
            writer.WriteElementString("TimecodeFormat", timecodeFormat.ToString());
            writer.WriteElementString("SpeedUnit", speedUnit.ToString());
            writer.WriteElementString("AccelerationUnit", accelerationUnit.ToString());
            writer.WriteElementString("AngleUnit", angleUnit.ToString());
            writer.WriteElementString("AngularVelocityUnit", angularVelocityUnit.ToString());
            writer.WriteElementString("AngularAccelerationUnit", angularAccelerationUnit.ToString());
            writer.WriteElementString("CustomLengthUnit", customLengthUnit);
            writer.WriteElementString("CustomLengthAbbreviation", customLengthAbbreviation);
            writer.WriteElementString("AspectRatio", aspectRatio.ToString());
            writer.WriteElementString("DeinterlaceByDefault", deinterlaceByDefault ? "true" : "false");
            writer.WriteElementString("InteractiveFrameTracker", interactiveFrameTracker ? "true" : "false");
            writer.WriteElementString("WorkingZoneMemory", workingZoneMemory.ToString());
            writer.WriteElementString("SyncLockSpeed", syncLockSpeed ? "true" : "false");
            writer.WriteElementString("SyncByMotion", syncByMotion ? "true" : "false");
            writer.WriteElementString("ImageFormat", imageFormat.ToString());
            writer.WriteElementString("VideoFormat", videoFormat.ToString());
            writer.WriteElementString("Background", XmlHelper.WriteColor(backgroundColor, true));

            writer.WriteStartElement("InfoFading");
            defaultFading.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteElementString("DrawOnPlay", drawOnPlay ? "true" : "false");

            if (recentColors.Count > 0)
            {
                writer.WriteStartElement("RecentColors");

                for (int i = 0; i < maxRecentColors; i++)
                {
                    if (i >= recentColors.Count)
                    {
                        break;
                    }

                    writer.WriteElementString("RecentColor", string.Format("{0};{1};{2}", recentColors[i].R.ToString(), recentColors[i].G.ToString(), recentColors[i].B.ToString()));
                }
                writer.WriteEndElement();
            }

            writer.WriteElementString("MaxRecentColors", maxRecentColors.ToString());

            writer.WriteStartElement("TrackingProfile");
            trackingProfile.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteElementString("EnableFiltering", enableFiltering ? "true" : "false");
            writer.WriteElementString("EnableCustomToolsDebugMode", enableCustomToolsDebugMode ? "true" : "false");
            writer.WriteElementString("DefaultReplaySpeed", defaultReplaySpeed.ToString("0", CultureInfo.InvariantCulture));
            writer.WriteElementString("DetectImageSequences", detectImageSequences ? "true" : "false");
            writer.WriteElementString("PreloadKeyframes", preloadKeyframes.ToString());
            writer.WriteElementString("PlaybackKVA", playbackKVA);
        }
Esempio n. 4
0
        public void WriteXML(XmlWriter writer)
        {
            writer.WriteElementString("TimecodeFormat", timecodeFormat.ToString());
            writer.WriteElementString("SpeedUnit", speedUnit.ToString());
            writer.WriteElementString("AccelerationUnit", accelerationUnit.ToString());
            writer.WriteElementString("AngleUnit", angleUnit.ToString());
            writer.WriteElementString("AngularVelocityUnit", angularVelocityUnit.ToString());
            writer.WriteElementString("AngularAccelerationUnit", angularAccelerationUnit.ToString());
            writer.WriteElementString("CustomLengthUnit", customLengthUnit);
            writer.WriteElementString("CustomLengthAbbreviation", customLengthAbbreviation);
            writer.WriteElementString("AspectRatio", aspectRatio.ToString());
            writer.WriteElementString("DeinterlaceByDefault", deinterlaceByDefault ? "true" : "false");
            writer.WriteElementString("InteractiveFrameTracker", interactiveFrameTracker ? "true" : "false");
            writer.WriteElementString("WorkingZoneSeconds", workingZoneSeconds.ToString());
            writer.WriteElementString("WorkingZoneMemory", workingZoneMemory.ToString());
            writer.WriteElementString("SyncLockSpeed", syncLockSpeed ? "true" : "false");
            writer.WriteElementString("ImageFormat", imageFormat.ToString());
            writer.WriteElementString("VideoFormat", videoFormat.ToString());

            writer.WriteStartElement("InfoFading");
            defaultFading.WriteXml(writer);
            writer.WriteEndElement();

            writer.WriteElementString("MaxFading", maxFading.ToString());
            writer.WriteElementString("DrawOnPlay", drawOnPlay ? "true" : "false");

            if (recentColors.Count > 0)
            {
                writer.WriteStartElement("RecentColors");

                for (int i = 0; i < maxRecentColors; i++)
                {
                    if (i >= recentColors.Count)
                    {
                        break;
                    }

                    writer.WriteElementString("RecentColor", string.Format("{0};{1};{2}", recentColors[i].R.ToString(), recentColors[i].G.ToString(), recentColors[i].B.ToString()));
                }
                writer.WriteEndElement();
            }

            writer.WriteElementString("MaxRecentColors", maxRecentColors.ToString());

            writer.WriteStartElement("TrackingProfile");
            trackingProfile.WriteXml(writer);
            writer.WriteEndElement();
        }