Skip to content
LIBRARY
Sources.BooleanStep.md

Sources.BooleanStep

Generate step signal of type Boolean.

The Boolean output y is a step signal that transitions from startValue to !startValue at time = startTime.

This component extends from BlockComponents.Interfaces.PartialBooleanSource

Usage

BlockComponents.Sources.BooleanStep(startTime=0, startValue=false)

Parameters:

NameDescriptionUnitsDefault value
startTimeTime instant of step starts0
startValueOutput before startTimefalse

Connectors

  • y - This connector represents a boolean signal as an output from a component (BooleanOutput)

Behavior

Source

dyad
"""
Generate step signal of type Boolean.

The Boolean output y is a step signal that transitions from `startValue`
to `!startValue` at time = `startTime`.
"""
component BooleanStep
  extends BlockComponents.Interfaces.PartialBooleanSource
  "Time instant of step start"
  parameter startTime::Time = 0
  "Output before startTime"
  parameter startValue::Boolean = false
relations
  y = ifelse(time >= startTime, !startValue, startValue)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/BooleanStep.svg"}
  }
}
end
Flattened Source
dyad
"""
Generate step signal of type Boolean.

The Boolean output y is a step signal that transitions from `startValue`
to `!startValue` at time = `startTime`.
"""
component BooleanStep
  "Connector of Boolean output signal"
  y = BooleanOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 1000, "y1": 450, "x2": 1100, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  "Time instant of step start"
  parameter startTime::Time = 0
  "Output before startTime"
  parameter startValue::Boolean = false
relations
  y = ifelse(time >= startTime, !startValue, startValue)
metadata {
  "Dyad": {
    "labels": [{"label": "$(instance)", "x": 500, "y": 1100, "rot": 0}],
    "icons": {"default": "dyad://BlockComponents/BooleanStep.svg"}
  }
}
end


Test Cases

No test cases defined.