diff --git a/sleepyhead/Graphs/gGraphView.cpp b/sleepyhead/Graphs/gGraphView.cpp index 42d4c1d7..679232fc 100644 --- a/sleepyhead/Graphs/gGraphView.cpp +++ b/sleepyhead/Graphs/gGraphView.cpp @@ -2726,33 +2726,65 @@ void gGraphView::wheelEvent(QWheelEvent *event) vertScrollTime.start(); return; } + // (This is a total pain in the butt on MacBook touchpads..) if (vertScrollTime.elapsed() < scrollDampening) { return; } horizScrollTime.start(); + } - gGraph *graph = nullptr; - int group = 0; - int x = event->x(); - int y = event->y(); + gGraph *graph = nullptr; + int group = 0; + int x = event->x(); + int y = event->y(); - float h, py = 0, pinned_height = 0; + float h, py = 0, pinned_height = 0; - // Find graph hovered over + // Find graph hovered over + for (int i = 0; i < m_graphs.size(); i++) { + gGraph *g = m_graphs[i]; + if (!g || g->isEmpty() || !g->visible() || !g->isPinned()) { + continue; + } + + h = g->height() * m_scaleY; + pinned_height += h + graphSpacer; + + if (py > height()) { + break; // we are done.. can't draw anymore + } + + if ((py + h + graphSpacer) >= 0) { + if ((y >= py) && (y <= py + h)) { + graph = g; + break; + } else if ((y >= py + h) && (y <= py + h + graphSpacer + 1)) { + // What to do when double clicked on the resize handle? + graph = g; + break; + } + } + + py += h; + py += graphSpacer; // do we want the extra spacer down the bottom? + } + if (!graph) { + py = -m_offsetY; + py += pinned_height; + for (int i = 0; i < m_graphs.size(); i++) { gGraph *g = m_graphs[i]; - if (!g || g->isEmpty() || !g->visible() || !g->isPinned()) { + if (!g || g->isEmpty() || !g->visible() || g->isPinned()) { continue; } h = g->height() * m_scaleY; - pinned_height += h + graphSpacer; if (py > height()) { - break; // we are done.. can't draw anymore + break; } if ((py + h + graphSpacer) >= 0) { @@ -2764,55 +2796,16 @@ void gGraphView::wheelEvent(QWheelEvent *event) graph = g; break; } + } py += h; py += graphSpacer; // do we want the extra spacer down the bottom? } - if (!graph) { - py = -m_offsetY; - py += pinned_height; + } - for (int i = 0; i < m_graphs.size(); i++) { - gGraph *g = m_graphs[i]; - if (!g || g->isEmpty() || !g->visible() || g->isPinned()) { - continue; - } - - h = g->height() * m_scaleY; - - if (py > height()) { - break; - } - - if ((py + h + graphSpacer) >= 0) { - if ((y >= py) && (y <= py + h)) { - graph = g; - break; - } else if ((y >= py + h) && (y <= py + h + graphSpacer + 1)) { - // What to do when double clicked on the resize handle? - graph = g; - break; - } - - } - - py += h; - py += graphSpacer; // do we want the extra spacer down the bottom? - } - } - -// // Pick the first valid graph in the primary group -// for (int i = 0; i < m_graphs.size(); i++) { -// if (!m_graphs[i]) continue; -// if (m_graphs[i]->group() == group) { -// if (!m_graphs[i]->isEmpty() && m_graphs[i]->visible()) { -// g = m_graphs[i]; -// break; -// } -// } -// } + if (event->modifiers() == Qt::NoModifier) { if (!graph) { // just pick any graph then for (int i = 0; i < m_graphs.size(); i++) { @@ -2853,40 +2846,44 @@ void gGraphView::wheelEvent(QWheelEvent *event) saveHistory(); SetXBounds(graph->min_x, graph->max_x, group); - } else if ((event->modifiers() & Qt::ControlModifier)) { - int x = event->x(); - int y = event->y(); + } else if ((event->modifiers() & Qt::ControlModifier)) { - float py = -m_offsetY; - float h; + if (graph) graph->wheelEvent(event); +// int x = event->x(); +// int y = event->y(); - for (int i = 0; i < m_graphs.size(); i++) { - gGraph *g = m_graphs[i]; - if (!g || g->isEmpty() || !g->visible()) { continue; } +// float py = -m_offsetY; +// float h; - h = g->height() * m_scaleY; - if (py > height()) { - break; - } - if ((py + h + graphSpacer) >= 0) { - if ((y >= py) && (y <= py + h)) { - if (x < titleWidth) { - // What to do when ctrl+wheel is used on the graph title ?? - } else { - // send event to graph.. - g->wheelEvent(event); - } - } else if ((y >= py + h) && (y <= py + h + graphSpacer + 1)) { - // What to do when the wheel is used on the resize handle? - } +// for (int i = 0; i < m_graphs.size(); i++) { +// gGraph *g = m_graphs[i]; +// if (!g || g->isEmpty() || !g->visible()) { continue; } - } +// h = g->height() * m_scaleY; - py += h; - py += graphSpacer; // do we want the extra spacer down the bottom? - } +// if (py > height()) { +// break; +// } + +// if ((py + h + graphSpacer) >= 0) { +// if ((y >= py) && (y <= py + h)) { +// if (x < titleWidth) { +// // What to do when ctrl+wheel is used on the graph title ?? +// } else { +// // send event to graph.. +// g->wheelEvent(event); +// } +// } else if ((y >= py + h) && (y <= py + h + graphSpacer + 1)) { +// // What to do when the wheel is used on the resize handle? +// } + +// } + +// py += h; +// py += graphSpacer; // do we want the extra spacer down the bottom? +// } } } diff --git a/sleepyhead/build_number.h b/sleepyhead/build_number.h index 67e89cde..c1c3b74a 100644 --- a/sleepyhead/build_number.h +++ b/sleepyhead/build_number.h @@ -1 +1 @@ -const int build_number = 10; +const int build_number = 11; diff --git a/sleepyhead/docs/release_notes.html b/sleepyhead/docs/release_notes.html index 5528ea51..f1600c3b 100644 --- a/sleepyhead/docs/release_notes.html +++ b/sleepyhead/docs/release_notes.html @@ -1,33 +1,37 @@
-Greetings!
Here is a definitely new and improved SleepyHead build :)
-I'm pleased to report that CMS50i and CMS50f oximeters finally work with SleepyHead, a huge thanks to François Revol and Michael Masterson for there assistance with this.
-German users will be pleased to learn that the (Pulox) PO-200, PO-300, and PO-400 oximeters are secretely Contecs CMS50's in disguise, (D+, E and F respectively)..
+Right clicky menu has tons of new stuff for you to play with... some of this you're hopefully going to love! :)
+New Graph Clone ability allows you to make a temporary copy of a graph, and operate it completely independently... +You can even take these graph clones with you to another day! They aren't saved though. they are gone when you close SleepyHead. +
Y-Axis menu allows for better control of Y-Axis scaling, all of this has been improved greatly... no more having to go into preferences +to set minimum/maximum values (that SleepyHead wasn't honouring properly anyway). Now you can adjust these settings live for each graph!
+Fisher & Paykel support got a tweak and timestamps should be correct, and even the new AirSense machines import mostly. +I still need to to see more AirSense data to get everything right though!
-This build features recent code that modified the internal "Day" objects, so they can hold sessions from multiple machines.. which is a pretty significant change in how data is stored in memory. -This was done so Oximeter, CPAP, sleep stage, positional, etc.. Session's don't have to be handled individually.. Now for instance, I can compare oximetery and CPAP data in the same object, -leading to much more powerful calculation and graphing possibilities. Nerdy stuff end users won't know about, but you will. ;)
-You will likely need to REBUILD YOUR CPAP MACHINE DATABASE from the Data menu to get the benefit of the latest goodies. This rebuild will be automatic in the final 0.9.7 public builds (well, they will face a forced reimport unless they are ResMed users, but anyway :/)
- -Check out the new right click menu over the titlebar/yAxis area, you will find it useful.. Remember to click outside of the popup menu to make it go away.. Design feature. :P
-I'd very much love to hear your comments on the latest changes, some of this is stuff I've been planning for ages.
Sleep Well, and good luck!
JediMark