RiverWare Series Display
Compression
Proposal for Persistence of Series Display Compression
on Slots (only).
|
The original RiverWare Series Display Compression design document recommended that Persistence not be implemented for the Series Display Compression feature.
|
It was noted that if Persistence was to be implemented, the Display Compression Specification -- if active -- should be saved with each of the following entities:
The nature of the use of this feature in these four applications warrants reconsideration of an implementation of Series Display Compression settings persistence for only Slots.
Persistence of Series Display Compression settings should be implemented for Slots. That is, relevant Slot records in RiverWare model files (and Exported RiverWare Object files) should include a Display Compression Specification (class Sim/DisplayCompressSpec) if and only if compression was active the last time the Slot was viewed in an Open Slot dialog.
This means that the following classes should include a Display Compression Specification field. Probably this should be via a pointer to a dynamically allocated DisplayCompressSpec instance.
[Currently Display Compression Specification records currently live only in GUI components].
The DisplayCompressSpec currently includes the following fields.
class DisplayCompressSpec { private: bool _panelShown; bool _on; DisplayCompress::Op _op; DisplayCompress::Precision _prec; double _refValue; ... }; |
DisplayCompress Definitions used above:
typedef enum { DISP_COMPR_OP_UND = 0, DISP_COMPR_OP_HIDE_DUPS, // Compress duplicate timestep rows. DISP_COMPR_OP_HIDE_NANS, // Hide rows having only NaNs. DISP_COMPR_OP_HIDE_VALUE, // Hide rows having only the Reference Value. DISP_COMPR_OP_HIDE_NAN_VAL // Hide rows having only NaNs or the Ref Value. } Op; // Operation Code |
typedef enum { DISP_COMPR_PREC_UND = 0, DISP_COMPR_PREC_DISPLAY, // Compare values using Display Precision DISP_COMPR_PREC_CONVERGENCE, // Compare values using the Slot's Convergence DISP_COMPR_PREC_EXACT // Compare values using exact equality } Precision; // Precision Code |
The following terse string representations are intended for persistence of these enumerated types.
QString DisplayCompress::opStrTerse (DisplayCompress::Op operation) { switch (operation) { case DISP_COMPR_OP_UND: return ("OP_UND"); case DISP_COMPR_OP_HIDE_DUPS: return ("OP_HIDE_DUPS"); case DISP_COMPR_OP_HIDE_NANS: return ("OP_HIDE_NANS"); case DISP_COMPR_OP_HIDE_VALUE: return ("OP_HIDE_VAL"); case DISP_COMPR_OP_HIDE_NAN_VAL: return ("OP_HIDE_NAN_VAL"); } return ("OP_???"); } |
QString DisplayCompress::precisionStrTerse (DisplayCompress::Precision prec) { switch (prec) { case DISP_COMPR_PREC_UND: return ("PREC_UND"); case DISP_COMPR_PREC_DISPLAY: return ("PREC_DISP"); case DISP_COMPR_PREC_CONVERGENCE: return ("PREC_CONV"); case DISP_COMPR_PREC_EXACT: return ("PREC_EXACT"); } return ("PREC_???"); } |
A Tcl-parsable DisplayCompressSpec record could look like this:
"$s" displayCompress {shown} {on} {OP_HIDE_VAL} {PREC_DISP} 20.0 |
where:
--- (end) ---