Analysis: Adding New Component Types to Model Reports
Phil Weinstein, CADSWES

Status:

(1) Requirements

Add these three items to model reports (i.e. as user-addable components):

  1. Pie Chart (RiverWare "output device")
  2. Tabular Series Slot Report (RiverWare "output device")
  3. Water accounting information (NOT YET SPECIFIED).

(2) New Report Component Overview

A model report is a RiverWare "output device" which generates an HTML document containing a hierarchy of report components. The three new types of components to be made available are similar to certain already-supported components.

Specifically, model output reports already support the inclusion of any Plot Page output device instance. It is included in the generated HTML document as an image. This is exactly how a Pie Chart output device instance would be included. The Tabular Series Slot Report is also an output device, but its output is essentially an HTML table.

Model reports also support a Model Information component containing couple optional paragraphs (derived from text blocks defined in the model) and the number of each type of Simulation Object in the model, presented in a two-column table. The new Water Accounting Information component would be similar to that component. (TBD).

The Model Report mechanism generates HTML using an ad-hock (though consistently structured) "template" mechanism. HTML snippets are assembled using just character string processing. In particular DOM is not used (e.g. as provided by QDom). (Note that we do use QDom in RiverWare for various XML serializations -- but not for model reports).

Since each of the new types of model report components are similar to existing components, the development task will consist of mostly copying and modifying examples of existing definitions and blocks of code.

(2.1) Pie Chart model report component

This can be handled in virtually the same way as Plot Pages. The Plot Page report component has these attributes:

  1. Plot Page Name (selection of a particular Plot Page instance)
  2. Title (section header text entered by the user)
  3. Width (pixel quantity, for the image generated for the report)
  4. Height (pixel quantity, for the image generated for the report).

A mechanism for selecting among the existing Chart instances will be created as a modified duplicate of the existing support for Plot Pages. (Pie-) Chart already supports the generation of an image (for export); this will be made available to, and used by the model report generation mechanism.

(2.2) Tabular Series Slot Report model report component

The inclusion of this component will be similar to the inclusion of a Pie Chart component -- it is a reference to an existing RiverWare "output device" instance. However, the Tabular Series Slot Report generates an HTML document. The contents of the "body" of that generated HTML document will be made available to, and used by the model report generation mechanism.

Minor note: Since the Tabular Series Slot Report itself provides a "Title", it probably wouldn't make sense to redundantly support a title in the model report component configuration for the Tabular Series Slot Report.

(2.3) Water Accounting Information model report component

NOTE: The requirements for this report component need to be defined.

Assuming this represents just summary information for the Accounts in the model, and possibly also enumerations of Accounts (and maybe Supplies and Exchanges), this will be a relatively simple adaptation of the already existing Model Information component.

(3) Development Status

Temporary Development GIT Branch: PhilModelRep

Day Hours Description
11-6-2013 3.0 Project Planning (incl. this document)
11-7-2013 7.0 Definitions and configuration implementation for Pie Chart and Tabular Series Slot Report components.
11-8-2013 3.5 Pie Chart Rendering. sample
11-11-2013 7.75 Tabular Series Slot Reports. sample
11-12-2013 8.25 Account System Information, Account Table, Supply Table. sample
11-13-2013 7.0 Account Method Table, and revisions to prior items.

sample

11-14-2013 8.0 Account Section, Supply & Exchange support for Slot, Slot Table items, other accounting revisions.
11-15-2013 7.5 Pie Chart revisions (timestep fix, white backgrounds, warning) ... including separate commit for white backgrounds in Pie Chart printing and image export (2.0 hours).
11-18-2013 4.5 Feature document: R:\doc\Output\ModelReport\2013\ModelRepNov2013Enh.html
... also online: HTML / PDF
  56.5 Total Hours Completed (as of 11-18)

Related Filed Bugs:

---