BHoM / BHoM/BHoM_UI

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

Open
#128 7 comments 4 reactions 2 assignees Claimed by @tg359 View on GitHub
type:feature
Dominant language
C#
Stars
9
Forks
6
PR merge metrics
No merged PRs in 30d

Description

#### 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:
- On the UI side, we need to add a new entry in the menu that provides a list of units to choose. The `Name` of the `ParamInfo` will then add a suffix of the form ` [unit]` and it will be serialised in the `ParamInfo` itself.
- On the Engine side, when we select the unit we need a `FromSI` and a `ToSI` method that scales the scalar into the right unit. Return format of any method, regardless of the unit of the inputs has be be SI.

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.