Changes between Version 1 and Version 2 of Ticket #592, comment 20


Ignore:
Timestamp:
May 14, 2014, 3:37:42 PM (11 years ago)
Author:
olle

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #592, comment 20

    v1 v2  
    33 1. Alarm numbering. Currently, when numbering of alarms have been needed, the numbers have been generated locally from an alarm list. It might be advantageous to have a unique number associated with each alarm, so data access object class/file `LabSensorAlarmConfig.java` in `src/net/sf/basedb/labenv/dao/` should be updated with a private instance variable `int no` with public accessor methods. To ensure that the numbers are unique and consecutive, they will not be set in the configuration file, but be assigned by class/file `LabEnvironmentConfiguraton.java` in `src/net/sf/basedb/labenv/` when parsing alarm entries in the configuration file in private method `List<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)`. Only an alarm entry with some non-null value will result in an alarm item, and get a number. Java servlet `LabEnvironmentServlet.java` in `src/net/sf/basedb/labenv/servlet/` will be updated in private method `JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc)` to include the number in the JSON object for the alarm in the JSON array. JSP file `labenvironmentalarms.jsp` in `resources/reports/` will be updated to use the intrinsic alarm numbers instead of locally generated ones.
    44 2. User entry for an alarm. Currently, it only consists of a user log-in id string. It should be updated to allow more attributes, starting with an email address string. The `labenv-config.xml` configuration file will be updated by making the "user" tag a block, that can contain other tags, starting with an "id" tag (the former contents of the "user" tag) and an "emailaddress" tag. A new data access object class/file `LabSensorAlarmUserConfig.java` in `src/net/sf/basedb/labenv/dao/` will be added to store the user entries for an alarm. Class/file `LabEnvironmentConfiguraton.java` in `src/net/sf/basedb/labenv/` will be updated when parsing alarm entries in the configuration file in private method `List<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns)` to call new private method `List<LabSensorAlarmUserConfig> fetchLabSensorAlarmUserList(Element alarmTag, Namespace ns)` to obtain the user list.
     5 3. Alarm when contact with a lab environment sensor is lost. When `null` values are obtained from a lab environment sensor, all configured alarms for that sensor should report the error, since there is no guarantee that the lab environment values lie within the configured limits. Class/file `LabEnvironment.java` in `src/net/sf/basedb/labenv/` should be updated in private method `measureAndStoreLabEnvironmentData(LabSensorUtil labSensorUtil, LabSensorConfig labSensorConfig, Date measurementTime)` to call `checkAlarms(...)` after every finished cycle of obtaining data for averaging, and public method `checkAlarms(...)` to have temperature and humidity arguments of type `Double` instead of `double`, and to report an alarm if any of the values is `null`.