public override void Dispose() { try { if (/*exists (avoid first try exceptions)?*/ _rawDataAccess != null) { _rawDataAccess.Dispose(); } } catch { } finally { _rawDataAccess = null; } try { if (/*exists (avoid first try exceptions)?*/ _realTimeViewer != null) { _realTimeViewer.Dispose(); } } catch { } finally { _realTimeViewer = null; } try { if (/*exists (avoid first try exceptions)?*/ _detectorsAccess != null) { _detectorsAccess.Dispose(); } } catch { } finally { _detectorsAccess = null; } try { if (/*exists (avoid first try exceptions)?*/ _apcsAccess != null) { _apcsAccess.Dispose(); } } catch { } finally { _apcsAccess = null; } try { if (/*exists (avoid first try exceptions)?*/ _cargoHostEndPoint != null) { _cargoHostEndPoint.Close(); } } catch { } finally { _cargoHostEndPoint = null; } try { base.Dispose(); } catch { } }
public RawDataAccess(EventLoggerAccess eventLogger, DetectorsAccess detectorAccess) : base(AppConfiguration.DiplotConnectionUri, AppConfiguration.DiplotMulticastIPAddress, AppConfiguration.DiplotDataPort) { if (/*invalid?*/ eventLogger == null) { throw new ArgumentNullException(ClassName + " logger reference (eventLogger) must not be null"); } Logger = eventLogger; if (/*invalid?*/ detectorAccess == null) { throw new ArgumentNullException(ClassName + " detector access (detectorAccess) must not be null"); } DetectorsAccessInstance = detectorAccess; GetHighEnergyData(); IncomingData = new BlockingCollection <DataInfo>(); _sendRawDataThread = Threads.Create(SendRawDataAgent, ref _sendRawDataEnd, "Raw Data Access Send thread"); Debug.Assert(!_sendRawDataEnd.WaitOne(0)); _sendRawDataThread.Start(); }
public DetectorsDataAccess(EventLoggerAccess logger) : base(logger) { _logger = logger; _detectorsAccess = new DetectorsAccess(_logger); _detectorsAccess.ReadyEvent += new ConnectionStateChangeHandler(OnDetectorsChange); _apcsAccess = new ApcsAccess(logger); _apcsAccess.ReadyEvent += new ConnectionStateChangeHandler(OnApcsChange); _apcsAccess.Start(); _detectorsAccess.Start(); _OpcTags = new OpcTags(); base.TagUpdate += new PLCTagUpdateHandler(_OpcTags.DataAccess_TagUpdate); base.TagUpdate += new PLCTagUpdateHandler(DetectorsDataAccess_TagUpdate); _cargoHostEndPoint = new CargoHostEndPoint(AppConfiguration.CargoHostServer, AppConfiguration.CargoHostPort); _logger.LogInfo("Cargo Host HostEndPoint is " + _cargoHostEndPoint.IPAddress + ":" + _cargoHostEndPoint.IPPort.ToString()); _rawDataAccess = new RawDataAccess(_logger, _detectorsAccess); _realTimeViewer = new RealTimeViewer(_logger); }
public DataInfo(DetectorsAccess.LineHeader header, float[] linedata) { LineData = linedata; LineHeader = header; }