Switch Icon
Examples.Switch
Usage
DiscreteComponents.Examples.Switch()
Connectors
u1- This connector represents a real signal as an input to a component (RealInput)u2- This connector represents a real signal as an input to a component (RealInput)y- This connector represents a real signal as an output from a component (RealOutput)signal- This connector represents a boolean signal as an input to a component (BooleanInput)
Behavior
Behavior of this component cannot be rendered because it includes path variables.
Source
component Switch
u1 = RealInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -40, "y1": 190, "x2": 60, "y2": 290, "rot": 0}
},
"tags": []
}
}
u2 = RealInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -50, "y1": 690, "x2": 50, "y2": 790, "rot": 0}
},
"tags": []
}
}
y = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
},
"tags": []
}
}
signal = BooleanInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": -40, "x2": 550, "y2": 60, "rot": 90}
},
"tags": []
}
}
relations
y = ifelse(signal, u1, u2)
metadata {"Dyad": {"doc": {"behavior": false}}}
end
Flattened Source
component Switch
u1 = RealInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -40, "y1": 190, "x2": 60, "y2": 290, "rot": 0}
},
"tags": []
}
}
u2 = RealInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": -50, "y1": 690, "x2": 50, "y2": 790, "rot": 0}
},
"tags": []
}
}
y = RealOutput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 960, "y1": 450, "x2": 1060, "y2": 550, "rot": 0}
},
"tags": []
}
}
signal = BooleanInput() {
"Dyad": {
"placement": {
"diagram": {"iconName": "default", "x1": 450, "y1": -40, "x2": 550, "y2": 60, "rot": 90}
},
"tags": []
}
}
relations
y = ifelse(signal, u1, u2)
metadata {"Dyad": {"doc": {"behavior": false}}}
endTest Cases
No test cases defined.
Related
- Examples
- Experiments
- Analyses