Esempio n. 1
0
 // relative position overload for GPSDataInstance structures (accurate for relatively close distances - e.g., several miles)
 public static double getRelativePosition(GPSDataInstance origin,
                                          GPSDataInstance location,
                                          out double X, out double Y
                                          )
 {
     X = getGPSDistance(origin.Latitude, origin.Longitude, location.Latitude, origin.Longitude);
     Y = getGPSDistance(origin.Latitude, origin.Longitude, origin.Latitude, location.Longitude);
     return(Math.Sqrt(X * X + Y * Y));
 }
Esempio n. 2
0
        //getGPSdata opverloaded to include a given frameindex
        public GPSDataInstance getGPSDataInstance(int frameindex)
        {
            GPSDataInstance gpsdata = new GPSDataInstance(frameindex, LongDegrees, LongMinutes, LongDeciminutes,
                                                          LatDegrees, LatMinutes, LatDeciminutes,
                                                          SpeedOverGround,
                                                          CourseOverGround,
                                                          MRCStatus
                                                          );

            return(gpsdata);
        }
Esempio n. 3
0
        //getGPSdata opverloaded to include a given frameindex
        public GPSDataInstance getGPSDataInstance(int frameindex)
        {
            GPSDataInstance gpsdata = new GPSDataInstance(frameindex,
                                                          LatitudeAsDecimal,
                                                          LongitudeAsDecimal,
                                                          SpeedOverGround,
                                                          CourseOverGround,
                                                          MRCStatus
                                                          );

            return(gpsdata);
        }
        // the recording thread main loop
        public void mainLoop()
        {
            OutOfRecordingThread = false;
            ManagedImage    rawImage       = new ManagedImage();
            ManagedImage    convertedImage = new ManagedImage();
            GPSDataInstance newGpsData;



            while (RecordingThreadActive)
            {
                // 1. retrieving a frame from the buffer

                if ((Flag_GravityFound_Y && (IMUcomms != null)) || (IMUcomms == null)) // record only if gravity is found or if there is no IMU
                {
                    FrameQueue.add(Cam);
                    //Cam.RetrieveBuffer(rawImage);

                    // increasing frame index
                    FrameIndex++;

                    //tempImage = new ManagedImage(rawImage);

                    //FrameQueue.add(tempImage);

                    //FrameQueue.Buffer[FrameQueue.last].Convert(PixelFormat.PixelFormatBgr, convertedImage);
                    //System.Drawing.Bitmap bitmap = convertedImage.bitmap;
                    //DisplayPicture.Image = (Image)convertedImage.bitmap;


                    // adding gps data in the GPS data list
                    if (GpsReceiver != null)
                    {
                        newGpsData = new GPSDataInstance(FrameIndex,
                                                         GpsReceiver.LatitudeAsDecimal,
                                                         GpsReceiver.LongitudeAsDecimal,
                                                         GpsReceiver.SpeedOverGround,
                                                         GpsReceiver.CourseOverGround,
                                                         GpsReceiver.MRCStatus);
                        GpsCaptureData.Add(newGpsData);
                    }
                }
            }

            DisplayPicture.Image = null;
            OutOfRecordingThread = true;
        }
 //getGPSdata opverloaded to include a given frameindex
 public GPSDataInstance getGPSDataInstance(int frameindex)
 {
     GPSDataInstance gpsdata = new GPSDataInstance(frameindex, LongDegrees, LongMinutes, LongDeciminutes,
                                                       LatDegrees, LatMinutes, LatDeciminutes,
                                                       SpeedOverGround,
                                                       CourseOverGround,
                                                       MRCStatus
                                                       );
     return gpsdata;
 }
        // the recording thread main loop
        public void mainLoop()
        {
            OutOfRecordingThread = false;
            ManagedImage rawImage = new ManagedImage();
            ManagedImage convertedImage = new ManagedImage();
            GPSDataInstance newGpsData;

            while (RecordingThreadActive)
            {

                // 1. retrieving a frame from the buffer

                if ((Flag_GravityFound_Y && (IMUcomms != null)) || (IMUcomms == null)) // record only if gravity is found or if there is no IMU
                {

                    FrameQueue.add(Cam);
                    //Cam.RetrieveBuffer(rawImage);

                    // increasing frame index
                    FrameIndex++;

                    //tempImage = new ManagedImage(rawImage);

                    //FrameQueue.add(tempImage);

                    //FrameQueue.Buffer[FrameQueue.last].Convert(PixelFormat.PixelFormatBgr, convertedImage);
                    //System.Drawing.Bitmap bitmap = convertedImage.bitmap;
                    //DisplayPicture.Image = (Image)convertedImage.bitmap;

                    // adding gps data in the GPS data list
                    if (GpsReceiver != null)
                    {

                        newGpsData = new GPSDataInstance(FrameIndex,
                                                         GpsReceiver.LatitudeAsDecimal,
                                                         GpsReceiver.LongitudeAsDecimal,
                                                         GpsReceiver.SpeedOverGround,
                                                         GpsReceiver.CourseOverGround,
                                                         GpsReceiver.MRCStatus);
                        GpsCaptureData.Add(newGpsData);
                    }

                }

            }

            DisplayPicture.Image = null;
            OutOfRecordingThread = true;
        }
Esempio n. 7
0
 public FrameData(ManagedImage img, GPSDataInstance gpsData)
 {
     Img     = img;
     GPSData = gpsData;
 }
 public FrameData(ManagedImage img, GPSDataInstance gpsData)
 {
     Img = img;
     GPSData = gpsData;
 }
Esempio n. 9
0
 // GPS distance computation overload with GPSDatainstance structures
 public static double getGPSDistance(GPSDataInstance location1, GPSDataInstance location2)
 {
     return(getGPSDistance(location1.Latitude, location1.Longitude, location2.Latitude, location2.Longitude));
 }