Skip to content
LIBRARY
Sources.IntegerStep.md

Sources.IntegerStep

Generate step signal of type Integer.

The Integer output y equals offset for time < startTime and offset + height for time >= startTime.

Mirrors Modelica.Blocks.Sources.IntegerStep.

This component extends from BlockComponents.Interfaces.IntegerSignalSource

Usage

BlockComponents.Sources.IntegerStep(offset=0, startTime=0, height=1)

Parameters:

NameDescriptionUnitsDefault value
offsetOffset of output signal y0
startTimeOutput y = offset for time < startTime0
heightHeight of step1

Connectors

  • y - This connector represents an integer signal as an output from a component (IntegerOutput)

Behavior

Source

dyad
"""
Generate step signal of type Integer.

The Integer output `y` equals `offset` for `time < startTime` and
`offset + height` for `time >= startTime`.

Mirrors `Modelica.Blocks.Sources.IntegerStep`.
"""
component IntegerStep
  extends BlockComponents.Interfaces.IntegerSignalSource
  "Height of step"
  parameter height::Integer = 1
relations
  y = offset + ifelse(time < startTime, 0, height)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/IntegerStep.svg"}
  }
}
end
Flattened Source
dyad
"""
Generate step signal of type Integer.

The Integer output `y` equals `offset` for `time < startTime` and
`offset + height` for `time >= startTime`.

Mirrors `Modelica.Blocks.Sources.IntegerStep`.
"""
component IntegerStep
  "Connector of Integer output signal"
  y = IntegerOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 560, "rot": 0}
      },
      "tags": []
    }
  }
  "Offset of output signal y"
  parameter offset::Integer = 0
  "Output y = offset for time < startTime"
  parameter startTime::Real = 0
  "Height of step"
  parameter height::Integer = 1
relations
  y = offset + ifelse(time < startTime, 0, height)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/IntegerStep.svg"}
  }
}
end


Test Cases

No test cases defined.