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

This class is used for storing the information for any blocks that are created and provides methods for logging and checking run-control limits. More...

Collaboration diagram for Seci.Definitions.BlockInfo:
Collaboration graph

Public Member Functions

 BlockInfo ()
 Standard Constructor - necessary for XML serialization. More...
 
object Clone ()
 Clone method (only a shallow copy). More...
 
void LogValue (DateTime time, String shortName, String runNumber)
 Method for logging the current value of the block. The block is only logged to file if the value satisfies the logging conditions of the block More...
 
bool OutOfRange ()
 Check whether the block has exceeded the run-control settings. More...
 
void SetRunControl (Boolean enabled)
 Method for enabling and disabling run-control. More...
 
void SetRunControlLimits (Boolean enabled, Double low, Double high)
 Method for setting the numeric run-control limits. More...
 
void SetRunControlLimits (Boolean enabled, String value)
 Method for setting the run-control limit for a single non-numeric value Note: data collection will pause when the value is not matched. More...
 

Static Public Member Functions

static Boolean ExceedsTolerance (String currValue, String prevValue, Double tolerance)
 Check whether the current value has changed by an amount greater than the set tolerance. Note: is public for testing purposes More...
 
static Boolean OkayToLog (DateTime timeNow, DateTime lastLogged, Double loggingRate, String currVal, String prevVal, Double tolerance, Boolean onAnyChange, Boolean onToleranceExceeded)
 Checks whether to log the block value. Note: public for the purposes of testing More...
 

Static Public Attributes

static readonly String ErrorString = "Error"
 Only log the error if it is the first time. More...
 

Properties

String Alias [get, set]
 
Boolean ApplyFixedFormatting [get, set]
 
Boolean ApplyFormatting [get, set]
 
Boolean BlockEnabled [get, set]
 
String BlockName [get, set]
 
String BlockUnits [get, set]
 
String CurrentValue [get, set]
 Property for getting and setting the current value of the block. If the block is set to log changes only, then the set method has to check whether the value has changed. More...
 
String FormattedCurrentValue [get]
 Property for getting the current value of the block in a formatted state. More...
 
String FormattedSetPointValue [get]
 Property for getting the current value of the block in a formatted state. More...
 
String GoButton [get, set]
 
String Group [get, set]
 
Boolean InRange [get]
 
Boolean LogChangesOnly [get, set]
 
Boolean LogChangesTolerance [get, set]
 
Single LoggingRate [get, set]
 
Boolean LogToSharedFile [get, set]
 
Boolean LogValueToFile [get, set]
 
Double LowerLimit [get, set]
 
String NexusGroup [get, set]
 
String NexusName [get, set]
 
int NumberDecimalPlaces [get, set]
 
String OwningComponent [get, set]
 
String ParentVI [get, set]
 
Boolean PrevReadError [get, set]
 
String ReadControl [get, set]
 
ControlType ReadType [get, set]
 
String RunControlValue [get, set]
 
Boolean SaveSettings [get, set]
 
String SetPointValue [get, set]
 Property for getting the current setpoint value for the block. If the "write control" is not defined it returns null. More...
 
Double Tolerance [get, set]
 
Boolean UnderRunControl [get, set]
 
Double UpperLimit [get, set]
 
String ValueFormatting [get, set]
 
Boolean Visible [get, set]
 
String WaitForControl [get, set]
 
String WriteControl [get, set]
 

Private Member Functions

String formatValue (Double value)
 
void logValue (DateTime time, String shortName, String runNumber)
 Method for calling the appropriate method for logging the value. More...
 
void writeToFile (DateTime time, String shortName, String runNumber)
 Method for actually writing to file. The filename is of the form "ShortNameRunNumber_BlockName.txt". More...
 

Static Private Member Functions

static String convertTimeToString (ref DateTime time)
 Method for converting a DateTime to the format need for log files More...
 

Private Attributes

String _alias
 Units. More...
 
Boolean _applyFixedFormatting = false
 Whether to apply formatting. More...
 
Boolean _applyScientificFormatting = true
 Is it in range? More...
 
Boolean _blockEnabled
 How many decimal points to show (deprecated) More...
 
String _blockName
 
