You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- icon rotation now saved with key `r`, previously was `wall` which was not the best name
35
-
- connectors nodes now saved with an underscore: `_name`, this helps prevent a collision with nodes named `x`, `y`, or `r`
3
+
The ModelingToolkitDesigner.jl package is a helper tool for visualizing and editing [ModelingToolkit.jl](https://github.com/SciML/ModelingToolkit.jl) system connections.
36
4
37
5
## Examples
38
-
Examples can be found in the "examples" folder.
6
+
Examples can be found in the `examples` folder.
39
7
40
8
### Hydraulic Example
41
9
@@ -49,7 +17,7 @@ Examples can be found in the "examples" folder.
49
17
50
18

51
19
52
-
# Tutorial
20
+
##Tutorial
53
21
54
22
Let's start with a simple hydraulic system with no connections defined yet...
After the original `system()` component function is updated with the connection equations, the connections will be re-drawn automatically when using `ModelingToolkitDesigner.view()`. *Note: CairoMakie vector based images can also be generated by passing `false` to the 2nd argument of `view()` (i.e. the `interactive` variable).*
121
89
122
-
# Hierarchy
90
+
##Hierarchy
123
91
If a component has a double lined box then it is possible to "look under the hood". Simply select the component and click __open__.
Edits made to sub-components can be saved and loaded directly or indirectly.
128
96
129
-
# Pass Thrus
97
+
##Pass Thrus
130
98
To generate more esthetic diagrams, one can use as special kind of component called a `PassThru`, which simply defines 2 or more connected `connectors` to serve as a corner, tee, or any other junction. Simply define a component function starting with `PassThru` and ModelingToolkitDesigner.jl will recognize it as a special component type. For example for a corner with 2 connection points:
131
99
132
100
@@ -172,7 +140,7 @@ Adding these components to your system will then allow for corners, tees, etc. t
ModelingToolkitDesigner.jl comes with icons for the ModelingToolkitStandardLibrary.jl pre-loaded. For custom components, icons are loaded from either the `path` variable supplied to `ODESystemDesign()` or from an `icons` folder of the package namespace. To find the paths ModelingToolkitDesign.jl is searching, run the following on the component of interest (for example `sys.vol`)
The first file location comes from the `path` variable. The second is looking for a folder `icons` in the component parent package, in this case `ModelingToolkitStandardLibrary`, and the third path is from the `icons` folder of this `ModelingToolkitDesigner` package. The first real file is the chosen icon load path. Feel free to contribute icons here for any other public component libraries.
186
154
187
-
## Icon Rotation
155
+
###Icon Rotation
188
156
Rotate an icon using the button or key `r`. The icon rotation is controlled by the `r` atribute in the saved `.toml` design file. The default direction is "E" for east. The image direciton can change to any "N","S","E","W". For example, to rotate the capacitor icon by -90 degrees (i.e. from "E" to "N") simply edit the design file as
189
157
190
158
```
@@ -195,12 +163,12 @@ y = 0.29
195
163
r = "N"
196
164
```
197
165
198
-
# Colors
166
+
##Colors
199
167
ModelingToolkitDesigner.jl colors the connections based on `ModelingToolkitDesigner.design_colors`. Colors for the ModelingToolkitStandardLibrary.jl are already loaded. To add a custom connector color, simply use `add_color(system::ODESystem, color::Symbol)` where `system` is a reference to the connector (e.g. `sys.vol.port`) and `color` is a named color from [Colors.jl](https://juliagraphics.github.io/Colors.jl/stable/namedcolors/).
200
168
201
-
# TODO
169
+
##TODO
202
170
- Finish adding icons for the ModelingToolkitStandardLibrary.jl
203
171
- Improve text positioning and fontsize
204
172
- How to include connection equations automatically, maybe implement the `input` macro
205
173
- Provide `PassThru`'s without requiring user to add `PassThru` components to ODESystem
0 commit comments