mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Vertical font test #1
This commit is contained in:
parent
076589cb3b
commit
348b787760
@ -1,8 +1,8 @@
|
||||
/********************************************************************
|
||||
/*
|
||||
gFlagsLine Implementation
|
||||
Copyright (c)2011 Mark Watkins <jedimark@users.sourceforge.net>
|
||||
License: GPL
|
||||
*********************************************************************/
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <QVector>
|
||||
@ -91,8 +91,8 @@ void gFlagsGroup::paint(gGraph &w, int left, int top, int width, int height)
|
||||
gFlagsLine::gFlagsLine(ChannelID code,QColor flag_color,QString label,bool always_visible,FlagType flt)
|
||||
:Layer(code),m_label(label),m_always_visible(always_visible),m_flt(flt),m_flag_color(flag_color)
|
||||
{
|
||||
quads=new GLBuffer(flag_color,2048,GL_QUADS);
|
||||
lines=new GLBuffer(flag_color,2048,GL_LINES);
|
||||
addGLBuf(quads=new GLBuffer(flag_color,2048,GL_QUADS));
|
||||
addGLBuf(lines=new GLBuffer(flag_color,2048,GL_LINES));
|
||||
quads->setAntiAlias(true);
|
||||
lines->setAntiAlias(true);
|
||||
}
|
||||
@ -124,7 +124,7 @@ void gFlagsLine::paint(gGraph & w,int left, int top, int width, int height)
|
||||
|
||||
|
||||
// Draw text label
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(m_label,x,y);
|
||||
w.renderText(m_label,left-x-10,top+(height/2)+(y/2));
|
||||
float x1,x2;
|
||||
@ -163,8 +163,8 @@ void gFlagsLine::paint(gGraph & w,int left, int top, int width, int height)
|
||||
//glEnable(GL_SCISSOR_TEST);
|
||||
|
||||
|
||||
quads->draw();
|
||||
lines->draw();
|
||||
//quads->draw();
|
||||
//lines->draw();
|
||||
/*glEnableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
bool antialias=pref["UseAntiAliasing"].toBool();
|
||||
|
@ -24,7 +24,7 @@ void gShadowArea::paint(gGraph & w,int left, int top, int width, int height)
|
||||
int start_px=left-1;
|
||||
int end_px=left+width;
|
||||
|
||||
float h=top;
|
||||
//float h=top;
|
||||
|
||||
double rmx=w.rmax_x-w.rmin_x;
|
||||
double px=((1/rmx)*(w.min_x-w.rmin_x))*width;
|
||||
@ -78,8 +78,10 @@ void gFooBar::paint(gGraph & w,int left, int top, int width, int height)
|
||||
if (xx==0)
|
||||
return;
|
||||
|
||||
height=height;
|
||||
|
||||
int start_px=left;
|
||||
int end_px=left+width;
|
||||
//int end_px=left+width;
|
||||
|
||||
float h=top;
|
||||
|
||||
|
@ -36,7 +36,7 @@ void DoneGraphs()
|
||||
}
|
||||
}
|
||||
|
||||
void GetTextExtent(QString text, float & width, float & height, QFont *font)
|
||||
void GetTextExtent(QString text, int & width, int & height, QFont *font)
|
||||
{
|
||||
QFontMetrics fm(*font);
|
||||
//QRect r=fm.tightBoundingRect(text);
|
||||
@ -146,6 +146,13 @@ Layer::Layer(ChannelID code)
|
||||
Layer::~Layer()
|
||||
{
|
||||
}
|
||||
void Layer::drawGLBuf()
|
||||
{
|
||||
if (!m_visible) return;
|
||||
for (int i=0;i<mgl_buffers.size();i++) {
|
||||
mgl_buffers[i]->draw();
|
||||
}
|
||||
}
|
||||
|
||||
void Layer::SetDay(Day * d)
|
||||
{
|
||||
@ -192,6 +199,13 @@ bool LayerGroup::isEmpty()
|
||||
}
|
||||
return empty;
|
||||
}
|
||||
void LayerGroup::drawGLBuf()
|
||||
{
|
||||
for (int i=0;i<layers.size();i++) {
|
||||
layers[i]->drawGLBuf();
|
||||
}
|
||||
}
|
||||
|
||||
void LayerGroup::SetDay(Day * d)
|
||||
{
|
||||
for (int i=0;i<layers.size();i++) {
|
||||
@ -305,6 +319,12 @@ bool gGraph::isEmpty()
|
||||
}
|
||||
return empty;
|
||||
}
|
||||
void gGraph::drawGLBuf()
|
||||
{
|
||||
for (int i=0;i<m_layers.size();i++) {
|
||||
m_layers[i]->drawGLBuf();
|
||||
}
|
||||
}
|
||||
/*void gGraph::invalidate()
|
||||
{ // this may not be necessary, as scrollbar & resize issues a full redraw..
|
||||
|
||||
@ -447,9 +467,9 @@ void gGraph::mouseMoveEvent(QMouseEvent * event)
|
||||
// qDebug() << m_title << "Move" << event->pos() << m_graphview->pointClicked();
|
||||
int y=event->pos().y();
|
||||
int x=event->pos().x();
|
||||
int x2=m_graphview->pointClicked().x(),y2=m_graphview->pointClicked().y();
|
||||
int x2=m_graphview->pointClicked().x();//,y2=m_graphview->pointClicked().y();
|
||||
int w=m_lastbounds.width()-(right+m_marginright);
|
||||
int h=m_lastbounds.height()-(bottom+m_marginbottom);
|
||||
//int h=m_lastbounds.height()-(bottom+m_marginbottom);
|
||||
double xx=max_x-min_x;
|
||||
double xmult=xx/w;
|
||||
m_selecting_area=false;
|
||||
@ -522,17 +542,18 @@ void gGraph::mouseMoveEvent(QMouseEvent * event)
|
||||
}
|
||||
void gGraph::mousePressEvent(QMouseEvent * event)
|
||||
{
|
||||
int y=event->pos().y();
|
||||
event=event;
|
||||
/*int y=event->pos().y();
|
||||
int x=event->pos().x();
|
||||
int w=m_lastbounds.width()-(right+m_marginright);
|
||||
int h=m_lastbounds.height()-(bottom+m_marginbottom);
|
||||
int x2,y2;
|
||||
//int h=m_lastbounds.height()-(bottom+m_marginbottom);
|
||||
//int x2,y2;
|
||||
double xx=max_x-min_x;
|
||||
double xmult=xx/w;
|
||||
//double xmult=xx/w;
|
||||
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;
|
||||
y-=top+m_margintop;
|
||||
}
|
||||
}*/
|
||||
//qDebug() << m_title << "Clicked" << x << y << left << right << top << bottom << m_width << m_height;
|
||||
}
|
||||
|
||||
@ -661,7 +682,7 @@ void gGraph::mouseDoubleClickEvent(QMouseEvent * event)
|
||||
int x=event->pos().x();
|
||||
int w=m_lastbounds.width()-(m_marginleft+left+right+m_marginright);
|
||||
int h=m_lastbounds.height()-(bottom+m_marginbottom);
|
||||
int x2=m_graphview->pointClicked().x(),y2=m_graphview->pointClicked().y();
|
||||
//int x2=m_graphview->pointClicked().x(),y2=m_graphview->pointClicked().y();
|
||||
if ((m_graphview->horizTravel()<4) && (x>left+m_marginleft && x<w+m_marginleft+left && y>top+m_margintop && y<h)) { // normal click in main area
|
||||
if (event->button() & Qt::RightButton) {
|
||||
ZoomX(1.66,x); // Zoon out
|
||||
@ -733,6 +754,8 @@ void gGraph::DrawTextQue()
|
||||
// margin recalcs..
|
||||
void gGraph::resize(int width, int height)
|
||||
{
|
||||
width=width;
|
||||
height=height;
|
||||
//m_height=height;
|
||||
//m_width=width;
|
||||
}
|
||||
@ -892,14 +915,29 @@ void gGraphView::DrawTextQue()
|
||||
if (q.angle==0) {
|
||||
painter.drawText(q.x, q.y, q.text);
|
||||
} else {
|
||||
float w,h;
|
||||
QString c;
|
||||
int w,h;
|
||||
GetTextExtent(q.text, w, h, q.font);
|
||||
int x=q.x-4;
|
||||
int y=q.y-(w)/2;
|
||||
int tp=y;
|
||||
qDebug() << "DrawText" << q.text << "@" <<x<< ","<< y;
|
||||
for (int i=0;i<q.text.length();i++) {
|
||||
c=q.text[i];
|
||||
GetTextExtent(c, w, h, q.font);
|
||||
if (c==" ") {
|
||||
y=tp;
|
||||
x+=w+6;
|
||||
}
|
||||
painter.drawText(x-w/2,y,c);
|
||||
|
||||
painter.translate(q.x, q.y);
|
||||
painter.rotate(-q.angle);
|
||||
painter.drawText(floor(-w/2.0), floor(-h/2.0), q.text);
|
||||
painter.rotate(+q.angle);
|
||||
painter.translate(-q.x, -q.y);
|
||||
y+=h+3;
|
||||
}
|
||||
//painter.translate(q.x, q.y);
|
||||
//painter.rotate(-q.angle);
|
||||
//painter.drawText(floor(-w/2.0), floor(-h/2.0), q.text);
|
||||
//painter.rotate(+q.angle);
|
||||
//painter.translate(-q.x, -q.y);
|
||||
}
|
||||
q.text.clear();
|
||||
//q.text.squeeze();
|
||||
@ -1119,6 +1157,7 @@ void gGraphView::paintGL()
|
||||
|
||||
if ((py + h + graphSpacer) >= 0) {
|
||||
w=width();
|
||||
|
||||
m_graphs[i]->paint(px,py,width()-titleWidth,h);
|
||||
glColor4f(0,0,0,1);
|
||||
//if (i<numgraphs-1) {
|
||||
@ -1147,10 +1186,14 @@ void gGraphView::paintGL()
|
||||
}
|
||||
if (!numgraphs) {
|
||||
QColor col=Qt::black;
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(m_emptytext,x,y,bigfont);
|
||||
AddTextQue(m_emptytext,(width()/2)-x/2,(height()/2)+y/2,0.0,col,bigfont);
|
||||
}
|
||||
|
||||
for (int i=0;i<m_graphs.size();i++) {
|
||||
m_graphs[i]->drawGLBuf();
|
||||
}
|
||||
DrawTextQue();
|
||||
//glDisable(GL_TEXTURE_2D);
|
||||
//glDisable(GL_DEPTH_TEST);
|
||||
@ -1351,8 +1394,8 @@ void gGraphView::mouseReleaseEvent(QMouseEvent * event)
|
||||
QMouseEvent e(event->type(),p,event->button(),event->buttons(),event->modifiers());
|
||||
m_graphs[m_graph_index]->mouseReleaseEvent(&e);
|
||||
}
|
||||
int x=event->x();
|
||||
int y=event->y();
|
||||
//int x=event->x();
|
||||
//int y=event->y();
|
||||
}
|
||||
|
||||
void gGraphView::mouseDoubleClickEvent(QMouseEvent * event)
|
||||
|
@ -21,7 +21,7 @@ extern QFont * defaultfont;
|
||||
extern QFont * mediumfont;
|
||||
extern QFont * bigfont;
|
||||
|
||||
void GetTextExtent(QString text, float & width, float & height, QFont *font=defaultfont);
|
||||
void GetTextExtent(QString text, int & width, int & height, QFont *font=defaultfont);
|
||||
|
||||
class gGraphView;
|
||||
class gGraph;
|
||||
@ -47,8 +47,8 @@ public:
|
||||
protected:
|
||||
QColor m_color;
|
||||
GLshort * buffer;
|
||||
int m_type; // type (GL_LINES, GL_QUADS, etc)
|
||||
int m_max;
|
||||
int m_type; // type (GL_LINES, GL_QUADS, etc)
|
||||
int m_cnt; // cnt
|
||||
float m_size;
|
||||
int s1,s2,s3,s4;
|
||||
@ -114,7 +114,9 @@ public:
|
||||
//void Y() { return m_Y; }
|
||||
|
||||
|
||||
void drawGLBuf();
|
||||
protected:
|
||||
void addGLBuf(GLBuffer *buf) { mgl_buffers.push_back(buf); }
|
||||
//QRect bounds; // bounds, relative to top of individual graph.
|
||||
Day *m_day;
|
||||
bool m_visible;
|
||||
@ -128,6 +130,7 @@ protected:
|
||||
short m_Y;
|
||||
short m_order; // order for positioning..
|
||||
LayerPosition m_position;
|
||||
QVector<GLBuffer *> mgl_buffers;
|
||||
};
|
||||
|
||||
class LayerGroup:public Layer
|
||||
@ -143,6 +146,7 @@ public:
|
||||
virtual EventDataType Maxy();
|
||||
virtual bool isEmpty();
|
||||
virtual void SetDay(Day * d);
|
||||
void drawGLBuf();
|
||||
|
||||
protected:
|
||||
QVector<Layer *> layers;
|
||||
@ -174,6 +178,7 @@ public:
|
||||
void qglColor(QColor col);
|
||||
void renderText(QString text, int x,int y, float angle=0.0, QColor color=Qt::black, QFont *font=defaultfont);
|
||||
|
||||
void drawGLBuf();
|
||||
QString title() { return m_title; }
|
||||
|
||||
//virtual void repaint(); // Repaint individual graph..
|
||||
|
@ -16,7 +16,7 @@ gLineChart::gLineChart(ChannelID code,QColor col,bool square_plot, bool disable_
|
||||
{
|
||||
m_line_color=col;
|
||||
m_report_empty=false;
|
||||
lines=new GLBuffer(col,40000,GL_LINES);
|
||||
addGLBuf(lines=new GLBuffer(col,40000,GL_LINES));
|
||||
lines->setAntiAlias(true);
|
||||
|
||||
}
|
||||
@ -425,13 +425,13 @@ void gLineChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
|
||||
if (m_report_empty) {
|
||||
QString msg="No Waveform Available";
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(msg,x,y,bigfont);
|
||||
//DrawText(w,msg,left+(width/2.0)-(x/2.0),scry-w.GetBottomMargin()-height/2.0+y/2.0,0,Qt::gray,bigfont);
|
||||
}
|
||||
} else {
|
||||
lines->scissor(left,w.flipY(top+height+2),width+1,height+1);
|
||||
lines->draw();
|
||||
//lines->draw();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,10 +11,10 @@
|
||||
gLineOverlayBar::gLineOverlayBar(ChannelID code,QColor color,QString label,FlagType flt)
|
||||
:Layer(code),m_flag_color(color),m_label(label),m_flt(flt)
|
||||
{
|
||||
points=new GLBuffer(color,2048,GL_POINTS);
|
||||
addGLBuf(points=new GLBuffer(color,2048,GL_POINTS));
|
||||
points->setSize(4);
|
||||
quads=new GLBuffer(color,2048,GL_QUADS);
|
||||
lines=new GLBuffer(color,2048,GL_LINES);
|
||||
addGLBuf(quads=new GLBuffer(color,2048,GL_QUADS));
|
||||
addGLBuf(lines=new GLBuffer(color,2048,GL_LINES));
|
||||
points->setAntiAlias(true);
|
||||
quads->setAntiAlias(true);
|
||||
lines->setAntiAlias(true);
|
||||
@ -39,7 +39,7 @@ void gLineOverlayBar::paint(gGraph & w, int left, int topp, int width, int heigh
|
||||
|
||||
float x1,x2;
|
||||
|
||||
float x,y;
|
||||
int x,y;
|
||||
|
||||
// Crop to inside the margins.
|
||||
// glScissor(left,topp,width,height);
|
||||
@ -144,10 +144,9 @@ void gLineOverlayBar::paint(gGraph & w, int left, int topp, int width, int heigh
|
||||
glLineWidth (1.5);
|
||||
} else glLineWidth (1);
|
||||
|
||||
quads->draw();
|
||||
lines->draw();
|
||||
//glPointSize(4);
|
||||
points->draw();
|
||||
//quads->draw();
|
||||
//lines->draw();
|
||||
//points->draw();
|
||||
|
||||
if (antialias) {
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
|
@ -81,7 +81,7 @@ void gSegmentChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
if (m_total==0) {
|
||||
QColor col=Qt::green;
|
||||
QString a=":-)";
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(a,x,y,bigfont);
|
||||
|
||||
w.renderText(a,start_px+xoffset-x/2, (start_py+yoffset+y/2),0,col,bigfont);
|
||||
@ -158,7 +158,7 @@ void gSegmentChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
//glVertex2f(tpx,tpy);
|
||||
//glEnd();
|
||||
QString a=m_names[m]; //QString::number(floor(100.0/m_total*data),'f',0)+"%";
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(a,x,y);
|
||||
w.renderText(a,tpx-(x/2.0),(tpy+y/2.0));
|
||||
}
|
||||
@ -190,6 +190,7 @@ void gSegmentChart::paint(gGraph & w,int left, int top, int width, int height)
|
||||
glEnd();
|
||||
|
||||
if (!m_names[m].isEmpty()) {
|
||||
int px,py;
|
||||
GetTextExtent(m_names[m],px,py);
|
||||
if (px+5<bw) {
|
||||
w.renderText(m_names[m],(xp+bw/2)-(px/2),top+((height/2)-(py/2)),0,Qt::black);
|
||||
@ -235,25 +236,24 @@ void gTAPGraph::SetDay(Day *d)
|
||||
QMap<EventStoreType,qint64> tap;
|
||||
|
||||
EventStoreType data=0,lastval=0;
|
||||
qint64 time=0,lasttime=0,firsttime=0;
|
||||
bool first=true;
|
||||
qint64 time=0,lasttime=0;
|
||||
//bool first;
|
||||
bool rfirst=true;
|
||||
bool changed;
|
||||
//bool changed;
|
||||
EventDataType gain=1,offset=0;
|
||||
for (QVector<Session *>::iterator s=m_day->begin();s!=m_day->end();s++) {
|
||||
if ((*s)->eventlist.find(m_code)==(*s)->eventlist.end()) continue;
|
||||
for (int q=0;q<(*s)->eventlist[m_code].size();q++) {
|
||||
EventList &el=*(*s)->eventlist[m_code][q];
|
||||
firsttime=lasttime=el.time(0);
|
||||
lasttime=el.time(0);
|
||||
lastval=el.raw(0);
|
||||
if (rfirst) {
|
||||
gain=el.gain();
|
||||
offset=el.offset();
|
||||
rfirst=false;
|
||||
}
|
||||
first=true;
|
||||
changed=false;
|
||||
EventStoreType lastlastval;
|
||||
//first=true;
|
||||
//changed=false;
|
||||
for (int i=1;i<el.count();i++) {
|
||||
data=el.raw(i);
|
||||
time=el.time(i);
|
||||
@ -264,7 +264,7 @@ void gTAPGraph::SetDay(Day *d)
|
||||
} else {
|
||||
tap[lastval]=v;
|
||||
}
|
||||
changed=true;
|
||||
//changed=true;
|
||||
lasttime=time;
|
||||
lastval=data;
|
||||
}
|
||||
@ -277,10 +277,6 @@ void gTAPGraph::SetDay(Day *d)
|
||||
tap[data]=v;
|
||||
}
|
||||
}
|
||||
/*if (lastval!=data){
|
||||
int v=(time-lastlasttime)/1000L;
|
||||
tap[data]+=v;
|
||||
} */
|
||||
}
|
||||
}
|
||||
m_values.clear();
|
||||
|
@ -10,8 +10,8 @@ void gStatsLine::paint(gGraph & w, int left, int top, int width, int height)
|
||||
{
|
||||
if (!m_visible) return;
|
||||
//if (m_empty) return;
|
||||
|
||||
float x,y;
|
||||
height=height;
|
||||
//int x,y;
|
||||
m_text=m_label;
|
||||
// GetTextExtent(m_text,x,y);
|
||||
int z=(width+gYAxis::Margin)/5;
|
||||
|
@ -14,10 +14,10 @@ public:
|
||||
//bool isEmpty();
|
||||
|
||||
protected:
|
||||
QString m_label;
|
||||
QColor m_textcolor;
|
||||
//bool m_empty;
|
||||
EventDataType m_min,m_max,m_avg,m_p90;
|
||||
QString m_label;
|
||||
QString m_text;
|
||||
QStaticText st_label,st_min,st_max,st_avg,st_p90;
|
||||
float m_tx,m_ty;
|
||||
|
@ -29,7 +29,7 @@ gXAxis::gXAxis(QColor col,bool fadeout)
|
||||
tz_offset=t2.secsTo(t1)/60L;
|
||||
tz_offset*=60000L;
|
||||
|
||||
vertarray=new GLBuffer(m_line_color);
|
||||
addGLBuf(vertarray=new GLBuffer(m_line_color));
|
||||
}
|
||||
gXAxis::~gXAxis()
|
||||
{
|
||||
@ -84,7 +84,7 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
|
||||
fitmode=3;
|
||||
}
|
||||
|
||||
float x,y;
|
||||
int x,y;
|
||||
GetTextExtent(fd,x,y);
|
||||
|
||||
if (x<=0) {
|
||||
@ -182,8 +182,8 @@ void gXAxis::paint(gGraph & w,int left,int top, int width, int height)
|
||||
}
|
||||
}
|
||||
|
||||
glLineWidth(1);
|
||||
vertarray->draw();
|
||||
//glLineWidth(1);
|
||||
//vertarray->draw();
|
||||
/* glEnableClientState(GL_VERTEX_ARRAY);
|
||||
w.qglColor(Qt::black);
|
||||
glVertexPointer(2, GL_SHORT, 0, vertarray);
|
||||
|
@ -20,8 +20,8 @@ gXGrid::gXGrid(QColor col)
|
||||
m_show_major_lines=true;
|
||||
m_show_minor_lines=true;
|
||||
|
||||
majorvert=new GLBuffer(m_major_color);
|
||||
minorvert=new GLBuffer(m_minor_color);
|
||||
addGLBuf(majorvert=new GLBuffer(m_major_color));
|
||||
addGLBuf(minorvert=new GLBuffer(m_minor_color));
|
||||
}
|
||||
gXGrid::~gXGrid()
|
||||
{
|
||||
@ -30,7 +30,7 @@ gXGrid::~gXGrid()
|
||||
}
|
||||
void gXGrid::paint(gGraph & w,int left,int top, int width, int height)
|
||||
{
|
||||
float x,y;
|
||||
int x,y;
|
||||
|
||||
double miny=w.min_y;
|
||||
double maxy=w.max_y;
|
||||
@ -153,9 +153,9 @@ void gXGrid::paint(gGraph & w,int left,int top, int width, int height)
|
||||
// Draw the lines & ticks
|
||||
// Turn on blending??
|
||||
|
||||
glLineWidth(1);
|
||||
majorvert->draw();
|
||||
minorvert->draw();
|
||||
//glLineWidth(1);
|
||||
//majorvert->draw();
|
||||
//minorvert->draw();
|
||||
/*
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
w.qglColor(m_minor_color);
|
||||
@ -177,7 +177,7 @@ gYAxis::gYAxis(QColor col)
|
||||
m_text_color=col;
|
||||
|
||||
m_yaxis_scale=1;
|
||||
vertarray=new GLBuffer(m_line_color);
|
||||
addGLBuf(vertarray=new GLBuffer(m_line_color));
|
||||
}
|
||||
gYAxis::~gYAxis()
|
||||
{
|
||||
@ -185,7 +185,7 @@ gYAxis::~gYAxis()
|
||||
}
|
||||
void gYAxis::paint(gGraph & w,int left,int top, int width, int height)
|
||||
{
|
||||
float x,y;
|
||||
int x,y;
|
||||
int labelW=0;
|
||||
|
||||
double miny=w.min_y;
|
||||
@ -323,17 +323,7 @@ void gYAxis::paint(gGraph & w,int left,int top, int width, int height)
|
||||
qWarning() << "vertarray bounds exceeded in gYAxis for " << w.title() << "graph" << "MinY =" <<miny << "MaxY =" << maxy << "min_ytick=" <<min_ytick;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
vertarray->draw();
|
||||
// Draw the lines & ticks
|
||||
// Turn on blending??
|
||||
/*glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glLineWidth(1);
|
||||
w.qglColor(m_line_color);
|
||||
glVertexPointer(2, GL_SHORT, 0, vertarray);
|
||||
glDrawArrays(GL_LINES, 0, vertcnt>>1);
|
||||
glDisableClientState(GL_VERTEX_ARRAY); // deactivate vertex arrays after drawing */
|
||||
//vertarray->draw();
|
||||
}
|
||||
|
||||
|
38
daily.cpp
38
daily.cpp
@ -72,7 +72,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
|
||||
layout->addWidget(scrollbar,0);
|
||||
|
||||
const int default_height=150;
|
||||
SF=new gGraph(GraphView,"Event Flags",default_height);
|
||||
SF=new gGraph(GraphView,"EVENT FLAGS",default_height);
|
||||
|
||||
// GAHI=new gGraph(GraphView,"Event Breakdown",default_height);
|
||||
gSegmentChart * seg=new gSegmentChart(GST_Pie);
|
||||
@ -85,25 +85,25 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
|
||||
|
||||
SF->AddLayer(AddCPAP(seg),LayerRight,100);
|
||||
|
||||
FRW=new gGraph(GraphView,"Flow Rate",default_height);
|
||||
MP=new gGraph(GraphView,"Mask Pressure",default_height);
|
||||
PRD=new gGraph(GraphView,"Pressure",default_height);
|
||||
LEAK=new gGraph(GraphView,"Leak",default_height);
|
||||
SNORE=new gGraph(GraphView,"Snore",default_height);
|
||||
RR=new gGraph(GraphView,"Respiratory Rate",default_height);
|
||||
TV=new gGraph(GraphView,"Tidal Volume",default_height);
|
||||
MV=new gGraph(GraphView,"Minute Ventilation",default_height);
|
||||
FLG=new gGraph(GraphView,"Flow Limitation",default_height);
|
||||
PTB=new gGraph(GraphView,"Patient Trig. Breath",default_height);
|
||||
RE=new gGraph(GraphView,"Respiratory Event",default_height);
|
||||
FRW=new gGraph(GraphView,"FLOW RATE",default_height);
|
||||
MP=new gGraph(GraphView,"MASK PRESSURE",default_height);
|
||||
PRD=new gGraph(GraphView,"PRESSURE",default_height);
|
||||
LEAK=new gGraph(GraphView,"LEAK",default_height);
|
||||
SNORE=new gGraph(GraphView,"SNORE",default_height);
|
||||
RR=new gGraph(GraphView,"RESPIRATORY RATE",default_height);
|
||||
TV=new gGraph(GraphView,"TIDAL VOLUME",default_height);
|
||||
MV=new gGraph(GraphView,"MINUTE VENTILATION",default_height);
|
||||
FLG=new gGraph(GraphView,"FLOW LIMITATION",default_height);
|
||||
PTB=new gGraph(GraphView,"PATIENT. TRIG BREATHING",default_height);
|
||||
RE=new gGraph(GraphView,"RESPIRATORY EVENT",default_height);
|
||||
IE=new gGraph(GraphView,"I:E",default_height);
|
||||
TE=new gGraph(GraphView,"Te",default_height);
|
||||
TI=new gGraph(GraphView,"Ti",default_height);
|
||||
INTPULSE=new gGraph(GraphView,"Pulse",default_height,1);
|
||||
TE=new gGraph(GraphView,"TE",default_height);
|
||||
TI=new gGraph(GraphView,"TI",default_height);
|
||||
INTPULSE=new gGraph(GraphView,"PULSE",default_height,1);
|
||||
INTSPO2=new gGraph(GraphView,"SPO2",default_height,1);
|
||||
PULSE=new gGraph(GraphView,"Pulse",default_height,1);
|
||||
PULSE=new gGraph(GraphView,"PULSE",default_height,1);
|
||||
SPO2=new gGraph(GraphView,"SPO2",default_height,1);
|
||||
PLETHY=new gGraph(GraphView,"Plethy",default_height,1);
|
||||
PLETHY=new gGraph(GraphView,"PLETHY",default_height,1);
|
||||
|
||||
|
||||
gFlagsGroup *fg=new gFlagsGroup();
|
||||
@ -153,7 +153,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
|
||||
for (int i=0;i<ng;i++){
|
||||
graphs[i]->AddLayer(new gXGrid());
|
||||
}
|
||||
PRD->AddLayer(AddCPAP(new gStatsLine(CPAP_Pressure,"Pressure")),LayerBottom,0,20,1);
|
||||
/*PRD->AddLayer(AddCPAP(new gStatsLine(CPAP_Pressure,"Pressure")),LayerBottom,0,20,1);
|
||||
PRD->AddLayer(AddCPAP(new gStatsLine(CPAP_EPAP,"EPAP")),LayerBottom,0,20,1);
|
||||
PRD->AddLayer(AddCPAP(new gStatsLine(CPAP_IPAP,"IPAP")),LayerBottom,0,20,1);
|
||||
LEAK->AddLayer(AddCPAP(new gStatsLine(CPAP_Leak)),LayerBottom,0,20,1);
|
||||
@ -165,7 +165,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared, MainWindow *mw)
|
||||
FLG->AddLayer(AddCPAP(new gStatsLine(CPAP_FlowLimitGraph)),LayerBottom,0,20,1);
|
||||
IE->AddLayer(AddCPAP(new gStatsLine(CPAP_IE)),LayerBottom,0,20,1);
|
||||
TE->AddLayer(AddCPAP(new gStatsLine(CPAP_Te)),LayerBottom,0,20,1);
|
||||
TI->AddLayer(AddCPAP(new gStatsLine(CPAP_Ti)),LayerBottom,0,20,1);
|
||||
TI->AddLayer(AddCPAP(new gStatsLine(CPAP_Ti)),LayerBottom,0,20,1); */
|
||||
|
||||
|
||||
PRD->AddLayer(AddCPAP(new gLineChart(CPAP_Pressure,QColor("dark green"),true)));
|
||||
|
Loading…
Reference in New Issue
Block a user