{
  "node": {
    "id": "block:enum-cast",
    "type": "Block",
    "label": "Enumeration code",
    "properties": {
      "id": "enum-cast",
      "name": "Enumeration code",
      "kind": "studio",
      "summary": "Explicitly converts a declared enumeration signal to its integer code.",
      "behavior": "Explicitly removes enumeration identity and exposes the member’s signed32 integer code.",
      "ports": [
        {
          "name": "in0",
          "direction": "input",
          "unit": "1",
          "description": "Input 1; i32 signal.",
          "shape": [],
          "elementType": "i32"
        },
        {
          "name": "out0",
          "direction": "output",
          "unit": "1",
          "description": "Output 1; i32 signal.",
          "shape": [],
          "elementType": "i32"
        }
      ],
      "parameters": [
        {
          "key": "signal.quantity",
          "label": "signal quantity",
          "unit": "1",
          "default": "dimensionless",
          "description": "Explicit signal quantity in the worked model."
        },
        {
          "key": "signal.shape",
          "label": "signal shape",
          "unit": "1",
          "default": [],
          "description": "Explicit signal shape in the worked model."
        },
        {
          "key": "signal.elementType",
          "label": "signal element Type",
          "unit": "1",
          "default": "i32",
          "description": "Explicit signal elementType in the worked model."
        },
        {
          "key": "signal.enumeration.id",
          "label": "signal enumeration id",
          "unit": "1",
          "default": "ChargeMode",
          "description": "Explicit signal enumeration id in the worked model."
        },
        {
          "key": "signal.enumeration.members",
          "label": "signal enumeration members",
          "unit": "1",
          "default": [
            {
              "name": "Idle",
              "value": 0
            },
            {
              "name": "CC",
              "value": 1
            },
            {
              "name": "CV",
              "value": 2
            }
          ],
          "description": "Explicit signal enumeration members in the worked model."
        }
      ],
      "equations": [
        "output = enumeration member code"
      ],
      "example": {
        "title": "Enumeration code — executable model",
        "text": "Converting the declared ChargeMode.CC member yields integer1.",
        "url": "https://design.lemonergy.com/cosim.html?example=routing-enum-cast",
        "label": "Open Studio example",
        "inputs": [],
        "checks": [
          {
            "port": "Result",
            "label": "Result",
            "atS": 0.2,
            "value": 1,
            "unit": "1",
            "tolerance": 1e-09
          }
        ]
      },
      "limits": [
        "The input must carry a declared enumeration identity. This does not construct arbitrary enumeration members from unvalidated integers."
      ],
      "references": [],
      "referenceNote": "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.",
      "caseIds": [
        "native-enum-cast"
      ],
      "availability": {
        "status": "released",
        "label": "Available in Lemonergy Studio",
        "detail": "The bundled example is available in the production release verified on 28 October 2026. The parameters and examples here are synthetic teaching fixtures, not a characterized cell or a validated operating limit."
      },
      "evidence": [
        "docs/glossary/native-block-verification.json"
      ],
      "sourceRepository": "Lemonergy Studio public contract",
      "sourceRevision": "verification-2026-10-27",
      "type": "enum-cast",
      "implementationId": "enum-cast",
      "url": "https://lemonergy.com/learn/glossary/blocks/enum-cast/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/enum-cast/",
      "sourceFile": "block-library.json",
      "reviewed": "2026-10-27",
      "releaseEvidence": {
        "environment": "production",
        "status": "verified",
        "revision": "e76cadfc203e15eb41f3478d8b1044a5b851953d",
        "verifiedOn": "2026-10-28",
        "exampleUrls": [
          "https://design.lemonergy.com/cosim.html?example=routing-enum-cast"
        ]
      }
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/native-enum-cast/0",
      "type": "usesBlock",
      "source": "workflow:native-enum-cast",
      "target": "block:enum-cast",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Enumeration code",
        "type": "enum-cast",
        "role": "Explicitly removes enumeration identity and exposes the member’s signed32 integer code.",
        "settings": [
          "Use the block reference for settings and connections.",
          "Bundled example verified on the production release of 28 October 2026."
        ]
      }
    }
  ],
  "outgoing": [],
  "neighbors": [
    {
      "id": "workflow:native-enum-cast",
      "type": "Workflow",
      "label": "Enumeration code — executable model",
      "properties": {
        "id": "native-enum-cast",
        "title": "Enumeration code — executable model",
        "kind": "studio",
        "summary": "Explicitly converts a declared enumeration signal to its integer code.",
        "steps": [
          "Review the interface, units and model limits.",
          "Open the Studio example and run its bundled model.",
          "Compare outputs with the numerical checks; change one input and run again."
        ],
        "example": "Converting the declared ChargeMode.CC member yields integer1.",
        "observe": "Inspect the output channels and checks on the block reference page.",
        "limits": "The input must carry a declared enumeration identity. This does not construct arbitrary enumeration members from unvalidated integers.",
        "url": "https://design.lemonergy.com/cosim.html?example=routing-enum-cast",
        "label": "Open Studio example",
        "evidence": [
          "docs/glossary/native-block-verification.json"
        ]
      }
    }
  ]
}
