示例#1
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);
        }
示例#2
0
        public static string GetFriendlyName(SpeedUnit unit)
        {
            switch (unit)
            {
            case SpeedUnit.MetersPerSec: return("m/s");

            case SpeedUnit.MilesPerHour: return("mph");

            default: return(unit.ToString());
            }
        }
示例#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("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();
        }
示例#4
0
        public string ToString(CultureInfo ci)
        {
            string tz;

            if (UseLocalTime)
            {
                tz = WxDateUnit.TimeZoneName(true, 0);
            }
            else
            {
                tz = UtcOffset.ToString(ci);
            }
            string sep = ci.TextInfo.ListSeparator;

            return(string.Format(CultureInfo.InvariantCulture,
                                 "{0}{8}{1}{8}{2}{8}{3}{8}{4}{8}{5}{8}{6}{8}{7}",
                                 tz, Temperature.ToString(),
                                 TemperatureRate.ToString(),
                                 Pressure.ToString(), Wind.ToString(),
                                 Rain.ToString(), RainRate.ToString(),
                                 "", sep));
        }
示例#5
0
 public void WriteXml(XmlWriter writer)
 {
     writer.WriteElementString("Units", _Units.ToString());
     writer.WriteElementString("Value", _Value.ToString("G17", CultureInfo.InvariantCulture));
 }
示例#6
0
        /// <summary>Stores advanced settings to <see cref="ConfigurationManager"/></summary>
        public static void Store()
        {
            ConfigurationManager.AppSettings["COMPort"]          = ComPort;
            ConfigurationManager.AppSettings["BaudRate"]         = BaudRate.ToString();
            ConfigurationManager.AppSettings["UseWindowsDriver"] = UseWindowsDriver ? "true" : "false";
            ConfigurationManager.AppSettings["PollingInterval"]  = PollingInterval.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["LogToTextBox"]     = LogToTextBox ? "true" : "false";
            ConfigurationManager.AppSettings["LogToFile"]        = LogToLogFile ? "true" : "false";
            switch (LogFormat)
            {
            case LogFormat.KML:
                ConfigurationManager.AppSettings["LogFormat"] = "KML";
                break;

            case LogFormat.CSV:
                ConfigurationManager.AppSettings["LogFormat"] = "CSV";
                break;

            default:
                ConfigurationManager.AppSettings["LogFormat"] = "GPX";
                break;
            }

            switch (TrackType)
            {
            case TrackType.Track: ConfigurationManager.AppSettings["TrackType"] = "Track"; break;

            default: ConfigurationManager.AppSettings["TrackType"] = "Points"; break;
            }
            ConfigurationManager.AppSettings["LogAltitude"]     = LogAltitude ? "true" : "false";
            ConfigurationManager.AppSettings["LogFileLocation"] = LogFileLocation;

            ConfigurationManager.AppSettings["UseGPSTime"]          = UseGpsTime ? "true" : "false";
            ConfigurationManager.AppSettings["StatusBar"]           = StatusBar ? "true" : "false";
            ConfigurationManager.AppSettings["MaxLogLength"]        = MaxLogLength.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["AltitudeCorrection"]  = AltitudeCorrection.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["StartImmediatelly"]   = StartImmediatelly ? "true" : "false";
            ConfigurationManager.AppSettings["KMLNameFormat"]       = KmlNameFormat;
            ConfigurationManager.AppSettings["KMLDescFormat"]       = KmlDescFormat;
            ConfigurationManager.AppSettings["KMLLineColor"]        = KmlLineColor.ToArgb().ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["MinimalDistance"]     = MinimalDistance.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["TextLogFormat"]       = TextLogFormat;
            ConfigurationManager.AppSettings["InvalidPositionsMax"] = InvalidPositionsMax.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["NMEALog"]             = NmeaLog ? "true" : "false";
            ConfigurationManager.AppSettings["SeaLevelAltitude"]    = SeaLevelAltitude ? "true" : "false";
            ConfigurationManager.AppSettings["InfoPane"]            = InfoPane ? "true" : "false";
            ConfigurationManager.AppSettings["BeepTimer"]           = BeepTimer.ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["KeepAwake"]           = KeepAwakeList == null ? "" : string.Join(" ", KeepAwakeList);
            ConfigurationManager.AppSettings["SpeedUnit"]           = SpeedUnit.ToString();
            ConfigurationManager.AppSettings["DistanceUnit"]        = DistanceUnit.ToString();
            ConfigurationManager.AppSettings["ElevationUnit"]       = ElevationUnit.ToString();
            ConfigurationManager.AppSettings["CSVSeparator"]        = CsvSeparator.ToString();
            ConfigurationManager.AppSettings["CSVTextQualifier"]    = CsvTextQualifier.ToString();
            ConfigurationManager.AppSettings["CSVNewLine"]          = CsvNewLine;
            ConfigurationManager.AppSettings["CSVQualifierUsage"]   = ((int)CsvQualifierUsage).ToString(System.Globalization.CultureInfo.InvariantCulture);
            ConfigurationManager.AppSettings["CSVHeader"]           = CsvHeader;
            ConfigurationManager.AppSettings["CSVFields"]           = CsvFields;
            ConfigurationManager.AppSettings["CSVDateFormat"]       = CsvDateFormat;
            ConfigurationManager.AppSettings["CSVUTC"]   = CsvUtc ? "true" : "false";
            ConfigurationManager.AppSettings["Language"] = Language;
            ConfigurationManager.AppSettings["MainFormBottomEmptySpace"] = MainFormBottomEmptySpace.ToString(System.Globalization.CultureInfo.InvariantCulture);
        }
示例#7
0
 public string WindSpeedToString(SpeedUnit unit)
 {
     return
         (_appContext.GetString(_appContext.Resources.GetIdentifier(unit.ToString(), ResourceType.String,
                                                                    _appContext.PackageName)));
 }
示例#8
0
 public static string GetFriendlyName(SpeedUnit unit)
 {
     switch (unit) {
     case SpeedUnit.MetersPerSec: return "m/s";
     case SpeedUnit.MilesPerHour: return "mph";
     default: return unit.ToString();
     }
 }