CoeSwd6: User Def Axis Units: ScaledUnit-based axis units [1] Bug Number: n/a Release notes (y/n): no For Release Nums: 7.1 Plot axes units are now based on Scaled Units (ScaledUnitPtr) rather than unit character string. This means that, for example, a set of series slots with a mixture of FLOW units of cms, cfs, acre-ft/month and acre-feet/month are all mapped to the same vertical axes. (See the screenshot links below). This development involved three fundamental changes: (a) Plot axes units are now based on Scaled Units rather than unit character strings. (b) Slots are assigned to axes based on the slot's Unit Type rather than their unit description (unit name) string. (c) Slot values are mapped to plot coordinates using the Scaled Units associated with the axes to which Slot Curves are assigned, rather than to the slot's current display units. *Technical notes: (a) Change from unit character strings to ScaledUnitPtr in both Sim/PlotInfo (class AxisInfo) and Q3GUI/SlotPlot (class SlotPlot:: AxisItem). See also related changes throughout the SlotPlot and SlotCurve classes. (b) See method: bool SlotPlot::setAxes (SlotCurve* newSlotCurve). (c) See the updateCurveData() methods in each of the six SlotCurve subclasses. This still uses the same algorithm of establishing axes units in the process of dynamically adding slots to a plot -- EVEN FOR saved plots. So, still, no persistent data exists for the units of any axis. The following screenshots demonstrate adding two series slots to a plot -- one using CMS units, and the other using CFS. Notice that, in RiverWare 7.0, the two slots are assigned to different vertical axes using unrelated scales. In the new 7.1 development version, they are both assigned to the same axis, whose units are those of the FIRST SLOT added to the plot. http://cadswes2.colorado.edu/~philw/2017/CoeSwd6/2017-02-08/CmsCfsPlot-70.png http://cadswes2.colorado.edu/~philw/2017/CoeSwd6/2017-02-08/CmsCfsPlot-71a.png http://cadswes2.colorado.edu/~philw/2017/CoeSwd6/2017-02-08/CmsCfsPlot-71b.png This is a coherent level of functionality, though it has some usability limitations. Major subsequent development steps: (2) Preserving for each Axis: Unit Type and current Scaled Unit, and adjusting the slot curve insertion algorithm to honor the axis Unit Type assignments. (3) Support selection of a different Scaled Unit for non-time axes (within the axis' Unit Type). (4) Support moving curves to the opposite axis (when the other axis is either not yet used, or is of the same unit type). Note that the vertical scales of such axes will _not_ be synchronized (as it currently true in RiverWare 7.0, see the screenshot above). (5) Adding an optionally shown visual indication in Legend Items of which vertical axes a slot curve is associated with. Note-1: My plan is to limit the support for (4) and (5) to vertical axis assignment, even though it could also apply to horizontal axis assignment. The applicability of the latter would be very limited. Note-2: An additional possible feature would be SWAPPING the vertical axes. (That, actually, wouldn't be difficult to do also for the horizontal axes). ---