Custom unit specification

Custom unit specification - Messages

#1 Posted: 6/18/2014 4:29:15 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Andrey, thanks for the example. I open this topic because I cannot post attachments otherwise.

Here are some observations:
- The title strings, given in the tags do not appear in the unit selection list (I would have expected them as description strings).
- If a specific language title is given, then a language specific string is required in the tag, otherwise you do not even get the base version if the unit language is set to that version.
- That is, the only function of the title attribute seems to be suppression of the generic unit name, it makes a language specific unit name compulsory.

I would expect the title attributes to appear as descriptions in the selection dialog and in the dynamic assistant. Currently, just the unit names themselves are used, which just doubles the text.

I would expect to be able to use the generic unit names even if I specified a specific title. E.g. for percent, the description is language specific, but the percent sign is not. Am I really expected to provide the same string in individual languages once I choose to provide individual titles? This, however is only relevant if the title has some real use, otherwise no problem to just leave that attribute out.

Also, I would propose to allocate a separate dimension "Angle" to not mix angular with other dimensionless quantities.
units.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#2 Posted: 6/18/2014 4:33:44 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Here is the first attempt to restore the added units of the inofficial portable distribution within the new units framework of SMath 0.97.5280.

There is one more issue: somehow saving and re-opening the attached file leads replaces the unit 'vha by 'Morgen.
Obviously, I still do not really understand the file format, because I don't know how to add descriptions to the units, which are visible in the dynamic assistant and in the unit selection dialog.


<?xml version="1.0" encoding="utf-8"?>
<entries lang:default="eng" xmlns="http://smath.info/studio/entries" xmlns:lang="http://smath.info/studio/entries">
  <units>
    <property dimension="613" title="Quantity" lang:rus="Количество">
      <add factor="1" exp="-2" system="All" title="Percent" lang:rus="Процент" lang:ger="Prozent">
        <synonym name="% percent" lang:ger="% Prozent" lang:rus="% Процент"/>
      </add>
      <add factor="12" system="All" title="dozen" lang:ger="Dutzend">
        <synonym name="dozen" lang:ger="Dutzend"/>
      </add>
      <add factor="1" exp="-3" system="All" title="per thousand">
        <synonym name="‰"/>
      </add>
      <add factor="1" exp="-6" system="All" title="part per million">
        <synonym name="ppm"/>
      </add>
      <add factor="60" system="All" title="sixty" lang:ger="Schock">
        <synonym name="sixty" lang:ger="Schock"/>
      </add>
      <add factor="1" exp="6" system="All" title="million" lang:ger="Million">
        <synonym name="million" lang:ger="Mio Million"/>
      </add>
      <add factor="1" exp="9" system="All" title="billion" lang:ger="Milliarde">
        <synonym name="billion" lang:ger="Mrd Milliarde"/>
      </add>
    </property>
	<property dimension="253">
      <add factor="1" exp="2" system="Metric" title="Ar" lang:ger="Ar">
        <synonym name="Ar" lang:ger="Ar" />
      </add>
      <add factor="25" exp="2" system="Metric" title="Morgen" lang:ger="Morgen">
        <synonym name="Morgen" lang:ger="Morgen Viertelhektar vha" />
      </add>
      <add factor="25" exp="2" system="Metric" title="Quarter of a hectar" lang:ger="Viertelhektar">
        <synonym name="vha" lang:ger="vha Viertelhektar" />
      </add>
    </property>
	<property dimension="279">
	  <add factor="98066.5" system="All" title="technical atmosphere (kgf/cm²" lang:ger="Technische Atmosphäre (1 kp/cm²" >
        <synonym name="at" lang:ger="at" />
      </add>
    </property>
 	<property dimension="278">
	  <add factor="735.49875" system="All" title="horse power (DIN)" lang:ger="Pferdestärke (DIN)" >
        <synonym name="hp_DIN" lang:ger="PS" />
      </add>
    </property>
 	<property dimension="262">
      <add factor="9.80665" exp="-3" system="All" title="Gram force" lang:ger="Pond">
        <synonym name="gf" lang:rus="гс" lang:ger="p" />
      </add>
    </property>
 </units>
</entries>



units.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Posted: 6/18/2014 6:05:59 PM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

There are some formatting problems with text incdices and underlines in unit names. See attachment.
format.PNG
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#4 Posted: 6/20/2014 10:42:35 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

Here is an update of our custom units file.

I tried to split the group "dimensionless" into "angle" and "quantity" and the
group "frequency" into "angular velocity", "frequency" and "radioactivity".

A limitation of my knowledge or of the units engine is that I cannot specify separate base units for these categories. When displaying an rpm value, the result is plain wrong, as the default base unit is Hz instead of 1/s. Perhaps it would be better to define the dimension "frequency" with base unit 1/s.

Put the attached file into directory "entries" in your SMath installation.
ufhb.zip (1 KiB) downloaded 50 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
  • New Posts New Posts
  • No New Posts No New Posts