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(); }
public void Open() { try { _connectionThread = Threads.Dispose(_connectionThread, ref _connectionEnd); } catch { } _connectionThread = Threads.Create(ConnectionAgent, ref _connectionEnd, "OPC Connection thread"); _connectionThread.Start(); }
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"); }
private void SpeedMsgStart() { if (_speedMsgThread == null) { _speedMsgThread = Threads.Create(SpeedMsgAgent, ref _speedMsgEnd, "TestAPCS Update thread"); _speedMsgException = null; _speedMsgThread.Start(); } }
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(); }
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; }
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(); }
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(); }
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 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); }