SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Protected Member Functions | Events | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Seci.Tools.ValuesUpdater Class Reference

This class is used for updating the values SECI has stored for the blocks and from the DAE. It contains an instance of the BackgroundWorker class that is used as a separate thread for retrieving the current experiment values, and an instance of the Timer class which fires off the BackgroundWorkers every x milliseconds. More...

Inheritance diagram for Seci.Tools.ValuesUpdater:
Inheritance graph
Collaboration diagram for Seci.Tools.ValuesUpdater:
Collaboration graph

Public Member Functions

void Dispose ()
 The dispose method to be called from code. More...
 
void PauseUpdater ()
 Method for pausing the timer. This is done by setting the delay and period to infinity. More...
 
void ResumeUpdater ()
 Method for resuming the timer. This is done by setting the delay and period to their normal values. More...
 
void StartUpdater ()
 Method for starting the timer, which fires off the update thread. More...
 
delegate void ValuesUpdatedEventHandler (Boolean timeout)
 Event for indicating to the GUI level that the values were updated. More...
 
 ValuesUpdater (int updateRate)
 Constructor. Initialises the BackgroundWorker object. More...
 

Static Public Member Functions

static void LogValuesAtStartOrEndRun (DateTime time, string runNumber)
 Calls the method to log the blocks at the start or end of a run. If logging the end of a run, then need to use previous run number. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 If the value passed it true then the method has been called directly or indirectly from SECI code. If the value passed is false then the method has been called by the runtime from inside the finalizer. More...
 

Events

ValuesUpdatedEventHandler OnValuesUpdated
 

Private Member Functions

void _daeUpdater_DoWork (object sender, DoWorkEventArgs e)
 The method that is run on the BackgroundWorker thread. More...
 
void _daeUpdater_RunWorkerCompleted (object sender, RunWorkerCompletedEventArgs e)
 The method that is run once the BackgroundWorker thread is finished. This raises an OnValuesUpdated event. More...
 
void blockUpdater_DoWork (object sender, System.ComponentModel.DoWorkEventArgs e)
 The method that is run on the BackgroundWorker thread. More...
 
