mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 19:20:45 +00:00
XTicker cleanup, removed extra Memory Hog option from view menu.
This commit is contained in:
parent
4dd741db6f
commit
df1c0f42b2
@ -150,16 +150,12 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
glEnableClientState(GL_VERTEX_ARRAY);
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
w.qglColor(m_flag_color);
|
w.qglColor(m_flag_color);
|
||||||
if (quadcnt>0) {
|
if (quadcnt>0) {
|
||||||
//glEnableClientState(GL_VERTEX_ARRAY);
|
|
||||||
glVertexPointer(2, GL_SHORT, 0, quadarray);
|
glVertexPointer(2, GL_SHORT, 0, quadarray);
|
||||||
glDrawArrays(GL_QUADS, 0, quadcnt>>1);
|
glDrawArrays(GL_QUADS, 0, quadcnt>>1);
|
||||||
//glDisableClientState(GL_VERTEX_ARRAY);
|
|
||||||
}
|
}
|
||||||
if (vertcnt>0) {
|
if (vertcnt>0) {
|
||||||
//glEnableClientState(GL_VERTEX_ARRAY);
|
|
||||||
glVertexPointer(2, GL_SHORT, 0, vertarray);
|
glVertexPointer(2, GL_SHORT, 0, vertarray);
|
||||||
glDrawArrays(GL_LINES, 0, vertcnt>>1);
|
glDrawArrays(GL_LINES, 0, vertcnt>>1);
|
||||||
//glDisableClientState(GL_VERTEX_ARRAY);
|
|
||||||
}
|
}
|
||||||
if (pointcnt>0) {
|
if (pointcnt>0) {
|
||||||
glPointSize(4);
|
glPointSize(4);
|
||||||
|
@ -8,6 +8,9 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "gXAxis.h"
|
#include "gXAxis.h"
|
||||||
|
|
||||||
|
const int divisors[]={86400000,3600000,2700000,1800000,1200000,900000,600000,300000,120000,60000,45000,30000,20000,15000,10000,5000,2000,1000,100,50,10};
|
||||||
|
const int divcnt=sizeof(divisors)/sizeof(int);
|
||||||
|
|
||||||
gXAxis::gXAxis(QColor col)
|
gXAxis::gXAxis(QColor col)
|
||||||
:gLayer(EmptyChannel)
|
:gLayer(EmptyChannel)
|
||||||
{
|
{
|
||||||
@ -53,10 +56,8 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
qint64 xx=maxx-minx;
|
qint64 xx=maxx-minx;
|
||||||
if (xx<=0) return;
|
if (xx<=0) return;
|
||||||
|
|
||||||
|
//Most of this could be precalculated when min/max is set..
|
||||||
QString fd,tmpstr;
|
QString fd,tmpstr;
|
||||||
int divisors[]={86400000,3600000,2700000,1800000,1200000,900000,600000,300000,120000,60000,45000,30000,20000,15000,10000,5000,2000,1000,100,50};
|
|
||||||
int divcnt=sizeof(divisors)/sizeof(int);
|
|
||||||
int divmax,dividx;
|
int divmax,dividx;
|
||||||
int fitmode;
|
int fitmode;
|
||||||
if (xx>86400000L) { // Day
|
if (xx>86400000L) { // Day
|
||||||
@ -69,14 +70,14 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
dividx=1;
|
dividx=1;
|
||||||
divmax=10;
|
divmax=10;
|
||||||
fitmode=1;
|
fitmode=1;
|
||||||
} else if (xx>60000) { // Seconds
|
} else if (xx>5000) { // Seconds
|
||||||
fd="00:00:00";
|
fd="00:00:00";
|
||||||
dividx=9;
|
dividx=6;
|
||||||
divmax=16;
|
divmax=17;
|
||||||
fitmode=2;
|
fitmode=2;
|
||||||
} else { // Microseconds
|
} else { // Microseconds
|
||||||
fd="00:00:00:000";
|
fd="00:00:00:000";
|
||||||
dividx=15;
|
dividx=16;
|
||||||
divmax=divcnt;
|
divmax=divcnt;
|
||||||
fitmode=3;
|
fitmode=3;
|
||||||
}
|
}
|
||||||
@ -84,12 +85,12 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
float x,y;
|
float x,y;
|
||||||
GetTextExtent(fd,x,y);
|
GetTextExtent(fd,x,y);
|
||||||
|
|
||||||
if (x<=0) { // font size bug
|
if (x<=0) {
|
||||||
qWarning() << "gXAxis::Plot() x<=0";
|
qWarning() << "gXAxis::Plot() x<=0 font size bug";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int max_ticks=width/(x+10); // Max number of ticks that will fit
|
int max_ticks=width/(x+15); // Max number of ticks that will fit
|
||||||
|
|
||||||
int fit_ticks=0;
|
int fit_ticks=0;
|
||||||
int div=-1;
|
int div=-1;
|
||||||
@ -105,7 +106,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fit_ticks==0) {
|
if (fit_ticks==0) {
|
||||||
qDebug() << "gXAxis::Plot() FitTicks==0!";
|
qDebug() << "gXAxis::Plot() What exactly do you expect to find at this zoom level?";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((div<0) || (div>divcnt)) {
|
if ((div<0) || (div>divcnt)) {
|
||||||
@ -189,7 +190,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
|
|||||||
glDrawArrays(GL_LINES, 0, vertcnt>>1);
|
glDrawArrays(GL_LINES, 0, vertcnt>>1);
|
||||||
glDisableClientState(GL_VERTEX_ARRAY); // deactivate vertex arrays after drawing
|
glDisableClientState(GL_VERTEX_ARRAY); // deactivate vertex arrays after drawing
|
||||||
|
|
||||||
glDisable(GL_SCISSOR_TEST);
|
// glDisable(GL_SCISSOR_TEST);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,8 +13,8 @@ gYAxis::gYAxis(QColor col)
|
|||||||
{
|
{
|
||||||
m_line_color=col;
|
m_line_color=col;
|
||||||
m_text_color=col;
|
m_text_color=col;
|
||||||
m_major_color=Qt::darkGray;
|
m_major_color=QColor(190,190,190,64);
|
||||||
m_minor_color=Qt::lightGray;
|
m_minor_color=QColor(220,220,220,64);
|
||||||
|
|
||||||
m_show_major_lines=true;
|
m_show_major_lines=true;
|
||||||
m_show_minor_lines=true;
|
m_show_minor_lines=true;
|
||||||
|
@ -170,7 +170,7 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
|
|||||||
FRW->AddLayer(g);
|
FRW->AddLayer(g);
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),"H")));
|
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),"H")));
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,QColor("red"),"PR",FT_Dot)));
|
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,QColor("red"),"PR",FT_Dot)));
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure,QColor("white"),"P",FT_Dot)));
|
//FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure,QColor("white"),"P",FT_Dot)));
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0B,QColor("blue"),"0B",FT_Dot)));
|
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0B,QColor("blue"),"0B",FT_Dot)));
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown10,QColor("orange"),"10",FT_Dot)));
|
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown10,QColor("orange"),"10",FT_Dot)));
|
||||||
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0E,QColor("yellow"),"0E",FT_Dot)));
|
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0E,QColor("yellow"),"0E",FT_Dot)));
|
||||||
|
@ -99,7 +99,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
|
|
||||||
if (!pref.Exists("MemoryHog")) pref["MemoryHog"]=true;
|
if (!pref.Exists("MemoryHog")) pref["MemoryHog"]=true;
|
||||||
ui->action_Memory_Hog->setChecked(pref["MemoryHog"].toBool());
|
|
||||||
|
|
||||||
if (!pref.Exists("fruitsalad")) pref["fruitsalad"]=true;
|
if (!pref.Exists("fruitsalad")) pref["fruitsalad"]=true;
|
||||||
|
|
||||||
@ -339,11 +338,6 @@ void MainWindow::on_actionOverlay_Bars_toggled(bool checked)
|
|||||||
daily->RedrawGraphs();
|
daily->RedrawGraphs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_action_Memory_Hog_toggled(bool checked)
|
|
||||||
{
|
|
||||||
pref["MemoryHog"]=checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::on_action_Reset_Graph_Layout_triggered()
|
void MainWindow::on_action_Reset_Graph_Layout_triggered()
|
||||||
{
|
{
|
||||||
if (daily) daily->ResetGraphLayout();
|
if (daily) daily->ResetGraphLayout();
|
||||||
|
@ -74,8 +74,6 @@ private slots:
|
|||||||
|
|
||||||
void on_actionOverlay_Bars_toggled(bool arg1);
|
void on_actionOverlay_Bars_toggled(bool arg1);
|
||||||
|
|
||||||
void on_action_Memory_Hog_toggled(bool arg1);
|
|
||||||
|
|
||||||
void on_action_Reset_Graph_Layout_triggered();
|
void on_action_Reset_Graph_Layout_triggered();
|
||||||
|
|
||||||
void on_action_Preferences_triggered();
|
void on_action_Preferences_triggered();
|
||||||
|
@ -593,7 +593,6 @@
|
|||||||
<addaction name="actionOverlay_Bars"/>
|
<addaction name="actionOverlay_Bars"/>
|
||||||
<addaction name="actionDisplay_Graph_Snapshots"/>
|
<addaction name="actionDisplay_Graph_Snapshots"/>
|
||||||
<addaction name="action_Link_Graphs"/>
|
<addaction name="action_Link_Graphs"/>
|
||||||
<addaction name="action_Memory_Hog"/>
|
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="action_Fullscreen"/>
|
<addaction name="action_Fullscreen"/>
|
||||||
<addaction name="action_Reset_Graph_Layout"/>
|
<addaction name="action_Reset_Graph_Layout"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user