Update UnitSymbol to switch method. Refactor Converts to Internal - #181
Conversation
…ctor-convert-methods-to-internal-for-access
|
@BHoMBot check required |
|
@Chrisshort92 to confirm, the following actions are now queued:
There are 22 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@peterjamesnugent to confirm, the following actions are now queued:
There are 18 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@peterjamesnugent to confirm, the following actions are now queued:
There are 18 requests in the queue ahead of you. |
|
@BHoMBot check installer |
|
@Chrisshort92 to confirm, the following actions are now queued:
There are 18 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@Chrisshort92 to confirm, the following actions are now queued:
There are 8 requests in the queue ahead of you. |
|
@BHoMBot check versioning |
|
@Chrisshort92 to confirm, the following actions are now queued:
There are 9 requests in the queue ahead of you. |
|
The check |
peterjamesnugent
left a comment
There was a problem hiding this comment.
Tested with the latest script, works for me.
|
@BHoMBot check ready-to-merge |
|
@peterjamesnugent to confirm, the following actions are now queued:
There are 2 requests in the queue ahead of you. |
Depends On
This change creates conflicts in Etabs & SAP Toolkits through the use of Adapter.Query() & Units.Query() . Both resolved in these PRs.
Issues addressed by this PR
Closes #180
Adds
Query.UnitSymbol(Enum), returning the symbol for aBH.oM.Unitsmember —LengthUnit.Millimeter->mm,AreaMomentOfInertiaUnit.CentimeterToTheFourth->cm⁴.It dispatches on the quantity and reuses the BHoM -> UnitsNet mapper that already backs the
conversions, so a symbol and a conversion can never disagree about which UnitsNet unit a BHoM unit
is. Those 22 mappers move from
privatetointernalsoQuerycan reach them.internalpublishes nothing — the Grasshopper harvest keys off
public static.Test files
https://burohappold.sharepoint.com/:f:/r/sites/BHoM/02_Current/12_Scripts/02_Pull%20Request/BHoM/Localisation_Toolkit/Units_Engine/%23178-add-fromunitstring-and-tounitstring-extension-methods-to-bhengineunits?d=wa31dff9fd66d429d82862958d7784b0d&csf=1&web=1&e=oFSP83
Changelog
Query.UnitSymboltoUnits_Engine, returning a unit's display symbolConvert's per-quantity unit mappers are nowinternalrather thanprivateAdditional comments
ToPressureUnitwas the only mapper declaredthis object unit. Inert whileprivate, but asinternalit would publish an extension method onobjectacross the assembly, so thethisisremoved. Both call sites already used static-call syntax.