diff --git a/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.cpp b/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.cpp index cb24c31d72b9f019afa88ce22408daecaf7b9e2d..04b28cde489ae3f1efb4804ef574cb1a40516fb9 100644 --- a/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.cpp +++ b/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.cpp @@ -40,11 +40,12 @@ namespace armarx::armem::gui // This cast is safe because 999 * 1000 < MAX_INT. microseconds->setValue( static_cast<int>((QDateTime::currentMSecsSinceEpoch() % 1000) * 1000)); + microseconds->setSuffix(" µs"); auto* hlayout = new QHBoxLayout(); hlayout->addWidget(new QLabel("Time")); hlayout->addWidget(dateTime); - hlayout->addWidget(new QLabel("µs")); + hlayout->addWidget(new QLabel(".")); hlayout->addWidget(microseconds); setLayout(hlayout); } @@ -58,8 +59,10 @@ namespace armarx::armem::gui RelativeTimestampInput::RelativeTimestampInput() : seconds(new QDoubleSpinBox()) { - seconds->setSingleStep(0.1); seconds->setDecimals(6); + seconds->setSingleStep(0.1); + seconds->setRange(-1e6, 1e6); + seconds->setSuffix(" s"); seconds->setValue(0); auto* hlayout = new QHBoxLayout(); diff --git a/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.h b/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.h index 511a2d4157081cbc2ab35e164904cd390f863d81..59e5cfa207b82926bdca68357790297e4c52d31b 100644 --- a/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.h +++ b/source/RobotAPI/libraries/armem_gui/prediction_widget/TimestampInput.h @@ -35,6 +35,7 @@ namespace armarx::gui namespace armarx::armem::gui { + class TimestampInput : public QWidget { Q_OBJECT // NOLINT @@ -43,6 +44,7 @@ namespace armarx::armem::gui virtual armarx::DateTime retrieveTimeStamp() = 0; }; + class AbsoluteTimestampInput : public TimestampInput { Q_OBJECT // NOLINT @@ -57,6 +59,7 @@ namespace armarx::armem::gui armarx::gui::LeadingZeroSpinBox* microseconds; }; + class RelativeTimestampInput : public TimestampInput { Q_OBJECT // NOLINT @@ -69,4 +72,5 @@ namespace armarx::armem::gui private: QDoubleSpinBox* seconds; // NOLINT }; + } // namespace armarx::armem::gui