mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 04:00:44 +00:00
Day Transition Test #2
This commit is contained in:
parent
c547706a8e
commit
5eff786db9
@ -710,7 +710,7 @@ void gToolTip::paint() //actually paints it.
|
|||||||
void gToolTip::timerDone()
|
void gToolTip::timerDone()
|
||||||
{
|
{
|
||||||
m_visible=false;
|
m_visible=false;
|
||||||
m_graphview->updateGL();
|
m_graphview->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
Layer::Layer(ChannelID code)
|
Layer::Layer(ChannelID code)
|
||||||
@ -1183,7 +1183,10 @@ void gGraph::AddLayer(Layer * l,LayerPosition position, short width, short heigh
|
|||||||
l->addref();
|
l->addref();
|
||||||
m_layers.push_back(l);
|
m_layers.push_back(l);
|
||||||
}
|
}
|
||||||
void gGraph::redraw() { m_graphview->updateGL(); }
|
void gGraph::redraw()
|
||||||
|
{
|
||||||
|
m_graphview->redraw();
|
||||||
|
}
|
||||||
void gGraph::timedRedraw(int ms)
|
void gGraph::timedRedraw(int ms)
|
||||||
{
|
{
|
||||||
m_graphview->timedRedraw(ms);
|
m_graphview->timedRedraw(ms);
|
||||||
@ -1233,7 +1236,7 @@ void gGraph::mouseMoveEvent(QMouseEvent * event)
|
|||||||
if (qstatus2) {
|
if (qstatus2) {
|
||||||
qstatus2->setText(str);
|
qstatus2->setText(str);
|
||||||
}
|
}
|
||||||
//m_graphview->updateGL();
|
//m_graphview->redraw();
|
||||||
//nolayer=false;
|
//nolayer=false;
|
||||||
doredraw=true;
|
doredraw=true;
|
||||||
} else if (event->buttons() & Qt::RightButton) {
|
} else if (event->buttons() & Qt::RightButton) {
|
||||||
@ -1295,7 +1298,7 @@ void gGraph::mouseMoveEvent(QMouseEvent * event)
|
|||||||
if (m_layers[i]->mouseMoveEvent(event)) doredraw=true;
|
if (m_layers[i]->mouseMoveEvent(event)) doredraw=true;
|
||||||
}
|
}
|
||||||
if (doredraw)
|
if (doredraw)
|
||||||
m_graphview->updateGL();
|
m_graphview->redraw();
|
||||||
//}
|
//}
|
||||||
//if (x>left+m_marginleft && x<m_lastbounds.width()-(right+m_marginright) && y>top+m_margintop && y<m_lastbounds.height()-(bottom+m_marginbottom)) { // main area
|
//if (x>left+m_marginleft && x<m_lastbounds.width()-(right+m_marginright) && y>top+m_margintop && y<m_lastbounds.height()-(bottom+m_marginbottom)) { // main area
|
||||||
// x-=left+m_marginleft;
|
// x-=left+m_marginleft;
|
||||||
@ -1385,7 +1388,7 @@ void gGraph::mouseReleaseEvent(QMouseEvent * event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else m_graphview->updateGL();
|
} else m_graphview->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_graphview->horizTravel()<mouse_movement_threshold) && (x>left && x<w+left && y>top && y<h)) {
|
if ((m_graphview->horizTravel()<mouse_movement_threshold) && (x>left && x<w+left && y>top && y<h)) {
|
||||||
@ -1442,7 +1445,7 @@ void gGraph::mouseReleaseEvent(QMouseEvent * event)
|
|||||||
m_lastx23=x;
|
m_lastx23=x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//m_graphview->updateGL();
|
//m_graphview->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1708,7 +1711,7 @@ void gGraph::SetXBounds(qint64 minx, qint64 maxx)
|
|||||||
max_x=maxx;
|
max_x=maxx;
|
||||||
|
|
||||||
//repaint();
|
//repaint();
|
||||||
//m_graphview->updateGL();
|
//m_graphview->redraw();
|
||||||
}
|
}
|
||||||
int gGraph::flipY(int y)
|
int gGraph::flipY(int y)
|
||||||
{
|
{
|
||||||
@ -1823,7 +1826,7 @@ gGraphView::gGraphView(QWidget *parent, gGraphView * shared) :
|
|||||||
redrawtimer=new QTimer(this);
|
redrawtimer=new QTimer(this);
|
||||||
//redrawtimer->setInterval(80);
|
//redrawtimer->setInterval(80);
|
||||||
//redrawtimer->start();
|
//redrawtimer->start();
|
||||||
connect(redrawtimer,SIGNAL(timeout()),SLOT(repaint()));
|
connect(redrawtimer,SIGNAL(timeout()),SLOT(updateGL()));
|
||||||
QImage *image=new QImage(":/icons/oximeter.png");
|
QImage *image=new QImage(":/icons/oximeter.png");
|
||||||
images.push_back(image);
|
images.push_back(image);
|
||||||
|
|
||||||
@ -1845,6 +1848,7 @@ gGraphView::gGraphView(QWidget *parent, gGraphView * shared) :
|
|||||||
m_fadingOut=false;
|
m_fadingOut=false;
|
||||||
m_fadingIn=false;
|
m_fadingIn=false;
|
||||||
m_inAnimation=false;
|
m_inAnimation=false;
|
||||||
|
m_limbo=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
gGraphView::~gGraphView()
|
gGraphView::~gGraphView()
|
||||||
@ -2014,7 +2018,7 @@ void gGraphView::scrollbarValueChanged(int val)
|
|||||||
//qDebug() << "Scrollbar Changed" << val;
|
//qDebug() << "Scrollbar Changed" << val;
|
||||||
if (m_offsetY!=val) {
|
if (m_offsetY!=val) {
|
||||||
m_offsetY=val;
|
m_offsetY=val;
|
||||||
updateGL(); // do this on a timer?
|
redraw(); // do this on a timer?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void gGraphView::ResetBounds(bool refresh) //short group)
|
void gGraphView::ResetBounds(bool refresh) //short group)
|
||||||
@ -2091,7 +2095,7 @@ void gGraphView::SetXBounds(qint64 minx, qint64 maxx,short group,bool refresh)
|
|||||||
qstatus2->setText(str);
|
qstatus2->setText(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refresh) updateGL();
|
if (refresh) redraw();
|
||||||
}
|
}
|
||||||
void gGraphView::updateScale()
|
void gGraphView::updateScale()
|
||||||
{
|
{
|
||||||
@ -2396,20 +2400,51 @@ bool gGraphView::renderGraphs()
|
|||||||
}
|
}
|
||||||
void gGraphView::fadeOut()
|
void gGraphView::fadeOut()
|
||||||
{
|
{
|
||||||
if (m_inAnimation) m_inAnimation=false;
|
//if (m_fadingOut) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//if (m_inAnimation) {
|
||||||
|
// m_inAnimation=false;
|
||||||
|
// }
|
||||||
|
//clone graphs to shapshot graphview object, render, and then fade in, before switching back to normal mode
|
||||||
|
/*gGraphView *sg=mainwin->snapshotGraph();
|
||||||
|
sg->trashGraphs();
|
||||||
|
sg->setFixedSize(width(),height());
|
||||||
|
sg->m_graphs=m_graphs;
|
||||||
|
sg->showSplitter(); */
|
||||||
|
|
||||||
|
//bool restart=false;
|
||||||
|
//if (!m_inAnimation)
|
||||||
|
// restart=true;
|
||||||
|
|
||||||
|
bool b=m_inAnimation;
|
||||||
|
m_inAnimation=false;
|
||||||
|
|
||||||
previous_day_snapshot=renderPixmap(width(),height(),false);
|
previous_day_snapshot=renderPixmap(width(),height(),false);
|
||||||
m_fadingOut=true;
|
m_inAnimation=b;
|
||||||
m_inAnimation=true;
|
//m_fadingOut=true;
|
||||||
m_animationStarted.start();
|
//m_fadingIn=false;
|
||||||
|
//m_inAnimation=true;
|
||||||
|
//m_limbo=false;
|
||||||
|
//m_animationStarted.start();
|
||||||
// updateGL();
|
// updateGL();
|
||||||
}
|
}
|
||||||
void gGraphView::fadeIn()
|
void gGraphView::fadeIn(bool dir)
|
||||||
{
|
{
|
||||||
// m_fadingOut=false;
|
m_tooltip->cancel();
|
||||||
// m_fadingIn=true;
|
|
||||||
// m_inAnimation=true;
|
if (m_fadingIn) {
|
||||||
// m_animationStarted.start();
|
previous_day_snapshot=current_day_snapshot;
|
||||||
//clone graphs to shapshot graphview object, render, and then fade in, before switching back to normal mode
|
}
|
||||||
|
m_inAnimation=false;
|
||||||
|
current_day_snapshot=renderPixmap(width(),height(),false);
|
||||||
|
m_inAnimation=true;
|
||||||
|
|
||||||
|
m_animationStarted.start();
|
||||||
|
m_fadingIn=true;
|
||||||
|
m_limbo=false;
|
||||||
|
m_fadedir=dir;
|
||||||
|
updateGL();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2418,10 +2453,11 @@ void gGraphView::paintGL()
|
|||||||
QTime time;
|
QTime time;
|
||||||
time.start();
|
time.start();
|
||||||
|
|
||||||
bool something_fun=PROFILE.ExistsAndTrue("EmptyGraphFun");
|
|
||||||
if (redrawtimer->isActive()) {
|
if (redrawtimer->isActive()) {
|
||||||
redrawtimer->stop();
|
redrawtimer->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool something_fun=PROFILE.ExistsAndTrue("EmptyGraphFun");
|
||||||
if (width()<=0) return;
|
if (width()<=0) return;
|
||||||
if (height()<=0) return;
|
if (height()<=0) return;
|
||||||
|
|
||||||
@ -2430,36 +2466,73 @@ void gGraphView::paintGL()
|
|||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
bool numgraphs=true;
|
bool numgraphs=true;
|
||||||
const int animTimeout=400;
|
const int animTimeout=200;
|
||||||
if (m_inAnimation) {
|
float phase=0;
|
||||||
int elapsed=m_animationStarted.elapsed();
|
|
||||||
float p=(float)elapsed / float(animTimeout); //percentage of way through animation timeslot
|
|
||||||
if (p>1.0) p=1.0;
|
|
||||||
|
|
||||||
p=1.0-p;
|
int elapsed=0;
|
||||||
|
if (m_inAnimation || m_fadingIn) {
|
||||||
|
elapsed=m_animationStarted.elapsed();
|
||||||
|
|
||||||
if (elapsed > animTimeout) {
|
if (elapsed > animTimeout) {
|
||||||
m_inAnimation=false; // end animation
|
|
||||||
} else {
|
|
||||||
if (m_fadingOut) {
|
if (m_fadingOut) {
|
||||||
GLuint tex=bindTexture(previous_day_snapshot);
|
m_fadingOut=false;
|
||||||
|
m_animationStarted.start();
|
||||||
|
elapsed=0;
|
||||||
|
m_limbo=true;
|
||||||
|
} else if (m_fadingIn) {
|
||||||
|
m_fadingIn=false;
|
||||||
|
m_inAnimation=false; // end animation
|
||||||
|
m_limbo=false;
|
||||||
|
m_fadingOut=false;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
} else {
|
||||||
|
phase=float(elapsed) / float(animTimeout); //percentage of way through animation timeslot
|
||||||
|
if (phase>1.0) phase=1.0;
|
||||||
|
if (phase<0) phase=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_inAnimation) {
|
||||||
|
if (m_fadingOut) {
|
||||||
|
// bindTexture(previous_day_snapshot);
|
||||||
|
} else if (m_fadingIn) {
|
||||||
|
int offset,offset2;
|
||||||
|
if (m_fadedir) { // forwards
|
||||||
|
offset2=-width();
|
||||||
|
offset=0;
|
||||||
|
phase=1.0-phase;
|
||||||
|
} else { // backwards
|
||||||
|
phase=phase;
|
||||||
|
offset=-width();
|
||||||
|
offset2=0;//-width();
|
||||||
|
}
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBegin(GL_QUADS);
|
|
||||||
float middle=(float)height() / 2.0;
|
|
||||||
glColor4f(255,255,255,255);
|
glColor4f(255,255,255,255);
|
||||||
glTexCoord2f(0.0f, 1.0f); glVertex2f(0,middle-(middle*p));
|
|
||||||
glTexCoord2f(1.0f, 1.0f); glVertex2f((float)width(),middle-(middle*p));
|
bindTexture(previous_day_snapshot);
|
||||||
glTexCoord2f(1.0f, 0.0f); glVertex2f((float)width(),middle+(middle*p));
|
glBegin(GL_QUADS);
|
||||||
glTexCoord2f(0.0f, 0.0f); glVertex2f(0,middle+(middle*p));
|
glTexCoord2f(0.0f, 1.0f); glVertex2f(width()*phase+offset2,0);
|
||||||
|
glTexCoord2f(1.0f, 1.0f); glVertex2f(width()+width()*phase+offset2,0);
|
||||||
|
glTexCoord2f(1.0f, 0.0f); glVertex2f(width()+width()*phase+offset2,height());
|
||||||
|
glTexCoord2f(0.0f, 0.0f); glVertex2f(width()*phase+offset2,height());
|
||||||
glEnd();
|
glEnd();
|
||||||
glBindTexture(GL_TEXTURE_2D,0);
|
|
||||||
|
bindTexture(current_day_snapshot);
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glTexCoord2f(0.0f, 1.0f); glVertex2f(width()*phase+offset,0);
|
||||||
|
glTexCoord2f(1.0f, 1.0f); glVertex2f(width()+width()*phase+offset,0);
|
||||||
|
glTexCoord2f(1.0f, 0.0f); glVertex2f(width()+width()*phase+offset,height());
|
||||||
|
glTexCoord2f(0.0f, 0.0f); glVertex2f(width()*phase+offset,height());
|
||||||
|
glEnd();
|
||||||
|
|
||||||
glDisable(GL_BLEND);
|
glDisable(GL_BLEND);
|
||||||
|
glBindTexture(GL_TEXTURE_2D,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_inAnimation || (!m_fadingIn)) {
|
||||||
if (!m_inAnimation) {
|
|
||||||
// Not in animation sequence, draw graphs like normal
|
// Not in animation sequence, draw graphs like normal
|
||||||
numgraphs=renderGraphs();
|
numgraphs=renderGraphs();
|
||||||
|
|
||||||
@ -2494,7 +2567,7 @@ void gGraphView::paintGL()
|
|||||||
swapBuffers(); // Dump to screen.
|
swapBuffers(); // Dump to screen.
|
||||||
|
|
||||||
if (this->isVisible()) {
|
if (this->isVisible()) {
|
||||||
if (m_inAnimation || (something_fun && !numgraphs)) {
|
if (m_limbo || m_inAnimation || (something_fun && !numgraphs)) {
|
||||||
redrawtimer->setInterval(25);
|
redrawtimer->setInterval(25);
|
||||||
redrawtimer->setSingleShot(true);
|
redrawtimer->setSingleShot(true);
|
||||||
redrawtimer->start();
|
redrawtimer->start();
|
||||||
@ -2507,7 +2580,7 @@ void gGraphView::setOffsetY(int offsetY)
|
|||||||
{
|
{
|
||||||
if (m_offsetY!=offsetY) {
|
if (m_offsetY!=offsetY) {
|
||||||
m_offsetY=offsetY;
|
m_offsetY=offsetY;
|
||||||
updateGL(); //issue full redraw..
|
redraw(); //issue full redraw..
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2516,7 +2589,7 @@ void gGraphView::setOffsetX(int offsetX)
|
|||||||
{
|
{
|
||||||
if (m_offsetX!=offsetX) {
|
if (m_offsetX!=offsetX) {
|
||||||
m_offsetX=offsetX;
|
m_offsetX=offsetX;
|
||||||
updateGL(); //issue redraw
|
redraw(); //issue redraw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2535,7 +2608,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
m_sizer_point.setX(x);
|
m_sizer_point.setX(x);
|
||||||
m_sizer_point.setY(y);
|
m_sizer_point.setY(y);
|
||||||
updateScrollBar();
|
updateScrollBar();
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2558,7 +2631,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
m_graphs[i]=p;
|
m_graphs[i]=p;
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
m_sizer_point.setY(yy-graphSpacer-m_graphs[m_graph_index]->height()*m_scaleY);
|
m_sizer_point.setY(yy-graphSpacer-m_graphs[m_graph_index]->height()*m_scaleY);
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
m_graph_index--;
|
m_graph_index--;
|
||||||
}
|
}
|
||||||
@ -2575,7 +2648,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
m_graphs[i]=p;
|
m_graphs[i]=p;
|
||||||
if (!empty) {
|
if (!empty) {
|
||||||
m_sizer_point.setY(yy+graphSpacer+m_graphs[m_graph_index]->height()*m_scaleY);
|
m_sizer_point.setY(yy+graphSpacer+m_graphs[m_graph_index]->height()*m_scaleY);
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
m_graph_index++;
|
m_graph_index++;
|
||||||
if (!empty) break;
|
if (!empty) break;
|
||||||
@ -2626,7 +2699,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
ChannelID code=fg->visibleLayers()[i]->code();
|
ChannelID code=fg->visibleLayers()[i]->code();
|
||||||
QString ttip=schema::channel[code].description();
|
QString ttip=schema::channel[code].description();
|
||||||
m_tooltip->display(ttip,x,y-20,800);
|
m_tooltip->display(ttip,x,y-20,800);
|
||||||
updateGL();
|
redraw();
|
||||||
//qDebug() << code << ttip;
|
//qDebug() << code << ttip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2637,7 +2710,7 @@ void gGraphView::mouseMoveEvent(QMouseEvent * event)
|
|||||||
} else {
|
} else {
|
||||||
if (!m_graphs[i]->units().isEmpty()) {
|
if (!m_graphs[i]->units().isEmpty()) {
|
||||||
m_tooltip->display(m_graphs[i]->units(),x,y-20,800);
|
m_tooltip->display(m_graphs[i]->units(),x,y-20,800);
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2881,7 +2954,7 @@ void gGraphView::setDay(Day * day)
|
|||||||
for (int i=0;i<m_graphs.size();i++) {
|
for (int i=0;i<m_graphs.size();i++) {
|
||||||
m_graphs[i]->setDay(day);
|
m_graphs[i]->setDay(day);
|
||||||
}
|
}
|
||||||
ResetBounds();
|
ResetBounds(false);
|
||||||
}
|
}
|
||||||
bool gGraphView::isEmpty()
|
bool gGraphView::isEmpty()
|
||||||
{
|
{
|
||||||
@ -2897,7 +2970,7 @@ bool gGraphView::isEmpty()
|
|||||||
|
|
||||||
void gGraphView::refreshTimeout()
|
void gGraphView::refreshTimeout()
|
||||||
{
|
{
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
void gGraphView::timedRedraw(int ms)
|
void gGraphView::timedRedraw(int ms)
|
||||||
{
|
{
|
||||||
@ -2913,7 +2986,7 @@ void gGraphView::resetLayout()
|
|||||||
m_graphs[i]->setHeight(default_height);
|
m_graphs[i]->setHeight(default_height);
|
||||||
}
|
}
|
||||||
updateScale();
|
updateScale();
|
||||||
updateGL();
|
redraw();
|
||||||
}
|
}
|
||||||
void gGraphView::deselect()
|
void gGraphView::deselect()
|
||||||
{
|
{
|
||||||
@ -3036,3 +3109,8 @@ int gGraphView::visibleGraphs()
|
|||||||
}
|
}
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
void gGraphView::redraw()
|
||||||
|
{
|
||||||
|
if (!m_inAnimation)
|
||||||
|
updateGL();
|
||||||
|
}
|
||||||
|
@ -752,7 +752,10 @@ public:
|
|||||||
void fadeOut();
|
void fadeOut();
|
||||||
|
|
||||||
//! \brief Start the animation sequence showing new Day's data. (fade in)
|
//! \brief Start the animation sequence showing new Day's data. (fade in)
|
||||||
void fadeIn();
|
void fadeIn(bool dir=false);
|
||||||
|
|
||||||
|
//! \brief Call UpdateGL unless animation is in progress
|
||||||
|
void redraw();
|
||||||
|
|
||||||
gGraph *m_selected_graph;
|
gGraph *m_selected_graph;
|
||||||
gToolTip * m_tooltip;
|
gToolTip * m_tooltip;
|
||||||
@ -806,7 +809,6 @@ public:
|
|||||||
//! \brief Sends day object to be distributed to all Graphs Layers objects
|
//! \brief Sends day object to be distributed to all Graphs Layers objects
|
||||||
void setDay(Day * day);
|
void setDay(Day * day);
|
||||||
|
|
||||||
|
|
||||||
GLShortBuffer * lines, * backlines, *quads, * stippled;
|
GLShortBuffer * lines, * backlines, *quads, * stippled;
|
||||||
|
|
||||||
//! \brief pops a graph off the list for multithreaded drawing code
|
//! \brief pops a graph off the list for multithreaded drawing code
|
||||||
@ -918,7 +920,10 @@ protected:
|
|||||||
QPixmap current_day_snapshot;
|
QPixmap current_day_snapshot;
|
||||||
bool m_fadingOut;
|
bool m_fadingOut;
|
||||||
bool m_fadingIn;
|
bool m_fadingIn;
|
||||||
|
bool m_limbo;
|
||||||
|
bool m_fadedir;
|
||||||
bool m_inAnimation;
|
bool m_inAnimation;
|
||||||
|
bool m_blockUpdates;
|
||||||
|
|
||||||
QTime m_animationStarted;
|
QTime m_animationStarted;
|
||||||
|
|
||||||
|
26
daily.cpp
26
daily.cpp
@ -376,7 +376,6 @@ void Daily::ReloadGraphs()
|
|||||||
{
|
{
|
||||||
QDate d;
|
QDate d;
|
||||||
if (previous_date.isValid()) {
|
if (previous_date.isValid()) {
|
||||||
GraphView->fadeOut();
|
|
||||||
d=previous_date;
|
d=previous_date;
|
||||||
Unload(d);
|
Unload(d);
|
||||||
} //else
|
} //else
|
||||||
@ -387,7 +386,6 @@ void Daily::ReloadGraphs()
|
|||||||
on_calendar_currentPageChanged(d.year(),d.month());
|
on_calendar_currentPageChanged(d.year(),d.month());
|
||||||
ui->calendar->setSelectedDate(d);
|
ui->calendar->setSelectedDate(d);
|
||||||
Load(d);
|
Load(d);
|
||||||
GraphView->fadeIn();
|
|
||||||
}
|
}
|
||||||
void Daily::on_calendar_currentPageChanged(int year, int month)
|
void Daily::on_calendar_currentPageChanged(int year, int month)
|
||||||
{
|
{
|
||||||
@ -527,12 +525,15 @@ void Daily::LoadDate(QDate date)
|
|||||||
|
|
||||||
void Daily::on_calendar_selectionChanged()
|
void Daily::on_calendar_selectionChanged()
|
||||||
{
|
{
|
||||||
GraphView->fadeOut();
|
|
||||||
if (previous_date.isValid())
|
|
||||||
Unload(previous_date);
|
|
||||||
|
|
||||||
|
if (previous_date.isValid()) {
|
||||||
|
GraphView->fadeOut();
|
||||||
|
Unload(previous_date);
|
||||||
|
}
|
||||||
|
bool fadedir=previous_date < ui->calendar->selectedDate();
|
||||||
ZombieMeterMoved=false;
|
ZombieMeterMoved=false;
|
||||||
Load(ui->calendar->selectedDate());
|
Load(ui->calendar->selectedDate());
|
||||||
|
GraphView->fadeIn(fadedir);
|
||||||
ui->calButton->setText(ui->calendar->selectedDate().toString(Qt::TextDate));
|
ui->calButton->setText(ui->calendar->selectedDate().toString(Qt::TextDate));
|
||||||
ui->calendar->setFocus(Qt::ActiveWindowFocusReason);
|
ui->calendar->setFocus(Qt::ActiveWindowFocusReason);
|
||||||
|
|
||||||
@ -546,7 +547,6 @@ void Daily::on_calendar_selectionChanged()
|
|||||||
ui->ouncesSpinBox->setVisible(true);
|
ui->ouncesSpinBox->setVisible(true);
|
||||||
ui->ouncesSpinBox->setSuffix("oz");
|
ui->ouncesSpinBox->setSuffix("oz");
|
||||||
}
|
}
|
||||||
GraphView->fadeIn();
|
|
||||||
}
|
}
|
||||||
void Daily::ResetGraphLayout()
|
void Daily::ResetGraphLayout()
|
||||||
{
|
{
|
||||||
@ -562,7 +562,7 @@ void Daily::graphtogglebutton_toggled(bool b)
|
|||||||
(*GraphView)[i]->setVisible(GraphToggles[title]->isChecked());
|
(*GraphView)[i]->setVisible(GraphToggles[title]->isChecked());
|
||||||
}
|
}
|
||||||
GraphView->updateScale();
|
GraphView->updateScale();
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
void Daily::Load(QDate date)
|
void Daily::Load(QDate date)
|
||||||
{
|
{
|
||||||
@ -617,9 +617,7 @@ void Daily::Load(QDate date)
|
|||||||
UpdateCPAPGraphs(cpap);
|
UpdateCPAPGraphs(cpap);
|
||||||
UpdateEventsTree(ui->treeWidget,cpap);
|
UpdateEventsTree(ui->treeWidget,cpap);
|
||||||
snapGV->setDay(cpap);
|
snapGV->setDay(cpap);
|
||||||
|
GraphView->ResetBounds(false);
|
||||||
|
|
||||||
GraphView->ResetBounds();
|
|
||||||
//snapGV->ResetBounds();
|
//snapGV->ResetBounds();
|
||||||
//GraphView->ResetBounds(1);
|
//GraphView->ResetBounds(1);
|
||||||
|
|
||||||
@ -633,8 +631,8 @@ void Daily::Load(QDate date)
|
|||||||
// GraphView->show();
|
// GraphView->show();
|
||||||
scrollbar->show();
|
scrollbar->show();
|
||||||
}
|
}
|
||||||
GraphView->updateGL();
|
//GraphView->redraw();
|
||||||
snapGV->updateGL();
|
//snapGV->redraw();
|
||||||
|
|
||||||
//RedrawGraphs();
|
//RedrawGraphs();
|
||||||
|
|
||||||
@ -1225,7 +1223,7 @@ void Daily::UpdateOXIGraphs(Day *day)
|
|||||||
|
|
||||||
void Daily::RedrawGraphs()
|
void Daily::RedrawGraphs()
|
||||||
{
|
{
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Daily::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
void Daily::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
|
||||||
@ -1360,7 +1358,7 @@ void Daily::on_bookmarkTable_itemClicked(QTableWidgetItem *item)
|
|||||||
st=it->data(Qt::UserRole).toLongLong(&ok);
|
st=it->data(Qt::UserRole).toLongLong(&ok);
|
||||||
et=it->data(Qt::UserRole+1).toLongLong(&ok);
|
et=it->data(Qt::UserRole+1).toLongLong(&ok);
|
||||||
GraphView->SetXBounds(st,et);
|
GraphView->SetXBounds(st,et);
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Daily::on_addBookmarkButton_clicked()
|
void Daily::on_addBookmarkButton_clicked()
|
||||||
|
@ -258,7 +258,7 @@ void Overview::ReloadGraphs()
|
|||||||
|
|
||||||
void Overview::RedrawGraphs()
|
void Overview::RedrawGraphs()
|
||||||
{
|
{
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Overview::UpdateCalendarDay(QDateEdit * dateedit,QDate date)
|
void Overview::UpdateCalendarDay(QDateEdit * dateedit,QDate date)
|
||||||
|
28
oximetry.cpp
28
oximetry.cpp
@ -657,7 +657,7 @@ void CMS50Serial::ReadyRead()
|
|||||||
if (c & 0x80) break;
|
if (c & 0x80) break;
|
||||||
}
|
}
|
||||||
mainwin->getOximetry()->graphView()->setEmptyText("Please Wait, Importing...");
|
mainwin->getOximetry()->graphView()->setEmptyText("Please Wait, Importing...");
|
||||||
mainwin->getOximetry()->graphView()->updateGL();
|
mainwin->getOximetry()->graphView()->redraw();
|
||||||
|
|
||||||
data.clear();
|
data.clear();
|
||||||
for (z=i;z<size;z++) {
|
for (z=i;z<size;z++) {
|
||||||
@ -706,11 +706,11 @@ void CMS50Serial::ReadyRead()
|
|||||||
int i=imptime.elapsed();
|
int i=imptime.elapsed();
|
||||||
|
|
||||||
//mainwin->getOximetry()->graphView()->setEmptyText("fun");
|
//mainwin->getOximetry()->graphView()->setEmptyText("fun");
|
||||||
//mainwin->getOximetry()->graphView()->updateGL();
|
//mainwin->getOximetry()->graphView()->redraw();
|
||||||
|
|
||||||
if (i>1000) {
|
if (i>1000) {
|
||||||
//mainwin->getOximetry()->graphView()->setEmptyText("fun");
|
//mainwin->getOximetry()->graphView()->setEmptyText("fun");
|
||||||
//mainwin->getOximetry()->graphView()->updateGL();
|
//mainwin->getOximetry()->graphView()->redraw();
|
||||||
imptime.start();
|
imptime.start();
|
||||||
failcnt++;
|
failcnt++;
|
||||||
QString a;
|
QString a;
|
||||||
@ -719,13 +719,13 @@ void CMS50Serial::ReadyRead()
|
|||||||
m_mode=SO_WAIT;
|
m_mode=SO_WAIT;
|
||||||
emit(importAborted());
|
emit(importAborted());
|
||||||
mainwin->getOximetry()->graphView()->setEmptyText("Import Failed");
|
mainwin->getOximetry()->graphView()->setEmptyText("Import Failed");
|
||||||
mainwin->getOximetry()->graphView()->updateGL();
|
mainwin->getOximetry()->graphView()->redraw();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
a="Waiting";
|
a="Waiting";
|
||||||
for (int i=0;i<failcnt;i++) a+=".";
|
for (int i=0;i<failcnt;i++) a+=".";
|
||||||
mainwin->getOximetry()->graphView()->setEmptyText(a);
|
mainwin->getOximetry()->graphView()->setEmptyText(a);
|
||||||
mainwin->getOximetry()->graphView()->updateGL();
|
mainwin->getOximetry()->graphView()->redraw();
|
||||||
requestData(); // retransmit the data request code
|
requestData(); // retransmit the data request code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -880,7 +880,7 @@ Oximetry::Oximetry(QWidget *parent,gGraphView * shared) :
|
|||||||
//go->SetDay(day);
|
//go->SetDay(day);
|
||||||
|
|
||||||
GraphView->setEmptyText(tr("No Oximetry Data"));
|
GraphView->setEmptyText(tr("No Oximetry Data"));
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
|
|
||||||
on_RefreshPortsButton_clicked();
|
on_RefreshPortsButton_clicked();
|
||||||
ui->RunButton->setChecked(false);
|
ui->RunButton->setChecked(false);
|
||||||
@ -964,7 +964,7 @@ void Oximetry::on_RefreshPortsButton_clicked()
|
|||||||
}
|
}
|
||||||
void Oximetry::RedrawGraphs()
|
void Oximetry::RedrawGraphs()
|
||||||
{
|
{
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
void Oximetry::on_SerialPortsCombo_activated(const QString &arg1)
|
void Oximetry::on_SerialPortsCombo_activated(const QString &arg1)
|
||||||
{
|
{
|
||||||
@ -1013,7 +1013,7 @@ void Oximetry::on_RunButton_toggled(bool checked)
|
|||||||
}
|
}
|
||||||
} // else it's already saved.
|
} // else it's already saved.
|
||||||
GraphView->setEmptyText(tr("Please Wait"));
|
GraphView->setEmptyText(tr("Please Wait"));
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
|
|
||||||
PLETHY->setRecMinY(0);
|
PLETHY->setRecMinY(0);
|
||||||
PLETHY->setRecMaxY(128);
|
PLETHY->setRecMaxY(128);
|
||||||
@ -1120,7 +1120,7 @@ void Oximetry::data_changed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
GraphView->updateScale();
|
GraphView->updateScale();
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1159,7 +1159,7 @@ void Oximetry::oximeter_running_check()
|
|||||||
ui->RunButton->setChecked(false);
|
ui->RunButton->setChecked(false);
|
||||||
ui->saveButton->setEnabled(false);
|
ui->saveButton->setEnabled(false);
|
||||||
GraphView->setEmptyText(tr("Check Oximeter is Ready"));
|
GraphView->setEmptyText(tr("Check Oximeter is Ready"));
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1174,7 +1174,7 @@ void Oximetry::on_ImportButton_clicked()
|
|||||||
day->getSessions().clear();
|
day->getSessions().clear();
|
||||||
GraphView->setDay(day);
|
GraphView->setDay(day);
|
||||||
GraphView->setEmptyText("Make Sure Oximeter Is Ready");
|
GraphView->setEmptyText("Make Sure Oximeter Is Ready");
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
|
|
||||||
if (!oximeter->startImport()) {
|
if (!oximeter->startImport()) {
|
||||||
mainwin->Notify(tr("Oximeter Error\n\nThe device did not respond.. Make sure it's switched on."));
|
mainwin->Notify(tr("Oximeter Error\n\nThe device did not respond.. Make sure it's switched on."));
|
||||||
@ -1303,7 +1303,7 @@ void Oximetry::on_saveButton_clicked()
|
|||||||
mainwin->getDaily()->ReloadGraphs();
|
mainwin->getDaily()->ReloadGraphs();
|
||||||
mainwin->getOverview()->ReloadGraphs();
|
mainwin->getOverview()->ReloadGraphs();
|
||||||
GraphView->setEmptyText("No Oximetry Data");
|
GraphView->setEmptyText("No Oximetry Data");
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Oximetry::update_progress(float f)
|
void Oximetry::update_progress(float f)
|
||||||
@ -1396,7 +1396,7 @@ bool Oximetry::openSPOFile(QString filename)
|
|||||||
bool Oximetry::openSPORFile(QString filename)
|
bool Oximetry::openSPORFile(QString filename)
|
||||||
{
|
{
|
||||||
//GraphView->setEmptyText("Please Wait");
|
//GraphView->setEmptyText("Please Wait");
|
||||||
//GraphView->updateGL();
|
//GraphView->redraw();
|
||||||
QFile f(filename);
|
QFile f(filename);
|
||||||
if (!f.open(QFile::ReadOnly)) return false;
|
if (!f.open(QFile::ReadOnly)) return false;
|
||||||
|
|
||||||
@ -1613,7 +1613,7 @@ void Oximetry::updateGraphs()
|
|||||||
if (qstatus2) qstatus2->setText(QString().sprintf("%02i:%02i:%02i",h,m,s));
|
if (qstatus2) qstatus2->setText(QString().sprintf("%02i:%02i:%02i",h,m,s));
|
||||||
}
|
}
|
||||||
GraphView->updateScale();
|
GraphView->updateScale();
|
||||||
GraphView->updateGL();
|
GraphView->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Oximetry::on_resetTimeButton_clicked() //revert to original session time
|
void Oximetry::on_resetTimeButton_clicked() //revert to original session time
|
||||||
|
Loading…
Reference in New Issue
Block a user