Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
7721c0f4
Commit
7721c0f4
authored
Apr 28, 2020
by
Gauthier Quesnel
Browse files
gui: add accumulator-2 model
parent
f6fc2d0b
Pipeline
#11690
passed with stage
in 1 minute and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/gui/gui.hpp
View file @
7721c0f4
...
...
@@ -105,6 +105,7 @@ static inline const char* status_string[] = {
"model_quantifier_bad_external_message"
,
"model_cross_bad_external_message"
,
"model_time_func_bad_init_message"
,
"model_accumulator_bad_external_message"
,
"gui_not_enough_memory"
,
"io_file_format_error"
,
"io_file_format_model_error"
,
...
...
app/gui/node-editor.cpp
View file @
7721c0f4
...
...
@@ -718,6 +718,13 @@ struct editor
}
break
;
case
dynamics_type
::
generator
:
{
auto
&
dyn
=
sim
.
generator_models
.
get
(
mdl
.
id
);
ImGui
::
PushItemWidth
(
120.0
f
);
ImGui
::
InputDouble
(
"value"
,
&
dyn
.
default_value
);
ImGui
::
InputDouble
(
"period"
,
&
dyn
.
default_period
);
ImGui
::
InputDouble
(
"offset"
,
&
dyn
.
default_offset
);
ImGui
::
PopItemWidth
();
imnodes
::
BeginOutputAttribute
(
get_out
(
dyn
.
y
[
0
]));
ImGui
::
TextUnformatted
(
"prod"
);
imnodes
::
EndAttribute
();
...
...
@@ -757,6 +764,21 @@ struct editor
ImGui
::
TextUnformatted
(
"out"
);
imnodes
::
EndAttribute
();
}
break
;
case
dynamics_type
::
accumulator_2
:
{
auto
&
dyn
=
sim
.
accumulator_2_models
.
get
(
mdl
.
id
);
imnodes
::
BeginInputAttribute
(
get_in
(
dyn
.
x
[
0
]));
ImGui
::
TextUnformatted
(
"number-1"
);
imnodes
::
EndAttribute
();
imnodes
::
BeginInputAttribute
(
get_in
(
dyn
.
x
[
1
]));
ImGui
::
TextUnformatted
(
"number-2"
);
imnodes
::
EndAttribute
();
imnodes
::
BeginInputAttribute
(
get_in
(
dyn
.
x
[
2
]));
ImGui
::
TextUnformatted
(
"acc-1"
);
imnodes
::
EndAttribute
();
imnodes
::
BeginInputAttribute
(
get_in
(
dyn
.
x
[
3
]));
ImGui
::
TextUnformatted
(
"acc-2"
);
imnodes
::
EndAttribute
();
}
break
;
case
dynamics_type
::
time_func
:
{
auto
&
dyn
=
sim
.
time_func_models
.
get
(
mdl
.
id
);
const
char
*
items
[]
=
{
"time"
,
"square"
};
...
...
@@ -1039,6 +1061,14 @@ struct editor
}
}
if
(
ImGui
::
MenuItem
(
"accumulator-2"
))
{
if
(
sim
.
accumulator_2_models
.
can_alloc
(
1u
)
&&
sim
.
models
.
can_alloc
(
1u
))
{
auto
&
mdl
=
sim
.
accumulator_2_models
.
alloc
();
sim
.
alloc
(
mdl
,
sim
.
accumulator_2_models
.
get_id
(
mdl
),
"acc-2"
);
}
}
if
(
ImGui
::
MenuItem
(
"time_func"
))
{
if
(
sim
.
time_func_models
.
can_alloc
(
1u
)
&&
sim
.
models
.
can_alloc
(
1u
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment