Exemplo n.º 1
0
        /// <summary>
        /// Grid point from on-machine positions
        /// Scenarios
        /// a) Lat/long present
        ///        TFA to use this as the seed location
        /// b) No Lat/long, but UTM zone present
        ///         Discussion with Grant and Raymond:
        ///         Potential corner case where UTMZone may be different to the projects CSIB.
        ///         safer to convert to lat/long using the UTMZone
        ///         unable to find any samples
        /// c) No Lat/long, no UTM zone, but has a NEE
        ///       TFA to use project CSIBs and NEE to determine potential LLs
        /// </summary>
        /// <param name="processor"></param>
        private void SetSeedPosition(TAGProcessorPreScanACSState processor)
        {
            PopulateNEE(processor);

            if (processor.LLHLatRecordedTime.HasValue)
            {
                SeedLatitude  = Math.Abs(processor.LLHLat - Consts.NullDouble) < Consts.TOLERANCE_DECIMAL_DEGREE ? (double?)null : processor.LLHLat;
                SeedLongitude = Math.Abs(processor.LLHLon - Consts.NullDouble) < Consts.TOLERANCE_DECIMAL_DEGREE ? (double?)null : processor.LLHLon;
                SeedHeight    = Math.Abs(processor.LLHHeight - Consts.NullDouble) < Consts.TOLERANCE_DECIMAL_DEGREE ? (double?)null : processor.LLHHeight;
                SeedTimeUTC   = processor.LLHLatRecordedTime; //We arbitrarily choose LLHLat, in the majority of cases this will be same for any LLH.
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Execute the pre-scan operation on the TAG file, returning a boolean success result.
        /// Sets up local state detailing the pre-scan fields retried from the ATG file
        /// </summary>
        public bool Execute(Stream TAGData, ref List <UTMCoordPointPair> aCSBladePositions, ref List <UTMCoordPointPair> aCSRearAxlePositions, ref List <UTMCoordPointPair> aCSTrackPositions, ref List <UTMCoordPointPair> aCSWheelPositions)
        {
            try
            {
                Initialise();

                using (var processor = new TAGProcessorPreScanACSState())
                {
                    var Sink = new TAGVisionLinkPrerequisitesValueSink(processor);
                    using (var Reader = new TAGReader(TAGData))
                    {
                        var TagFile = new TAGFile();

                        ReadResult = TagFile.Read(Reader, Sink);
                    }

                    if (ReadResult != TAGReadResult.NoError)
                    {
                        return(false);
                    }

                    IsCSIBCoordSystemTypeOnly = processor.IsCSIBCoordSystemTypeOnly;
                    if (!IsCSIBCoordSystemTypeOnly)
                    {
                        if (processor.HaveReceivedValidTipPositions)
                        {
                            aCSBladePositions.AddRange(processor.BladePositions);
                        }
                        if (processor.HaveReceivedValidRearPositions)
                        {
                            aCSRearAxlePositions.AddRange(processor.RearAxlePositions);
                        }
                        if (processor.HaveReceivedValidTrackPositions)
                        {
                            aCSTrackPositions.AddRange(processor.TrackPositions);
                        }
                        if (processor.HaveReceivedValidWheelPositions)
                        {
                            aCSWheelPositions.AddRange(processor.WheelPositions);
                        }
                    }
                    SetPublishedState(processor);
                }
            }
            catch
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fill out the local class properties with the information wanted from the TAG file
        /// </summary>
        /// <param name="processor"></param>
        private void SetPublishedState(TAGProcessorPreScanACSState processor)
        {
            LastDataTime = processor.DataTime;
            SetSeedPosition(processor);

            ProcessedEpochCount = processor.ProcessedEpochCount;
            RadioType           = processor.RadioType;
            RadioSerial         = processor.RadioSerial;
            MachineType         = processor.MachineType;
            MachineID           = processor.MachineID;
            HardwareID          = processor.HardwareID;
            ApplicationVersion  = processor.ApplicationVersion;
            DesignName          = processor.Design;
            PlatformType        = processor.GetPlatformType();
        }
Exemplo n.º 4
0
        private void PopulateNEE(TAGProcessorPreScanACSState processor)
        {
            SeedTimeUTC = processor._FirstDataTime;

            if (processor.HaveReceivedValidTipPositions)
            {
                SeedNorthing  = (processor.DataLeft.Y + processor.DataRight.Y) / 2;
                SeedEasting   = (processor.DataLeft.X + processor.DataRight.X) / 2;
                SeedElevation = (processor.DataLeft.Z + processor.DataRight.Z) / 2;
            }
            else
            {
                if (processor.HaveReceivedValidRearPositions)
                {
                    SeedNorthing  = (processor.DataRearLeft.Y + processor.DataRearRight.Y) / 2;
                    SeedEasting   = (processor.DataRearLeft.X + processor.DataRearRight.X) / 2;
                    SeedElevation = (processor.DataRearLeft.Z + processor.DataRearRight.Z) / 2;
                }
                else
                {
                    if (processor.HaveReceivedValidWheelPositions)
                    {
                        SeedNorthing  = (processor.DataWheelLeft.Y + processor.DataWheelRight.Y) / 2;
                        SeedEasting   = (processor.DataWheelLeft.X + processor.DataWheelRight.X) / 2;
                        SeedElevation = (processor.DataWheelLeft.Z + processor.DataWheelRight.Z) / 2;
                    }
                    else
                    {
                        if (processor.HaveReceivedValidTrackPositions)
                        {
                            SeedNorthing  = (processor.DataTrackLeft.Y + processor.DataTrackRight.Y) / 2;
                            SeedEasting   = (processor.DataTrackLeft.X + processor.DataTrackRight.X) / 2;
                            SeedElevation = (processor.DataTrackLeft.Z + processor.DataTrackRight.Z) / 2;
                        }
                    }
                }
            }
        }