示例#1
0
 internal string Actual(SpeedParameter windParameter)
 {
     switch (windParameter)
     {
         case SpeedParameter.KMPH:
             return KMPH.ToString("0.#");
         case SpeedParameter.MPS:
             return MPS.ToString("0.#");
         case SpeedParameter.Knot:
             return Knot.ToString("0.#");
         default:
             return KMPH.ToString("0.#");
     }
 }
示例#2
0
        public static string GetSpeedFormat(SpeedParameter speedParameter)
        {
            switch (speedParameter)
            {
            case SpeedParameter.KMPH:
                return("km/h");

            case SpeedParameter.MPS:
                return("m/s");

            case SpeedParameter.Knot:
                return("kn");

            default:
                return("");
            }
        }
示例#3
0
文件: Speed.cs 项目: soiOL/hello
        internal string Actual(SpeedParameter windParameter)
        {
            switch (windParameter)
            {
            case SpeedParameter.KMPH:
                return(KMPH.ToString("0.#"));

            case SpeedParameter.MPS:
                return(MPS.ToString("0.#"));

            case SpeedParameter.Knot:
                return(Knot.ToString("0.#"));

            default:
                return(KMPH.ToString("0.#"));
            }
        }
示例#4
0
文件: Speed.cs 项目: soiOL/hello
        public double ActualDouble(SpeedParameter speedParameter)
        {
            switch (speedParameter)
            {
            case SpeedParameter.KMPH:
                return(KMPH);

            case SpeedParameter.MPS:
                return(MPS);

            case SpeedParameter.Knot:
                return(Knot);

            default:
                return(0);
            }
        }
示例#5
0
文件: Speed.cs 项目: soiOL/hello
        internal string DanWei(SpeedParameter speedParameter)
        {
            switch (speedParameter)
            {
            case SpeedParameter.KMPH:
                return("km/h");

            case SpeedParameter.MPS:
                return("m/s");

            case SpeedParameter.Knot:
                return("knot");

            default:
                return("km/h");
            }
        }
        /// <summary>
        /// Get parameters from string.
        /// </summary>
        /// <param name="args">Parameters from console</param>
        /// <returns>Collection of parameters</returns>
        public static List <Parameter> GetParameters(string[] args)
        {
            if (!VerifyArgumentString(args))
            {
                throw new ArgumentException("Wrong parameters");
            }

            var parameters = new List <Parameter>();

            for (var i = 0; i < args.Length; i++)
            {
                Parameter parameter = null;

                if (args[i] == "-n")
                {
                    parameter = new ThreadParameter(args[i], args[i + 1]);
                }
                else if (args[i] == "-l")
                {
                    parameter = new SpeedParameter(args[i], args[i + 1]);
                }
                else if (args[i] == "-f")
                {
                    parameter = new FilePathParameter(args[i], args[i + 1]);
                }
                else if (args[i] == "-o")
                {
                    parameter = new OutputPathParameter(args[i], args[i + 1]);
                }

                if (parameter != null && parameter.Verify())
                {
                    parameters.Add(parameter);
                }
            }

            return(parameters);
        }
示例#7
0
 public void Set(SpeedParameter s)
 {
     SpeedParameter = s;
 }
 public static void ChangeParameter(WindParameter windFormat, SpeedParameter speedFormat)
 {
     WindParameter = windFormat;
     SpeedParameter = speedFormat;
 }
示例#9
0
 internal string DanWei(SpeedParameter speedParameter)
 {
     switch (speedParameter)
     {
         case SpeedParameter.KMPH:
             return "km/h";
         case SpeedParameter.MPS:
             return "m/s";
         case SpeedParameter.Knot:
             return "knot";
         default:
             return "km/h";
     }
 }
示例#10
0
 public double ActualDouble(SpeedParameter speedParameter)
 {
     switch (speedParameter)
     {
         case SpeedParameter.KMPH:
             return KMPH;
         case SpeedParameter.MPS:
             return MPS;
         case SpeedParameter.Knot:
             return Knot;
         default:
             return 0;
     }
 }
示例#11
0
 public void Set(SpeedParameter s)
 {
     SpeedParameter = s;
 }
 public SpeedViewModel(SpeedParameter l)
 {
     this.Parameter = l;
     Title = l.GetDisplayName();
 }
示例#13
0
 public SpeedViewModel(SpeedParameter l)
 {
     this.Parameter = l;
     Title          = l.GetDisplayName();
 }
示例#14
0
 public static string GetSpeedFormat(SpeedParameter speedParameter)
 {
     switch (speedParameter)
     {
         case SpeedParameter.KMPH:
             return "km/h";
         case SpeedParameter.MPS:
             return "m/s";
         case SpeedParameter.Knot:
             return "kn";
         default:
             return "";
     }
 }