Skip to content

Commit f56140e

Browse files
authored
Merge pull request #9 from bradcarman/bgc/nodes
Icon rotation feature
2 parents 94c32b4 + 2058e80 commit f56140e

File tree

25 files changed

+1368
-54
lines changed

25 files changed

+1368
-54
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name = "ModelingToolkitDesigner"
22
uuid = "23d639d0-9462-4d1e-84fe-d700424865b8"
33
authors = ["Brad Carman <[email protected]>"]
4-
version = "0.3.0"
4+
version = "1.0.0"
55

66
[deps]
77
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
88
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
99
FilterHelpers = "d8f44d74-4a63-4059-add9-16c5740a0809"
1010
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
1111
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
12+
ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
1213
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
1314

1415
[compat]
@@ -17,13 +18,12 @@ FileIO = "1.16"
1718
FilterHelpers = "0.2"
1819
GLMakie = "0.8"
1920
ModelingToolkit = "8.50"
20-
ModelingToolkitStandardLibrary = "1.12"
21+
ModelingToolkitStandardLibrary = "2"
2122
TOML = "1.0"
2223
julia = "1.6"
2324

2425
[extras]
25-
ModelingToolkitStandardLibrary = "16a59e39-deab-5bd0-87e4-056b12336739"
2626
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2727

2828
[targets]
29-
test = ["Test", "ModelingToolkitStandardLibrary"]
29+
test = ["Test"]

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
The ModelingToolkitDesigner.jl package is a helper tool for visualizing and editing ModelingToolkit.jl system connections.
44

55
# Updates
6+
## v1.0.0
7+
- added icon rotation feature
8+
9+
![rotation](https://github.com/bradcarman/ModelingToolkitDesigner.jl/assets/40798837/8c904030-5d4c-4ba8-a105-f0b098ae842a)
10+
11+
- added keyboard commands
12+
- m: after selecting a component, use the `m` key to turn dragging on. This can be easier then clicking and dragging.
13+
- c: connect
14+
- r: rotate
15+
16+
617
## v0.3.0
718
- Connector nodes are now correctly positioned around the component with natural ordering
819

@@ -75,7 +86,7 @@ ModelingToolkitDesigner.view(design)
7586

7687
Components can then be positioned in several ways:
7788
- keyboard: select component and then use up, down, left, right keys
78-
- mouse: click and drag (currently only 1 component at a time is supported)
89+
- mouse: click and drag (or click and then `m` key)
7990
- alignment: select and align horrizontal or vertial with respective buttons
8091

8192
![step2-3](https://user-images.githubusercontent.com/40798837/228626821-9e405ec3-e89b-4f30-bfff-ceb761ea6e2f.png)
@@ -84,7 +95,7 @@ Nodes/Connectors can be positioned by selecting with the mouse and using the __m
8495

8596
![step4-5](https://user-images.githubusercontent.com/40798837/228626824-06f4d432-ea93-408d-ad1a-ddaa6ddc14e6.png)
8697

87-
Connections can then be made by clicking 2 nodes and using the __connect__ button. One can then click the __save__ button which will store the visualization information in the `path` location in a `.toml` format as well as the connection code in `.jl` format.
98+
Connections can then be made by clicking 2 nodes and using the __connect__ button or the `c` key. One can then click the __save__ button which will store the visualization information in the `path` location in a `.toml` format as well as the connection code in `.jl` format.
8899

89100
![step6-7](https://user-images.githubusercontent.com/40798837/228640663-e263a561-6549-415b-a8ff-b74e78c4bdb9.png)
90101

@@ -165,7 +176,7 @@ julia> println.(ModelingToolkitDesigner.get_icons(sys.vol, path));
165176
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.
166177

167178
## Icon Rotation
168-
The icon rotation is controlled by the `r` atribute in the saved `.toml` design file. Currently this must be edited by hand. 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
179+
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
169180

170181
```
171182
[capacitor]
3.83 KB
Loading
Lines changed: 140 additions & 0 deletions
Loading
4.22 KB
Loading
Lines changed: 159 additions & 0 deletions
Loading
3.21 KB
Loading

0 commit comments

Comments
 (0)