String _blockUnits
 Name of block. More...
 
String _currentValue
 Log the data to a files that contains data from other blocks. More...
 
String _goButton
 Control that is written to. More...
 
String _group = "None"
 The component to which this block belongs. More...
 
Boolean _inRange
 Whether the run-control settings should be saved. More...
 
DateTime _lastLogged
 The current requested value. More...
 
Boolean _logChangesNow
 Rate at which block value is logged to file. More...
 
Boolean _logChangesTolerance
 Just log changes when they occur. More...
 
Single _loggingRate
 Log to file? More...
 
Boolean _logToSharedFile
 Log changes, but only if the value exceeds the tolerance. More...
 
Boolean _logValueToFile
 Is the block visible? More...
 
Double _lowerLimit
 Upper limit for run-control. More...
 
String _nexusGroup
 NeXus name. More...
 
String _nexusName
 The group this block belongs to. More...
 
int _numDecimalPoints = 3
 Whether to apply formatting. More...
 
String _owningComponent
 Alias. More...
 
String _parentVi
 NeXus group. More...
 
String _previousLogValue
 Last value - used to check whether value changed. More...
 
String _previousValue
 The latest value of the block. More...
 
Boolean _prevReadError = false
 Marks the last time the block was logged. More...
 
String _readControl
 VI on which it appears. More...
 
ControlType _readType
 Control for reading current value. More...
 
String _runcontrolValue = ""
 Lower limit for run-control. More...
 
Boolean _saveSettings
 Non-numeric run-control value. More...
 
String _setPointValue
 This value represents how much a value has to change for it to be logged. More...
 
Double _tolerance
 The last value LOGGED to file. Needed for log on change. More...
 
Boolean _underRunControl
 Control to wait for before returning (i.e. motion light). More...
 
Double _upperLimit
 Under run-control? More...
 
String _valueFormatting
 
Boolean _visible = true
 Is the block enabled? More...
 
String _waitForControl
 Button to push after setting. More...
 
String _writeControl
 The type of the read control. More...
 

Detailed Description

This class is used for storing the information for any blocks that are created and provides methods for logging and checking run-control limits.

Definition at line 18 of file BlockInfo.cs.

Constructor & Destructor Documentation

Seci.Definitions.BlockInfo.BlockInfo ( )
inline

Standard Constructor - necessary for XML serialization.

Definition at line 298 of file BlockInfo.cs.

Member Function Documentation

object Seci.Definitions.BlockInfo.Clone ( )
inline

Clone method (only a shallow copy).

Returns
Object that needs to be cast to BlockInfo

Definition at line 690 of file BlockInfo.cs.

static String Seci.Definitions.BlockInfo.convertTimeToString ( ref DateTime  time)
inlinestaticprivate

Method for converting a DateTime to the format need for log files

Parameters
timeThe current date and time
Returns
The time in the correct format for logging

Definition at line 460 of file BlockInfo.cs.

static Boolean Seci.Definitions.BlockInfo.ExceedsTolerance ( String  currValue,
String  prevValue,
Double  tolerance 
)
inlinestatic

Check whether the current value has changed by an amount greater than the set tolerance. Note: is public for testing purposes

Parameters
currValueThe current value
prevValueThe previous value
toleranceThe tolerance
Returns
True indicates that the tolerance has been exceeded

Definition at line 476 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.formatValue ( Double  value)
inlineprivate

Definition at line 239 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.LogValue ( DateTime  time,
String  shortName,
String  runNumber 
)
inline

Method for logging the current value of the block. The block is only logged to file if the value satisfies the logging conditions of the block

Parameters
timeThe current date and time
shortNameThe shortened name for the instrument
runNumberThe current run number

Definition at line 358 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.logValue ( DateTime  time,
String  shortName,
String  runNumber 
)
inlineprivate

Method for calling the appropriate method for logging the value.

Parameters
timeThe current date and time
shortNameThe shortened name for the instrument
runNumberThe current run number

Definition at line 401 of file BlockInfo.cs.

static Boolean Seci.Definitions.BlockInfo.OkayToLog ( DateTime  timeNow,
DateTime  lastLogged,
Double  loggingRate,
String  currVal,
String  prevVal,
Double  tolerance,
Boolean  onAnyChange,
Boolean  onToleranceExceeded 
)
inlinestatic

