Opened 6 years ago

Closed 6 years ago

#592 closed enhancement (fixed)

Lab environment extension improved report routines

Reported by: olle Owned by: olle
Priority: major Milestone: LabEnv v1.1
Component: net.sf.basedb.labenv Keywords:
Cc:

Description

The lab environment extension should have improved report routines, specifically it should be possible to display a graph of temperature and humidity data for one or more labs for a time interval spanning at least a day.

Change History (47)

comment:1 Changed 6 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 6 years ago by olle

Traceability note:

  • The lab environment extension was introduced in Ticket #529 (Retrieve and store temperature and humidity measurements).
  • Reggie ticket #530 (Display logs from temperature and humidity measurements) is concerned with retrieving data from the lab environment data base for specific dates of interest for the sample preparation and sequencing.
Last edited 6 years ago by olle (previous) (diff)

comment:3 Changed 6 years ago by olle

(In [2360]) Refs #592. Outermost Ant build file build.xml and file extensions.xml in META-INF updated by setting version to 1.1-dev.

comment:4 Changed 6 years ago by olle

Proposed improvements of filters for selecting data:

The LabEnv extension version 1.0 included daily and weekly distribution reports. In order for the statistical data to be relevant for different kinds of lab work, you want control over whether time periods when the climate control is shut down should be included. The climate control is normally shut down during the following periods:

  1. During the night (before and after working hours, 18:00-06:00).
  2. During weekends, Saturdays and Sundays.
  3. During work-free holidays occurring on weekdays, including Midsummer's Eve, Christmas Eve, and New Year's Eve.

Currently the daily distribution report includes an optional weekday filter, for including all weekdays, Monday-Friday, or Saturday-Sunday.

Improvements of the daily and weekly distribution reports:

  • The weekday filter should be extended with options for workdays and non-workdays, and should be available also for the weekly distribution report.
  • The weekly distribution report should be extended with the possibility of entering what day-time period should be included when selecting data for the report.
  • Selected weekday and daytime filters should be indicated in either the header title or chart title of the plot.
Last edited 6 years ago by olle (previous) (diff)

comment:5 Changed 6 years ago by olle

Design description of weekday and daytime filter enhancements:

JSP file labenvironmentdatabasestatistics.jsp in resources/reports/ update:

  • HTML section updated with input fields for daytime filter start and end times. Weekday filter updated with options for workdays and non-workdays. Option "Workdays" made new default choice.
  • Function gotoStep2() updated to show the daytime filter input fields for the weekly distribution, and the weekday filter menu for both the daily and weekly distribution.
  • Function goCreate() updated to send data to the servlet for the daytime filter input fields for the weekly distribution, and the weekday filter menu for both the daily and weekly distribution.

Class/file LabEnvironmentStatisticsServlet.java in src/net/sf/basedb/labenv/servlet/ update:

  • New static constants defined for workday and non-workday options in weekday filter, and new DateFormat items for common date expressions.
  • New HashMap<String, Boolean> item for cashing workday indication results.
  • Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated with new daytime filter and improved weekday filter.
  • Private method List<LabEnvironmentData> applyWeekdayFilter(String weekdayFilter, List<LabEnvironmentData> lthdRawList) updated with workday and non-workday filter.
  • New public method Boolean dayIsWorkday(Date date, String countryCode) added to return if a date is a workday.
  • New public method Date easterSundayDateGregorianCalendar(int year) added to return the Easter Sunday date for a specific year.
  • New private method List<LabEnvironmentData> applyDaytimeFilter(String filterFromTime, String filterToTime, List<LabEnvironmentData> lthdRawList) added. It returns a pruned list of LabEnvironmentData objects after applying a daytime filter.
  • New private convenience method Date addDays(Date date, int daysToAdd) added. It returns a date after adding a specified number of days.
  • Private method JSONArray createLabEnvironmentDailyDistributionReport(...) updated with new arguments String daytimeFilterFromTime and String daytimeFilterToTime.
  • Private method JSONObject createJsonPlot(...) updated with new arguments String daytimeFilterFromTime and String daytimeFilterToTime.
  • Private method String fetchChartHeaderTitle(...) updated with new argument String weekdayFilter.
  • Private method String fetchChartTitle(...) updated by exchanging argument String weekdayFilter for new arguments String daytimeFilterFromTime and String daytimeFilterToTime.

comment:6 Changed 6 years ago by olle

(In [2395]) Refs #592. LabEnv extension updated with weekday and daytime filter enhancements:

JSP file labenvironmentdatabasestatistics.jsp in resources/reports/ update:

  • HTML section updated with input fields for daytime filter start and end times. Weekday filter updated with options for workdays and non-workdays. Option "Workdays" made new default choice.
  • Function gotoStep2() updated to show the daytime filter input fields for the weekly distribution, and the weekday filter menu for both the daily and weekly distribution.
  • Function goCreate() updated to send data to the servlet for the daytime filter input fields for the weekly distribution, and the weekday filter menu for both the daily and weekly distribution.

Class/file LabEnvironmentStatisticsServlet.java in src/net/sf/basedb/labenv/servlet/ update:

  • New static constants defined for workday and non-workday options in weekday filter, and new DateFormat items for common date expressions.
  • New HashMap<String, Boolean> item for cashing workday indication results.
  • Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated with new daytime filter and improved weekday filter.
  • Private method List<LabEnvironmentData> applyWeekdayFilter(String weekdayFilter, List<LabEnvironmentData> lthdRawList) updated with workday and non-workday filter.
  • New public method Boolean dayIsWorkday(Date date, String countryCode) added to return if a date is a workday.
  • New public method Date easterSundayDateGregorianCalendar(int year) added to return the Easter Sunday date for a specific year.
  • New private method List<LabEnvironmentData> applyDaytimeFilter(String filterFromTime, String filterToTime, List<LabEnvironmentData> lthdRawList) added. It returns a pruned list of LabEnvironmentData objects after applying a daytime filter.
  • New private convenience method Date addDays(Date date, int daysToAdd) added. It returns a date after adding a specified number of days.
  • Private method JSONArray createLabEnvironmentDailyDistributionReport(...) updated with new arguments String daytimeFilterFromTime and String daytimeFilterToTime.
  • Private method JSONObject createJsonPlot(...) updated with new arguments String daytimeFilterFromTime and String daytimeFilterToTime.
  • Private method String fetchChartHeaderTitle(...) updated with new argument String weekdayFilter.
  • Private method String fetchChartTitle(...) updated by exchanging argument String weekdayFilter for new arguments String daytimeFilterFromTime and String daytimeFilterToTime.

