Lemonergy · Studio block

Enumeration constant

Emits a declared named enumeration member with its exact integer code.

Implementation ID
enum-constant
Reviewed
2026-10-27

Behavior

Emits one named member of a declared enumeration as a typed integer-coded signal.

Interface

Enumeration constant interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Enumeration constantStudio blockout0
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
out0output1Output 1; i32 signal.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
enumeration
enumeration
1ChargeModeExplicit enumeration in the worked model.
members
members
1[{"name": "Idle", "value": 0}, {"name": "CC", "value": 1}, {"name": "CV", "value": 2}]Explicit members in the worked model.
member
member
1CCExplicit member in the worked model.

Equations and rules

  • output = integer code of selected declared member

Worked example

Enumeration constant — executable model

ChargeMode.CC emits code1; selecting ChargeMode.CV emits code2.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Result
Result
0.2111e-09

Use in a workflow

Enumeration constant — executable model

Emits a declared named enumeration member with its exact integer code.

  1. Enumeration constant: Emits one named member of a declared enumeration as a typed integer-coded signal.
    • Use the block reference for settings and connections.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • Up to256 unique names and signed32 codes. Conflicting declarations are rejected. Use an explicit enumeration-code conversion before ordinary numeric operations.

Reference basis

This compiler and software type contract is defined by the documented behavior and executable example; no external research result or full external API parity is claimed.

Implementation sources

This reference follows the public interface and locally verified numerical checks for an upcoming release.

Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27

  • docs/glossary/native-block-verification.json

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)