Checks whether to log the block value. Note: public for the purposes of testing

Parameters
timeNowThe current time
lastLoggedLast time logged
currValThe current value
prevValThe previous value
toleranceThe tolerance
onAnyChangeLog on any changes
onToleranceExceededOnly log if change exceeds tolerance
Returns
Whether to log

Definition at line 315 of file BlockInfo.cs.

bool Seci.Definitions.BlockInfo.OutOfRange ( )
inline

Check whether the block has exceeded the run-control settings.

Returns
True indicates the value is out of range

Definition at line 553 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.SetRunControl ( Boolean  enabled)
inline

Method for enabling and disabling run-control.

Parameters
enabledEnable run-control?

Definition at line 681 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.SetRunControlLimits ( Boolean  enabled,
Double  low,
Double  high 
)
inline

Method for setting the numeric run-control limits.

Parameters
enabledEnabled run-control
lowThe lower limit for run-control
highThe upper limit for run-control

Definition at line 648 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.SetRunControlLimits ( Boolean  enabled,
String  value 
)
inline

Method for setting the run-control limit for a single non-numeric value Note: data collection will pause when the value is not matched.

Parameters
enabledEnabled run-control
valueThe run-control value

Definition at line 671 of file BlockInfo.cs.

void Seci.Definitions.BlockInfo.writeToFile ( DateTime  time,
String  shortName,
String  runNumber 
)
inlineprivate

Method for actually writing to file. The filename is of the form "ShortNameRunNumber_BlockName.txt".

Parameters
timeThe current date and time
shortNameThe shortened name for the instrument
runNumberThe current run number

Definition at line 419 of file BlockInfo.cs.

References Seci.Definitions.Status.LogAllBlocksToSingleFile, and Seci.Definitions.Status.StatusBlockName.

Member Data Documentation

String Seci.Definitions.BlockInfo._alias
private

Units.

Definition at line 23 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._applyFixedFormatting = false
private

Whether to apply formatting.

Definition at line 44 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._applyScientificFormatting = true
private

Is it in range?

Definition at line 43 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._blockEnabled
private

How many decimal points to show (deprecated)

Definition at line 48 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._blockName
private

Definition at line 21 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._blockUnits
private

Name of block.

Definition at line 22 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._currentValue
private

Log the data to a files that contains data from other blocks.

Definition at line 56 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._goButton
private

Control that is written to.

Definition at line 34 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._group = "None"
private

The component to which this block belongs.

Definition at line 25 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._inRange
private

Whether the run-control settings should be saved.

Definition at line 42 of file BlockInfo.cs.

DateTime Seci.Definitions.BlockInfo._lastLogged
private

The current requested value.

Definition at line 61 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._logChangesNow
private

Rate at which block value is logged to file.

Definition at line 53 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._logChangesTolerance
private

Just log changes when they occur.

Definition at line 54 of file BlockInfo.cs.

Single Seci.Definitions.BlockInfo._loggingRate
private

Log to file?

Definition at line 52 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._logToSharedFile
private

Log changes, but only if the value exceeds the tolerance.

Definition at line 55 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._logValueToFile
private

Is the block visible?

Definition at line 51 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo._lowerLimit
private

Upper limit for run-control.

Definition at line 39 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._nexusGroup
private

NeXus name.

Definition at line 28 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._nexusName
private

The group this block belongs to.

Definition at line 27 of file BlockInfo.cs.

int Seci.Definitions.BlockInfo._numDecimalPoints = 3
private

Whether to apply formatting.

Definition at line 45 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._owningComponent
private

Alias.

Definition at line 24 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._parentVi
private

NeXus group.

Definition at line 30 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._previousLogValue
private

Last value - used to check whether value changed.

Definition at line 58 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._previousValue
private

The latest value of the block.

Definition at line 57 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._prevReadError = false
private

Marks the last time the block was logged.

Definition at line 62 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._readControl
private

VI on which it appears.

Definition at line 31 of file BlockInfo.cs.

ControlType Seci.Definitions.BlockInfo._readType
private

