A server handles all data requests through its equipment module. More...
Public Member Functions | |
| int | addAlarmDefinition (int code, TAlarmDefinition adef) |
| Inserts an alarm definition into the alarm definition table. | |
| int | addAlarmDefinition (TAlarmDefinition adef) |
| Inserts an alarm definition into the alarm definition table. | |
| TDevice | getDevice (String devName) |
| Obtains a TDevice instance for the input device name. | |
| TDevice | getDevice (int devNumber) |
| Obtains a TDevice instance for the input device number. | |
| int | addAlarmWatchTableEntry (String deviceName, String propertyName, int dataSize, int dataFormat, int alarmSystem, int alarmSeverity, int alarmCode, int alarmCodeHigh, int alarmCodeLow, TAlarmWatchThreshold alarmWatchThreshold) |
| Inserts a property to be monitored into the local alarm server's Watch Table. | |
| int | addAlarmWatchTableEntry (String deviceName, String propertyName, int dataSize, int dataFormat, int alarmSeverity, int alarmCodeHigh, int alarmCodeLow, TAlarmWatchThreshold alarmWatchThreshold) |
| Inserts a property to be monitored into the local alarm server's Watch Table. | |
| int | addAlarmWatchTableEntry (String deviceName, String propertyName, int dataSize, int dataFormat, int alarmSeverity, int alarmCode, TAlarmWatchThreshold alarmWatchThreshold) |
| Inserts a property to be monitored into the local alarm server's Watch Table. | |
| int | addLocalHistoryRecord (int recordIndex, String device, String property, int dataSize, int dataFormat) |
| Inserts a local history element into the local history server. | |
| int | addLocalHistoryRecord (int recordIndex, String device, String property, int dataSize, int dataFormat, int arrayType, THistorySpecification histSpec) |
| Inserts a local history element into the local history server. | |
| TEquipmentModule () | |
| Principal constructor. | |
| void | setEquipmentFunction (TEquipmentFunction eqpFunction) |
| Assigns an equipment function. | |
| void | registerProperty (String prpName, TDataType dout, TDataType din, short acc, TPropertyDescription prpDesc, int prpId) |
| Registers a property without a handler. | |
| void | registerProperty (TExportProperty prp, TPropertyHandler handler) |
| Registers a property and assigns a handler. | |
| void | registerDevices (Collection< String[]> deviceCollection) |
| Adds a collection of device names to the module's device list. | |
| void | registerDevice (TDevice device) |
| Adds a device to the module's device list. | |
| int | registerDeviceName (String devName) |
| Adds a device name to the module's device list. | |
| LinkedList< String > | getPropertyNames () |
| Returns all property names in a linked list. | |
| LinkedList< String > | getDeviceNames () |
| Returns all device names in a linked list. | |
| boolean | hasStockProperty (String propertyName) |
| Returns true if this equipment module has registered a stock property of a given name. | |
| short | callStockProperty (String propertyName, String devName, TDataType dout, TDataType din, TAccess devAccess) |
| Calls a stock property handler. | |
| short | callProperty (String propertyName, String devName, TDataType dout, TDataType din, TAccess devAccess) |
| Finds a property and calls the property handler. | |
| int | scheduleProperty (String devPropertyList) |
| An equipment module can schedule a property or set of properties for immediate execution and delivery. | |
| int | resetMultiChannelProperty (String devPropertyList) |
| Sends (schedules) a 'reset_mca_property' signal to any listening client. | |
| int | registerCycleTrigger (TCycleTrigger trigger) |
| Registers a cycle trigger callback dispatch function. | |
| void | setCycleNumberKey (String key) |
| Sets the trigger cycler key to the value given. | |
| String | getCycleNumberKey () |
| Gets the trigger cycler key. | |
| int | unregisterCycleTrigger (TCycleTrigger trigger) |
| Unregisters a previously registered cycle trigger callback dispatch function. | |
| void | setStateChangeTrigger (TStateChangeTrigger stateChangeTrigger) |
| Establishes a state-change trigger callback for this equipment module. | |
| void | setStateChangeTrigger (TStateChangeTrigger stateChangeTrigger, String stateChangeKey) |
| Establishes a state-change trigger callback for this equipment module. | |
A server handles all data requests through its equipment module.
An exported device server refers to one and only one equipment module. The equipment module will have a property list and a device list associated with it.
| de.desy.tine.server.equipment.TEquipmentModule.TEquipmentModule | ( | ) |
Principal constructor.
Use this constructor in most cases. This will attempt to determine a suitable local name for the equipment module.
| int de.desy.tine.server.equipment.TEquipmentModule.addAlarmDefinition | ( | int | code, |
| TAlarmDefinition | adef | ||
| ) |
Inserts an alarm definition into the alarm definition table.
As an alternative to the <local name>="">-alarms.csv configuration file, the front end server can make use of this API call in order to fill in the alarm definition table describing locally generated alarms. This is particularly useful for embedded platforms where there is no file system, or where a TINE server is used as a translation layer and needs to map a given alarm system onto the TINE alarm system.
| code | is a specific alarm code to apply the alarm definition to. (Use the method without this parameter to simply apply the code registered in the TAlarmDefinition instance.) |
| adef | is an instance of an Alarm Definition Structure (ADS) containing the alarm table information which is to be appended to the alarm definition table |
| int de.desy.tine.server.equipment.TEquipmentModule.addAlarmDefinition | ( | TAlarmDefinition | adef | ) |
Inserts an alarm definition into the alarm definition table.
As an alternative to the <local name>="">-alarms.csv configuration file, the front end server can make use of this API call in order to fill in the alarm definition table describing locally generated alarms. This is particularly useful for embedded platforms where there is no file system, or where a TINE server is used as a translation layer and needs to map a given alarm system onto the TINE alarm system.
| adef | is an instance of an Alarm Definition Structure (ADS) containing the alarm table information which is to be appended to the alarm definition table |
| int de.desy.tine.server.equipment.TEquipmentModule.addAlarmWatchTableEntry | ( | String | deviceName, |
| String | propertyName, | ||
| int | dataSize, | ||
| int | dataFormat, | ||
| int | alarmSystem, | ||
| int | alarmSeverity, | ||
| int | alarmCode, | ||
| int | alarmCodeHigh, | ||
| int | alarmCodeLow, | ||
| TAlarmWatchThreshold | alarmWatchThreshold | ||
| ) |
Inserts a property to be monitored into the local alarm server's Watch Table.
Certain alarms are to be set whenever the value of a property exceeds a definable threshold. Such alarms can be managed automatically by the local alarm server if the alarm criteria are entered into the alarm watch table. This can be achieved by calling this routine (or supplying a startup configuration file almwatch.csv).
| deviceName | is the device name associated with the property to be called by the local alarm server. |
| propertyName | is the property which is to be called by the local alarm server. |
| dataSize | is the data array size to be called by the local alarm server. |
| dataFormat | is the TINE data format to be called by the local alarm server |
| alarmSystem | is the alarm system identifier to be associated with the alarm. The value of '0' signals the Central Alarm Server to apply the designated alarm system code for the server in question. |
| alarmSeverity | is the severity of the alarm issued when the data returned by the call exceed the given thresholds. |
| alarmCode | is the designated alarm code to apply to any alarm condition. Pass a '0' to distinguish between the alarmCodeHigh and alarmCodeLow conditions (next 2 parameters). |
| alarmCodeHigh | is the alarm code to apply when the high threshold value is exceeded by the readback data. (parameter alarmCode must be '0'). If both alarmCode and alarmCodeHigh are '0', then the code TErrorList.value_too_high (or TErrorList.warn_too_high) is applied. |
| alarmCodeLow | is the alarm code to apply when the low threshold value is exceeded by the readback data. (parameter alarmCode must be '0'). If both alarmCode and alarmCodeLow are '0', then the code TErrorList.value_too_low (or TErrorList.warn_too_low) is applied. |
| alarmWatchThreshold | is an intance of a TAlarmWatchThreshold which defines the threshold conditions for applying an alarm. |
| int de.desy.tine.server.equipment.TEquipmentModule.addAlarmWatchTableEntry | ( | String | deviceName, |
| String | propertyName, | ||
| int | dataSize, | ||
| int | dataFormat, | ||
| int | alarmSeverity, | ||
| int | alarmCodeHigh, | ||
| int | alarmCodeLow, | ||
| TAlarmWatchThreshold | alarmWatchThreshold | ||
| ) |
Inserts a property to be monitored into the local alarm server's Watch Table.
Certain alarms are to be set whenever the value of a property exceeds a definable threshold. Such alarms can be managed automatically by the local alarm server if the alarm criteria are entered into the alarm watch table. This can be achieved by calling this routine (or supplying a startup configuration file almwatch.csv).
| deviceName | is the device name associated with the property to be called by the local alarm server. |
| propertyName | is the property which is to be called by the local alarm server. |
| dataSize | is the data array size to be called by the local alarm server. |
| dataFormat | is the TINE data format to be called by the local alarm server |
| alarmSeverity | is the severity of the alarm issued when the data returned by the call exceed the given thresholds. |
| alarmCodeHigh | is the alarm code to apply when the high threshold value is exceeded by the readback data. If alarmCodeHigh is '0', then the code TErrorList.value_too_high (or TErrorList.warn_too_high) is applied. |
| alarmCodeLow | is the alarm code to apply when the low threshold value is exceeded by the readback data. If alarmCodeLow is '0', then the code TErrorList.value_too_low (or TErrorList.warn_too_low) is applied. |
| alarmWatchThreshold | is an intance of a TAlarmWatchThreshold which defines the threshold conditions for applying an alarm. |
| int de.desy.tine.server.equipment.TEquipmentModule.addAlarmWatchTableEntry | ( | String | deviceName, |
| String | propertyName, | ||
| int | dataSize, | ||
| int | dataFormat, | ||
| int | alarmSeverity, | ||
| int | alarmCode, | ||
| TAlarmWatchThreshold | alarmWatchThreshold | ||
| ) |
Inserts a property to be monitored into the local alarm server's Watch Table.
Certain alarms are to be set whenever the value of a property exceeds a definable threshold. Such alarms can be managed automatically by the local alarm server if the alarm criteria are entered into the alarm watch table. This can be achieved by calling this routine (or supplying a startup configuration file almwatch.csv).
| deviceName | is the device name associated with the property to be called by the local alarm server. |
| propertyName | is the property which is to be called by the local alarm server. |
| dataSize | is the data array size to be called by the local alarm server. |
| dataFormat | is the TINE data format to be called by the local alarm server |
| alarmSeverity | is the severity of the alarm issued when the data returned by the call exceed the given thresholds. |
| alarmCode | is the designated alarm code to apply to any alarm condition. Pass a '0' to distinguish between the alarmCodeHigh and alarmCodeLow conditions (next 2 parameters). |
| alarmWatchThreshold | is an intance of a TAlarmWatchThreshold which defines the threshold conditions for applying an alarm. |
| int de.desy.tine.server.equipment.TEquipmentModule.addLocalHistoryRecord | ( | int | recordIndex, |
| String | device, | ||
| String | property, | ||
| int | dataSize, | ||
| int | dataFormat | ||
| ) |
Inserts a local history element into the local history server.
A server can instruct the local history server to keep a history of the given property by utilizing this call. The local history server will periodically call the property as specified according to the following input parameters.
| recordIndex | is the local history index to be identified with this local history element (Note: this must be unique with this server process and within the history data repository). |
| device | is the device name to be associated with the property name supplied as the second parameter. |
| property | is the requested property for which a history is to be kept |
| dataSize | is the length of the local history call. |
| dataFormat | is the TINE format of the local history call. |
| int de.desy.tine.server.equipment.TEquipmentModule.addLocalHistoryRecord | ( | int | recordIndex, |
| String | device, | ||
| String | property, | ||
| int | dataSize, | ||
| int | dataFormat, | ||
| int | arrayType, | ||
| THistorySpecification | histSpec | ||
| ) |
Inserts a local history element into the local history server.
A server can instruct the local history server to keep a history of the given property by utilizing this call. The local history server will periodically call the property as specified according to the following input parameters.
| recordIndex | is the local history index to be identified with this local history element (Note: this must be unique with this server process and within the history data repository). |
| device | is the device name to be associated with the property name supplied as the second parameter. |
| property | is the requested property for which a history is to be kept |
| dataSize | is the length of the local history call. |
| dataFormat | is the TINE format of the local history call. |
| arrayType | is the input property's array type. Passing a value of '0' (AT_UNKNOWN) will instruct the subsystem to determine the property's array type from the property registry. |
| histSpec | is an instance of t THistorySpecification object which instructs the local history subsystem how to maintain the local history information (e.g. short and long term storage depths, filtering conditions, polling and archive intervals). |
| short de.desy.tine.server.equipment.TEquipmentModule.callProperty | ( | String | propertyName, |
| String | devName, | ||
| TDataType | dout, | ||
| TDataType | din, | ||
| TAccess | devAccess | ||
| ) |
Finds a property and calls the property handler.
If no property handler is installed, the equipment function is called instead.
| propertyName | |
| devName | |
| dout | |
| din | |
| devAccess |
| short de.desy.tine.server.equipment.TEquipmentModule.callStockProperty | ( | String | propertyName, |
| String | devName, | ||
| TDataType | dout, | ||
| TDataType | din, | ||
| TAccess | devAccess | ||
| ) |
Calls a stock property handler.
| propertyName | |
| devName | |
| dout | |
| din | |
| devAccess |
| String de.desy.tine.server.equipment.TEquipmentModule.getCycleNumberKey | ( | ) |
Gets the trigger cycler key.
By default a CYCLER is a server called "CYCLER" in the same context as the initializing device server and produces a keyword (property) called "CycleNumber". This gives rise to the Cycle Key: "/\<context\>/CYCLER/CycleNumber". This default value can also be set via the environment (set TINE_CYCLE_KEY) or via API.
| TDevice de.desy.tine.server.equipment.TEquipmentModule.getDevice | ( | String | devName | ) |
Obtains a TDevice instance for the input device name.
| devName | is the device name for which the TDevice instance is desired |
| TDevice de.desy.tine.server.equipment.TEquipmentModule.getDevice | ( | int | devNumber | ) |
Obtains a TDevice instance for the input device number.
| devNumber | is the device number for which the TDevice instance is desired |
| LinkedList<String> de.desy.tine.server.equipment.TEquipmentModule.getDeviceNames | ( | ) |
Returns all device names in a linked list.
| LinkedList<String> de.desy.tine.server.equipment.TEquipmentModule.getPropertyNames | ( | ) |
Returns all property names in a linked list.
| boolean de.desy.tine.server.equipment.TEquipmentModule.hasStockProperty | ( | String | propertyName | ) |
Returns true if this equipment module has registered a stock property of a given name.
| propertyName |
| int de.desy.tine.server.equipment.TEquipmentModule.registerCycleTrigger | ( | TCycleTrigger | trigger | ) |
Registers a cycle trigger callback dispatch function.
If a CYCLER is running in a server's context, then the server will receive 'Cycle Number' events scheduled by the designated CYCLER server. The cycle number will make use of the 'System Data Stamp' to tag all data sets obtained from the server. A server can also register a trigger function dispatch routine (or routines) to be called when a 'Cycle Number' event occurs. The dispatch routines will be called prior to setting the 'System Stamp' to the new Cycle Number, which will be set following the execution of all dispatch routines. Optionally, the server can provide a property (or list of properties) to be scheduled following the dispatch execution. This will ensure that such properties will be called immediately following dispatch execution AND contain the most recent Cycle Number as the 'System Data Stamp'.
| trigger | is a reference to the dispatch handler to be called when a new cycle number arrives. |
Example:
class MyCycleTrigger implements TCycleTrigger { long ts = 0; public void update(int cycleNumber, int status) { long tts = System.currentTimeMillis(); if (ts == tts) { // 2 updates within the same millisecond ? (are there 2 CYCLERs?) return; } ts = tts; DbgLog.log("update","received cycle number : "+cycleNumber+" <"+status+">"); // do something useful? (maybe hardware IO) } } private void initializeDeviceServer() { sineEqpModule = new SineEquipmentModule("SINEQM",(SineDevice[])sineDeviceSet.toArray(new SineDevice[0])); sineEqpModule.registerCycleTrigger(new MyCycleTrigger()); // can alternatively be registered directly with the equipment module factory (e.g.): // TEquipmentModuleFactory.getInstance().registerCycleTrigger(new MyCycleTrigger()); // Other iniatialization stuff omitted ... // ... }
| void de.desy.tine.server.equipment.TEquipmentModule.registerDevice | ( | TDevice | device | ) |
Adds a device to the module's device list.
| device | is the TDevice instance to register |
| int de.desy.tine.server.equipment.TEquipmentModule.registerDeviceName | ( | String | devName | ) |
Adds a device name to the module's device list.
This method also creates a TDevice instance for the device name in question, which can be retrieved via a call to getDevice().
| devName | is the device name to be assigned |
| void de.desy.tine.server.equipment.TEquipmentModule.registerProperty | ( | String | prpName, |
| TDataType | dout, | ||
| TDataType | din, | ||
| short | acc, | ||
| TPropertyDescription | prpDesc, | ||
| int | prpId | ||
| ) |
Registers a property without a handler.
This property has to be handled by the equipment function.
| prpName | is the property name |
| dout | Provides output format specification |
| din | Provides input format specification |
| acc | Access information |
| prpDesc | Property description, parsed into a string description of the property as well as range values and units. |
| prpId | an assigned Property ID |
| void de.desy.tine.server.equipment.TEquipmentModule.registerProperty | ( | TExportProperty | prp, |
| TPropertyHandler | handler | ||
| ) |
Registers a property and assigns a handler.
| prp | is the TExportProperty instance to be registered |
| handler | is the designated property dispatch handler |
| int de.desy.tine.server.equipment.TEquipmentModule.resetMultiChannelProperty | ( | String | devPropertyList | ) |
Sends (schedules) a 'reset_mca_property' signal to any listening client.
A server with registered multi-channel array properties can inform any attached clients that the mutli-channel array configuration has changed (e.g. array elements have been added, removed, or otherwise edited) by using this call. Any listening clients with multi-channel array links will then return to the original client startup conditions and 're-learn' the new array indexing now in place.
| devPropertyList | is (comma separated) list of properties which are to be reset at the client side. |
| int de.desy.tine.server.equipment.TEquipmentModule.scheduleProperty | ( | String | devPropertyList | ) |
An equipment module can schedule a property or set of properties for immediate execution and delivery.
| devPropertyList | A single string argument containing one or more properties to be scheduled for immediate execution. This should be a single string. If more than one property is to be scheduled, then the property list string should be a set of properties separated by commas or blanks |
| void de.desy.tine.server.equipment.TEquipmentModule.setCycleNumberKey | ( | String | key | ) |
Sets the trigger cycler key to the value given.
By default a CYCLER is a server called "CYCLER" in the same context as the initializing device server and produces a keyword (property) called "CycleNumber". This gives rise to the Cycle Key: "/\<context\>/CYCLER/CycleNumber". If it is known a priori, that the CYCLER exists in another context or uses another server name or property name, the cycle key can be set via this API call or via environment (set TINE_CYCLE_KEY=<key>).
| key | is the desired CYCLER trigger key |
| void de.desy.tine.server.equipment.TEquipmentModule.setEquipmentFunction | ( | TEquipmentFunction | eqpFunction | ) |
Assigns an equipment function.
| eqpFunction |
| void de.desy.tine.server.equipment.TEquipmentModule.setStateChangeTrigger | ( | TStateChangeTrigger | stateChangeTrigger | ) |
Establishes a state-change trigger callback for this equipment module.
If a GLOBLAS server is running and providing state information, then any detected state change will be passed to the callback function provided. The callback must implement the TStateChangeTrigger class. It will receive both the current state and previous state (as Strings).
| stateChangeTrigger | is a reference to the callback instance. |
| void de.desy.tine.server.equipment.TEquipmentModule.setStateChangeTrigger | ( | TStateChangeTrigger | stateChangeTrigger, |
| String | stateChangeKey | ||
| ) |
Establishes a state-change trigger callback for this equipment module.
If a GLOBLAS server is running and providing state information, then any detected state change will be passed to the callback function provided. The callback must implement the TStateChangeTrigger class. It will receive both the current state and previous state (as Strings).
| stateChangeTrigger | is a reference to the callback instance. |
| stateChangeKey | is the GLOBALS keyword providing the declared state for the context associated with this equipment module. If 'null' then the default keyword "DeclaredState" is assumed. |
| int de.desy.tine.server.equipment.TEquipmentModule.unregisterCycleTrigger | ( | TCycleTrigger | trigger | ) |
Unregisters a previously registered cycle trigger callback dispatch function.
If a cycle trigger event dispatch routine is no longer required, it can be unregistered using this routine.
| trigger | is a reference to the dispatch handler to be removed |
1.7.4