Hopsan / hopsan

Hopsan is a free multi-domain system simulation tool developed at the division of Fluid and mechatronic systems at Linköping university.
Apache License 2.0
157 stars 43 forks source link

Unit change when writing mathematical expression as input #2201

Open nikal14 opened 7 months ago

nikal14 commented 7 months ago

Describe the bug When writing a value in input: pressure, in for example "C-type Pressure Source", as a mathematical expression the unit changes to Pa without changing the input value.

To Reproduce

  1. Add a C_type_Pressure_Source
  2. Change the unit for "input: pressure" to MPa
  3. Set the value of "input: pressure" to "20-7" or "20/100" and press apply, then ok
  4. The unit for pressure will change back to Pa without changing the input value

Expected behavior The component should keep the unit as stated by the user or change the input value with the correct prefix.