Control for reading current value.

Definition at line 32 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._runcontrolValue = ""
private

Lower limit for run-control.

Definition at line 40 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._saveSettings
private

Non-numeric run-control value.

Definition at line 41 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._setPointValue
private

This value represents how much a value has to change for it to be logged.

Definition at line 60 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo._tolerance
private

The last value LOGGED to file. Needed for log on change.

Definition at line 59 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._underRunControl
private

Control to wait for before returning (i.e. motion light).

Definition at line 37 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo._upperLimit
private

Under run-control?

Definition at line 38 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._valueFormatting
private

Definition at line 46 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo._visible = true
private

Is the block enabled?

Definition at line 49 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._waitForControl
private

Button to push after setting.

Definition at line 35 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo._writeControl
private

The type of the read control.

Definition at line 33 of file BlockInfo.cs.

readonly String Seci.Definitions.BlockInfo.ErrorString = "Error"
static

Only log the error if it is the first time.

Definition at line 64 of file BlockInfo.cs.

Property Documentation

String Seci.Definitions.BlockInfo.Alias
getset
Boolean Seci.Definitions.BlockInfo.ApplyFixedFormatting
getset

Definition at line 88 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.ApplyFormatting
getset

Definition at line 87 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.BlockEnabled
getset

Definition at line 85 of file BlockInfo.cs.

Referenced by Seci.Remoting.Bridge.SetBlockValue().

String Seci.Definitions.BlockInfo.BlockName
getset

Definition at line 67 of file BlockInfo.cs.

Referenced by Seci.BlockDictionary.Replace().

String Seci.Definitions.BlockInfo.BlockUnits
getset

Definition at line 68 of file BlockInfo.cs.

Referenced by SeciUserInterface.Forms.RunControlViewer.updateValues().

String Seci.Definitions.BlockInfo.CurrentValue
getset

Property for getting and setting the current value of the block. If the block is set to log changes only, then the set method has to check whether the value has changed.

Definition at line 126 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.FormattedCurrentValue
get

Property for getting the current value of the block in a formatted state.

Definition at line 163 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.FormattedSetPointValue
get

Property for getting the current value of the block in a formatted state.

Definition at line 213 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.GoButton
getset
String Seci.Definitions.BlockInfo.Group
getset

Definition at line 72 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.InRange
get

Definition at line 84 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.LogChangesOnly
getset

Definition at line 91 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.LogChangesTolerance
getset

Definition at line 92 of file BlockInfo.cs.

Single Seci.Definitions.BlockInfo.LoggingRate
getset

Definition at line 101 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.LogToSharedFile
getset

Definition at line 96 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.LogValueToFile
getset

Definition at line 94 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo.LowerLimit
getset

Definition at line 82 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.NexusGroup
getset

Definition at line 74 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.NexusName
getset

Definition at line 73 of file BlockInfo.cs.

int Seci.Definitions.BlockInfo.NumberDecimalPlaces
getset

Definition at line 90 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.OwningComponent
getset

Definition at line 71 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.ParentVI
getset
Boolean Seci.Definitions.BlockInfo.PrevReadError
getset

Definition at line 97 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.ReadControl
getset
ControlType Seci.Definitions.BlockInfo.ReadType
getset

Definition at line 99 of file BlockInfo.cs.

Referenced by Seci.Standard.DaeMonitor.createEntry().

String Seci.Definitions.BlockInfo.RunControlValue
getset

Definition at line 83 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.SaveSettings
getset

Definition at line 95 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.SetPointValue
getset

Property for getting the current setpoint value for the block. If the "write control" is not defined it returns null.

Definition at line 190 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo.Tolerance
getset

Definition at line 93 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.UnderRunControl
getset

Definition at line 80 of file BlockInfo.cs.

Double Seci.Definitions.BlockInfo.UpperLimit
getset

Definition at line 81 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.ValueFormatting
getset

Definition at line 89 of file BlockInfo.cs.

Boolean Seci.Definitions.BlockInfo.Visible
getset

Definition at line 86 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.WaitForControl
getset

Definition at line 79 of file BlockInfo.cs.

String Seci.Definitions.BlockInfo.WriteControl
getset

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