##// END OF EJS Templates
Improves AMDA result parsing...
Improves AMDA result parsing Finds the unit among all the commented lines, in order to handle the case where the number of commented lines differs from one file to another

File last commit:

r489:e186227e6169
r492:41e897ecff03
Show More
TimeWidget.cpp
50 lines | 1.5 KiB | text/x-c | CppLexer
#include "TimeWidget/TimeWidget.h"
#include "ui_TimeWidget.h"
#include <Common/DateUtils.h>
#include <SqpApplication.h>
#include <Time/TimeController.h>
TimeWidget::TimeWidget(QWidget *parent) : QWidget{parent}, ui{new Ui::TimeWidget}
{
ui->setupUi(this);
ui->applyToolButton->setIcon(sqpApp->style()->standardIcon(QStyle::SP_DialogApplyButton));
// Connection
connect(ui->startDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
connect(ui->endDateTimeEdit, &QDateTimeEdit::dateTimeChanged, this,
&TimeWidget::onTimeUpdateRequested);
connect(ui->applyToolButton, &QToolButton::clicked, &sqpApp->timeController(),
&TimeController::onTimeNotify);
// Initialisation
auto endDateTime = QDateTime::currentDateTimeUtc();
auto startDateTime = endDateTime.addSecs(-3600); // one hour before
ui->startDateTimeEdit->setDateTime(startDateTime);
ui->endDateTimeEdit->setDateTime(endDateTime);
auto dateTime = SqpDateTime{DateUtils::secondsSinceEpoch(startDateTime),
DateUtils::secondsSinceEpoch(endDateTime)};
sqpApp->timeController().onTimeToUpdate(dateTime);
}
TimeWidget::~TimeWidget()
{
delete ui;
}
void TimeWidget::onTimeUpdateRequested()
{
auto dateTime = SqpDateTime{DateUtils::secondsSinceEpoch(ui->startDateTimeEdit->dateTime()),
DateUtils::secondsSinceEpoch(ui->endDateTimeEdit->dateTime())};
emit timeUpdated(std::move(dateTime));
}