@@ -5,38 +5,34 @@ using ModelingToolkitDesigner
55using CairoMakie
66using GLMakie
77
8- @component function PassThru2 (;name)
8+ @component function PassThru2 (; name)
99 @variables t
10-
10+
1111 systems = @named begin
1212 p1 = Pin ()
1313 p2 = Pin ()
1414 end
1515
16- eqs = [
17- connect (p1, p2)
18- ]
16+ eqs = [connect (p1, p2)]
1917
2018 return ODESystem (eqs, t, [], []; name, systems)
2119end
2220
23- @component function PassThru3 (;name)
21+ @component function PassThru3 (; name)
2422 @variables t
25-
23+
2624 systems = @named begin
2725 p1 = Pin ()
2826 p2 = Pin ()
2927 p3 = Pin ()
3028 end
3129
32- eqs = [
33- connect (p1, p2, p3)
34- ]
30+ eqs = [connect (p1, p2, p3)]
3531
3632 return ODESystem (eqs, t, [], []; name, systems)
3733end
3834
39- @component function Circuit (;name)
35+ @component function Circuit (; name)
4036
4137 R = 1.0
4238 C = 1.0
4844 capacitor = Capacitor (C = C)
4945 source = Voltage ()
5046 constant = Constant (k = V)
51- ground = Ground ()
47+ ground = Ground ()
5248 pt2 = PassThru2 ()
5349 pt3 = PassThru3 ()
5450 end
6864 # connect(resistor.n, capacitor.p)
6965 # connect(capacitor.n, source.n, ground.g)]
7066
71- ODESystem (eqs, t, [], []; systems, name)
67+ ODESystem (eqs, t, [], []; systems, name)
7268end
7369
7470@named rc = Circuit ()
8076
8177path = joinpath (@__DIR__ , " design" )
8278design = ODESystemDesign (rc, path)
83- GLMakie. set_theme! (Theme (;fontsize= 12 ))
79+ GLMakie. set_theme! (Theme (; fontsize = 12 ))
8480ModelingToolkitDesigner. view (design)
8581
8682# CairoMakie.set_theme!(Theme(;fontsize=12))
0 commit comments