mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
Change UTC to LocalTime for session times
This commit is contained in:
parent
a458fdfad6
commit
332ea6f159
@ -442,7 +442,7 @@ void OximeterImport::on_fileImportButton_clicked()
|
|||||||
// oximodule->setStartTime( ??? ); Nope, it was set in the loader module by the file import routime
|
// oximodule->setStartTime( ??? ); Nope, it was set in the loader module by the file import routime
|
||||||
on_syncButton_clicked();
|
on_syncButton_clicked();
|
||||||
}
|
}
|
||||||
qDebug() << "Finished file import: Oximodule startTime is " << oximodule->startTime().toString("yyyy.MM.dd HH:mm:ss");
|
qDebug() << "Finished file import: Oximodule startTime is " << oximodule->startTime().toString("yyyy-MMM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OximeterImport::on_liveImportButton_clicked()
|
void OximeterImport::on_liveImportButton_clicked()
|
||||||
@ -557,13 +557,13 @@ void OximeterImport::on_stopButton_clicked()
|
|||||||
|
|
||||||
void OximeterImport::on_calendarWidget_clicked(const QDate &date)
|
void OximeterImport::on_calendarWidget_clicked(const QDate &date)
|
||||||
{
|
{
|
||||||
qDebug() << "Calendar widget clicked " << date.toString("yyyy.MM.dd");
|
qDebug() << "Calendar widget clicked " << date.toString("yyyy-MMM-dd");
|
||||||
if (ui->radioSyncCPAP->isChecked()) {
|
if (ui->radioSyncCPAP->isChecked()) {
|
||||||
Day * day = p_profile->GetGoodDay(date, MT_CPAP);
|
Day * day = p_profile->GetGoodDay(date, MT_CPAP);
|
||||||
|
|
||||||
sessbar->clear();
|
sessbar->clear();
|
||||||
if (day) {
|
if (day) {
|
||||||
QDateTime time=QDateTime::fromMSecsSinceEpoch(day->first(), Qt::UTC);
|
QDateTime time=QDateTime::fromMSecsSinceEpoch(day->first(), Qt::LocalTime);
|
||||||
sessbar->clear();
|
sessbar->clear();
|
||||||
QList<QColor> colors;
|
QList<QColor> colors;
|
||||||
colors.push_back("#ffffe0");
|
colors.push_back("#ffffe0");
|
||||||
@ -580,11 +580,13 @@ void OximeterImport::on_calendarWidget_clicked(const QDate &date)
|
|||||||
ui->dateTimeEdit->setDateTime(time);
|
ui->dateTimeEdit->setDateTime(time);
|
||||||
} else {
|
} else {
|
||||||
ui->sessbarLabel->setText(tr("No CPAP data available on %1").arg(date.toString(Qt::SystemLocaleLongDate)));
|
ui->sessbarLabel->setText(tr("No CPAP data available on %1").arg(date.toString(Qt::SystemLocaleLongDate)));
|
||||||
|
qDebug() << "Using oximeter time " << oximodule->startTime().toString("yyyy-MMM-dd hh:mm:ssap") << "on date " << date.toString(Qt::SystemLocaleLongDate);
|
||||||
ui->dateTimeEdit->setDateTime(QDateTime(date,oximodule->startTime().time()));
|
ui->dateTimeEdit->setDateTime(QDateTime(date,oximodule->startTime().time()));
|
||||||
}
|
}
|
||||||
|
|
||||||
sessbar->update();
|
sessbar->update();
|
||||||
} else if (ui->radioSyncOximeter) {
|
} else if (ui->radioSyncOximeter) {
|
||||||
|
qDebug() << "Using oximeter date and time";
|
||||||
ui->sessbarLabel->setText(tr("%1").arg(date.toString(Qt::SystemLocaleLongDate)));
|
ui->sessbarLabel->setText(tr("%1").arg(date.toString(Qt::SystemLocaleLongDate)));
|
||||||
ui->dateTimeEdit->setDateTime(QDateTime(date, ui->dateTimeEdit->dateTime().time()));
|
ui->dateTimeEdit->setDateTime(QDateTime(date, ui->dateTimeEdit->dateTime().time()));
|
||||||
}
|
}
|
||||||
@ -597,7 +599,8 @@ void OximeterImport::on_calendarWidget_selectionChanged()
|
|||||||
|
|
||||||
void OximeterImport::onSessionSelected(Session * session)
|
void OximeterImport::onSessionSelected(Session * session)
|
||||||
{
|
{
|
||||||
QDateTime time=QDateTime::fromMSecsSinceEpoch(session->first(), Qt::UTC);
|
QDateTime time=QDateTime::fromMSecsSinceEpoch(session->first(), Qt::LocalTime);
|
||||||
|
qDebug() << "Selected session starts at " << time.toString("yyyy-MMM-dd hh:mm:ssap");
|
||||||
ui->dateTimeEdit->setDateTime(time);
|
ui->dateTimeEdit->setDateTime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -607,7 +610,7 @@ void OximeterImport::on_sessionBackButton_clicked()
|
|||||||
int idx = (sessbar->selected()-1);
|
int idx = (sessbar->selected()-1);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
sessbar->setSelected(idx);
|
sessbar->setSelected(idx);
|
||||||
QDateTime datetime = QDateTime::fromMSecsSinceEpoch(sessbar->session(idx)->first(), Qt::UTC);
|
QDateTime datetime = QDateTime::fromMSecsSinceEpoch(sessbar->session(idx)->first(), Qt::LocalTime);
|
||||||
ui->dateTimeEdit->setDateTime(datetime);
|
ui->dateTimeEdit->setDateTime(datetime);
|
||||||
sessbar->update();
|
sessbar->update();
|
||||||
}
|
}
|
||||||
@ -619,7 +622,7 @@ void OximeterImport::on_sessionForwardButton_clicked()
|
|||||||
int idx = (sessbar->selected()+1);
|
int idx = (sessbar->selected()+1);
|
||||||
if (idx < sessbar->count()) {
|
if (idx < sessbar->count()) {
|
||||||
sessbar->setSelected(idx);
|
sessbar->setSelected(idx);
|
||||||
QDateTime datetime = QDateTime::fromMSecsSinceEpoch(sessbar->session(idx)->first(), Qt::UTC);
|
QDateTime datetime = QDateTime::fromMSecsSinceEpoch(sessbar->session(idx)->first(), Qt::LocalTime);
|
||||||
ui->dateTimeEdit->setDateTime(datetime);
|
ui->dateTimeEdit->setDateTime(datetime);
|
||||||
sessbar->update();
|
sessbar->update();
|
||||||
}
|
}
|
||||||
@ -639,7 +642,7 @@ void OximeterImport::on_radioSyncOximeter_clicked()
|
|||||||
ui->syncCPAPGroup->setVisible(false);
|
ui->syncCPAPGroup->setVisible(false);
|
||||||
if ( oximodule ) {
|
if ( oximodule ) {
|
||||||
if (oximodule->isStartTimeValid()) {
|
if (oximodule->isStartTimeValid()) {
|
||||||
qDebug() << "Oximeter time is valid " << oximodule->startTime().toString();
|
qDebug() << "Oximeter time is valid " << oximodule->startTime().toString("yyyy-MMM-dd HH:mm:ssap");
|
||||||
ui->calendarWidget->setSelectedDate(oximodule->startTime().date());
|
ui->calendarWidget->setSelectedDate(oximodule->startTime().date());
|
||||||
ui->dateTimeEdit->setDateTime(oximodule->startTime());
|
ui->dateTimeEdit->setDateTime(oximodule->startTime());
|
||||||
} else
|
} else
|
||||||
@ -781,7 +784,7 @@ void OximeterImport::on_syncButton_clicked()
|
|||||||
qCritical() << "OximeterImport::on_syncButton_clicked called when oximodule is null";
|
qCritical() << "OximeterImport::on_syncButton_clicked called when oximodule is null";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
qDebug() << "Oximodule Start Time is " << oximodule->startTime().toString("yyyy.MM.dd HH.mm.ss") << "Duration: " << oximodule->getDuration(/* dummy */ 0 );
|
qDebug() << "Oximodule Start Time is " << oximodule->startTime().toString("yyyy-MMM-dd HH.mm.ss") << "Duration: " << oximodule->getDuration(/* dummy */ 0 );
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentWidget(ui->syncPage);
|
ui->stackedWidget->setCurrentWidget(ui->syncPage);
|
||||||
|
|
||||||
@ -792,7 +795,7 @@ void OximeterImport::on_syncButton_clicked()
|
|||||||
QDate last = p_profile->LastDay();
|
QDate last = p_profile->LastDay();
|
||||||
|
|
||||||
QDate oxidate = oximodule->startTime().date();
|
QDate oxidate = oximodule->startTime().date();
|
||||||
qDebug() << "Oximodule start date is " << oximodule->startTime().date().toString("yyyy.MM.dd");
|
qDebug() << "Oximodule start date is " << oximodule->startTime().date().toString("yyyy-MMM-dd");
|
||||||
|
|
||||||
|
|
||||||
if ((oxidate >= first) && (oxidate <= last)) {
|
if ((oxidate >= first) && (oxidate <= last)) {
|
||||||
@ -1141,14 +1144,14 @@ void OximeterImport::setInformation()
|
|||||||
void OximeterImport::on_oximeterType_currentIndexChanged(int index)
|
void OximeterImport::on_oximeterType_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0: //New CMS50's
|
case 0: // New CMS50's Version 7 protocol
|
||||||
ui->directImportButton->setEnabled(true);
|
ui->directImportButton->setEnabled(true);
|
||||||
ui->liveImportButton->setEnabled(false);
|
ui->liveImportButton->setEnabled(false);
|
||||||
ui->fileImportButton->setEnabled(true);
|
ui->fileImportButton->setEnabled(true);
|
||||||
ui->oldCMS50specific->setVisible(false);
|
ui->oldCMS50specific->setVisible(false);
|
||||||
ui->newCMS50settingsPanel->setVisible(true);
|
ui->newCMS50settingsPanel->setVisible(true);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1: // old CMS50 models
|
||||||
ui->directImportButton->setEnabled(true);
|
ui->directImportButton->setEnabled(true);
|
||||||
ui->liveImportButton->setEnabled(true);
|
ui->liveImportButton->setEnabled(true);
|
||||||
ui->fileImportButton->setEnabled(true);
|
ui->fileImportButton->setEnabled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user