void blockUpdater_RunWorkerCompleted (object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
 The method that is run once the BackgroundWorker thread is finished. This raises an OnValuesUpdated event. More...
 
void createStatusBlock ()
 
void updateTimer_Tick (object obj)
 The method that is called when the timer ticks. If the BackgroundWorker thread is not busy it will request that it starts running. More...
 

Static Private Member Functions

static void logStatusBlock (Boolean force)
 

Private Attributes

BackgroundWorker _blockUpdater
 
BackgroundWorker _daeUpdater
 
Boolean _daeUpdating = false
 
Boolean _timedOut = false
 
TimerCallback _updateCallBack
 
int _updateRate = 500
 
Timer _updateTimer
 

Static Private Attributes

static BlockInfo _statusBlock
 

Detailed Description

This class is used for updating the values SECI has stored for the blocks and from the DAE. It contains an instance of the BackgroundWorker class that is used as a separate thread for retrieving the current experiment values, and an instance of the Timer class which fires off the BackgroundWorkers every x milliseconds.

Definition at line 16 of file ValuesUpdater.cs.

Constructor & Destructor Documentation

Seci.Tools.ValuesUpdater.ValuesUpdater ( int  updateRate)
inline

Constructor. Initialises the BackgroundWorker object.

Parameters
updateRateThe rate at which the values should be updated in milliseconds

Definition at line 37 of file ValuesUpdater.cs.

Member Function Documentation

void Seci.Tools.ValuesUpdater._daeUpdater_DoWork ( object  sender,
DoWorkEventArgs  e 
)
inlineprivate

The method that is run on the BackgroundWorker thread.

Parameters
senderThe sender
eThe event arguments

Definition at line 202 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater._daeUpdater_RunWorkerCompleted ( object  sender,
RunWorkerCompletedEventArgs  e 
)
inlineprivate

The method that is run once the BackgroundWorker thread is finished. This raises an OnValuesUpdated event.

Parameters
senderThe sender
eThe event arguments

Definition at line 253 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.blockUpdater_DoWork ( object  sender,
System.ComponentModel.DoWorkEventArgs  e 
)
inlineprivate

The method that is run on the BackgroundWorker thread.

Parameters
senderThe sender
eThe event arguments

Definition at line 141 of file ValuesUpdater.cs.

References Seci.Definitions.Status.UseDaeMonitorVI.

void Seci.Tools.ValuesUpdater.blockUpdater_RunWorkerCompleted ( object  sender,
System.ComponentModel.RunWorkerCompletedEventArgs  e 
)
inlineprivate

The method that is run once the BackgroundWorker thread is finished. This raises an OnValuesUpdated event.

Parameters
senderThe sender
eThe event arguments

Definition at line 188 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.createStatusBlock ( )
inlineprivate

Definition at line 67 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.Dispose ( )
inline

The dispose method to be called from code.

Definition at line 281 of file ValuesUpdater.cs.

virtual void Seci.Tools.ValuesUpdater.Dispose ( bool  disposing)
inlineprotectedvirtual

If the value passed it true then the method has been called directly or indirectly from SECI code. If the value passed is false then the method has been called by the runtime from inside the finalizer.

Parameters
disposingIndicates where the call has come from

Definition at line 300 of file ValuesUpdater.cs.

static void Seci.Tools.ValuesUpdater.logStatusBlock ( Boolean  force)
inlinestaticprivate

Definition at line 219 of file ValuesUpdater.cs.

static void Seci.Tools.ValuesUpdater.LogValuesAtStartOrEndRun ( DateTime  time,
string  runNumber 
)
inlinestatic

Calls the method to log the blocks at the start or end of a run. If logging the end of a run, then need to use previous run number.

Parameters
timeThe log time
runNumberThe appropriate run number

Definition at line 264 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.PauseUpdater ( )
inline

Method for pausing the timer. This is done by setting the delay and period to infinity.

Definition at line 93 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.ResumeUpdater ( )
inline

Method for resuming the timer. This is done by setting the delay and period to their normal values.

Definition at line 104 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.StartUpdater ( )
inline

Method for starting the timer, which fires off the update thread.

Definition at line 81 of file ValuesUpdater.cs.

void Seci.Tools.ValuesUpdater.updateTimer_Tick ( object  obj)
inlineprivate

The method that is called when the timer ticks. If the BackgroundWorker thread is not busy it will request that it starts running.

Parameters
objThe sender?

Definition at line 117 of file ValuesUpdater.cs.

delegate void Seci.Tools.ValuesUpdater.ValuesUpdatedEventHandler ( Boolean  timeout)

Event for indicating to the GUI level that the values were updated.

Member Data Documentation

BackgroundWorker Seci.Tools.ValuesUpdater._blockUpdater
private

Definition at line 18 of file ValuesUpdater.cs.

BackgroundWorker Seci.Tools.ValuesUpdater._daeUpdater
private

Definition at line 19 of file ValuesUpdater.cs.

Boolean Seci.Tools.ValuesUpdater._daeUpdating = false
private

Definition at line 24 of file ValuesUpdater.cs.

BlockInfo Seci.Tools.ValuesUpdater._statusBlock
staticprivate

Definition at line 23 of file ValuesUpdater.cs.

Boolean Seci.Tools.ValuesUpdater._timedOut = false
private

Definition at line 25 of file ValuesUpdater.cs.

TimerCallback Seci.Tools.ValuesUpdater._updateCallBack
private

Definition at line 21 of file ValuesUpdater.cs.

int Seci.Tools.ValuesUpdater._updateRate = 500
private

Definition at line 22 of file ValuesUpdater.cs.

Timer Seci.Tools.ValuesUpdater._updateTimer
private

Definition at line 20 of file ValuesUpdater.cs.

Event Documentation

ValuesUpdatedEventHandler Seci.Tools.ValuesUpdater.OnValuesUpdated

Definition at line 31 of file ValuesUpdater.cs.


The documentation for this class was generated from the following file: