Changeset 2165 in ntrip for trunk/BNC/bncfigureppp.cpp
- Timestamp:
- Jan 3, 2010, 9:47:44 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncfigureppp.cpp
r2164 r2165 53 53 bncSettings settings; 54 54 55 _xyzRef[0] = 0.0; 56 _xyzRef[1] = 0.0; 57 _xyzRef[2] = 0.0; 58 59 QString refCrdStr = settings.value("pppRefCrd").toString(); 60 if (!refCrdStr.isEmpty()) { 61 QStringList refCrdStrList = refCrdStr.split(' ', QString::SkipEmptyParts); 62 if (refCrdStrList.size() == 3) { 63 _xyzRef[0] = refCrdStrList[0].toDouble(); 64 _xyzRef[1] = refCrdStrList[1].toDouble(); 65 _xyzRef[2] = refCrdStrList[2].toDouble(); 66 } 67 } 55 _xyzRef[0] = settings.value("pppRefCrdX").toDouble(); 56 _xyzRef[1] = settings.value("pppRefCrdY").toDouble(); 57 _xyzRef[2] = settings.value("pppRefCrdZ").toDouble(); 58 68 59 } 69 60 … … 80 71 void bncFigurePPP::slotNewPosition(bncTime time, double x, double y, double z){ 81 72 82 const static int MAXNUMPOS = 300;83 84 73 QMutexLocker locker(&_mutex); 85 74 … … 105 94 QPoint bncFigurePPP::pltPoint(double tt, double yy) { 106 95 107 double tScale = 0. 85* _width / _tRange;96 double tScale = 0.90 * _width / _tRange; 108 97 double yScale = 0.90 * _height / (2.0 * _neuMax); 109 double tOffset = _tRange / 1 0.0;98 double tOffset = _tRange / 13.0; 110 99 double yOffset = _neuMax / 10.0; 111 100 … … 121 110 122 111 QPainter painter(this); 112 123 113 _width = painter.viewport().width(); 124 114 _height = painter.viewport().height(); 115 116 QFont font; 117 font.setPointSize(int(font.QFont::pointSize()*0.8)); 118 painter.setFont(font); 125 119 126 120 // Plot X-coordinates as a function of time (in seconds) … … 128 122 if (_pos.size() > 1) { 129 123 130 _tRange = _pos[_pos.size()-1]->time - _pos[0]->time; // in sec 124 // _tRange = _pos[_pos.size()-1]->time - _pos[0]->time; 125 _tRange = MAXNUMPOS; // GW 131 126 _tMin = _pos[0]->time.gpssec(); 132 127 … … 177 172 QString strP = QString("%1 m").arg( tic,0,'f',2); 178 173 QString strM = QString("%1 m").arg(-tic,0,'f',2); 174 QString strZ = QString("%1 m").arg(0.0,0,'f',2); 179 175 180 176 QPoint pntP = pltPoint(_tMin, tic); 181 177 QPoint pntM = pltPoint(_tMin,-tic); 178 QPoint pntZ = pltPoint(_tMin, 0.0); 182 179 183 180 int ww = QFontMetrics(this->font()).width('w'); 184 181 185 painter.drawText(pntP.x() - ww * strP.length(), pntP.y()+ww, strP); 186 painter.drawText(pntM.x() - ww * strM.length(), pntM.y(), strM); 182 painter.drawText(0,pntP.y() - ww * 0.5,pntP.x() - ww * 0.25,pntP.x(),Qt::AlignRight,strP); 183 painter.drawText(0,pntM.y() - ww * 0.5,pntM.x() - ww * 0.25,pntM.y(),Qt::AlignRight,strM); 184 painter.drawText(0,pntZ.y() - ww * 0.5,pntZ.x() - ww * 0.25,pntZ.y(),Qt::AlignRight,strZ); 187 185 188 186 painter.drawLine(pntP.x(), pntP.y(), pntP.x()+ww, pntP.y()); 189 187 painter.drawLine(pntM.x(), pntM.y(), pntM.x()+ww, pntM.y()); 190 191 // time-tic192 // --------193 painter.drawText(pltPoint(_tMin+_tRange,0.0),194 QString(" %1 s").arg(_tRange));195 188 196 189 // neu components … … 199 192 double t1 = _tMin + (_pos[ii-1]->time - _pos[0]->time); 200 193 double t2 = _tMin + (_pos[ii]->time - _pos[0]->time); 194 195 // time-tics 196 // --------- 197 if (fmod(t1,60.) == 0) { 198 QPoint pntTic = pltPoint(t1, 0.0); 199 int daySec = int(fmod(t1,86400.)); 200 int hours = int(daySec / 3600); 201 int minutes = int((daySec - hours * 3600)/ 60.); 202 QString strTic = QString("%1:%2").arg(hours, 2, 10, QChar('0')) 203 .arg(minutes, 2, 10, QChar('0')); 204 painter.setPen(QColor(Qt::black)); 205 double xFirstCharTic = pntTic.x() - ww * 1.2; 206 if ( xFirstCharTic > pntZ.x()) { 207 painter.drawText(xFirstCharTic,pntTic.y() + ww * 1.7,strTic); 208 painter.drawLine(pntTic.x(),pntTic.y(),pntTic.x(),pntTic.y() + ww * 0.5); 209 } 210 } 201 211 painter.setPen(QColor(Qt::red)); 202 212 painter.drawLine(pltPoint(t1, neu[ii-1][0]), pltPoint(t2, neu[ii][0]));
Note:
See TracChangeset
for help on using the changeset viewer.