TableSlot Plotting: Optional Automatic Placement of the Vertical Distance Entity on the Vertical Axis. [6-23-2009]. SEE: http://cadswes2.colorado.edu/~philw/2009/PlotAxisVertDistDefault/ ------------- Sim/SimWS.hpp Sim/SimWS.cpp ------------- Added flag to Sim library Workspace object to indicate whether or not the default arrangement of axis for two-column table slots should be overridden to put the vertical distance entity on the vertical axis. // Misc. preferences saved with model bool _overrideDefaultPlotAxesForVertDist; // default: false // Misc. preferences saved with model bool overrideDefaultPlotAxesForVertDist() const { return _overrideDefaultPlotAxesForVertDist; } void setOverrideDefaultPlotAxesForVertDist (bool); Model file persistence for this new flag: In SimWorkspace::dump (cwostream& os): os << "OverrideDefaultPlotAxesForVertDist " << (_overrideDefaultPlotAxesForVertDist ? "1" : "0") << endl; New method: int overrideDefaultPlotAxesForVertDistCmd (ClientData, Tcl_Interp *interp, int argc, char *argv[]); Tcl_CreateCommand (rwInterp, "OverrideDefaultPlotAxesForVertDist", overrideDefaultPlotAxesForVertDistCmd, (ClientData) NULL, NULL); -------------------- Q3GUI/AxisDlg.cpp Q3GUI/AxisDlg.hpp Q3GUI/AxisDlgBase.ui -------------------- Addition of toggle to support the optional automatic placement of the vertical distance entity on the vertical axis. +-- Auto Swap Axes -------------------+ | | | [X] Place single vertical distance | | column entity on vertical axis | +-------------------------------------+ New widgets: Q3GroupBox* _autoSwapAxesBox; QCheckBox* _axesVertDistOverrideCheckbox; New Qt slot (signal handler): void axesVertDistOverrideToggled (bool); -------------------- Q3GUI/SlotCurve.cpp -------------------- Change to method: SlotCurve* SlotCurve::createSlotCurve(QwtPlot *parent, Slot *slotPtr, int xColumn, int yColumn, int zColumn, ....) ... in the case of plots for two-column TableSlots where the axes have not yet been assigned, reverse the default assignments based on these method calls: rwWorkspace->overrideDefaultPlotAxesForVertDist(); SlotGUIUtils::slotColIsProbablyVerticalDistance (tableSlotPtr, 0); SlotGUIUtils::slotColIsProbablyVerticalDistance (tableSlotPtr, 1); ---------------------- Q3GUI/SlotGUIUtils.cpp Q3GUI/SlotGUIUtils.hpp ---------------------- Change to method: bool SlotGUIUtils::slotColIsProbablyVerticalDistance (const Slot*, int col) ... if the column label is BLANK (and it has a unit type of LENGTH), regard that as a vertical distance entity. This is needed for these two TableSlots which lack column labels: [Power Reservoir] Net Head vs Generator Capacity [Power Reservoir] Net Head vs Plant Efficiency ---