/// <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) { try { Initialise(); using (var Processor = new TAGProcessorPreScanState()) { 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; SetPublishedState(Processor); } } catch // (Exception E) // make sure any exception is trapped to return correct response to caller { return(false); } return(true); }
/// <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); }