Choosing units in SMath Viewer.

Choosing units in SMath Viewer. - Messages

#1 Posted: 9/1/2025 8:54:25 AM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1,052 likes in 1,718 posts.

Group: User

I post here because I can't find a page for the SMath Viewer Plugin.

How to extend the way for Choosing units in SMath Viewer?. For example, I want to enable to choose the output of a power in hp, kW, kJ/min, BTU/hr or the input for a volumetric flux in m^3/hr, LPM, GPM, etc.

Thanks in advance.
Alvaro.
Edited 9/1/2025 10:03:49 AM
#2 Posted: 9/4/2025 2:10:14 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1,052 likes in 1,718 posts.

Group: User

Hi. This is my approach, but I'm not entirely convinced, I have the feeling that there must be a better solution.

image.png

CalcPot.sm (146.06 KiB) downloaded 76 time(s).

CalcPot.exe (3.77 MiB) downloaded 21 time(s).

Best regards.
Alvaro.
1 users liked this post
Oscar Campo 9/4/2025 3:01:56 PM
#3 Posted: 9/5/2025 10:26:13 AM
Martin Kraska

Martin Kraska

1,277 likes in 2,201 posts.

Group: Moderator

You can mess with the file Units.xml in the entries directory of your installation directory.

You can extend or reduce the units assigned to a particular dimension. Note that it seems not possible to distinguish physically different dimensions with the same base unit representation (just like energy and torque). But that is subject to testing.

So a new unit Nm will be displayed in the dynamic assistant with the annotation "Energy".

image.png

image.png
Martin KraskaPre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Alvaro Diaz Falconi 9/5/2025 6:51:39 PM
#4 Posted: 9/5/2025 7:03:56 PM
Alvaro Diaz Falconi

Alvaro Diaz Falconi

1,052 likes in 1,718 posts.

Group: User

Hi Martin. Yo're right! Thanks! I'm not a fan of editing those files for two reasons. First, it's local; if I want someone else to have access to those changes, I have to ask them to make them too. And second, because every update deletes those changes.

However, I hadn't realized this is completely different here, since whoever I share the executable with doesn't even have to have SMath installed. I'm going to try editing that file in an installation of your portable version. In addition to removing several units that wouldn't be useful, such as nanopascals, I could introduce others such as meters or inches of water column for pressure, cubic meters for volume, GPM, LPM for flow rates, BTU/min for power, and many others.

Best regards.
Alvaro
  • New Posts
  • No New Posts