/// <summary> /// Initializes the component. /// </summary> private void Init() { debugWidgets = new List <IRealtimeField>(); updater = new UpdaterThread(Interval, UpdateContent); InitializeComponent(); InitializeDebugWidgets(); }
/// <summary> /// Creates a new instance of this control with default FPS of 5. /// </summary> public LiveCamera() { InitializeComponent(); fps = DEFAULT_FPS; updater = new UpdaterThread(Interval, UpdateContent); Active = false; }
/// <summary> /// Initializes the component. /// </summary> private void Init() { debugWidgets = new List<IRealtimeField>(); updater = new UpdaterThread(Interval, UpdateContent); InitializeComponent(); InitializeDebugWidgets(); }
/// <summary> /// Finishes the updater thread. /// </summary> /// <exception cref="System.Exception">A error occured during termination of FT245RBitbangController ({0}) updater thread.</exception> private void FinishUpdaterThread() { if (UpdaterThread != null) { try { KeepUpdaterThreadAlive = false; UpdaterThreadSignal(); if (!UpdaterThread.Join(1000)) { UpdaterThread.Abort(); } UpdaterThread = null; } catch (Exception E) { Log.Exception("A error occured during termination of FT245RBitbangController ({0}) updater thread.".Build(SerialNumber), E); throw new Exception("A error occured during termination of FT245RBitbangController ({0}) updater thread.".Build(SerialNumber, E)); } } }
/// <summary> /// Finishes the updater thread. /// </summary> /// <exception cref="System.Exception">A error occured during termination of DirectStripController updater thread.</exception> private void FinishUpdaterThread() { if (UpdaterThread != null) { try { KeepUpdaterThreadAlive = false; UpdaterThreadSignal(); if (!UpdaterThread.Join(1000)) { UpdaterThread.Abort(); } UpdaterThread = null; } catch (Exception E) { Log.Exception("A error occured during termination of DirectStripController updater thread.", E); throw new Exception("A error occured during termination of DirectStripController updater thread.", E); } } }
/// <summary> /// Finishes the updater thread. /// </summary> private void FinishUpdaterThread() { if (UpdaterThread != null) { try { KeepUpdaterThreadAlive = false; UpdaterThreadSignal(); if (!UpdaterThread.Join(1000)) { UpdaterThread.Abort(); Log.Warning("{0} did not quit. Forcing abort.".Build(UpdaterThread.Name)); } UpdaterThread = null; } catch (Exception E) { Log.Exception("A error occured during termination of the {0}: {1}.".Build(UpdaterThread.Name), E); throw new Exception("A error occured during termination of the {0}: {1}.".Build(UpdaterThread.Name), E); } } }
protected void InitializeCustomComponents() { this.Disposed += BasicDXView_Disposed; syncContext = SynchronizationContext.Current; updaterThread = new UpdaterThread(syncContext); double pow = (34 - 10 + 3) / 2.0; updaterThread.InterEventDelay = (int)Math.Pow(2.0, pow); //updaterThread.InterEventDelay = 500; realTimeSource = CreateRealTimeSource(); bookGridControl.DataSource = realTimeSource; backgroundTimer = new Timer(updaterThread.OnIdle, null, TimeSpan.Zero, TimeSpan.FromMilliseconds(10)); starterThread = new Thread(updaterThread.Do); starterThread.IsBackground = true; starterThread.Start(); realTimeSource.DataSource = updaterThread.List; }
/// <summary> /// Finishes the updater thread. /// </summary> /// <exception cref="System.Exception">A error occured during termination of ArtNet updater thread.</exception> private void FinishUpdaterThread() { if (UpdaterThread != null) { try { KeepUpdaterThreadAlive = false; lock (UpdaterThreadLocker) { Monitor.Pulse(UpdaterThreadLocker); } if (!UpdaterThread.Join(1000)) { UpdaterThread.Abort(); } UpdaterThread = null; } catch (Exception E) { Log.Exception("A error occured during termination of ArtNet updater thread.", E); throw new Exception("A error occured during termination of ArtNet updater thread.", E); } } }