Skip to content

Commit 185ee8c

Browse files
Merge pull request #3984 from SciML/bgc/gui_metadata_fix
gui_metadata fix
2 parents e69f96b + f5afef5 commit 185ee8c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/systems/system.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ function flatten(sys::System, noeqs = false)
773773
# later removed by the user will be re-added. Right now, we just want to
774774
# retain `defaults(sys)` as-is.
775775
discover_from_metadata = false, metadata = get_metadata(sys),
776+
gui_metadata = get_gui_metadata(sys),
776777
description = description(sys), name = nameof(sys))
777778
end
778779

src/systems/systems.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ function __mtkcompile(sys::AbstractSystem; simplify = false,
165165
assertions = assertions(sys),
166166
guesses = guesses(sys), initialization_eqs = initialization_equations(sys),
167167
continuous_events = continuous_events(sys),
168-
discrete_events = discrete_events(sys))
168+
discrete_events = discrete_events(sys),
169+
gui_metadata = get_gui_metadata(sys))
169170
@set! ssys.parameter_dependencies = get_parameter_dependencies(sys)
170171
return ssys
171172
end

test/components.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ include("common/rc_model.jl")
4646
@test get_component_type(pin).name == :Pin
4747
@test get_component_type(rc_model.resistor).name == :Resistor
4848

49+
@mtkcompile rc_model_compile = RCModel()
50+
@test get_component_type(rc_model).name == :RCModel
51+
@test get_component_type(rc_model_compile).name == :RCModel
52+
4953
completed_rc_model = complete(rc_model)
5054
@test isequal(completed_rc_model.resistor.n.i, resistor.n.i)
5155
@test ModelingToolkit.n_expanded_connection_equations(capacitor) == 2
@@ -352,7 +356,8 @@ end
352356
@named comp1 = System(Equation[], t; systems = [input])
353357
@named output = RealOutput()
354358
@named comp2 = System(Equation[], t; systems = [output])
355-
@named sys = System([connect(comp2.output.u, comp1.input.u)], t; systems = [comp1, comp2])
359+
@named sys = System([connect(comp2.output.u, comp1.input.u)], t; systems = [
360+
comp1, comp2])
356361
eq = only(equations(expand_connections(sys)))
357362
# as opposed to `output.u ~ input.u`
358363
@test isequal(eq, comp1.input.u ~ comp2.output.u)

0 commit comments

Comments
 (0)