RiverWare: Searching Series Slots by Timestep Flags
Edit 9-3-2008, Phil
Weinstein -- HIT REFRESH -- See
also all available screenshots -- Printable PDF
Two new capabilities were added to RiverWare to locate SeriesSlots having certain Timestep Series Flags (e.g. Input, Output, Rules, Surcharge Release, etc). These are available in RiverWare 5.1.
|
![]() |
Both capabilities support the distinction between Input Flags before the Run Start timestep (Initialization Period Inputs) and on-or-after the Run Start timestep (Run Period Inputs).
(1) The "Find Series Slots with Inputs" dialog
Displayed from the Workspace menu:
If Accounting is enabled the user may choose to search any or all of the following Series Slot "domains":
The Input Flag search may be limited to either Initialization Timesteps (before the Run Start timestep) or Run Period Timesteps (on or after the Run Start timestep). If both are checked, all Series Slots having any Inputs are found, regardless of where (in time) those Input timesteps are within the Slots' time series.
The search operation is performed by clicking the Search push button. The number of Series Slots with Input-flagged timesteps, and the total number of Series Slots matching the checked "domains" are indicated in a status line to the right of the Search button. If search criteria is changed (by clicking any of the check boxes at the top of the dialog), a green check icon is displayed next to the Search button indicating that a new Search with the new criteria has yet to be performed. The green check icon (not shown in the image above) is hidden upon performing another Search.
Several context menu (right click) operations are available within the Slot List:
Push buttons along the bottom of the "Find Series Slots with Inputs" dialog provide these functions:
![]() |
|
![]() |
(2) The "Has Flag" GUS Slot and Supply Filters
New "Has Flag" Slot and Supply Filters are now available in certain Selections picked with GUS (Grand Unified Selector). This allows the user to exclusively include or exclude Slots having a particular Flag set on any timesteps.
These selection filters are somewhat "expensive" -- they may be slow
in large models or in models with many timesteps. So they are not made available
in all GUS selection applications. For example, they are not available for Workspace
Canvas Display Groups. Initially, these filters have been made available in the
Workspace >> Slots >> Open Slot...
operation and for adding Slots to an SCT.
![]() |
|
![]() |
The latter two match only Slots having an Input flag either before the Run
Start timestep OR on or after the Run Start timestep, respectively.
Implementation Notes
Both the "Find Series Slots with Inputs" dialog, and the "Has Flag" GUS Slot and Supply Filters make use of the following Sim-library RootFilter types, implemented with a single RootFilter class:
FILTER_SLOT_HAS_FLAG
FILTER_SUPPLY_HAS_FLAGclass RootFilter_SeriesHasFlag : public RootFilter;
Declared in: Sim/RootFilter.Slot.hpp
Defined in: Sim/RootFilter.Slot.cpp
The "Has Flag" predicates are implemented in three Sim/SlotGUIUtils functions (rather than in the SeriesSlot class):
bool hasFlag (const SeriesSlot*, const ValueState,
Date_Time* firstFoundDtRet=NULL);bool hasInputsBefore (const SeriesSlot*,
const Date_Time& refDateTime,
Date_Time* firstFoundDtRet=NULL);bool hasInputsAfterOrOn (const SeriesSlot*,
const Date_Time& refDateTime,
Date_Time* firstFoundDtRet=NULL);
The "Find Series Slots with Inputs" dialog makes use of the QtUtils/SlotListPanel which was originally developed for the SCT Slot List Tabs (for lists of Non-Series Slots). The contents of the Slot List is built from four distinct internal RootSelections, one for each Slot "domain" (physical, account, supply, and exchange). The Qt4 Designer-built UI file is among the source files used in this dialog module:
QtUtils/FindSlotsWithInputsDlg.hpp
QtUtils/FindSlotsWithInputsDlg.cpp
QtUtils/FindSlotsWithInputsWidgets.ui
QtUtils/ui_FindSlotsWithInputsWidgets.h (generated)
The "Has Flag" RootFilter can be made available in any RootSelection (displayed in GUS) with the following calls:
RootSelection* sel = ...;
...
sel->addAllAvailableFilters (true); // expensive ones too
sel->addFilter (FILTER_SLOT_HAS_FLAG);
sel->addFilter (FILTER_SUPPLY_HAS_FLAG);
--- (end) ---