diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp index 41b0066a..62a47d3a 100644 --- a/sleepyhead/Graphs/gLineChart.cpp +++ b/sleepyhead/Graphs/gLineChart.cpp @@ -170,6 +170,7 @@ void gLineChart::paint(QPainter &painter, gGraph &w, const QRegion ®ion) return; } + top++; EventDataType miny, maxy; diff --git a/sleepyhead/SleepLib/event.cpp b/sleepyhead/SleepLib/event.cpp index 9266de8a..b5b39f4b 100644 --- a/sleepyhead/SleepLib/event.cpp +++ b/sleepyhead/SleepLib/event.cpp @@ -92,7 +92,7 @@ void EventList::AddEvent(qint64 time, EventStoreType data) qint32 delta = (m_first - time); - for (quint32 i = 0; i < m_count; i++) { + for (quint32 i = 0; i < m_count; ++i) { m_time[i] -= delta; } @@ -172,10 +172,9 @@ void EventList::AddWaveform(qint64 start, qint16 *data, int recs, qint64 duratio if (m_update_minmax) { EventDataType min = m_min, max = m_max, val, gain = m_gain; - //if (m_offset; - for (sp = data; sp < ep; sp++) { + for (sp = data; sp < ep; ++sp) { *dp++ = raw = *sp; - val = EventDataType(*sp) * gain + m_offset; + val = EventDataType(raw) * gain + m_offset; if (min > val) { min = val; } @@ -186,8 +185,8 @@ void EventList::AddWaveform(qint64 start, qint16 *data, int recs, qint64 duratio m_max = max; } else { //register EventDataType val,gain=m_gain; - for (sp = data; sp < ep; sp++) { - *dp++ = raw = *sp; + for (sp = data; sp < ep; ++sp) { + *dp++ = *sp; //val=EventDataType(raw)*gain; } } @@ -241,7 +240,7 @@ void EventList::AddWaveform(qint64 start, unsigned char *data, int recs, qint64 if (m_update_minmax) { // ignoring m_offset - for (sp = data; sp < ep; sp++) { + for (sp = data; sp < ep; ++sp) { raw = *sp; val = EventDataType(raw) * m_gain; @@ -252,14 +251,14 @@ void EventList::AddWaveform(qint64 start, unsigned char *data, int recs, qint64 *dp++ = raw; } } else { - for (sp = data; sp < ep; sp++) { + for (sp = data; sp < ep; ++sp) { raw = *sp; - val = EventDataType(raw) * m_gain; + //val = EventDataType(raw) * m_gain; *dp++ = raw; } } - } + void EventList::AddWaveform(qint64 start, char *data, int recs, qint64 duration) { if (m_type != EVL_Waveform) { @@ -308,20 +307,19 @@ void EventList::AddWaveform(qint64 start, char *data, int recs, qint64 duration) EventStoreType *dp = &edata[r]; if (m_update_minmax) { - for (sp = data; sp < ep; sp++) { + for (sp = data; sp < ep; ++sp) { raw = *sp; val = EventDataType(raw) * m_gain + m_offset; if (m_min > val) { m_min = val; } - if (m_max < val) { m_max = val; } *dp++ = raw; } } else { - for (sp = data; sp < ep; sp++) { + for (sp = data; sp < ep; ++sp) { raw = *sp; - val = EventDataType(raw) * m_gain + m_offset; + // val = EventDataType(raw) * m_gain + m_offset; *dp++ = raw; } } diff --git a/sleepyhead/SleepLib/session.cpp b/sleepyhead/SleepLib/session.cpp index c294d6ae..b629d2fa 100644 --- a/sleepyhead/SleepLib/session.cpp +++ b/sleepyhead/SleepLib/session.cpp @@ -980,7 +980,7 @@ EventDataType Session::Min(ChannelID id) bool first = true; EventDataType min = 0, t1; - int evec_size=evec.size(); + int evec_size = evec.size(); for (int i = 0; i < evec_size; ++i) { if (evec[i]->count() != 0) { @@ -1000,6 +1000,7 @@ EventDataType Session::Min(ChannelID id) m_min[id] = min; return min; } + EventDataType Session::Max(ChannelID id) { QHash::iterator i = m_max.find(id);