Small fixes and bigger library
This commit is contained in:
@@ -607,6 +607,179 @@
|
||||
"end for;"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ac5011ce-4659-4bdd-900a-63a1c779652c": {
|
||||
"name": "pulse",
|
||||
"interface": {
|
||||
"ports": {
|
||||
"69974610-3bd6-42c1-a8bb-afe6086ef0f3": {
|
||||
"port_type": "signal",
|
||||
"name": "y",
|
||||
"direction": "output",
|
||||
"multiplicity": false,
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"description": null,
|
||||
"value_type": "real",
|
||||
"quantity": null,
|
||||
"unit": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": {
|
||||
"8e128f7a-cf97-4f27-a664-488921819395": {
|
||||
"name": "amplitude",
|
||||
"value": "1.0",
|
||||
"value_type": "real",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": null
|
||||
},
|
||||
"5ff17831-f2f9-4833-9e4b-4facf7c28c0c": {
|
||||
"name": "width",
|
||||
"value": "50.0",
|
||||
"value_type": "real",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": "Pulse width in %"
|
||||
},
|
||||
"b036592b-4dc0-498b-a966-7146cf9cf95b": {
|
||||
"name": "offset",
|
||||
"value": "0",
|
||||
"value_type": "real",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": null
|
||||
},
|
||||
"df82150d-973d-4a8a-9bd5-6ce21a2e8bbb": {
|
||||
"name": "period",
|
||||
"value": "1.0",
|
||||
"value_type": "real",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": null
|
||||
},
|
||||
"1195c93e-3309-494e-9a56-96e8fd5e330c": {
|
||||
"name": "nperiod",
|
||||
"value": "-1",
|
||||
"value_type": "int",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": "Number of periods (<0 means infinite)"
|
||||
},
|
||||
"3f5f7b5c-2794-4e75-a5c8-1ef2b0ecd87d": {
|
||||
"name": "startTime",
|
||||
"value": "0.0",
|
||||
"value_type": "real",
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"quantity": null,
|
||||
"unit": null,
|
||||
"description": null
|
||||
}
|
||||
},
|
||||
"implementation": {
|
||||
"implementation_type": "equation",
|
||||
"declarations": [
|
||||
"Integer count;",
|
||||
"Modelica.Units.SI.Time T_start;",
|
||||
"Modelica.Units.SI.Time T_width=period*width/100;"
|
||||
],
|
||||
"initial_equations": [
|
||||
"initial algorithm",
|
||||
"count := integer((time-startTime)/period);",
|
||||
"T_start := startTime + count*period;"
|
||||
],
|
||||
"equations": [
|
||||
"when time >= (pre(count)+1)*period + startTime then",
|
||||
"\tcount = pre(count) + 1;",
|
||||
"\tT_start = time;",
|
||||
"end when;",
|
||||
"y = offset + (if (time < startTime or nperiod == 0 or (nperiod > 0 and count >= nperiod)) then 0 else if time < T_start + T_width then amplitude else 0);"
|
||||
]
|
||||
}
|
||||
},
|
||||
"ec0599cb-b57b-4194-b166-526d5cd5382a": {
|
||||
"name": "plusminus",
|
||||
"interface": {
|
||||
"ports": {
|
||||
"23a8b215-7c2f-4ccf-b020-4d274d7a228f": {
|
||||
"port_type": "signal",
|
||||
"name": "plus",
|
||||
"direction": "input",
|
||||
"multiplicity": true,
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"description": null,
|
||||
"value_type": "real",
|
||||
"quantity": null,
|
||||
"unit": null
|
||||
},
|
||||
"4c4771f8-22c8-4829-a060-913470e2b2fc": {
|
||||
"port_type": "signal",
|
||||
"name": "minus",
|
||||
"direction": "input",
|
||||
"multiplicity": true,
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"description": null,
|
||||
"value_type": "real",
|
||||
"quantity": null,
|
||||
"unit": null
|
||||
},
|
||||
"a186a0e1-7aea-4fb6-871c-0ba70d78b8ac": {
|
||||
"port_type": "signal",
|
||||
"name": "y",
|
||||
"direction": "output",
|
||||
"multiplicity": false,
|
||||
"matrix_size": [
|
||||
1,
|
||||
1
|
||||
],
|
||||
"description": null,
|
||||
"value_type": "real",
|
||||
"quantity": null,
|
||||
"unit": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": {},
|
||||
"implementation": {
|
||||
"implementation_type": "equation",
|
||||
"declarations": [],
|
||||
"initial_equations": [],
|
||||
"equations": [
|
||||
"y = sum(plus) - sum(minus);"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"connections": {
|
||||
@@ -661,6 +834,16 @@
|
||||
"connection_type": "signal",
|
||||
"source": "a2709c23-7485-43b2-bc87-28a0f4c37c0b",
|
||||
"target": "8bd1cc42-03b9-4c46-b31b-c1f46933dc9e"
|
||||
},
|
||||
"42f8d11c-8b31-476a-8e56-dd1ac3703508": {
|
||||
"connection_type": "signal",
|
||||
"source": "69974610-3bd6-42c1-a8bb-afe6086ef0f3",
|
||||
"target": "23a8b215-7c2f-4ccf-b020-4d274d7a228f"
|
||||
},
|
||||
"81e6b0d7-65f2-4edc-a303-6eee78ac1972": {
|
||||
"connection_type": "signal",
|
||||
"source": "5807dc83-d049-4f0f-9708-d041a752fcd0",
|
||||
"target": "4c4771f8-22c8-4829-a060-913470e2b2fc"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1149,6 +1332,139 @@
|
||||
-32
|
||||
]
|
||||
}
|
||||
},
|
||||
"ac5011ce-4659-4bdd-900a-63a1c779652c": {
|
||||
"shapes": {
|
||||
"7a9115fe-4e40-49d9-ab50-2f399ca1038b": {
|
||||
"layer": 0,
|
||||
"type": "rectangle",
|
||||
"pos": [
|
||||
-48,
|
||||
-48
|
||||
],
|
||||
"width": 96.0,
|
||||
"height": 96.0,
|
||||
"line_type": "solid",
|
||||
"line_thickness": 5.0,
|
||||
"corner_radius": 8.0,
|
||||
"line_color": "#00007fff",
|
||||
"fill_color": "#ebebebff"
|
||||
},
|
||||
"80e150dc-07d3-4d27-9fe0-eecb82fb2689": {
|
||||
"layer": 4,
|
||||
"type": "line",
|
||||
"pos": [
|
||||
-32,
|
||||
-32
|
||||
],
|
||||
"end": [
|
||||
-32,
|
||||
32
|
||||
],
|
||||
"line_type": "solid",
|
||||
"line_thickness": 3.0,
|
||||
"line_color": "#000000ff"
|
||||
},
|
||||
"66c7fb78-2866-4f9f-9df2-95cfa4c57a2d": {
|
||||
"layer": 2,
|
||||
"type": "line",
|
||||
"pos": [
|
||||
-32,
|
||||
32
|
||||
],
|
||||
"end": [
|
||||
32,
|
||||
32
|
||||
],
|
||||
"line_type": "solid",
|
||||
"line_thickness": 3.0,
|
||||
"line_color": "#000000ff"
|
||||
},
|
||||
"b1b1f425-eea6-48e7-a61d-f9eb221984b7": {
|
||||
"layer": 3,
|
||||
"type": "line",
|
||||
"pos": [
|
||||
-32,
|
||||
14
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
14
|
||||
],
|
||||
"line_type": "solid",
|
||||
"line_thickness": 2.0,
|
||||
"line_color": "#ffaa00ff"
|
||||
},
|
||||
"0c0b7ec3-557d-4fb4-b8b8-b6b6a269ec55": {
|
||||
"layer": 5,
|
||||
"type": "line",
|
||||
"pos": [
|
||||
3,
|
||||
14
|
||||
],
|
||||
"end": [
|
||||
3,
|
||||
-13
|
||||
],
|
||||
"line_type": "solid",
|
||||
"line_thickness": 2.0,
|
||||
"line_color": "#ffaa00ff"
|
||||
},
|
||||
"e5c99d8a-69db-4915-b1e7-84ac5e52de02": {
|
||||
"layer": 6,
|
||||
"type": "line",
|
||||
"pos": [
|
||||
3,
|
||||
-13
|
||||
],
|
||||
"end": [
|
||||
32,
|
||||
-13
|
||||
],
|
||||
"line_type": "solid",
|
||||
"line_thickness": 2.0,
|
||||
"line_color": "#ffaa00ff"
|
||||
}
|
||||
},
|
||||
"port_positions": {
|
||||
"69974610-3bd6-42c1-a8bb-afe6086ef0f3": [
|
||||
-8,
|
||||
-8
|
||||
]
|
||||
}
|
||||
},
|
||||
"ec0599cb-b57b-4194-b166-526d5cd5382a": {
|
||||
"shapes": {
|
||||
"ecbbad0e-67e3-4d13-ba25-7660f50bc38e": {
|
||||
"layer": 0,
|
||||
"type": "rectangle",
|
||||
"pos": [
|
||||
-48,
|
||||
-48
|
||||
],
|
||||
"width": 96.0,
|
||||
"height": 96.0,
|
||||
"line_type": "solid",
|
||||
"line_thickness": 5.0,
|
||||
"corner_radius": 8.0,
|
||||
"line_color": "#00007fff",
|
||||
"fill_color": "#ebebebff"
|
||||
}
|
||||
},
|
||||
"port_positions": {
|
||||
"23a8b215-7c2f-4ccf-b020-4d274d7a228f": [
|
||||
-24,
|
||||
9
|
||||
],
|
||||
"4c4771f8-22c8-4829-a060-913470e2b2fc": [
|
||||
-24,
|
||||
-26
|
||||
],
|
||||
"a186a0e1-7aea-4fb6-871c-0ba70d78b8ac": [
|
||||
11,
|
||||
-8
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1207,8 +1523,8 @@
|
||||
48
|
||||
],
|
||||
"2b3844e8-1875-40d0-ae4e-7a14ca217bce": [
|
||||
-432,
|
||||
236
|
||||
-428,
|
||||
744
|
||||
],
|
||||
"bf08f999-bfe8-493a-9ad2-9c2965e17d6d": [
|
||||
-504,
|
||||
@@ -1233,6 +1549,14 @@
|
||||
"8e8dca73-2d11-4631-9c24-5e1a4e3b2920": [
|
||||
64,
|
||||
128
|
||||
],
|
||||
"ac5011ce-4659-4bdd-900a-63a1c779652c": [
|
||||
-432,
|
||||
560
|
||||
],
|
||||
"ec0599cb-b57b-4194-b166-526d5cd5382a": [
|
||||
-120,
|
||||
656
|
||||
]
|
||||
},
|
||||
"component_labels": {
|
||||
|
||||
Reference in New Issue
Block a user