Refactoring #1565

Feature #1534: === Parameter handling ===

to associate units with parameters, use string instead of inheritance

Added by wuttke over 4 years ago. Updated about 4 years ago.

Status:ArchivedStart date:03 Aug 2016
Priority:NormalDue date:
Assignee:wuttke% Done:


Target version:Sprint32


While implementing units-in-parameters using the inheritance approach, I learned that units can be undefined when parameters are created, and must allow to be modified later. For instance when generic distributions is used in a specific context, mean value and standard deviation get their unit from that context. Complicated things also happen with detector coordinates. Probably, at some point we will want to pass unit as a parameter. All this can be handled much better if m_unit is a member variable of RealParameter. Easiest if that variable is of type string, m_unit = one of "", "nm", "rad". So I have to refactor, removing the inheritance mechanism implemented yesterday.


#1 Updated by wuttke over 4 years ago

at this occasion, correct the limits for angles form +-90 or +-180 to +-PID2 or +-PI

#2 Updated by wuttke over 4 years ago

  • Parent task changed from #1290 to #1534

#3 Updated by wuttke over 4 years ago

  • Status changed from Rfc to Sprint
  • Target version set to Sprint32

member variable of type string is perhaps not the best solution, but in any case a valid first approximation, and will allow us to implement the functionality we want

#4 Updated by wuttke over 4 years ago

  • Status changed from Sprint to Resolved

Resolved in 07c2106.
The unit name is wrapped in by class Unit.
Parameter registration now has chain form, e.g.
registerParameter(name, link).setUnit(string).setLimited(lower,upper).setFixed()

#5 Updated by herck about 4 years ago

  • Status changed from Resolved to Archived

Also available in: Atom PDF