本文整理汇总了C++中QwtPlotCanvas::replot方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCanvas::replot方法的具体用法?C++ QwtPlotCanvas::replot怎么用?C++ QwtPlotCanvas::replot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotCanvas
的用法示例。
在下文中一共展示了QwtPlotCanvas::replot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: myReplot
void caWaterfallPlot::myReplot()
{
#if QWT_VERSION >= 0x060100
QwtPlotCanvas *canvas = (QwtPlotCanvas *) plot->canvas();
canvas->replot();
#else
plot->canvas()->replot();
#endif
}
示例2: TimeOut
// display
void caStripPlot::TimeOut()
{
int c, j;
double elapsedTime = 0.0;
int delta = 0;
double x0, x1, increment;
int totalMissed = 0;
int dataCountLimit = (int) (MULTFOROVERLAPPINGTIMES * HISTORY -1);
if(!timerID) return;
mutex.lock();
// we need an exact time scale
if(Start) {
Start = false;
ftime(&timeStart);
}
ftime(&timeNow);
elapsedTime = ((double) timeNow.time + (double) timeNow.millitm / (double)1000) -
((double) timeStart.time + (double) timeStart.millitm / (double)1000);
// change scale base in case of running time scale
if(thisXaxisType == TimeScale) {
timeData = INTERVAL + elapsedTime;
setAxisScale(QwtPlot::xBottom, timeData - INTERVAL, timeData);
}
// replot in order to get the exact transformation of real coordinates to pixels
if(thisXaxisType == TimeScale) {
replot();
} else {
#if QWT_VERSION >= 0x060100
QwtPlotCanvas *canvas = (QwtPlotCanvas *) this->canvas();
canvas->replot();
#else
canvas()->replot();
#endif
}
// we want to be sure that no pixels are missed, this is particularly important for ms windows
// this is really not nice and time consuming, up to now no better solution
for (int i = 2; i < dataCount; i++ ) {
x0 = transform(QwtPlot::xBottom, rangeData[0][i-1].value);
x1 = transform(QwtPlot::xBottom, rangeData[0][i].value);
delta = (int) (x0+0.5) - (int) (x1+0.5) - 1;
if(delta > 0 && x0 > 0 && x1 > 0 && delta < 20) {
increment = (base[i-1].value - base[i].value)/ (double) (delta+1);
//printf("===============> missed ticks=%d at=%d x0=%.1f x1=%.1f %d %d\n", delta, i, x0, x1, (int) (x0+0.5) , (int) (x1+0.5));
totalMissed++;
// insert missing time base data and adjust time holes
if(thisXaxisType != TimeScale) {
for(j = 0; j < delta; j++) {
base.insert(i, base[i]);
base.removeLast();
}
for(j = 1; j < delta+1; j++) {
base[j+i-1].value = base[i-1].value - increment * (double) j;
}
}
// insert missing data and timebase
for (c = 0; c < NumberOfCurves; c++ ) {
for(j = 0; j < delta; j++) {
if(thisStyle[c] == FillUnder) {
fillData[c].insert(i, fillData[c][i]);
fillData[c].removeLast();
}
rangeData[c].insert(i, rangeData[c][i]);
rangeData[c].removeLast();
}
for(j = 1; j < delta+1; j++) {
rangeData[c][j+i-1].value = fillData[c][j+i-1].value = invTransform(QwtPlot::xBottom, (int) (x0+0.5)-j);
}
}
if ((dataCount + delta) < dataCountLimit) dataCount = dataCount + delta;
}
}
for (int c = 0; c < NumberOfCurves; c++ ) {
if(thisStyle[c] == FillUnder) {
fillcurve[c]->setSamples(fillData[c].toVector());
}
errorcurve[c]->setSamples(rangeData[c].toVector());
}
if(thisXaxisType == TimeScale) {
replot();
} else {
#if QWT_VERSION >= 0x060100
QwtPlotCanvas *canvas = (QwtPlotCanvas *) this->canvas();
canvas->replot();
//.........这里部分代码省略.........