BHoM / BHoM_UI

GNU Lesser General Public License v3.0
9 stars 6 forks source link

Provide a way to specify the units of an input for int, double, long and vector #128

Open epignatelli opened 5 years ago

epignatelli commented 5 years ago

Description:

This issue is to capture our thoughts around the unit conversion in one of the last coordination calls. A common use case with the BHoM, especially in the Structure namespace is to do some unit manipulation before inputting the numbers in the method.

To make this a bit smoother we can provide a way to input the unit of the scalar we are using. This can be solved in different ways according to the UI we use (flow-base and tabular). The main problem we want to solve is two-fold:

  1. A display problem: I want to see the numbers with a certain order of magnitude/unit.
  2. To ease the way we perform calculation, and remove the extra step of manually moving from one unit to the other (e.g. N/mm2 to KN/m2)

A. Flow-base @ZiolkowskiJakub @epignatelli In grasshopper, we can add another element to the menu of the parameter which allows you to specify the input unit. This will require two main implementations:

B. Tabular @awakeman In Excel, the situation is a little different. We can leverage the format option of a cell to change the order of magnitude of the display. This is mainly to support the fact that the excel spreadsheet that users use for calculations is also the mean to report the work to the client. Excel can use the same Engine method of the flow-based side to go back and forth SI.

@al-fisher @adecler @IsakNaslundBh @alelom @FraserGreenroyd

epignatelli commented 4 years ago

@al-fisher @tg359 this now also involves wrapping an external tool to take care of the math, if I am not wrong?

Resorting to 3.1 MVP if so, and we solve it as a whole. Otherwise I can take care of creating a proof of concept from the UI side.

al-fisher commented 4 years ago

Yep - this will depend on the Units_Engine in the Localisation_Toolkit. @tg359 and all discussed and agreed wrapping UnitsNet

al-fisher commented 4 years ago

Resorting to 3.1 MVP if so, and we solve it as a whole. Otherwise I can take care of creating a proof of concept from the UI side.

Bumped to 3.1 for you - worth doing formal coordinated effort rather than quick proof of concept!

epignatelli commented 4 years ago

Ok! Thanks Al! I assigned @tg359 to the issue as well, to make sure we coordinate when we start doing this!

al-fisher commented 4 years ago

Created new issue here https://github.com/BHoM/Localisation_Toolkit/issues/18 which this is dependant on and to start planning next steps on this

FraserGreenroyd commented 1 year ago

This is now handled I think via the Quantities attributes and the use of Localisation_Toolkit for conversions so closing this issue but feel free to reopen if any element has not been completed satisfactorily 😄

IsakNaslundBh commented 1 year ago

Actually only think one half of this issue has been handled - the matter of displaying units.

To ease the way we perform calculation, and remove the extra step of manually moving from one unit to the other (e.g. N/mm2 to KN/m2)

Is still not resolved (enabling unit conversions from UI into methods). Think we should keep this open