Exemple #1
0
        public Mission(Location loc, Airframe plane, User usr, Camera camera, string description, string videoFile, string logFile)
        {
            this.DateFlown = DateTime.Now;

            this.location = loc;
            this.LocationID = loc.ID;

            this.plane = plane;
            this.AircraftID = plane.ID;

            this.user = usr;
            this.PilotID = usr.ID;

            this.camera = camera;
            this.CameraID = camera.ID;

            this.Description = description;
            this.MissionVideo = videoFile;
            this.MissionLog = logFile;

            PointCount = 0;
            TargetsDetected = 0;
        }
 public void NewMission(Location loc, Airframe plane, User user, Camera camera, IMavLinkListener callback, IVideoController videoController)
 {
     frmCreateMission createMission = new frmCreateMission();
     if (createMission.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         IsLive = createMission.IsLive;
         if (createMission.IsLive)
         {
             missionReader = new MissionPlannerLiveConnector("127.0.0.1", "56781", callback);
             if (missionReader.Open(false, DateTime.Now))
             {
                 mission = new Mission(loc, plane, user, camera, createMission.Description, createMission.VideoFile, createMission.LogFile);
                 this.videoController = videoController;
             }
         }
         else
         {
             if (File.Exists(createMission.LogFile) && File.Exists(createMission.VideoFile))
             {
                 mission = new Mission(loc, plane, user, camera, createMission.Description, createMission.VideoFile, createMission.LogFile);
                 missionReader = new MissionPlannerLogReader(createMission.LogFile, false, callback);
                 this.videoController = videoController;
             }
         }
     }
 }