Fix AHI problem

This commit is contained in:
Mark Watkins 2011-09-11 02:30:25 +10:00
parent 81f5401e30
commit cb0ef55943

View File

@ -304,9 +304,9 @@ EventDataType Day::cph(ChannelID code)
for (int i=0;i<sessions.size();i++) { for (int i=0;i<sessions.size();i++) {
if (!sessions[i]->m_sum.contains(code)) continue; if (!sessions[i]->m_sum.contains(code)) continue;
sum+=sessions[i]->count(code); sum+=sessions[i]->count(code);
h+=sessions[i]->hours(); //h+=sessions[i]->hours();
} }
sum/=h; sum/=hours();;
return sum; return sum;
} }
@ -317,8 +317,9 @@ EventDataType Day::sph(ChannelID code)
for (int i=0;i<sessions.size();i++) { for (int i=0;i<sessions.size();i++) {
if (!sessions[i]->m_sum.contains(code)) continue; if (!sessions[i]->m_sum.contains(code)) continue;
sum+=sessions[i]->sum(code)/3600.0; sum+=sessions[i]->sum(code)/3600.0;
h+=sessions[i]->hours(); //h+=sessions[i]->hours();
} }
h=hours();
sum=(100.0/h)*sum; sum=(100.0/h)*sum;
return sum; return sum;
} }