comment:7 Changed 6 years ago by olle

Design discussion for displaying graphs of lab environment data over a time interval:

Initially, three graph alternatives should be included for displaying values over time:

  1. Daily display, where graphs show values over time for a specific date.
  2. Weekly display, where graphs show values over time for a 7-day period with a specific start date.
  3. Overview display, where graphs show min, mean, and max values for each day for a chosen period (optionally the full time period stored in the database).

Since the climate control is only active during part of the day, for the Overview display to be useful, it should be possible to select data from a specific time period during the day.

Options for the three display alternatives:

Option Description Available for alternative(s)
Date Start date for graph All
Chart data Sensor to show data for, or all sensors All
Daytime filter Start and end times for day time period to be displayed. If start time > end time, data from the two periods (Midnight - end time) and (start time - Next Midnight) for each day are used. Overview display only.

Time markers will be drawn on the bottom part of the diagram, connected to vertical dotted guide lines. Time markers for the three display alternatives:

Display alternative Time markers
Daily display Hourly markers 00 - 24.
Weekly display Day markers consisting of the date in YYYYMMDD format, followed by an underscore character "_" and a three-letter abbreviation of the day of week, e.g. "20140430_Wed" for Wednesday 2014-04-30.
Overview display Day markers consisting of the date in YYYYMMDD format. How many day markers are drawn, depends on the size of the time period, in order not to clog the diagram. For a number of days < 30, all day markers are drawn; for 31 - 149 days markers for dates "01", "05", "10", "15", "20", and "25" are drawn; for 150 - 299 days markers for dates "01", "10", and "20" are drawn; and for > 300 days markers for date "01" are drawn.

Other properties of the graphs:

  • The display graphs will contain much statistical information shown in the distribution box plots, i.e. mean value, standard deviation, and range will be displayed at the top left corner, while the 25%, 50%, and 75% percentile values will be displayed on the right part of the diagram, connected to horizontal guide lines.
  • Only data values from consecutive data points should be connected with lines. To determine if some data points are missing, the display program needs to know the configured time interval between storage of two consecutive data points. Two data points should be considered consecutive, if the time between them doesn't exceed the configured time interval times a factor of size about 1.5. The latter will allow data points before and after an extension restart to still be considered consecutive, while a larger time interval will indicate missing data points.
Last edited 6 years ago by olle (previous) (diff)

comment:8 Changed 6 years ago by olle

Design of implementation for displaying graphs of lab environment data over a time interval:

  1. New JSP file labenvironmentdatabasedisplay.jsp in resources/reports/ added. It is based on labenvironmentdatabasestatistics.jsp, but with fewer options. It has new functions getStorageIntervalInSeconds() and getLabEnvDatabaseConfig() to obtain storage interval in seconds, needed to identify missing data points. Function goCreate() makes an Ajax call to new servlet LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ to obtain a JSON Object with plot data.
  2. New class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ added. It is based on LabEnvironmentStatisticsServlet.java, but with new private methods
    a. List<LabEnvironmentDayData> createOverviewSelection(List<LabEnvironmentData> lthdRawList),
    b. JSONArray createLabEnvironmentOverviewReport(JSONArray jsonStatisticsPlotArray, List<LabEnvironmentData> lthdList, Data startDate, Date endDate, String chartVariant, String viewType, String sensorName, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime),
    c. JSONObject createJsonOverviewPlot(String chartVariant, List<LabEnvironmentData> lthdList, Date startDate, Date endDate, String viewType, String chartSite, String variableType, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime),
    d. JSONObject createJSONPlotDisplay(String chartVariant, String headerTitle, String title, String variableTitle, HashMap<String,List<Float>> periodStringFloatListHashMap, String viewType, Date startDate),
    e. List<Float> singleFloatList(List<LabEnvironmentData> lthdList, String variableType), and
    f. int numMarkers(Date startDate, Date endDate).
    New inner private class LabEnvironmentDayData added, for use with overview display.
  3. Class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) by accepting new command "GetLabEnvDatabaseConfig", that returns JSON object created by new private method JSONObject createLabEnvDatabaseConfig(JSONObject json).
  4. Class/file ReportTableUtil.java in src/net/sf/basedb/labenv/util/ updated in public method String getCurrentPeriod(Date currentDateTime, String viewType) with support for view types "dailyDisplay", "weeklyDisplay", and "overviewDisplay". New DateFormat instance variables yearMonthDayPeriodDateFormat and hourMinutePeriodDateFormat added, as well as public convenience method String getDayOfWeekString(Date date, boolean addNumberPrefix).
  5. JavaScript file boxplot.js in resources/reports/ updated with new functions:
    a. createGraphPlot(boxPlotJsonObject, canvas, draw_area_wdt, draw_area_hgt, draw_scale_factor, viewType, storageIntervalInSeconds)
    b. calculateMinDataValueSimple(boxPlotJsonObject) (for variable v3)
    c. calculateMaxDataValueSimple(boxPlotJsonObject) (for variable v3)
    d. calculateMinDataValueSimple2(boxPlotJsonObject) (for variable v1)
    e. calculateMaxDataValueSimple2(boxPlotJsonObject) (for variable v3, calls c.)
    f. drawGraphPlotLineSegment(x1, y1, x2, y2, x_min, x_max, y_min, y_max, min_off, max_off, x_pad, context, xoff, yoff, wdt, hgt, draw_scale_factor, linewidth)
    g. drawGraphPlotDataPoint(x, y, x_min, x_max, y_min, y_max, min_off, max_off, x_pad, context, xoff, yoff, wdt, hgt, draw_scale_factor)
    h. drawGraphPlotBoxScaleMarkerXBottom(markerNum, markerNumTot, value, font_size, x_pad, context, xoff, yoff, wdt, hgt)
    i. drawDottedLineX(value, min, max, min_off, max_off, context, xoff, yoff, wdt, hgt)
    j. drawDottedLineVertical(x, y1, y2, context, xoff, yoff, wdt, hgt)
    k. drawPoint(x, y, context, xoff, yoff, wdt, hgt)
  6. XML file servlets.xml in META-INF updated with entry for new LabEnvironmentDisplay servlet.
  7. XML file extensions.xml in META-INF updated with new entry for "Lab environment database display" coupled to JSP file labenvironmentdatabasedisplay.jsp in resources/reports/.
  8. New image file chart_curve.png in resources/images/ added. It is used for new menu item "Lab environment database display".

