private StringBuilder SetSpeed(Speed speed, StringBuilder sb)
 {
     switch (SpeedParameter)
     {
         case SpeedParameter.KMPH:
             sb.Append(speed.KMPH.ToString("0.0") + " km/h");
             break;
         case SpeedParameter.MPS:
             sb.Append(speed.MPS.ToString("0.0") + " m/s");
             break;
         case SpeedParameter.Knot:
             sb.Append(speed.Knot.ToString("0.0") + " kn");
             break;
         default:
             break;
     }
     return sb;
 }
示例#2
0
 public static Speed FromMPS(double mps)
 {
     var speed = new Speed();
     speed.MPS = mps;
     return speed;
 }
示例#3
0
 public static Speed FromKnot(double knot)
 {
     var speed = new Speed();
     speed.Knot = knot;
     return speed;
 }
示例#4
0
 public static Speed FromKMPH(double kmph)
 {
     var speed = new Speed();
     speed.KMPH = kmph;
     return speed;
 }