mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
Remove c++11 auto iterators :(
This commit is contained in:
parent
feec1ca758
commit
8aa0c2b8b4
@ -1259,8 +1259,8 @@ EventDataType gGraph::MaxY()
|
|||||||
return rmax_y = f_maxy;
|
return rmax_y = f_maxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto iterEnd = m_layers.constEnd();
|
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
|
||||||
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
||||||
Layer *layer = *iter;
|
Layer *layer = *iter;
|
||||||
if (layer->isEmpty()) {
|
if (layer->isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
@ -1291,8 +1291,8 @@ EventDataType gGraph::physMinY()
|
|||||||
|
|
||||||
//if (m_enforceMinY) return rmin_y=f_miny;
|
//if (m_enforceMinY) return rmin_y=f_miny;
|
||||||
|
|
||||||
auto iterEnd = m_layers.constEnd();
|
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
|
||||||
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
||||||
Layer *layer = *iter;
|
Layer *layer = *iter;
|
||||||
if (layer->isEmpty()) {
|
if (layer->isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
@ -1322,8 +1322,8 @@ EventDataType gGraph::physMaxY()
|
|||||||
|
|
||||||
// if (m_enforceMaxY) return rmax_y=f_maxy;
|
// if (m_enforceMaxY) return rmax_y=f_maxy;
|
||||||
|
|
||||||
auto iterEnd = m_layers.constEnd();
|
QVector<Layer *>::const_iterator iterEnd = m_layers.constEnd();
|
||||||
for (auto iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
for (QVector<Layer *>::const_iterator iter = m_layers.constBegin(); iter != iterEnd; ++iter) {
|
||||||
Layer *layer = *iter;
|
Layer *layer = *iter;
|
||||||
if (layer->isEmpty()) {
|
if (layer->isEmpty()) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -25,7 +25,7 @@ Day::Day(Machine *m)
|
|||||||
}
|
}
|
||||||
Day::~Day()
|
Day::~Day()
|
||||||
{
|
{
|
||||||
for (auto s = sessions.begin(); s != sessions.end(); ++s) {
|
for (QList<Session *>::iterator s = sessions.begin(); s != sessions.end(); ++s) {
|
||||||
delete(*s);
|
delete(*s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -35,8 +35,8 @@ MachineType Day::machine_type() const
|
|||||||
}
|
}
|
||||||
Session *Day::find(SessionID sessid)
|
Session *Day::find(SessionID sessid)
|
||||||
{
|
{
|
||||||
auto end=sessions.end();
|
QList<Session *>::iterator end=sessions.end();
|
||||||
for (auto s = sessions.begin(); s != end; ++s) {
|
for (QList<Session *>::iterator s = sessions.begin(); s != end; ++s) {
|
||||||
if ((*s)->session() == sessid) {
|
if ((*s)->session() == sessid) {
|
||||||
return (*s);
|
return (*s);
|
||||||
}
|
}
|
||||||
@ -59,12 +59,12 @@ EventDataType Day::settings_sum(ChannelID code)
|
|||||||
{
|
{
|
||||||
EventDataType val = 0;
|
EventDataType val = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
auto set = sess.settings.find(code);
|
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
|
||||||
|
|
||||||
if (set != sess.settings.end()) {
|
if (set != sess.settings.end()) {
|
||||||
val += set.value().toDouble();
|
val += set.value().toDouble();
|
||||||
@ -81,8 +81,8 @@ EventDataType Day::settings_max(ChannelID code)
|
|||||||
EventDataType max = min;
|
EventDataType max = min;
|
||||||
EventDataType value;
|
EventDataType value;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for(auto it = sessions.begin(); it < end; ++it) {
|
for(QList<Session *>::iterator it = sessions.begin(); it < end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
value = sess.settings.value(code, min).toDouble();
|
value = sess.settings.value(code, min).toDouble();
|
||||||
@ -101,9 +101,9 @@ EventDataType Day::settings_min(ChannelID code)
|
|||||||
EventDataType min = max;
|
EventDataType min = max;
|
||||||
EventDataType value;
|
EventDataType value;
|
||||||
|
|
||||||
auto end=sessions.end();
|
QList<Session *>::iterator end=sessions.end();
|
||||||
|
|
||||||
for(auto it = sessions.begin(); it < end; ++it) {
|
for(QList<Session *>::iterator it = sessions.begin(); it < end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
value = sess.settings.value(code, max).toDouble();
|
value = sess.settings.value(code, max).toDouble();
|
||||||
@ -121,11 +121,11 @@ EventDataType Day::settings_avg(ChannelID code)
|
|||||||
EventDataType val = 0;
|
EventDataType val = 0;
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; it++) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
auto set = sess.settings.find(code);
|
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
|
||||||
|
|
||||||
if (set != sess.settings.end()) {
|
if (set != sess.settings.end()) {
|
||||||
val += set.value().toDouble();
|
val += set.value().toDouble();
|
||||||
@ -143,12 +143,12 @@ EventDataType Day::settings_wavg(ChannelID code)
|
|||||||
{
|
{
|
||||||
double s0 = 0, s1 = 0, s2 = 0, tmp;
|
double s0 = 0, s1 = 0, s2 = 0, tmp;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; it++) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
auto set = sess.settings.find(code);
|
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(code);
|
||||||
|
|
||||||
if (set != sess.settings.end()) {
|
if (set != sess.settings.end()) {
|
||||||
s0 = sess.hours();
|
s0 = sess.hours();
|
||||||
@ -187,16 +187,16 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
|
|||||||
// First Calculate count of all events
|
// First Calculate count of all events
|
||||||
bool timeweight;
|
bool timeweight;
|
||||||
|
|
||||||
auto sess_end = sessions.end();
|
QList<Session *>::iterator sess_end = sessions.end();
|
||||||
for (auto sess_it = sessions.begin(); sess_it != sess_end; sess_it++) {
|
for (QList<Session *>::iterator sess_it = sessions.begin(); sess_it != sess_end; sess_it++) {
|
||||||
Session &sess = *(*sess_it);
|
Session &sess = *(*sess_it);
|
||||||
if (!sess.enabled()) { continue; }
|
if (!sess.enabled()) { continue; }
|
||||||
|
|
||||||
auto ei = sess.m_valuesummary.find(code);
|
QHash<ChannelID, QHash<EventStoreType, EventStoreType> >::iterator ei = sess.m_valuesummary.find(code);
|
||||||
|
|
||||||
if (ei == sess.m_valuesummary.end()) { continue; }
|
if (ei == sess.m_valuesummary.end()) { continue; }
|
||||||
|
|
||||||
auto tei = sess.m_timesummary.find(code);
|
QHash<ChannelID, QHash<EventStoreType, quint32> >::iterator tei = sess.m_timesummary.find(code);
|
||||||
timeweight = (tei != sess.m_timesummary.end());
|
timeweight = (tei != sess.m_timesummary.end());
|
||||||
gain = sess.m_gain[code];
|
gain = sess.m_gain[code];
|
||||||
|
|
||||||
@ -215,17 +215,17 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
|
|||||||
|
|
||||||
//qint64 tval;
|
//qint64 tval;
|
||||||
if (timeweight) {
|
if (timeweight) {
|
||||||
auto teival_end = tei.value().end();
|
QHash<EventStoreType, quint32>::iterator teival_end = tei.value().end();
|
||||||
for (auto it = tei.value().begin(); it != teival_end; ++it) {
|
for (QHash<EventStoreType, quint32>::iterator it = tei.value().begin(); it != teival_end; ++it) {
|
||||||
value = it.key();
|
value = it.key();
|
||||||
weight = it.value();
|
weight = it.value();
|
||||||
SN += weight;
|
SN += weight;
|
||||||
wmap[value] += weight;
|
wmap[value] += weight;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
auto eival_end = ei.value().end();
|
QHash<EventStoreType, EventStoreType>::iterator eival_end = ei.value().end();
|
||||||
|
|
||||||
for (auto it = ei.value().begin(); it != eival_end; ++it) {
|
for (QHash<EventStoreType, EventStoreType>::iterator it = ei.value().begin(); it != eival_end; ++it) {
|
||||||
value = it.key();
|
value = it.key();
|
||||||
weight = it.value();
|
weight = it.value();
|
||||||
|
|
||||||
@ -241,8 +241,8 @@ EventDataType Day::percentile(ChannelID code, EventDataType percentile)
|
|||||||
// Build sorted list of value/counts
|
// Build sorted list of value/counts
|
||||||
ValueCount vc;
|
ValueCount vc;
|
||||||
|
|
||||||
auto wmap_end = wmap.end();
|
QHash<EventStoreType, qint64>::iterator wmap_end = wmap.end();
|
||||||
for (auto it = wmap.begin(); it != wmap_end; it++) {
|
for (QHash<EventStoreType, qint64>::iterator it = wmap.begin(); it != wmap_end; it++) {
|
||||||
vc.value = EventDataType(it.key()) * gain;
|
vc.value = EventDataType(it.key()) * gain;
|
||||||
vc.count = it.value();
|
vc.count = it.value();
|
||||||
vc.p = 0;
|
vc.p = 0;
|
||||||
@ -314,8 +314,8 @@ EventDataType Day::avg(ChannelID code)
|
|||||||
// Cache this?
|
// Cache this?
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_avg.contains(code)) {
|
if (sess.enabled() && sess.m_avg.contains(code)) {
|
||||||
@ -334,8 +334,8 @@ EventDataType Day::sum(ChannelID code)
|
|||||||
// Cache this?
|
// Cache this?
|
||||||
EventDataType val = 0;
|
EventDataType val = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_sum.contains(code)) {
|
if (sess.enabled() && sess.m_sum.contains(code)) {
|
||||||
@ -351,9 +351,9 @@ EventDataType Day::wavg(ChannelID code)
|
|||||||
double s0 = 0, s1 = 0, s2 = 0;
|
double s0 = 0, s1 = 0, s2 = 0;
|
||||||
qint64 d;
|
qint64 d;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
|
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_wavg.contains(code)) {
|
if (sess.enabled() && sess.m_wavg.contains(code)) {
|
||||||
@ -383,8 +383,8 @@ qint64 Day::total_time()
|
|||||||
|
|
||||||
// Remember sessions may overlap..
|
// Remember sessions may overlap..
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session &sess = *(*it);
|
Session &sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -402,8 +402,8 @@ qint64 Day::total_time()
|
|||||||
// This is my implementation of a typical "brace counting" algorithm mentioned here:
|
// This is my implementation of a typical "brace counting" algorithm mentioned here:
|
||||||
// http://stackoverflow.com/questions/7468948/problem-calculating-overlapping-date-ranges
|
// http://stackoverflow.com/questions/7468948/problem-calculating-overlapping-date-ranges
|
||||||
|
|
||||||
auto rend = range.end();
|
QMultiMap<qint64, bool>::iterator rend = range.end();
|
||||||
for (auto rit = range.begin(); rit != rend; ++rit) {
|
for (QMultiMap<qint64, bool>::iterator rit = range.begin(); rit != rend; ++rit) {
|
||||||
b = rit.value();
|
b = rit.value();
|
||||||
|
|
||||||
if (!b) {
|
if (!b) {
|
||||||
@ -430,9 +430,9 @@ qint64 Day::total_time()
|
|||||||
|
|
||||||
bool Day::hasEnabledSessions()
|
bool Day::hasEnabledSessions()
|
||||||
{
|
{
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
|
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
if ((*it)->enabled()) {
|
if ((*it)->enabled()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -463,8 +463,8 @@ qint64 Day::first(ChannelID code)
|
|||||||
qint64 date = 0;
|
qint64 date = 0;
|
||||||
qint64 tmp;
|
qint64 tmp;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess=*(*it);
|
Session & sess=*(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -488,8 +488,8 @@ qint64 Day::last(ChannelID code)
|
|||||||
qint64 date = 0;
|
qint64 date = 0;
|
||||||
qint64 tmp;
|
qint64 tmp;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; it++) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -514,8 +514,8 @@ EventDataType Day::Min(ChannelID code)
|
|||||||
EventDataType tmp;
|
EventDataType tmp;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; it++) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; it++) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_min.contains(code)) {
|
if (sess.enabled() && sess.m_min.contains(code)) {
|
||||||
@ -540,8 +540,8 @@ EventDataType Day::physMin(ChannelID code)
|
|||||||
EventDataType tmp;
|
EventDataType tmp;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_min.contains(code)) {
|
if (sess.enabled() && sess.m_min.contains(code)) {
|
||||||
@ -564,9 +564,9 @@ bool Day::hasData(ChannelID code, SummaryType type)
|
|||||||
{
|
{
|
||||||
bool has = false;
|
bool has = false;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
|
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -635,8 +635,8 @@ EventDataType Day::Max(ChannelID code)
|
|||||||
EventDataType tmp;
|
EventDataType tmp;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_max.contains(code)) {
|
if (sess.enabled() && sess.m_max.contains(code)) {
|
||||||
@ -661,8 +661,8 @@ EventDataType Day::physMax(ChannelID code)
|
|||||||
EventDataType tmp;
|
EventDataType tmp;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_max.contains(code)) {
|
if (sess.enabled() && sess.m_max.contains(code)) {
|
||||||
@ -685,8 +685,8 @@ EventDataType Day::cph(ChannelID code)
|
|||||||
|
|
||||||
//EventDataType h=0;
|
//EventDataType h=0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_cnt.contains(code)) {
|
if (sess.enabled() && sess.m_cnt.contains(code)) {
|
||||||
@ -703,8 +703,8 @@ EventDataType Day::sph(ChannelID code)
|
|||||||
EventDataType sum = 0;
|
EventDataType sum = 0;
|
||||||
EventDataType h = 0;
|
EventDataType h = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.m_sum.contains(code)) {
|
if (sess.enabled() && sess.m_sum.contains(code)) {
|
||||||
@ -722,8 +722,8 @@ int Day::count(ChannelID code)
|
|||||||
{
|
{
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -736,12 +736,12 @@ int Day::count(ChannelID code)
|
|||||||
|
|
||||||
bool Day::settingExists(ChannelID id)
|
bool Day::settingExists(ChannelID id)
|
||||||
{
|
{
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
auto set = sess.settings.find(id);
|
QHash<ChannelID, QVariant>::iterator set = sess.settings.find(id);
|
||||||
|
|
||||||
if (set != sess.settings.end()) {
|
if (set != sess.settings.end()) {
|
||||||
return true;
|
return true;
|
||||||
@ -754,8 +754,8 @@ bool Day::settingExists(ChannelID id)
|
|||||||
|
|
||||||
bool Day::eventsLoaded()
|
bool Day::eventsLoaded()
|
||||||
{
|
{
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.eventsLoaded()) {
|
if (sess.eventsLoaded()) {
|
||||||
@ -768,8 +768,8 @@ bool Day::eventsLoaded()
|
|||||||
|
|
||||||
bool Day::channelExists(ChannelID id)
|
bool Day::channelExists(ChannelID id)
|
||||||
{
|
{
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled() && sess.eventlist.contains(id)) {
|
if (sess.enabled() && sess.eventlist.contains(id)) {
|
||||||
@ -782,9 +782,9 @@ bool Day::channelExists(ChannelID id)
|
|||||||
|
|
||||||
bool Day::channelHasData(ChannelID id)
|
bool Day::channelHasData(ChannelID id)
|
||||||
{
|
{
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
|
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -820,8 +820,8 @@ qint64 Day::first()
|
|||||||
qint64 date = 0;
|
qint64 date = 0;
|
||||||
qint64 tmp;
|
qint64 tmp;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
@ -846,9 +846,9 @@ qint64 Day::last()
|
|||||||
qint64 date = 0;
|
qint64 date = 0;
|
||||||
qint64 tmp;
|
qint64 tmp;
|
||||||
|
|
||||||
auto end = sessions.end();
|
QList<Session *>::iterator end = sessions.end();
|
||||||
|
|
||||||
for (auto it = sessions.begin(); it != end; ++it) {
|
for (QList<Session *>::iterator it = sessions.begin(); it != end; ++it) {
|
||||||
Session & sess = *(*it);
|
Session & sess = *(*it);
|
||||||
|
|
||||||
if (sess.enabled()) {
|
if (sess.enabled()) {
|
||||||
|
@ -422,8 +422,8 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
|
|||||||
new_sessions.clear(); // this hash is used by OpenFile
|
new_sessions.clear(); // this hash is used by OpenFile
|
||||||
|
|
||||||
// for each p0/p1/p2/etc... folder
|
// for each p0/p1/p2/etc... folder
|
||||||
for (auto p = paths.begin(); p != paths.end(); p++) {
|
for (int p=0; p < size; ++p) {
|
||||||
dir.setPath(*p);
|
dir.setPath(paths.at(p));
|
||||||
|
|
||||||
if (!dir.exists() || !dir.isReadable()) { continue; }
|
if (!dir.exists() || !dir.isReadable()) { continue; }
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
|
|||||||
|
|
||||||
// Scan through new sessions and parse event and waveform data
|
// Scan through new sessions and parse event and waveform data
|
||||||
// NOTE: this function could be multithreaded.
|
// NOTE: this function could be multithreaded.
|
||||||
for (auto it = new_sessions.begin(); it != new_sessions.end(); ++it) {
|
for (QHash<SessionID, Session *>::iterator it = new_sessions.begin(); it != new_sessions.end(); ++it) {
|
||||||
sid = it.key();
|
sid = it.key();
|
||||||
|
|
||||||
if (sessfiles.contains(sid)) {
|
if (sessfiles.contains(sid)) {
|
||||||
@ -497,7 +497,7 @@ int PRS1Loader::OpenMachine(Machine *m, QString path, Profile *profile)
|
|||||||
cnt = 0;
|
cnt = 0;
|
||||||
|
|
||||||
// Scan through parsed sessions, do a little cleanup and add to machine object
|
// Scan through parsed sessions, do a little cleanup and add to machine object
|
||||||
for (auto it = new_sessions.begin(); it != new_sessions.end(); ++it) {
|
for (QHash<SessionID, Session *>::iterator it = new_sessions.begin(); it != new_sessions.end(); ++it) {
|
||||||
Session *sess = it.value();
|
Session *sess = it.value();
|
||||||
|
|
||||||
if ((sess->length()) <= 0) {
|
if ((sess->length()) <= 0) {
|
||||||
|
@ -37,8 +37,8 @@ const QString STR_UnknownModel = "Resmed S9 ???";
|
|||||||
const QString & lookupModel(quint16 model)
|
const QString & lookupModel(quint16 model)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto end = Resmed_Model_Map.end();
|
QHash<QString, QList<quint16> >::iterator end = Resmed_Model_Map.end();
|
||||||
for (auto it = Resmed_Model_Map.begin(); it != end; ++it) {
|
for (QHash<QString, QList<quint16> >::iterator it = Resmed_Model_Map.begin(); it != end; ++it) {
|
||||||
QList<quint16> & list = it.value();
|
QList<quint16> & list = it.value();
|
||||||
for (int i=0; i < list.size(); ++i) {
|
for (int i=0; i < list.size(); ++i) {
|
||||||
if (list.at(i) == model) {
|
if (list.at(i) == model) {
|
||||||
@ -61,7 +61,7 @@ const QString STR_ext_gz = ".gz";
|
|||||||
EDFSignal *EDFParser::lookupSignal(ChannelID ch)
|
EDFSignal *EDFParser::lookupSignal(ChannelID ch)
|
||||||
{
|
{
|
||||||
// Get list of all known foreign language names for this channel
|
// Get list of all known foreign language names for this channel
|
||||||
auto channames = resmed_codes.find(ch);
|
QHash<ChannelID, QStringList>::iterator channames = resmed_codes.find(ch);
|
||||||
|
|
||||||
if (channames == resmed_codes.end()) {
|
if (channames == resmed_codes.end()) {
|
||||||
// no alternatives strings found for this channel
|
// no alternatives strings found for this channel
|
||||||
@ -70,7 +70,7 @@ EDFSignal *EDFParser::lookupSignal(ChannelID ch)
|
|||||||
|
|
||||||
// Scan through EDF's list of signals to see if any match
|
// Scan through EDF's list of signals to see if any match
|
||||||
for (int i = 0; i < channames.value().size(); i++) {
|
for (int i = 0; i < channames.value().size(); i++) {
|
||||||
auto jj = lookup.find(channames.value()[i]);
|
QHash<QString, EDFSignal *>::iterator jj = lookup.find(channames.value()[i]);
|
||||||
|
|
||||||
if (jj == lookup.end()) {
|
if (jj == lookup.end()) {
|
||||||
continue;
|
continue;
|
||||||
@ -87,7 +87,7 @@ EDFSignal *EDFParser::lookupSignal(ChannelID ch)
|
|||||||
// Check if given string matches any alternative signal names for this channel
|
// Check if given string matches any alternative signal names for this channel
|
||||||
bool matchSignal(ChannelID ch, const QString & name)
|
bool matchSignal(ChannelID ch, const QString & name)
|
||||||
{
|
{
|
||||||
auto channames = resmed_codes.find(ch);
|
QHash<ChannelID, QStringList>::iterator channames = resmed_codes.find(ch);
|
||||||
|
|
||||||
if (channames == resmed_codes.end()) {
|
if (channames == resmed_codes.end()) {
|
||||||
return false;
|
return false;
|
||||||
@ -121,7 +121,7 @@ EDFParser::EDFParser(QString name)
|
|||||||
}
|
}
|
||||||
EDFParser::~EDFParser()
|
EDFParser::~EDFParser()
|
||||||
{
|
{
|
||||||
for (auto s = edfsignals.begin(); s != edfsignals.end(); s++) {
|
for (QVector<EDFSignal>::iterator s = edfsignals.begin(); s != edfsignals.end(); s++) {
|
||||||
if ((*s).data) { delete [](*s).data; }
|
if ((*s).data) { delete [](*s).data; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +572,7 @@ int ResmedLoader::Open(QString &path, Profile *profile)
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Parse the idmap into machine objects properties, (overwriting any old values)
|
// Parse the idmap into machine objects properties, (overwriting any old values)
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
for (auto i = idmap.begin(); i != idmap.end(); i++) {
|
for (QHash<QString, QString>::iterator i = idmap.begin(); i != idmap.end(); i++) {
|
||||||
m->properties[i.key()] = i.value();
|
m->properties[i.key()] = i.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1502,8 +1502,8 @@ int ResmedLoader::Open(QString &path, Profile *profile)
|
|||||||
hash[CPAP_RespRate] = "RR"; // Is this a setting to force respiratory rate on S/T machines? or an average
|
hash[CPAP_RespRate] = "RR"; // Is this a setting to force respiratory rate on S/T machines? or an average
|
||||||
hash[CPAP_PresReliefSet] = "Easy-Breathe";
|
hash[CPAP_PresReliefSet] = "Easy-Breathe";
|
||||||
|
|
||||||
for (auto it = hash.begin(); it != hash.end(); ++it) {
|
for (QHash<ChannelID, QString>::iterator it = hash.begin(); it != hash.end(); ++it) {
|
||||||
auto a = stredf.lookup.find(it.value());
|
QHash<QString, EDFSignal *>::iterator a = stredf.lookup.find(it.value());
|
||||||
if (a != stredf.lookup.end()) {
|
if (a != stredf.lookup.end()) {
|
||||||
sig = a.value();
|
sig = a.value();
|
||||||
sess->settings[it.key()] = EventDataType(sig->data[dn] * sig->gain);
|
sess->settings[it.key()] = EventDataType(sig->data[dn] * sig->gain);
|
||||||
|
@ -28,7 +28,7 @@ void RegisterLoader(MachineLoader *loader)
|
|||||||
}
|
}
|
||||||
void DestroyLoaders()
|
void DestroyLoaders()
|
||||||
{
|
{
|
||||||
for (auto i = m_loaders.begin(); i != m_loaders.end(); i++) {
|
for (QList<MachineLoader *>::iterator i = m_loaders.begin(); i != m_loaders.end(); i++) {
|
||||||
delete(*i);
|
delete(*i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ MachineLoader::MachineLoader()
|
|||||||
|
|
||||||
MachineLoader::~MachineLoader()
|
MachineLoader::~MachineLoader()
|
||||||
{
|
{
|
||||||
for (auto m = m_machlist.begin(); m != m_machlist.end(); m++) {
|
for (QList<Machine *>::iterator m = m_machlist.begin(); m != m_machlist.end(); m++) {
|
||||||
delete *m;
|
delete *m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ Profile::~Profile()
|
|||||||
delete session;
|
delete session;
|
||||||
delete general;
|
delete general;
|
||||||
|
|
||||||
for (auto it = machlist.begin(); it != machlist.end(); it++) {
|
for (QHash<MachineID, Machine *>::iterator it = machlist.begin(); it != machlist.end(); it++) {
|
||||||
delete it.value();
|
delete it.value();
|
||||||
}
|
}
|
||||||
m_opened=false;
|
m_opened=false;
|
||||||
|
@ -248,7 +248,7 @@ void UpdaterWindow::ParseUpdateXML(QIODevice *dev)
|
|||||||
|
|
||||||
QStringList versions;
|
QStringList versions;
|
||||||
|
|
||||||
for (auto it = updateparser.releases.begin(); it != updateparser.releases.end(); ++it) {
|
for (QHash<QString, Release>::iterator it = updateparser.releases.begin(); it != updateparser.releases.end(); ++it) {
|
||||||
versions.push_back(it.key());
|
versions.push_back(it.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,8 +117,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->action_Screenshot->setEnabled(false);
|
ui->action_Screenshot->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
auto machines = p_profile->GetMachines(MT_CPAP);
|
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||||
for (auto it = machines.begin(); it != machines.end(); ++it) {
|
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||||
QString mclass=(*it)->GetClass();
|
QString mclass=(*it)->GetClass();
|
||||||
if (mclass == STR_MACH_ResMed) {
|
if (mclass == STR_MACH_ResMed) {
|
||||||
qDebug() << "ResMed machine found.. locking Session splitting capabilities";
|
qDebug() << "ResMed machine found.. locking Session splitting capabilities";
|
||||||
|
@ -70,8 +70,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
auto machines = p_profile->GetMachines(MT_CPAP);
|
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||||
for (auto it = machines.begin(); it != machines.end(); ++it) {
|
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||||
QString mclass=(*it)->GetClass();
|
QString mclass=(*it)->GetClass();
|
||||||
if (mclass == STR_MACH_ResMed) {
|
if (mclass == STR_MACH_ResMed) {
|
||||||
ui->combineSlider->setEnabled(false);
|
ui->combineSlider->setEnabled(false);
|
||||||
|
@ -541,7 +541,7 @@ QString Statistics::GenerateHTML()
|
|||||||
QList<Period> periods;
|
QList<Period> periods;
|
||||||
|
|
||||||
bool skipsection = false;;
|
bool skipsection = false;;
|
||||||
for (auto i = rows.begin(); i != rows.end(); ++i) {
|
for (QList<StatisticsRow>::iterator i = rows.begin(); i != rows.end(); ++i) {
|
||||||
StatisticsRow &row = (*i);
|
StatisticsRow &row = (*i);
|
||||||
QString name;
|
QString name;
|
||||||
|
|
||||||
|
@ -127,14 +127,12 @@ void initTranslations(QSettings & settings) {
|
|||||||
layout2.addWidget(&lang_combo, 1);
|
layout2.addWidget(&lang_combo, 1);
|
||||||
layout2.addWidget(&lang_okbtn);
|
layout2.addWidget(&lang_okbtn);
|
||||||
|
|
||||||
for (auto it = langNames.begin(); it != langNames.end(); ++it) {
|
for (QHash<QString, QString>::iterator it = langNames.begin(); it != langNames.end(); ++it) {
|
||||||
const QString & code = it.key();
|
const QString & code = it.key();
|
||||||
const QString & name = it.value();
|
const QString & name = it.value();
|
||||||
lang_combo.addItem(name, code);
|
lang_combo.addItem(name, code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
langsel.connect(&lang_okbtn, SIGNAL(clicked()), &langsel, SLOT(close()));
|
langsel.connect(&lang_okbtn, SIGNAL(clicked()), &langsel, SLOT(close()));
|
||||||
|
|
||||||
langsel.exec();
|
langsel.exec();
|
||||||
|
Loading…
Reference in New Issue
Block a user