comment:9 Changed 6 years ago by olle

(In [2401]) Refs #592. Lab environment extension updated for displaying graphs of lab environment data over a time interval:

  1. New JSP file labenvironmentdatabasedisplay.jsp in resources/reports/ added. It is based on labenvironmentdatabasestatistics.jsp, but with fewer options. It has new functions getStorageIntervalInSeconds() and getLabEnvDatabaseConfig() to obtain storage interval in seconds, needed to identify missing data points. Function goCreate() makes an Ajax call to new servlet LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ to obtain a JSON Object with plot data.
  2. New class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ added. It is based on LabEnvironmentStatisticsServlet.java, but with new private methods
    a. List<LabEnvironmentDayData> createOverviewSelection(List<LabEnvironmentData> lthdRawList),
    b. JSONArray createLabEnvironmentOverviewReport(JSONArray jsonStatisticsPlotArray, List<LabEnvironmentData> lthdList, Data startDate, Date endDate, String chartVariant, String viewType, String sensorName, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime),
    c. JSONObject createJsonOverviewPlot(String chartVariant, List<LabEnvironmentData> lthdList, Date startDate, Date endDate, String viewType, String chartSite, String variableType, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime),
    d. JSONObject createJSONPlotDisplay(String chartVariant, String headerTitle, String title, String variableTitle, HashMap<String,List<Float>> periodStringFloatListHashMap, String viewType, Date startDate),
    e. List<Float> singleFloatList(List<LabEnvironmentData> lthdList, String variableType), and
    f. int numMarkers(Date startDate, Date endDate).
    New inner private class LabEnvironmentDayData added, for use with overview display.
  3. Class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) by accepting new command "GetLabEnvDatabaseConfig", that returns JSON object created by new private method JSONObject createLabEnvDatabaseConfig(JSONObject json).
  4. Class/file ReportTableUtil.java in src/net/sf/basedb/labenv/util/ updated in public method String getCurrentPeriod(Date currentDateTime, String viewType) with support for view types "dailyDisplay", "weeklyDisplay", and "overviewDisplay". New DateFormat instance variables yearMonthDayPeriodDateFormat and hourMinutePeriodDateFormat added, as well as public convenience method String getDayOfWeekString(Date date, boolean addNumberPrefix).
  5. JavaScript file boxplot.js in resources/reports/ updated with new functions:
    a. createGraphPlot(boxPlotJsonObject, canvas, draw_area_wdt, draw_area_hgt, draw_scale_factor, viewType, storageIntervalInSeconds)
    b. calculateMinDataValueSimple(boxPlotJsonObject) (for variable v3)
    c. calculateMaxDataValueSimple(boxPlotJsonObject) (for variable v3)
    d. calculateMinDataValueSimple2(boxPlotJsonObject) (for variable v1)
    e. calculateMaxDataValueSimple2(boxPlotJsonObject) (for variable v3, calls c.)
    f. drawGraphPlotLineSegment(x1, y1, x2, y2, x_min, x_max, y_min, y_max, min_off, max_off, x_pad, context, xoff, yoff, wdt, hgt, draw_scale_factor, linewidth)
    g. drawGraphPlotDataPoint(x, y, x_min, x_max, y_min, y_max, min_off, max_off, x_pad, context, xoff, yoff, wdt, hgt, draw_scale_factor)
    h. drawGraphPlotBoxScaleMarkerXBottom(markerNum, markerNumTot, value, font_size, x_pad, context, xoff, yoff, wdt, hgt)
    i. drawDottedLineX(value, min, max, min_off, max_off, context, xoff, yoff, wdt, hgt)
    j. drawDottedLineVertical(x, y1, y2, context, xoff, yoff, wdt, hgt)
    k. drawPoint(x, y, context, xoff, yoff, wdt, hgt)
  6. XML file servlets.xml in META-INF updated with entry for new LabEnvironmentDisplay servlet.
  7. XML file extensions.xml in META-INF updated with new entry for "Lab environment database display" coupled to JSP file labenvironmentdatabasedisplay.jsp in resources/reports/.
  8. New image file chart_curve.png in resources/images/ added. It is used for new menu item "Lab environment database display".

comment:10 Changed 6 years ago by olle

(In [2402]) Refs #592. Lab environment extension updated in field name and help text for start date when displaying graphs of lab environment data over a time interval:

  1. JSP file labenvironmentdatabasedisplay.jsp in resources/reports/ updated in function gotoStep2() to name date field "Start date" for view type "weeklyDisplay" and "overviewDisplay", and correction of corresponding help text.

comment:11 Changed 6 years ago by olle

(In [2403]) Refs #592. Lab environment extension updated in class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ by suppressing "unchecked" warnings for private method JSONObject createJsonOverviewPlot(String chartVariant, List<LabEnvironmentData> lthdList, Date startDate, Date endDate, String viewType, String chartSite, String variableType, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime).

comment:12 Changed 6 years ago by olle

(In [2405]) Refs #592. Lab environment extension updated in class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ by commenting out debug statement:

  1. Private method JSONObject createJSONPlotDisplay(String chartVariant, String headerTitle, String title, String variableTitle, HashMap<String,List<Float>> periodStringFloatListHashMap, String viewType, Date startDate) updated by commenting out debug output of period list, since the output can be extensive, without giving much extra information, after the method has been tested to work under most conditions.

comment:13 Changed 6 years ago by olle

Design discussion for lab environment alarm control:

Configuration of lab environment alarms will in the first version be handled by settings in configuration file labenv-config.xml. However, the alarm functionality will be updated:

  1. When an alarm has been reported, an alarm blocker flag is set to prevent this alarm from being reported again before the flag is re-set.
  2. Restarting the lab environment extension will re-set all alarm blocker flags, enabling new alarms to be reported.
  3. A new menu item "Lab environment alarms" should be added to the lab environment menu. Selecting the new menu item should show an alarm control page.
  4. The alarm control page should show a table with one row for each configured alarm, with the following information:
    a. Alarm no.
    b. Sensor name.
    c. Start time.
    d. End time.
    e. Weekday filter.
    f. Temperature min.
    g. Temperature max.
    h. Humidity min.
    i. Humidity max.
    j. Alarm blocked (status indicated by value of a Yes/No option menu).
    k. Alarm text (text of last reported alarm, if any).
  5. The alarm blocker Yes/No option menu for an alarm will be disabled, unless the logged-in user log-in id occurs in the user list for the alarm.
  6. If the logged-in user has permission to control any alarm in the table, a button "Set alarm blocker" will appear on the page. Clicking the button will set the alarm blocker status to the current setting on the page for any alarm the logged-in user has permission to control. Clicking the button is necessary to re-set any alarm blocker status, just changing a value in the alarm blocker Yes/No option menu will not affect the setting used by the lab environment service.
Last edited 6 years ago by olle (previous) (diff)

comment:14 Changed 6 years ago by olle

Design of implementation for lab environment alarm control:

  1. XML file extensions.xml in META-INF updated with new entry for "Lab environment alarms" coupled to JSP file labenvironmentalarms.jsp in resources/reports/.
  2. New JSP file labenvironmentalarms.jsp in resources/reports/ added. At loading, function createLabEnvAlarmWebPage() is called to create the page after calling functions getLabSensorConfigList() and getLabSensorConfigList() to obtain information on alarm configuration and logged-in user. The latter functions obtain the information by making Ajax calls to java servlet LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/. Button "Set alarm blocker" is coupled to function goSetAlarmBlocker(), which will make an Ajax call to servlet LabEnvironmentServlet to set the alarm blocker status.
  3. Java servlet class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated to accept Ajax calls for commands "SetLabEnvAlarmconfig" and "GetLoggedInUserLogInId".
    b. Private method JSONObject createLabSensorConfigList(JSONObject json) updated to include alarm list information as a JSONArray.
    c. New private method String fetchLoggedInUserLogInId(SessionControl sc) added. It returns the log-in id for the logged-in user, or null if the id could not be obtained.
    d. New private method void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc) added. It updates lab environment alarm configuration regarding alarm blocked flags, based on input from an Ajax request.
  4. Configuration file labenv-config.xml updated with "weekdayfilter" tags for alarms.
  5. Java servlet class/file LabEnvironmentStatisticsServlet.java in src/net/sf/basedb/labenv/servlet/ updated be adding new public method boolean includeWeekday(Date date, String weekdayFilter). It checks if an input date passes an optional weekday filter. Returns false if date is null.
  6. Java data access object class/file LabSensorAlarmConfig.java in src/net/sf/basedb/labenv/dao/ updated with instance variables for String weekdayFilter, Boolean alarmBlocked, and String alarmText, with corresponding public accessor methods.
  7. Java class/file LabEnvironmentConfigation.java in src/net/sf/basedb/labenv/ updated with support for weekday filter.
  8. Java class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated with support for weekday filter.
Last edited 6 years ago by olle (previous) (diff)

comment:15 Changed 6 years ago by olle

(In [2415]) Refs #592. Lab environment extension updated with lab environment alarm control:

  1. XML file extensions.xml in META-INF updated with new entry for "Lab environment alarms" coupled to JSP file labenvironmentalarms.jsp in resources/reports/.
  2. New JSP file labenvironmentalarms.jsp in resources/reports/ added. At loading, function createLabEnvAlarmWebPage() is called to create the page after calling functions getLabSensorConfigList() and getLabSensorConfigList() to obtain information on alarm configuration and logged-in user. The latter functions obtain the information by making Ajax calls to java servlet LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/. Button "Set alarm blocker" is coupled to function goSetAlarmBlocker(), which will make an Ajax call to servlet LabEnvironmentServlet to set the alarm blocker status.
  3. Java servlet class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated to accept Ajax calls for commands "SetLabEnvAlarmconfig" and "GetLoggedInUserLogInId".
    b. Private method JSONObject createLabSensorConfigList(JSONObject json) updated to include alarm list information as a JSONArray.
    c. New private method String fetchLoggedInUserLogInId(SessionControl sc) added. It returns the log-in id for the logged-in user, or null if the id could not be obtained.
    d. New private method void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc) added. It updates lab environment alarm configuration regarding alarm blocked flags, based on input from an Ajax request.
  4. Configuration file labenv-config.xml updated with "weekdayfilter" tags for alarms.
  5. Java servlet class/file LabEnvironmentStatisticsServlet.java in src/net/sf/basedb/labenv/servlet/ updated be adding new public method boolean includeWeekday(Date date, String weekdayFilter). It checks if an input date passes an optional weekday filter. Returns false if date is null.
  6. Java data access object class/file LabSensorAlarmConfig.java in src/net/sf/basedb/labenv/dao/ updated with instance variables for String weekdayFilter, Boolean alarmBlocked, and String alarmText, with corresponding public accessor methods.
  7. Java class/file LabEnvironmentConfigation.java in src/net/sf/basedb/labenv/ updated with support for weekday filter.
  8. Java class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated with support for weekday filter.

comment:16 Changed 6 years ago by olle

(In [2416]) Refs #592. Lab environment extension updated in code formatting:

  1. Java class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated in public method void checkAlarms(String labSensorUrl, Date measurementTime, double temperature, double humidity) by insertion of missing newline character to make code more readable.

comment:17 Changed 6 years ago by olle

