mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-14 01:30:49 +00:00
Fix session search function to make sure invalidates properly
This commit is contained in:
parent
5e8047f528
commit
285fa6746e
@ -1262,24 +1262,12 @@ EventDataType Profile::calcBelowThreshold(ChannelID code, EventDataType threshol
|
|||||||
|
|
||||||
Day * Profile::findSessionDay(Session * session)
|
Day * Profile::findSessionDay(Session * session)
|
||||||
{
|
{
|
||||||
MachineType mt = session->type();
|
// MachineType mt = session->type();
|
||||||
|
|
||||||
QDate start = LastGoodDay(mt);
|
QMap<QDate, Day *>::iterator it;
|
||||||
QDate end = LastGoodDay(mt);
|
QMap<QDate, Day *>::iterator it_end = p_profile->daylist.end();
|
||||||
|
for (it = p_profile->daylist.begin(); it != it_end; ++it) {
|
||||||
QDate date = start;
|
Day *day = it.value();
|
||||||
|
|
||||||
if (date.isNull()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
double val = 0;
|
|
||||||
int cnt = 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
Day *day = FindGoodDay(date, mt);
|
|
||||||
|
|
||||||
if (day) {
|
|
||||||
for (int i=0; i<day->size(); i++) {
|
for (int i=0; i<day->size(); i++) {
|
||||||
Session * s = day->sessions.at(i);
|
Session * s = day->sessions.at(i);
|
||||||
if (s == session) {
|
if (s == session) {
|
||||||
@ -1287,9 +1275,6 @@ Day * Profile::findSessionDay(Session * session)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
date = date.addDays(1);
|
|
||||||
} while (date <= end);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user