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.

  1. "Find Series Slots with Inputs" dialog
    Displayed from the Workspace menu: Workspace >> Slots >> Find Inputs...
     
  2. "Has Flag" GUS Slot Filter
    Currently available only for certain Slot selections, including from the Workspace menu: Workspace >> Slots >> Open Slot...
     

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: Workspace >> Slots >> Find Inputs...

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.

Unless Supply Slots or Exchange Slots are shown in the Slot List, the user has the option of showing the Slots' Object Name and Account Name (if applicable) in separate columns. This is controlled by the [x] Compress columns check box below the Slot List.

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:

  1. Open Slots... push button:  Separate Open Slot dialogs are shown for each of the selected items in the Slot List. If more than four (4) Slots are selected, then a query dialog box is shown confirming the operation with a message like this: "Do you want to show 421 Open Slot dialogs?".  Note that all shown Open Slot dialogs may be hidden with the Workspace >> Slots >> Close All Slots... menu operation.
     
  2. Show All Slots in SCT... push button:  All Slots in the Slot List (regardless of item selection) are shown in a new SCT dialog, and the "Find Series Slots with Inputs" dialog is closed.
     
  3. Show Selected Slots in SCT... push button:  Selected Slots in the Slot List are shown in a new SCT dialog, and the "Find Series Slots with Inputs" dialog is closed.
     
  4. Cancel push button:  The "Find Series Slots with Inputs" dialog is closed.
 
 

(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 "Has Flag" Slot and Supply Filters have three choices for Input Flags:

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_FLAG

class RootFilter_SeriesHasFlag : public RootFilter;
D
eclared 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) ---