Example #1
0
        public RealTimeViewer(EventLoggerAccess log, DetectorsDataAccess dataAccess)
        {
            _log = log;
            _dataAccess = dataAccess;
            _dataAccess.DisplayControlUpdateRequest += new Subsystem.DataAccessCore.DashboardControlUpdateHandler(_dataAccess_DisplayControlUpdateRequest);

            int dataPort = int.Parse(ConfigurationManager.AppSettings["RealTimeViewerDataPort"]);
            string address = ConfigurationManager.AppSettings["RealTimeViewerMulticastIPAddress"];
            _realTimeViewerBytesPerPixel = uint.Parse(ConfigurationManager.AppSettings["RealTimeViewerBytesPerPixel"]);
            _realTimeViewerPixelsPerColumn = uint.Parse(ConfigurationManager.AppSettings["RealTimeViewerPixelsPerColumn"]);

            _masterControlAddress = string.Empty;

            if ((dataAccess.Detectors.PixelPerColumn > _realTimeViewerPixelsPerColumn) &&
                (_realTimeViewerPixelsPerColumn != 0))
            {
                float value = (float)dataAccess.Detectors.PixelPerColumn / (float)_realTimeViewerPixelsPerColumn;
                _pixelInterval = (int)(Math.Round(value, 0, MidpointRounding.ToEven));
            }
            else
                _pixelInterval = 1;

            try
            {
                _realTimeViewerHost = new RealTimeViewerHost(address, dataPort);
            }
            catch { }

            _inComingDataColl = new BlockingCollection<DataInfo>(AppConfiguration.DataCollectionMaxSize);
        }
Example #2
0
        public RealTimeViewer(EventLoggerAccess log)
        {
            _log = log;
            IsDualEnergy = false;
            _realTimeViewerHost = new RealTimeViewerHost(AppConfiguration.RealTimeViewerMulticastIPAddress,
                                                         AppConfiguration.RealTimeViewerDataPort,
                                                         AppConfiguration.RealTimeViewerUdpClientPort,
                                                         log);

            _inComingDataColl = new BlockingCollection<DataInfo>();
            

            _sendThread = Threads.Create(SendAgent, ref _sendEnd, "Real Time View Data Send thread");
            _sendThread.Start();
        }