(In [2418]) Refs #592. Lab environment extension updated to only use a fixed number of decimals when reporting alarms:

  1. Java class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated in public method void checkAlarms(String labSensorUrl, Date measurementTime, double temperature, double humidity) to format output values for temperature and humidity data to only use a number of decimals defined in new private constant numberOfDecimals, initialized to 2.

comment:18 Changed 6 years ago by olle

(In [2419]) Refs #592. Lab environment extension updated to check permission to re-set alarm blocker settings on the server side only, eliminating the need to send the alarm user list to the client JSP script:

  1. JSP file labenvironmentalarms.jsp in resources/reports/ updated:
    a. Function createLabEnvAlarmWebPage() updated to obtain alarm permission directly from Ajax response from servlet.
    b. Function fetchAlarmPermission(loggedInUserLoginId, userId) removed.
  2. Java servlet class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated to add SessionControl object as argument when calling private method JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc), and by removing support for Ajax command "GetLoggedInUserLogInId".
    b. Private method JSONObject createLabSensorConfigList(...) updated with second argument SessionControl sc, used to call new private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc) to obtain alarm permission.
    c. New private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc) added. It returns true if the alarm user list contains the logged-in user log-in id, else false.
    d. Private method void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc) updated to call new private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc) to obtain alarm permission.

comment:19 Changed 6 years ago by olle

(In [2423]) Refs #592. Lab environment extension updated in header title for overview display:

  1. Java servlet class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ updated in private method String fetchChartHeaderTitle(String chartVariant, String viewType, String chartSite, String variableType, String weekdayFilter) by exchanging string "overview display" for the more descriptive "min,mean,max display" for overview display.

comment:20 Changed 6 years ago by olle

Design update of the lab environment alarm infra-structure:

  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 LabEnvironmentConfiguration.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.
  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 LabEnvironmentConfiguration.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.
  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.
Last edited 6 years ago by olle (previous) (diff)

comment:21 Changed 6 years ago by olle

(In [2424]) Refs #592. Lab environment extension updated in alarm infra-structure to allow:
a. Intrinsic alarm numbering.
b. More complex user entry for an alarm; initially with id and email address.
c. Alarm when contact with a lab environment sensor is lost.

  1. New data access object class/file LabSensorAlarmUserConfig.java in src/net/sf/basedb/labenv/dao/ added. It will store the user entries for an alarm.
  2. Data access object class/file LabSensorAlarmConfig.java in src/net/sf/basedb/labenv/dao/ updated:
    a. New private instance variable int no with public accessor methods.
    b. Private instance variable userList updated to be of type List<LabSensorAlarmUserConfig> instead of List<String>.
  3. Class/file LabEnvironmentConfiguration.java in src/net/sf/basedb/labenv/ updated:
    a. Private method List<LabSensorAlarmConfig> fetchLabSensorAlarmList(Element labSensorTag, Namespace ns) updated to assign alarm numbers when parsing alarm entries in the configuration file, and to obtain the user list by calling new private method List<LabSensorAlarmUserConfig> fetchLabSensorAlarmUserList(Element alarmTag, Namespace ns).
    b. New private method List<LabSensorAlarmUserConfig> fetchLabSensorAlarmUserList(Element alarmTag, Namespace ns) added. It obtains the user list from an alarm XML tag.
    c. New private convenience method LabSensorAlarmUserConfig createIfNeeded(LabSensorAlarmUserConfig labSensorAlarmUserConfig) added.
    d. Private convenience method LabSensorAlarmConfig createIfNeeded(LabSensorAlarmConfig labSensorAlarmConfig) updated to set the alarm number to the incremented value of new private instance variable int alarmNo.
  4. Class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated:
    a. Private method measureAndStoreLabEnvironmentData(LabSensorUtil labSensorUtil, LabSensorConfig labSensorConfig, Date measurementTime) updated to call checkAlarms(...) after every finished cycle of obtaining data for averaging.
    b. Public method checkAlarms(...) updated to have temperature and humidity arguments of type Double instead of double, and to report an alarm if any of the values is null.
  5. Java servlet LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Private method JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc) updated to include the number in the JSON object for the alarm in the JSON array.
    b. Private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc) updated to check if the logged-in user log-in id equals the alarm user id attribute.
    c. Private method void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc) updated to use the intrinsic alarm number instead of a locally generated one.
  6. JSP file labenvironmentalarms.jsp in resources/reports/ updated to use the intrinsic alarm numbers instead of locally generated ones.

comment:22 Changed 6 years ago by olle

(In [2425]) Refs #592. Lab environment extension updated in alarm infra-structure to allow more complex user entry for an alarm; update of configuration file template labenv-config.xml:

  1. Configuration file template labenv-config.xml 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.

comment:23 Changed 6 years ago by olle

(In [2426]) Refs #592. Lab environment extension updated in alarm text layout:

  1. Class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated in public method checkAlarms(String labSensorUrl, Date measurementTime, Double temperature, Double humidity) by inserting a space character between the sensor URL and date string in the alarm text.

comment:24 Changed 6 years ago by olle

Test of alarm:

  • Set-up: The lab environment extension were configured to measure temperature and humidity values every minute, and store the average values every 5 minutes. An activated alarm were identified by an entry in the log file. Alarms were configured for lab sensors 1 and 2:

    a. The alarms were set to be in use during hours 08:00 - 16:30.
    b. Narrow limit settings were used for temperature and humidity, ensuring that an alarm should be activated with high probability when averaged data were obtained to be stored on the server.
    c. User A were set in the user list for both alarms, while user B were set only in the user list for the alarm for sensor 1.
    d. At a specified time, the network cable for sensor 2 was disconnected for a 7 minute interval, in order to test missing data alarm.
  • Results: The test results were those expected for a passed test:

    a. No alarm were reported outside the time interval 08:00 - 16:30, even though the temperature or humidity values were outside the alarm limits.
    b. Alarms were reported during the time interval 08:00 - 16:30, when temperature or humidity values were outside the alarm limits.
    c. After an alarm had been reported, the alarm was marked as blocked for further alarm reports, until re-set by one of the configured users. Both alarm blocker Yes/No menus were enabled for alarm user A, while only the alarm blocker Yes/No menu for alarm 1 was enabled for user B.
    d. A blocked alarm could be re-set by a user for which the alarm blocker Yes/No menu was enabled by setting the menu to No, and pressing the "Set alarm blocker" button (the old alarm text will remain until a new alarm is reported).
    e. A "Missing data" alarm was reported for sensor 2, after it had been disconnected for more than 5 minutes.
