Cylindrical Tank volume display improvement

Starting with the 12/9/2022 Nightly build, there will be a way to display the volume of the Cylindrical Tank as a pure volume, as opposed to a percentage of the capacity. The driving properties for this new display option are within the valueDisplay object:

{
  "enabled": true,
  "format": "0%",
  "unit": {
    "enabled": false,
    "value": "",
    "fix": "post"
  },
  "style": {
    "classes": ""
  }
}

Note the addition of a format property and a unit object, which contains several additional properties. These settings default to these values to assure that existing Cylindrical Tanks display as they always have, where the displayed value has always been a percentage of the value against the capacity props.

The format property provides helpful enumerations of probable formats (percent, none, integer, currency), but accepts any string format you'd like to provide. If the format property is unable to meet your use-case, the unit object provides for more fine-tuning of the displayed value, including the ability to prefix or postfix units onto the value property when displayed. The value property of unit will be attached as either a prefix or postfix to the displayed value even if a formatting option is applied as long as unit is enabled. This allows for displaying values however you like, including "H20 50%"

The following screenshot provides some examples of different settings and how they are applied to a Cylindrical Tank:

Instance 1:

  • Default display properties.

Instance 2:

  • No formatting applied ("none"), so the value property is displayed as a pure value, regardless of the capacity value. Note that the liquid continues to display as a percentage of the available space, so you should still manage your capacity value to reflect the available space of the tank.

Instance 3:

  • Default settings, but it's worth noting that the value here is greater than the warningThreshold. The warningThreshold has always been and will continue to be the percentage of fill at which the Cylindrical Tank should display a warning. Again, this is unchanged, but some users might have assumed the warningThreshold was intended to be the limit of the value which would trigger the warning appearance.

Instance 4:

  • Here, we see the same values as Instance 3 but with a lower warningThreshold which has been exceeded by the percentage as a calculation of value over capacity, and so the warning appearance has been applied.

Instance 5:

  • Here, we are applying the "integer" formatting, but we have also elected to provide our own units ("L") as a postfix to the displayed value.

Instance 6:

  • This example shows how to use a unit value ("$" in this instance) as a prefix to the displayed value.
  • This example is similar to use of the "currency" formatting option, but note the lack of displayed trailing decimal places.
7 Likes