mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-16 02:30:45 +00:00
Sacrificed Multithreaded recalcs, as memory footprint was damn scary.. I'll revist this later
This commit is contained in:
parent
f9c1fa27c5
commit
2cb35b69c0
@ -336,7 +336,7 @@ bool Machine::Save()
|
|||||||
Session *s=m_savelist.at(i);
|
Session *s=m_savelist.at(i);
|
||||||
s->UpdateSummaries();
|
s->UpdateSummaries();
|
||||||
s->Store(path);
|
s->Store(path);
|
||||||
//s->TrashEvents();
|
s->TrashEvents();
|
||||||
savelistCnt++;
|
savelistCnt++;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -740,6 +740,7 @@ void Session::updateCountSummary(ChannelID code)
|
|||||||
m_timesummary[code]=timesum;
|
m_timesummary[code]=timesum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FlowParser flowparserobject;
|
||||||
void Session::UpdateSummaries()
|
void Session::UpdateSummaries()
|
||||||
{
|
{
|
||||||
ChannelID id;
|
ChannelID id;
|
||||||
@ -747,7 +748,7 @@ void Session::UpdateSummaries()
|
|||||||
calcAHIGraph(this);
|
calcAHIGraph(this);
|
||||||
|
|
||||||
// Calculates RespRate and related waveforms (Tv, MV, Te, Ti) if missing
|
// Calculates RespRate and related waveforms (Tv, MV, Te, Ti) if missing
|
||||||
calcRespRate(this);
|
calcRespRate(this, &flowparserobject);
|
||||||
|
|
||||||
calcLeaks(this);
|
calcLeaks(this);
|
||||||
calcSPO2Drop(this);
|
calcSPO2Drop(this);
|
||||||
|
@ -2481,6 +2481,23 @@ void MainWindow::reprocessEvents(bool restart)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MainWindow::FreeSessions()
|
||||||
|
{
|
||||||
|
QDate first=PROFILE.FirstDay();
|
||||||
|
QDate date=PROFILE.LastDay();
|
||||||
|
Day *day;
|
||||||
|
QDate current=daily->getDate();
|
||||||
|
do {
|
||||||
|
day=PROFILE.GetDay(date,MT_CPAP);
|
||||||
|
if (day) {
|
||||||
|
if (date!=current) {
|
||||||
|
day->CloseEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
date=date.addDays(-1);
|
||||||
|
} while (date>=first);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::doReprocessEvents()
|
void MainWindow::doReprocessEvents()
|
||||||
{
|
{
|
||||||
m_inRecalculation=true;
|
m_inRecalculation=true;
|
||||||
@ -2496,10 +2513,11 @@ void MainWindow::doReprocessEvents()
|
|||||||
int daycount=first.daysTo(date);
|
int daycount=first.daysTo(date);
|
||||||
int idx=0;
|
int idx=0;
|
||||||
|
|
||||||
QList<Machine *> machines=PROFILE.GetMachines(MT_UNKNOWN);
|
//QList<Machine *> machines=PROFILE.GetMachines(MT_UNKNOWN);
|
||||||
|
|
||||||
if (qprogress) {
|
if (qprogress) {
|
||||||
qstatus->setText(tr("Loading Event Data"));
|
qstatus->setText(tr("Recalculating Summaries"));
|
||||||
|
//qstatus->setText(tr("Loading Event Data"));
|
||||||
qprogress->setValue(0);
|
qprogress->setValue(0);
|
||||||
qprogress->setVisible(true);
|
qprogress->setVisible(true);
|
||||||
}
|
}
|
||||||
@ -2509,6 +2527,7 @@ void MainWindow::doReprocessEvents()
|
|||||||
if (day) {
|
if (day) {
|
||||||
for (int i=0;i<day->size();i++) {
|
for (int i=0;i<day->size();i++) {
|
||||||
sess=(*day)[i];
|
sess=(*day)[i];
|
||||||
|
bool isopen=sess->eventsLoaded();
|
||||||
// Load the events
|
// Load the events
|
||||||
sess->OpenEvents();
|
sess->OpenEvents();
|
||||||
|
|
||||||
@ -2526,8 +2545,9 @@ void MainWindow::doReprocessEvents()
|
|||||||
sess->destroyEvent(CPAP_RDI);
|
sess->destroyEvent(CPAP_RDI);
|
||||||
|
|
||||||
sess->SetChanged(true);
|
sess->SetChanged(true);
|
||||||
//sess->machine()->SaveSession(sess);
|
sess->UpdateSummaries();
|
||||||
//if (!isopen) sess->TrashEvents();
|
sess->machine()->SaveSession(sess);
|
||||||
|
if (!isopen) sess->TrashEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
date=date.addDays(-1);
|
date=date.addDays(-1);
|
||||||
@ -2538,10 +2558,9 @@ void MainWindow::doReprocessEvents()
|
|||||||
|
|
||||||
} while (date>=first);
|
} while (date>=first);
|
||||||
|
|
||||||
qstatus->setText(tr("Recalculating Summaries"));
|
// for (int i=0;i<machines.size();i++) {
|
||||||
for (int i=0;i<machines.size();i++) {
|
// machines.at(i)->Save();
|
||||||
machines.at(i)->Save();
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
qstatus->setText(tr(""));
|
qstatus->setText(tr(""));
|
||||||
qprogress->setVisible(false);
|
qprogress->setVisible(false);
|
||||||
@ -2553,6 +2572,7 @@ void MainWindow::doReprocessEvents()
|
|||||||
} else {
|
} else {
|
||||||
Notify("Recalculations are now complete.","Task Completed");
|
Notify("Recalculations are now complete.","Task Completed");
|
||||||
|
|
||||||
|
FreeSessions();
|
||||||
daily->LoadDate(current);
|
daily->LoadDate(current);
|
||||||
if (overview) overview->ReloadGraphs();
|
if (overview) overview->ReloadGraphs();
|
||||||
}
|
}
|
||||||
|
@ -291,6 +291,7 @@ private slots:
|
|||||||
void on_filterBookmarksButton_clicked();
|
void on_filterBookmarksButton_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void FreeSessions();
|
||||||
|
|
||||||
Ui::MainWindow *ui;
|
Ui::MainWindow *ui;
|
||||||
Daily * daily;
|
Daily * daily;
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="importTab">
|
<widget class="QWidget" name="importTab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
Loading…
Reference in New Issue
Block a user