// Constructor
 public Control(Navigator navigator, Controls controls, float [] angles, float throttle, bool sailon, double duration, int iwarp, string frame)
 {
     // Navigator
     this.navigator = navigator;
     // Parent controls object
     this.controls = controls;
     // Reference frame for control angles
     this.frame = Frame.Frames[frame];
     // Frame window
     frameWindow = new FrameWindow(this);
     // Angles
     this.angles = angles;
     // Angle strings
     anglestr = new string [3];
     for (int i = 0; i < 3; i++) {
     anglestr[i] = angles[i].ToString();
     }
     // Throttle
     throttle_str = throttle.ToString();
     this.throttle = throttle;
     // Sail on
     sailon_str = sailon.ToString();
     this.sailon = sailon;
     // Time
     this.duration = duration;
     this.days = Math.Floor(duration / SecondsPerDay);
     this.days_str = days.ToString();
     this.hours = Math.Floor(duration % SecondsPerDay / SecondsPerHour);
     this.hours_str = this.hours.ToString();
     this.duration = days * SecondsPerDay + hours * SecondsPerHour;
     duration_str = duration.ToString();
     // Warp factor
     this.iwarp = iwarp;
     warp = warpLevels[iwarp];
 }
Beispiel #2
0
 /// Constructor
 public Control(Navigator navigator, Controls controls, float[] angles, float throttle, bool sailon, double duration, int iwarp, string frame)
 {
     // Navigator
     this.navigator = navigator;
     // Parent controls object
     this.controls = controls;
     // Reference frame for control angles
     this.frame = Frame.Frames[frame];
     // Frame window
     frameWindow = new FrameWindow(this);
     // Angles
     this.angles = angles;
     // Angle strings
     anglestr = new string[3];
     for (int i = 0; i < 3; i++)
     {
         anglestr[i] = angles[i].ToString();
     }
     // Throttle
     throttle_str  = throttle.ToString();
     this.throttle = throttle;
     // Sail on
     sailon_str  = sailon.ToString();
     this.sailon = sailon;
     // Time
     this.duration  = duration;
     this.days      = Math.Floor(duration / SecondsPerDay);
     this.days_str  = days.ToString();
     this.hours     = Math.Floor(duration % SecondsPerDay / SecondsPerHour);
     this.hours_str = this.hours.ToString();
     this.duration  = days * SecondsPerDay + hours * SecondsPerHour;
     duration_str   = duration.ToString();
     // Warp factor
     this.iwarp = iwarp;
     warp       = warpLevels[iwarp];
 }