49 _dialog->addLineEdit(
"dbgo",
"DebugObserver Topic",
"DebugObserver");
51 return qobject_cast<SimpleConfigDialog*>(_dialog);
68 connect(_widget.pushButtonSend, &QPushButton::clicked,
69 this, &DebugPlotterWidgetWidgetController::send);
76 void DebugPlotterWidgetWidgetController::send()
78 _last_send = clock_t::now();
81 oh.setDebugObserverBatchModeEnabled(
true);
85 obs->setDebugDatafield(
"DebugPlotter_obs",
"field",
new Variant(1));
86 obs->setDebugChannel(
"DebugPlotter_obs_c2",
88 {
"field_1",
new Variant(1)},
89 {
"field_2",
new Variant(1)}
91 obs->setDebugDatafield(
"DebugPlotter_obs",
"field_2",
new Variant(1));
92 obs->removeDebugDatafield(
"DebugPlotter_obs",
"field_2");
95 _widget.checkBoxSinValue->isChecked() ?
96 std::sin(std::chrono::steady_clock::now().time_since_epoch().count() / 1e9) :
97 _widget.doubleSpinBoxValue->
value();
99 const auto num_instances = _widget.spinBoxNumInstances->value();
101 const auto s = [&](
const std::string & name,
auto value)
103 for (
int i = 0; i < num_instances; ++i)
107 oh.setDebugObserverDatafield(
"DebugPlotter_via_helper", n,
value);
111 const bool b =
static_cast<std::uint64_t
>(val) % 2;
112 s(
"float",
static_cast<float>(val));
113 s(
"double",
static_cast<double>(val));
115 s(
"uint8",
static_cast<unsigned char>(val));
116 s(
"uint16",
static_cast<std::uint16_t
>(val));
117 s(
"uint32",
static_cast<std::uint32_t
>(val));
118 s(
"uint64",
static_cast<std::uint64_t
>(val));
120 s(
"int8",
static_cast<char >(val));
121 s(
"int16",
static_cast<std::int16_t
>(val));
122 s(
"int32",
static_cast<std::int32_t
>(val));
123 s(
"int64",
static_cast<std::int64_t
>(val));
130 oh.sendDebugObserverBatch();
131 obs->ice_flushBatchRequests();
136 _widget.doubleSpinBoxValue->setSingleStep(_widget.doubleSpinBoxValueStep->value());
137 if (!_widget.checkBoxAutoSend->isChecked())
141 const auto dtMs = std::chrono::duration_cast<std::chrono::milliseconds>(
142 clock_t::now() - _last_send
144 if (dtMs >= _widget.spinBoxAutoSendDelay->value())