Last edited 6 years ago by olle (previous) (diff)

comment:25 Changed 6 years ago by olle

(In [2427]) Refs #592. Lab environment extension updated in layout of alarm table:

  1. JSP file labenvironmentalarms.jsp in resources/reports/ updated:
    a. Function getTableCellYesNoSelectElement(value, id, permission, colspan, rowspan) updated with new argument clazz before colspan. Attribute class of the created cell element will be set to clazz.
    b. Function createLabEnvAlarmWebPage() updated to call function getTableCellYesNoSelectElement(...) with new argument clazz set to alarmTableClass, similarly to the other cell elements.

comment:26 Changed 6 years ago by olle

(In [2428]) Refs #592. Lab environment extension updated in header title for overview display:

  1. Java servlet class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ updated in private method String fetchChartHeaderTitle(String chartVariant, String viewType, String chartSite, String variableType, String weekdayFilter) by inserting space characters in title string "min,mean,max display" for overview display.

comment:27 Changed 6 years ago by olle

(In [2431]) Refs #592. Lab environment extension updated in servlet, in order to avoid problems with unclosed DbControl items:

  1. Java servlet class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Private method String fetchLoggedInUserLogIn(SessionControl sc) updated to accept an extra argument DbControl dc, instead of creating a new DbControl object from the SessionControl.
    b. Private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc) updated to accept an extra argument DbControl dc, which is used when calling private method String fetchLoggedInUserLogIn(SessionControl sc, DbControl dc).
    c. Private method void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc) updated to accept an extra argument DbControl dc, which is used when calling private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc, DbControl dc).
    d. Private method JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc) updated to accept an extra argument DbControl dc, which is used when calling private method boolean fetchAlarmPermission(LabSensorAlarmConfig alarm, SessionControl sc, DbControl dc).
    e. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated to get a new DbControl object from the SessionControl, and use it when calling private methods void setLabEnvAlarmConfig(HttpServletRequest req, SessionControl sc, DbControl dc) and JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc, DbControl dc).

comment:28 Changed 6 years ago by olle

(In [2432]) Refs #592. Lab environment extension updated with first version of alarm notification via e-mail:

  1. New library file mail.jar for e-mail support in java added in lib/compile/.
  2. Configuration file template labenv-config.xml updated by addition of a new "emailconfig" block, containing tags "smtphost", "fromaddress", and "fromname".
  3. New data access object class/file EmailConfig.java in src/net/sf/basedb/labenv/dao/ added. It contains private instance variables and corresponding public accessor methods for the attributes in the "emailconfig" block in configuration file labenv-config.xml.
  4. Java class/file LabenvironmentConfiguration.java in src/net/sf/basedb/labenv/ updated in private method void fetchConfiguration() to read the new e-mail settings from configuration file labenv-config.xml, and store the values in new private instance variable EmailConfig emailConfig with corresponding public accessor method.
  5. New utility class/file MailUtil.java in src/net/sf/basedb/labenv/util/ added. It contains a minimal set-up for sending e-mails.
  6. Class/file Labenvironment.java in src/net/sf/basedb/labenv/ updated:
    a. Public method void checkAlarms(String labSensorUrl, Date measurementTime, Double temperature, Double humidity) updated for an activated alarm to call new private method List<String> fetchEmailAddressList(LabSensorAlarmConfig alarm) to obtain an e-mail list for the alarm in question, and then call new private method void notification(String toAddress, String sensorName, String alarmText) to send e-mails to the addresses in the list.
    b. New private method List<String> fetchEmailAddressList(LabSensorAlarmConfig alarm) added. It returns a list of e-mail addresses for the alarm, or null if none could be found.
    c. New private method void notification(String toAddress, String sensorName, String alarmText) added. It calls public method void sendMail(...) in MailUtil to try to send a notification e-mail to address toAddress.
Last edited 6 years ago by olle (previous) (diff)

comment:29 Changed 6 years ago by olle

(In [2433]) Refs #592. Lab environment extension updated in servlet to reduce the amount of debug output:

  1. Java servlet class/file LabEnvironmentServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method void doGet(HttpServletRequest req, HttpServletResponse resp) updated by commenting out debug output of returned JSON string.
    b. Private method JSONObject createLabSensorConfigList(JSONObject json, SessionControl sc. DbControl dc) updated by commenting out debug info on data added to JSONArray.

comment:30 Changed 6 years ago by olle

(In [2439]) Refs #592. Lab environment extension updated in JSP files to have more relevant section names:

  1. JSP files labenvironmentdatabasedisplay.jsp and labenvironmentdatabasestatistics.jsp in resources/reports/ updated by exchanging section id itemCountSection for the more descriptive parameterSection.
Last edited 6 years ago by olle (previous) (diff)

comment:31 Changed 6 years ago by olle

(In [2440]) Refs #592. Lab environment extension updated by associating main "Lab Environment" menu item with a generic "thermometer" icon:

  1. XML file extensions.xml in META-INF updated by associating main "Lab Environment" menu item with new thermometer.png icon.
  2. New icon thermometer.png in resources\images\ added. The icon was obtained from web page http://www.iconki.com/16x16-objects-and-people-icons-327-p7.asp, and should be free to use according to the information on the page.

comment:32 Changed 6 years ago by olle

(In [2444]) Refs #592. Lab environment extension updated to hopefully make e-mail functionality for notification more consistent and stable:

  1. Jar file mail.jar in lib/compile/ exchanged for mail-1.4.3.jar, in order to use the same version as is currently used by BASE.
  2. Text file readme.txt in lib/compile/ updated with addition of file mail-1.4.3.jar.
  3. Java class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated in private method void notification(String toAddress, String sensorName, String alarmText) by putting call to mailUtil.sendMail(...) in a try-catch block and catch any exception thrown to be printed in the log file.
  4. Utility class/file MailUtil.java in src/net/sf/basedb/labenv/util/ updated in public method void sendMail(String smtpHost, String fromAddress, String fromName, String toAddress, String messageSubject, String messageBody) by exchanging call of Session.getDefaultInstance(props, new ForcedAuthenticator()) for Session.getInstance(props, new ForcedAuthenticator()), in order to hopefully avoid problems with "java.lang.SecurityException: Access to default session denied", when the default instance already has a different authenticator set.

comment:33 Changed 6 years ago by olle

(In [2462]) Refs #592. Lab environment extension updated with a copy of the Reggie CSS file for printing:

  1. CSS file printable.css in resources/css/ added. It is a copy of the Reggie CSS file with the same name, ensuring a consistent layout for printing.

comment:34 Changed 6 years ago by olle

Design update to support display of lab environment data for a single lab sensor and date in a pop-up window, in order to simplify implementation of Reggie ticket #530 (Display logs from temperature and humidity measurements):

  1. New JSP file labenvironmentdatabaseeventpopup.jsp in resources/reports/ added. It retrieves values for input parameters "pageTitle", "labSensorUrl", and "originDate" from the Http request, and transfers them to java servlet LabEnvironmentDisplayServlet in an Ajax request, after which it uses the returned JSON data to display a pop-up window with graphs of temperature and humidity for the lab and date of interest.
  2. Class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ should be updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) to retrieve an optional page title string from the Ajax request, and add it to the created jsonReport JSONObject for key string "pageTitle".

comment:35 Changed 6 years ago by olle

(In [2463]) Refs #592. Lab environment extension updated to support display of lab environment data for a single lab sensor and date in a pop-up window, in order to simplify implementation of Reggie ticket #530 (Display logs from temperature and humidity measurements):

  1. New JSP file labenvironmentdatabaseeventpopup.jsp in resources/reports/ added. It retrieves values for input parameters "pageTitle", "labSensorUrl", and "originDate" from the Http request, and transfers them to java servlet LabEnvironmentDisplayServlet in an Ajax request, after which it uses the returned JSON data to display a pop-up window with graphs of temperature and humidity for the lab and date of interest.
  2. Class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ updated in protected method void doGet(HttpServletRequest req, HttpServletResponse resp) to retrieve an optional page title string from the Ajax request, and add it to the created jsonReport JSONObject for key string "pageTitle".

comment:36 Changed 6 years ago by olle

Design update of lab environment weekly and overview display reports:

  1. Both weekly and overview display should support day-time and week day filters, since filtering of the data affects the calculated statistical values shown in and beside the graphs. Currently the overview display supports a day-time filter.
  1. Overview display report day markers. Day markers consist of the date in YYYYMMDD format. Currently, for a number of days < 30, all day markers are drawn; for 31 - 149 days markers for dates "01", "05", "10", "15", "20", and "25" are drawn; for 150 - 299 days markers for dates "01", "10", and "20" are drawn; and for > 300 days markers for date "01" are drawn. This should be updated for 31 - 366 days to show markers for Mondays, since it is advantageous for the interpretation of the graph to know when a new week starts.

Implementation:

  1. JSP file labenvironmentdatabasedisplay.jsp in resources/reports/ updated:
    a. Function gotoStep2() updated to display day-time filter input fields and week day selection menu for weekly and overview display reports.
    b. Function goCreate() updated to send input data for day-time and week day filters in Ajax request to LabEnvironmentDisplayServlet.
    c. HTML section updated with week day selection menu.
  2. Class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method doGet(HttpServletRequest req, HttpServletResponse resp) updated to apply optional day-time and week day filters for weekly and overview display reports.
    b. Private method JSONObject createJsonOverviewPlot(String chartVariant, List<LabEnvironmentData> lthdList, Date startDate, Date endDate, String viewType, String chartSite, String variableType, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime) updated for 31 - 366 days to show markers for Mondays.

comment:37 Changed 6 years ago by olle

(In [2465]) Refs #592. Lab environment extension updated for weekly and overview display reports:

  1. Both weekly and overview display updated to support day-time and week day filters, since filtering of the data affects the calculated statistical values shown in and beside the graphs. Currently the overview display supports a day-time filter.
  1. Overview display report day markers updated for 31 - 366 days to show markers for Mondays, since it is advantageous for the interpretation of the graph to know when a new week starts.

Implementation:

  1. JSP file labenvironmentdatabasedisplay.jsp in resources/reports/ updated:
    a. Function gotoStep2() updated to display day-time filter input fields and week day selection menu for weekly and overview display reports.
    b. Function goCreate() updated to send input data for day-time and week day filters in Ajax request to LabEnvironmentDisplayServlet.
    c. HTML section updated with week day selection menu.
  2. Class/file LabEnvironmentDisplayServlet.java in src/net/sf/basedb/labenv/servlet/ updated:
    a. Protected method doGet(HttpServletRequest req, HttpServletResponse resp) updated to apply optional day-time and week day filters for weekly and overview display reports.
    b. Private method JSONObject createJsonOverviewPlot(String chartVariant, List<LabEnvironmentData> lthdList, Date startDate, Date endDate, String viewType, String chartSite, String variableType, String weekdayFilter, String daytimeFilterFromTime, String daytimeFilterToTime) updated for 31 - 366 days to show markers for Mondays.

comment:38 Changed 6 years ago by olle

Design update of alarm blocking:

An alarm can be reported either when a lab environment value (temperature or humidity) is out of range, or when contact is lost with a lab sensor (missing data). Currently, a reported alarm blocks further alarms for that alarm configuration, irrespective of what caused the alarm. However, if contact is re-established with a lab sensor after a missing data alarm, alarms for lab environment variables being out of range for that sensor should have higher priority and result in a reported alarm, even if the previous missing data alarm had not been re-set manually. This can be implemented as follows:

  1. Data access object LabSensorAlarmConfig.java in src/net/sf/basedb/labenv/dao/ updated:
    a. Three new public static final integer constants ALARM_BLOCK_TYPE_UNKNOWN, ALARM_BLOCK_TYPE_MISSING_DATA, and ALARM_BLOCK_TYPE_LAB_ENVIRONMENT_DATA are defined.
    b. New private instance variable Integer alarmBlockType with public accessor methods added. It is initialized to null.
  2. Class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated:
    a. Public method void checkAlarms(String labSensorUrl, Date measurementTime, Double temperature, Double humidity) updated to report an alarm if alarm not blocked or if blocked alarm is of type missing data and current alarm is not. When an alarm is reported and the alarm block flag is set, the alarm type is set to that of the current alarm.
Last edited 6 years ago by olle (previous) (diff)

comment:39 Changed 6 years ago by olle

(In [2466]) Refs #592. Lab environment extension updated to report an alarm for lab environment variables being out of range even if a previous alarm had not been re-set, provided that the previous alarm was for missing data, i.e. that contact with the sensor had been lost:

  1. Data access object LabSensorAlarmConfig.java in src/net/sf/basedb/labenv/dao/ updated:
    a. Three new public static final integer constants ALARM_BLOCK_TYPE_UNKNOWN, ALARM_BLOCK_TYPE_MISSING_DATA, and ALARM_BLOCK_TYPE_LAB_ENVIRONMENT_DATA are defined.
    b. New private instance variable Integer alarmBlockType with public accessor methods added. It is initialized to null.
  2. Class/file LabEnvironment.java in src/net/sf/basedb/labenv/ updated:
    a. Public method void checkAlarms(String labSensorUrl, Date measurementTime, Double temperature, Double humidity) updated to report an alarm if alarm not blocked or if blocked alarm is of type missing data and current alarm is not. When an alarm is reported and the alarm block flag is set, the alarm type is set to that of the current alarm.

comment:40 Changed 6 years ago by olle

(In [2467]) Refs #592. Lab environment extension updated for displaying lab environment data for a single lab sensor and date in a pop-up window, by displaying an optional page headline at the top of the report section, in addition to being displayed at the top of the web page. This allows the headline to be included, also when the page is printed using the print function link on the page:

  1. JSP file labenvironmentdatabaseeventpopup.jsp in resources/reports/ updated in function onPlotGenerated(request) to add a page headline at the top of the report section, if the pageTitle string in the input "report" JSONObject differs from null and an empty string.

Last edited 6 years ago by olle (previous) (diff)

comment:41 Changed 6 years ago by olle

(In [2474]) Refs #592. Lab environment extension updated in XML file extensions.xml in META-INF:

  1. XML file extensions.xml in META-INF updated by renaming "id" tags, to make the name space more consistent with other BASE extensions. All extension "id" tags are now children of id-base, which is set to "net.sf.basedb.labenv.". The service extension has id suffix "service", the menu has id suffix "menu", and the menu items have id suffices "menu.*", where the last part describes the menu item.

comment:42 Changed 6 years ago by olle

(In [2481]) Refs #592. Lab environment extension updated for displaying lab environment data for a single lab sensor and date in a pop-up window, by making the layout of the window more consistent with other pop-up windows in BASE:

  1. JSP file labenvironmentdatabaseeventpopup.jsp in resources/reports/ updated:
    a. New service extension "id" used, when obtaining home path for icons.
    b. Form in HTML section updated by removing the outer frame.
    c. The "base:buttongroup" block in the HTML section updated by adding a print button to the left of the "Cancel" button at the bottom of the page. This replaces the link to the print function in the removed outer frame.

comment:43 Changed 6 years ago by olle

(In [2486]) Refs #592. Lab environment extension updated in JSP files by removing warning if no BASE project has been selected, since this is not necessary for the lab environment extension functionality:

  1. JSP files in resources/reports/ updated in HTML section by removal of warning if no BASE project has been selected:
    a. labenvironmentalarms.jsp
    b. labenvironmentdatabasedisplay.jsp
    c. labenvironmentdatabaseeventpopup.jsp
    d. labenvironmentdatabaseexport.jsp
    e. labenvironmentdatabasestatistics.jsp
    f. labsensorinfo.jsp

comment:44 Changed 6 years ago by olle

(In [2489]) Refs #592. Lab environment extension updated in versions of external library files used for compilation, and contents of various "readme" files:

  1. Outermost README file updated:
    a. Requirements: BASE version changed from 3.2 to 3.2.2, which the version referred to in other documentation.
    b. Installation: Instruction have been made independent of the detailed versions of external files.
    c. Compiling: Instruction have been made independent of the detailed versions of external files.
  1. Contents of directory labenv/lib/compile/ updated:
    a. Jar file jdom-1.1.2.jar exchanged for jdom-1.1.3.jar.
    b. Jar file json_simple-1.1.jar exchanged for json-simple-1.1.1.jar.
    c. File readme.txt updated in file list by exchanging jdom-1.1.2.jar for jdom-1.1.3.jar and json_simple-1.1.jar for json-simple-1.1.1.jar.
Last edited 6 years ago by olle (previous) (diff)

comment:45 Changed 6 years ago by olle

(In [2490]) Refs #592. Configuration file META-INF/extensions.xml updated by setting version to "1.1".

comment:46 Changed 6 years ago by olle

(In [2491]) Refs #592. Lab environment extension updated by setting version number to "1.1":

  1. Ant build file build.xml updated by setting version number to "1.1".
  2. Class/file LabEnv.java in src/net/sf/basedb/labenv/ updated by setting public static constant String VERSION to "1.1".

comment:47 Changed 6 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as a the lab environment extension has been updated with the following improvements:

  • Report routines added to display graphs of temperature and humidity data for one or more labs for a time interval spanning a day, a week, or an overview plot with min, mean, and max values for a chosen time interval. In the latter case, data for each day is averaged into a single data point.
  • New filters, including a workday/non-workday filter for better synchronization with lab environment control systems.
  • Alarms improved with an alarm overview page, blocking of new alarms for an alarm configuration after one is reported, possibility for alarm administrators to re-set the alarm blocks, possibility to get alarm notification via e-mail, and alarms when connection with a lab sensor is lost.
Note: See TracTickets for help on using tickets.