system.mes.meter.enums.getMeterCostSourceEnum
Description
Retrieves the values of the MeterCostSource enum. MeterCostSource defines how the cost per unit of measure is determined for a Meter Configuration. This is useful for populating selection inputs (such as dropdowns) or for validating a cost source value before setting it on a Meter Configuration.
Syntax
system.mes.meter.enums.getMeterCostSourceEnum()
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
| None | - | - | This method does not take any parameters. |
Returns
Returns a list of MeterCostSource enum values. Each value exposes name() (the constant name, used when setting a Meter Configuration's cost source) and toString() (the human-readable display name):
| Name | Display Name | Description |
|---|---|---|
STATIC | Static | A fixed cost value stored directly on the Meter Configuration. |
FROM_METER_TYPE | From Meter Type | The cost is inherited from the associated Meter Type. |
EXPRESSION | Expression | The cost is evaluated at runtime from an Ignition expression on the Meter Configuration. |
Code Examples
# Retrieve the MeterCostSource enum values
costSources = system.mes.meter.enums.getMeterCostSourceEnum()
# Print the constant name and display name of each value
for costSource in costSources:
print(costSource.name() + " - " + costSource.toString())
# Example output:
# STATIC - Static
# FROM_METER_TYPE - From Meter Type
# EXPRESSION - Expression