CoeSwd6: User Def Axis Units: Replaced ScaledUnitPtr with new AxisUnitInfo class Bug Number: n/a Release notes (y/n): no For Release Nums: 7.1 In the prior commit, the axes unit strings were replaced with a ScaledUnitPtr -- with logic changes to map all slots having the same UNIT TYPE of an axes' ScaleUnitPtr to that axes. This applied to both Sim/PlotInfo (class AxisInfo) and Q3GUI/SlotPlot (class SlotPlot::AxisItem). This commit replaces those ScaleUnitPtr fields with a new class, AxisUnitInfo (in Sim/PlotInfo) which provides a switch between a ScaledUnitPtr determined from the first slot added to that axis AND a custom ("fixed") scale and unit configuration. NOT YET implemented: (1) AxisUnitInfo serialization. (This will be a small XML record, similar to other new support classes in PlotInfo) (2) Enhancements to the AxisDlg to edit values in the AxisUnitInfo object. //---------------------------------------- class AxisUnitInfo { public: typedef enum { UnitMode_Slots = 0, // units of first slot added to axis UnitMode_Fixed // specified scale and units } UnitMode; private: UnitMode _unitMode; unit_type _unitType; ScaledUnitPtr _firstSlotUnits; // may be NULL, not persistent ScaledUnitPtr _fixedUnits; // may be NULL public: AxisUnitInfo() : _unitMode (UnitMode_Slots), _unitType (NUMUNITS), _firstSlotUnits (NULL), _fixedUnits (NULL) {} bool operator== (const AxisUnitInfo& rhs) const; bool isDefined() const { return (_unitType != NUMUNITS); } void clear(); UnitMode unitMode() const { return _unitMode; } bool unitMode_isSlots() const { return _unitMode == UnitMode_Slots; } bool unitMode_isFixed() const { return _unitMode == UnitMode_Fixed; } unit_type unitType() const { return _unitType; } QString unitTypeStr() const; ScaledUnitPtr firstSlotUnits() const { return _firstSlotUnits; } ScaledUnitPtr fixedUnits() const { return _fixedUnits; } void setUnitMode (UnitMode); void initialize (ScaledUnitPtr); bool setFirstSlotUnits (ScaledUnitPtr); // return indicates change bool setFixedUnits (ScaledUnitPtr); // return indicates change ScaledUnitPtr activeUnits() const; }; //----------------------------------------