XTicker cleanup, removed extra Memory Hog option from view menu.

This commit is contained in:
Mark Watkins 2011-08-06 20:45:00 +10:00
parent 4dd741db6f
commit df1c0f42b2
7 changed files with 16 additions and 28 deletions

View File

@ -150,16 +150,12 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry)
glEnableClientState(GL_VERTEX_ARRAY);
w.qglColor(m_flag_color);
if (quadcnt>0) {
//glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_SHORT, 0, quadarray);
glDrawArrays(GL_QUADS, 0, quadcnt>>1);
//glDisableClientState(GL_VERTEX_ARRAY);
}
if (vertcnt>0) {
//glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(2, GL_SHORT, 0, vertarray);
glDrawArrays(GL_LINES, 0, vertcnt>>1);
//glDisableClientState(GL_VERTEX_ARRAY);
}
if (pointcnt>0) {
glPointSize(4);

View File

@ -8,6 +8,9 @@
#include <QDebug>
#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)
:gLayer(EmptyChannel)
{
@ -53,10 +56,8 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
qint64 xx=maxx-minx;
if (xx<=0) return;
//Most of this could be precalculated when min/max is set..
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 fitmode;
if (xx>86400000L) { // Day
@ -69,14 +70,14 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
dividx=1;
divmax=10;
fitmode=1;
} else if (xx>60000) { // Seconds
} else if (xx>5000) { // Seconds
fd="00:00:00";
dividx=9;
divmax=16;
dividx=6;
divmax=17;
fitmode=2;
} else { // Microseconds
fd="00:00:00:000";
dividx=15;
dividx=16;
divmax=divcnt;
fitmode=3;
}
@ -84,12 +85,12 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
float x,y;
GetTextExtent(fd,x,y);
if (x<=0) { // font size bug
qWarning() << "gXAxis::Plot() x<=0";
if (x<=0) {
qWarning() << "gXAxis::Plot() x<=0 font size bug";
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 div=-1;
@ -105,7 +106,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
}
}
if (fit_ticks==0) {
qDebug() << "gXAxis::Plot() FitTicks==0!";
qDebug() << "gXAxis::Plot() What exactly do you expect to find at this zoom level?";
return;
}
if ((div<0) || (div>divcnt)) {
@ -189,7 +190,7 @@ void gXAxis::Plot(gGraphWindow & w,float scrx,float scry)
glDrawArrays(GL_LINES, 0, vertcnt>>1);
glDisableClientState(GL_VERTEX_ARRAY); // deactivate vertex arrays after drawing
glDisable(GL_SCISSOR_TEST);
// glDisable(GL_SCISSOR_TEST);
}

View File

@ -13,8 +13,8 @@ gYAxis::gYAxis(QColor col)
{
m_line_color=col;
m_text_color=col;
m_major_color=Qt::darkGray;
m_minor_color=Qt::lightGray;
m_major_color=QColor(190,190,190,64);
m_minor_color=QColor(220,220,220,64);
m_show_major_lines=true;
m_show_minor_lines=true;

View File

@ -170,7 +170,7 @@ Daily::Daily(QWidget *parent,QGLWidget * shared, MainWindow *mw)
FRW->AddLayer(g);
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_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_Unknown10,QColor("orange"),"10",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_Unknown0E,QColor("yellow"),"0E",FT_Dot)));

View File

@ -99,7 +99,6 @@ MainWindow::MainWindow(QWidget *parent) :
if (!pref.Exists("MemoryHog")) pref["MemoryHog"]=true;
ui->action_Memory_Hog->setChecked(pref["MemoryHog"].toBool());
if (!pref.Exists("fruitsalad")) pref["fruitsalad"]=true;
@ -339,11 +338,6 @@ void MainWindow::on_actionOverlay_Bars_toggled(bool checked)
daily->RedrawGraphs();
}
void MainWindow::on_action_Memory_Hog_toggled(bool checked)
{
pref["MemoryHog"]=checked;
}
void MainWindow::on_action_Reset_Graph_Layout_triggered()
{
if (daily) daily->ResetGraphLayout();

View File

@ -74,8 +74,6 @@ private slots:
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_Preferences_triggered();

View File

@ -593,7 +593,6 @@
<addaction name="actionOverlay_Bars"/>
<addaction name="actionDisplay_Graph_Snapshots"/>
<addaction name="action_Link_Graphs"/>
<addaction name="action_Memory_Hog"/>
<addaction name="separator"/>
<addaction name="action_Fullscreen"/>
<addaction name="action_Reset_Graph_Layout"/>