- Timestamp:
- Jan 4, 2010, 12:50:27 PM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncfigureppp.cpp
r2169 r2177 50 50 //////////////////////////////////////////////////////////////////////////// 51 51 bncFigurePPP::bncFigurePPP(QWidget *parent) : QWidget(parent) { 52 reset(); 53 } 54 55 56 // Destructor 57 //////////////////////////////////////////////////////////////////////////// 58 bncFigurePPP::~bncFigurePPP() { 59 for (int ii = 0; ii < _pos.size(); ++ii) { 60 delete _pos[ii]; 61 } 62 } 63 64 // 65 //////////////////////////////////////////////////////////////////////////// 66 void bncFigurePPP::reset() { 67 QMutexLocker locker(&_mutex); 52 68 53 69 bncSettings settings; … … 57 73 _xyzRef[2] = settings.value("pppRefCrdZ").toDouble(); 58 74 59 }60 61 // Destructor62 ////////////////////////////////////////////////////////////////////////////63 bncFigurePPP::~bncFigurePPP() {64 75 for (int ii = 0; ii < _pos.size(); ++ii) { 65 76 delete _pos[ii]; 66 77 } 78 _pos.clear(); 79 80 update(); 67 81 } 68 82 … … 82 96 _pos.push_back(newPos); 83 97 98 if (_pos.size() == 1) { 99 _startTime = time; 100 } 101 84 102 if (_pos.size() > MAXNUMPOS) { 85 103 delete _pos[0]; … … 114 132 _height = painter.viewport().height(); 115 133 116 QFont font ;117 font.setPointSize(int( font.QFont::pointSize()*0.8));134 QFont font = this->font(); 135 font.setPointSize(int(this->font().pointSize()*0.9)); 118 136 painter.setFont(font); 119 137 … … 121 139 // ----------------------------------------------------- 122 140 if (_pos.size() > 1) { 123 // _tRange = _pos[_pos.size()-1]->time - _pos[0]->time;124 141 _tRange = MAXNUMPOS; 125 142 _tMin = _pos[0]->time.gpssec(); … … 168 185 // neu-tics 169 186 // -------- 187 170 188 double tic = floor(20.0 * (_neuMax - 0.05)) / 20.0; 171 189 QString strP = QString("%1 m").arg( tic,0,'f',2); … … 180 198 181 199 painter.setPen(QColor(Qt::red)); 182 painter.drawText(0,int( ww * 1.0),int(pntP.x() + ww * 3.00), 183 int(pntP.x()),Qt::AlignRight,"N"); 184 painter.setPen(QColor(0,210,0,127)); 185 painter.drawText(0,int( ww * 1.0),int(pntP.x() + ww * 4.00), 186 int(pntP.x()),Qt::AlignRight,"E"); 200 painter.drawText(0, ww, pntP.x() + 3*ww, pntP.x(), Qt::AlignRight, "N"); 201 painter.setPen(QColor(Qt::green)); 202 painter.drawText(0, ww, pntP.x() + 4*ww, pntP.x(), Qt::AlignRight, "E"); 187 203 painter.setPen(QColor(Qt::blue)); 188 painter.drawText(0, int( ww * 1.0),int(pntP.x() + ww * 5.00),189 int(pntP.x()),Qt::AlignRight,"U"); 204 painter.drawText(0, ww, pntP.x() + 5*ww, pntP.x(), Qt::AlignRight, "U"); 205 190 206 painter.setPen(QColor(Qt::black)); 191 192 painter.drawText(0,int(pntP.y() - ww * 0.5),int(pntP.x() - ww * 0.25), 193 int(pntP.x()),Qt::AlignRight,strP); 194 painter.drawText(0,int(pntM.y() - ww * 0.5),int(pntM.x() - ww * 0.25), 195 int(pntM.y()),Qt::AlignRight,strM); 196 painter.drawText(0,int(pntZ.y() - ww * 0.5),int(pntZ.x() - ww * 0.25), 197 int(pntZ.y()),Qt::AlignRight,strZ); 207 painter.drawText(0, pntP.y()-ww/2, pntP.x()- ww/4, pntP.x(), 208 Qt::AlignRight, strP); 209 painter.drawText(0, pntM.y()-ww/2, pntM.x()- ww/4, pntM.x(), 210 Qt::AlignRight, strM); 211 painter.drawText(0, pntZ.y()-ww/2, pntZ.x()- ww/4, pntZ.x(), 212 Qt::AlignRight, strZ); 198 213 199 214 painter.drawLine(pntP.x(), pntP.y(), pntP.x()+ww, pntP.y()); 200 215 painter.drawLine(pntM.x(), pntM.y(), pntM.x()+ww, pntM.y()); 216 217 // Start Time 218 // ---------- 219 unsigned hour, minute; 220 double second; 221 _startTime.civil_time(hour, minute, second); 222 QString startStr = QString("Start %1:%2:%3") 223 .arg(hour, 2, 10, QChar('0')) 224 .arg(minute, 2, 10, QChar('0')) 225 .arg(int(second), 2, 10, QChar('0')); 226 painter.setPen(QColor(Qt::black)); 227 painter.drawText(0, ww, pntP.x() + 14*ww, pntP.x(), 228 Qt::AlignRight, startStr); 201 229 202 230 // neu components … … 206 234 double t2 = _tMin + (_pos[ii]->time - _pos[0]->time); 207 235 208 // start time209 // ----------210 if (ii == 1) {211 _daySec = int(fmod(t1,86400.));212 _hours = int(_daySec / 3600);213 _minutes = int((_daySec - _hours * 3600)/ 60.);214 _seconds = int(fmod(t1,60.));215 _strTic = QString("Start %1:%2:%3").arg(_hours, 2, 10, QChar('0'))216 .arg(_minutes, 2, 10, QChar('0'))217 .arg(_seconds, 2, 10, QChar('0'));218 painter.setPen(QColor(Qt::black));219 painter.drawText(0,int( ww * 1.0),int(pntP.x() + ww * 13.50),220 int(pntP.x()),Qt::AlignRight,_strTic);221 }222 236 223 237 // time-tics 224 238 // --------- 225 if (fmod(t1,60.) == 0) { 239 if ( fmod(_pos[ii-1]->time.daysec(), 60.0) == 0 ) { 240 _pos[ii-1]->time.civil_time(hour, minute, second); 226 241 QPoint pntTic = pltPoint(t1, 0.0); 227 _daySec = int(fmod(t1,86400.)); 228 _hours = int(_daySec / 3600); 229 _minutes = int((_daySec - _hours * 3600)/ 60.); 230 _strTic = QString("%1:%2").arg(_hours, 2, 10, QChar('0')) 231 .arg(_minutes, 2, 10, QChar('0')); 242 QString strTic = QString("%1:%2").arg(hour, 2, 10, QChar('0')) 243 .arg(minute, 2, 10, QChar('0')); 232 244 painter.setPen(QColor(Qt::black)); 233 245 double xFirstCharTic = pntTic.x() - ww * 1.2; 234 246 if ( xFirstCharTic > pntZ.x()) { 235 painter.drawText(int(xFirstCharTic),int(pntTic.y() + ww * 1.7),_strTic); 236 painter.drawLine(int(pntTic.x()),int(pntTic.y()), 237 int(pntTic.x()),int(pntTic.y() + ww * 0.5)); 247 painter.drawText(int(xFirstCharTic), int(pntTic.y() + ww * 1.7), 248 strTic); 249 painter.drawLine(pntTic.x(), pntTic.y(), 250 pntTic.x(), pntTic.y()+ww/2); 238 251 } 239 252 } -
trunk/BNC/bncfigureppp.h
r2169 r2177 34 34 bncFigurePPP(QWidget *parent); 35 35 ~bncFigurePPP(); 36 void reset(); 36 37 37 38 public slots: … … 42 43 43 44 private: 45 const static int MAXNUMPOS = 300; 46 44 47 class pppPos { 45 48 public: … … 52 55 QMutex _mutex; 53 56 QVector<pppPos*> _pos; 57 bncTime _startTime; 54 58 double _neuMax; 55 59 double _tRange; … … 58 62 int _height; 59 63 double _xyzRef[3]; 60 int _daySec;61 int _hours;62 int _minutes;63 int _seconds;64 QString _strTic;65 const static int MAXNUMPOS = 300;66 64 }; 67 65 -
trunk/BNC/bnctime.h
r2123 r2177 16 16 unsigned int gpsw() const; 17 17 double gpssec() const; 18 void civil_time (unsigned int& hour, unsigned int& min, 19 double& sec) const; 18 20 19 21 bool operator!=(const bncTime &time1) const; … … 27 29 bncTime& setmjd(double daysec, int mjd); 28 30 void reset() {_mjd = 0; _sec = 0;} 29 void civil_time (unsigned int& hour, unsigned int& min, double& sec) const;30 31 static void jdgp(double tjul, double & second, long & nweek); 31 32 -
trunk/BNC/bncwindow.cpp
r2176 r2177 1064 1064 slotSaveOptions(); 1065 1065 1066 _bncFigurePPP->reset(); 1067 1066 1068 _actDeleteMountPoints->setEnabled(false); 1067 1069 _actGetData->setEnabled(false);
Note:
See TracChangeset
for help on using the changeset viewer.