コード例 #1
0
        public BusinessManager(DetectorsDataAccess dataAccess, EventLoggerAccess log)
        {
            _dataAccess = dataAccess;
            _log        = log;

            _statusManager  = new DetectorsStatusManager(dataAccess, log);
            _requestManager = new RequestManager(dataAccess, (StatusManager)_statusManager, log);

            log.LogInfo("Using calibration: " + AppConfiguration.CalibrationMode.ToString());
            if (AppConfiguration.CalibrationMode == AppConfiguration.CalibrationModeEnum.Inline)
            {
                _calibration = new CalibrationInline(log, _dataAccess, _statusManager);
            }
            else if (AppConfiguration.CalibrationMode == AppConfiguration.CalibrationModeEnum.Persistent)
            {
                _calibration = new CalibrationPersistent(log, _dataAccess, _statusManager);
            }
            else if (AppConfiguration.CalibrationMode == AppConfiguration.CalibrationModeEnum.InlineStandstill)
            {
                _calibration = new CalibrationInline(log, _dataAccess, _statusManager);
            }
            _normalize = new NormalizeData(log, dataAccess, _calibration);

            _processThread = Threads.Create(ProcessDataThreadMethod, ref _processEnd, "Business Data thread");
            _processThread.Start();
        }
コード例 #2
0
ファイル: OpcClient.cs プロジェクト: marzlia/CXPortal
 public void Open()
 {
     try { _connectionThread = Threads.Dispose(_connectionThread, ref _connectionEnd); }
     catch { }
     _connectionThread = Threads.Create(ConnectionAgent, ref _connectionEnd, "OPC Connection thread");
     _connectionThread.Start();
 }
コード例 #3
0
        public RealTimeViewerDisplay(string multicastAddr, int dataPort)
        {
            InitializeComponent();
            CultureResources.registerDataProvider(this);;

            _activeScanEndPoint = new RealTimeDataAccess(multicastAddr, dataPort);
            _effect             = new SlideInTransitionEffect();
            _updateThread       = Threads.Create(UpdateAgent, ref _updateEnd, "Real Time View Update thread");
        }
コード例 #4
0
ファイル: TestAPCS.xaml.cs プロジェクト: marzlia/CXPortal
 private void SpeedMsgStart()
 {
     if (_speedMsgThread == null)
     {
         _speedMsgThread    = Threads.Create(SpeedMsgAgent, ref _speedMsgEnd, "TestAPCS Update thread");
         _speedMsgException = null;
         _speedMsgThread.Start();
     }
 }
コード例 #5
0
        public NormalizeData(EventLoggerAccess log, DetectorsDataAccess dataAccess, Calibration calibration)
        {
            _log          = log;
            _dataAccess   = dataAccess;
            _calibration  = calibration;
            _objectSearch = new ObjectSearch(log, dataAccess, _calibration);
            _rawDataColl  = new BlockingCollection <DataInfo>();

            _normalizeThread = Threads.Create(NormalizeAgent, ref _normalizeEnd, "Normalization thread");
            _normalizeThread.Start();
        }
コード例 #6
0
        public ObjectSearch(EventLoggerAccess log, DetectorsDataAccess dataAccess, Calibration calibration)
        {
            _log         = log;
            _dataAccess  = dataAccess;
            _archiveData = new ArchiveData(log, calibration);

            _inComingDataColl = new BlockingCollection <DataInfo>();

            _searchThread = Threads.Create(SearchAgent, ref _searchEnd, "Object Search thread");
            _searchThread.Start();

            _foundObject = false;
        }
コード例 #7
0
ファイル: RealTimeViewer.cs プロジェクト: marzlia/CXPortal
        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();
        }
コード例 #8
0
        public VanillaSession(VanillaWorld world, Client player)
            : base(player)
        {
            this.World   = world;
            this.Vanilla = world;

            OreTracker = new OreTracker(player);

            if (player.MinecraftUsername == null)
            {
                throw new ArgumentException("Player must be logged in, missing minecraftusername");
            }

            thread      = Threads.Create(this, RunServerReader, WatchdogKilled);
            thread.User = Player.MinecraftUsername;
            thread.Start();
        }
コード例 #9
0
ファイル: RawDataAccess.cs プロジェクト: Rustamung/CXPortal
 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();
 }
コード例 #10
0
        public ForumThread CreateThread(Member author, string body, string title, bool isParent = true)
        {
            int lastInserted = (from post in Posts orderby post.PostId descending select post.PostId).Count() == 0 ? 1 : (from post in Posts orderby post.PostId descending select post.PostId).First() + 1;
            var message      = Posts.Create();
            var thread       = Threads.Create();

            thread.Title     = title;
            thread.ParentId  = lastInserted;
            message.Body     = body;
            message.IsParent = isParent;
            // ici on établit les relations dans le sens N-1
            message.Author = author;
            message.Thread = thread;
            // ici on établit les relations dans le sens 1-N
            author.AuthorPosts.Add(message);
            thread.Posts.Add(message);
            // on ajoute le message au DbSet pour qu'il soit pris en compte par EF
            Posts.Add(message);
            Threads.Add(thread);
            SaveChanges();
            return(thread);
        }