Commit 6a6036fb authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

gui: enable a send message from constant model

parent 18cb1c78
Pipeline #34508 passed with stage
in 1 minute and 15 seconds
......@@ -2208,9 +2208,26 @@ show_dynamics_inputs(editor& ed, generator& dyn)
}
static void
show_dynamics_inputs(editor& /*ed*/, constant& dyn)
show_dynamics_inputs(editor& ed, constant& dyn)
{
ImGui::InputDouble("value", &dyn.default_value);
ImGui::InputDouble("offset", &dyn.default_offset);
if (ed.is_running()) {
if (ImGui::Button("Send now")) {
dyn.value = dyn.default_value;
dyn.sigma = dyn.default_offset;
auto& mdl = get_model(dyn);
mdl.tl = ed.simulation_current;
mdl.tn = ed.simulation_current + dyn.sigma;
if (dyn.sigma && mdl.tn == ed.simulation_current)
mdl.tn = std::nextafter(ed.simulation_current,
ed.simulation_current + 1.);
ed.sim.sched.update(mdl, mdl.tn);
}
}
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment