本文整理汇总了C++中replot函数的典型用法代码示例。如果您正苦于以下问题:C++ replot函数的具体用法?C++ replot怎么用?C++ replot使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了replot函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QwtPlot
EcgCh::EcgCh(QWidget *parent) :
QwtPlot(parent)
{
setMinimumHeight(10);
setMinimumWidth(10);
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(this);
setAxisTitle(QwtPlot::xBottom, "Czas [hh:mm:ss.ms]");
setAxisTitle(QwtPlot::yLeft, "Amplituda [mV]");
// picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft, QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn, canvas());
// picker->setStateMachine(new QwtPickerDragPointMachine());
// picker->setRubberBandPen(QColor(Qt::green));
// picker->setRubberBand(QwtPicker::CrossRubberBand);
// picker->setTrackerPen(QColor(Qt::white));
curve = new QwtPlotCurve("signal");
curve->setYAxis(QwtPlot::yLeft);
curve->attach(this);
peaksCurve = new QwtPlotCurve("signal");
peaksCurve->setYAxis(QwtPlot::yLeft);
peaksCurve->setStyle(QwtPlotCurve::CurveStyle::Dots);
peaksCurve->setPen(QPen(Qt::red, 5));
peaksCurve->attach(this);
samples = new QVector<QPointF>;
data = new QwtPointSeriesData;
peaksSamples = new QVector<QPointF>;
peaksData = new QwtPointSeriesData;
replot();
}
开发者ID:Aniseed,项目名称:ECG-analyzer,代码行数:31,代码来源:ecgch.cpp
示例2: sensor_callback
void Plot::timerEvent( QTimerEvent * )
{
circular_buffer.pop_back();
double data = sensor_callback();
circular_buffer.push_front(data);
d_curve->setSamples(x_sample, circular_buffer);
replot();
/*
switch( d_settings.updateType )
{
case Settings::RepaintCanvas:
{
// the axes in this example doesn't change. So all we need to do
// is to repaint the canvas.
canvas()->replot();
break;
}
default:
{
replot();
}
}
*/
}
开发者ID:johnliu55tw,项目名称:AccToPos,代码行数:25,代码来源:plot.cpp
示例3: replot
void SagittalZMPPlot::push(SensorValues sensors, bool left) {
if (left)
for (int i = PLOT_SIZE-1; i > 0; --i)
data[i] = data[i-1];
else
for (int i = 0; i < PLOT_SIZE - 1; ++i)
data[i] = data[i+1];
float total_weight = (sensors.sensors[Sensors::LFoot_FSR_FrontLeft]
+ sensors.sensors[Sensors::LFoot_FSR_FrontRight]
+ sensors.sensors[Sensors::LFoot_FSR_RearLeft]
+ sensors.sensors[Sensors::LFoot_FSR_RearRight]
+ sensors.sensors[Sensors::RFoot_FSR_FrontLeft]
+ sensors.sensors[Sensors::RFoot_FSR_FrontRight]
+ sensors.sensors[Sensors::RFoot_FSR_RearLeft]
+ sensors.sensors[Sensors::RFoot_FSR_RearRight]);
if (total_weight != 0)
data[left ? 0 : PLOT_SIZE - 1] =
(50.0f*sensors.sensors[Sensors::LFoot_FSR_FrontLeft]
+ 50.0f*sensors.sensors[Sensors::LFoot_FSR_FrontRight]
- 50.0f*sensors.sensors[Sensors::LFoot_FSR_RearLeft]
- 50.0f*sensors.sensors[Sensors::LFoot_FSR_RearRight]
+ 50.0f*sensors.sensors[Sensors::RFoot_FSR_FrontLeft]
+ 50.0f*sensors.sensors[Sensors::RFoot_FSR_FrontRight]
- 50.0f*sensors.sensors[Sensors::RFoot_FSR_RearLeft]
- 50.0f*sensors.sensors[Sensors::RFoot_FSR_RearRight]) / total_weight;
else
data[left ? 0 : PLOT_SIZE - 1] = 0.0f;
replot();
}
开发者ID:FionaCLin,项目名称:rUNSWift-2015-release,代码行数:29,代码来源:plots.cpp
示例4: RAD2DEG
void OdomPlot::push(Odometry vision, Odometry motion, Odometry combined, bool left) {
if (left)
for (int i = PLOT_SIZE-1; i > 0; --i){
motionData[i] = motionData[i-1];
visionData[i] = visionData[i-1];
combinedData[i] = combinedData[i-1];
}
else
for (int i = 0; i < PLOT_SIZE - 1; ++i){
motionData[i] = motionData[i+1];
visionData[i] = visionData[i+1];
combinedData[i] = combinedData[i+1];
}
motionData[left ? 0 : PLOT_SIZE - 1] = RAD2DEG(motion.turn);
visionData[left ? 0 : PLOT_SIZE - 1] = RAD2DEG(vision.turn);
combinedData[left ? 0 : PLOT_SIZE - 1] = RAD2DEG(combined.turn);
//std::cout << RAD2DEG(motion.turn) << "\t" << RAD2DEG(vision.turn) << "\t" << RAD2DEG(combined.turn) << "\n";
for(int i=0; i< (PLOT_SIZE-2); ++i){
motionDiff[i] = motionData[i+1] - motionData[i];
visionDiff[i] = visionData[i+1] - visionData[i];
combinedDiff[i] = combinedData[i+1] - combinedData[i];
}
replot();
}
开发者ID:FionaCLin,项目名称:rUNSWift-2015-release,代码行数:27,代码来源:plots.cpp
示例5: applyAxisSettings
void Plot::applySettings( const Settings &settings )
{
applyAxisSettings( QwtAxis::yLeft, settings );
applyAxisSettings( QwtAxis::yRight, settings );
replot();
}
开发者ID:27sparks,项目名称:GoldenCheetah,代码行数:7,代码来源:plot.cpp
示例6: clearGraphs
void LinesVisualisation::performStepComputation()
{
// do not perform painting if not visible
if(!isVisible())
return;
clearGraphs();
QVector<double> x, y;
// Paint the best
for (int i = 0; i < swarm()->size(); i++) {
const Particle *particle = (*swarm())[i];
x.clear();
y.clear();
y = particle->position;
for (int j = 0; j < swarm()->dimension(); j++) {
x.append(j + 1);
}
addGraph();
graph(i)->setData(x, y);
graph(i)->setPen(VisualisationHelper::rainbowCoding(i, swarm()->size()));
}
xAxis->setRange(0, swarm()->dimension());
if (swarm()->dimension() < 20)
{
xAxis->setAutoTickStep(false);
xAxis->setTickStep(1);
}
rescaleAxes(true);
setInteraction(QCP::iRangeDrag, true);
setInteraction(QCP::iRangeZoom, true);
replot();
}
开发者ID:epfl-disal,项目名称:SwarmViz,代码行数:34,代码来源:linesvisualisation.cpp
示例7: detachItems
void SweepInspector::loadSweep(int index) {
//load in new sweep values from data
if (data == NULL) return;
if ( (index < 0) || (index >= data->getNumSweeps())) return;
//remove old data and get new
if (d_curve) d_curve->attach(NULL);
detachItems();
fsweep sweep = data->getSweep(index);
d_curve = new QwtPlotCurve( data->timestampFromIndex(index) ); //Qwt will delete() this when its done with it
d_curve->setRenderHint( QwtPlotItem::RenderAntialiased );
d_curve->setStyle( QwtPlotCurve::Lines );
d_curve->setPen( QColor( Qt::yellow ), 2, Qt::SolidLine );
d_curve->setSamples( sweep );
d_curve->attach(this);
QwtInterval frange = data->limits(FREQ);
//setAxisScale(QwtPlot::xBottom, frange.minValue(), frange.maxValue(), (frange.maxValue() - frange.minValue())/ 5.0);
//setAxisScale(QwtPlot::yLeft, -135, 20, 10.0);
setTitle( QString("RF Sweep @ %1").arg(data->timestampFromIndex(index)) );
//set maximum zoom out
zoomer->setZoomBase(QRectF(QPointF(frange.minValue(), 40), QPointF(frange.maxValue(), -135)));
zoomer->zoomBase();
//find max, min, and average values and drop it on plot as well
double max = sweep.first().y(), min = sweep.first().y(), avg=0;
for(int i=0; i < sweep.size(); i++) {
max = std::max(max, sweep.at(i).y());
min = std::min(min, sweep.at(i).y());
avg += sweep.at(i).y();
} avg /= sweep.size();
//add markers onto the plot
QwtPlotMarker *one = new QwtPlotMarker(), *two = new QwtPlotMarker();
one->attach(this); one->setAxes(QwtPlot::xTop, QwtPlot::yRight);
two->attach(this); two->setAxes(QwtPlot::xTop, QwtPlot::yRight);
QwtText tone = QwtText(QString("Max: %1 dBm\nMin: %2 dBm\nAvg: %3 dBm").arg(max).arg(min).arg(avg));
tone.setFont( QFont( "Helvetica", 10, QFont::Bold ) );
tone.setColor( Qt::green );
tone.setRenderFlags(Qt::AlignTop | Qt::AlignLeft);
one->setLabel(tone);
one->setValue(0, 10);
one->setLabelAlignment(Qt::AlignBottom | Qt::AlignRight);
QwtText ttwo(data->plotText());
ttwo.setFont( QFont( "Helvetica", 10, QFont::Bold ) );
ttwo.setColor( Qt::white );
ttwo.setRenderFlags(Qt::AlignBottom | Qt::AlignRight);
two->setLabel(ttwo);
two->setValue(10, 10);
two->setLabelAlignment(Qt::AlignBottom | Qt::AlignLeft);
replot();
repaint();
}
开发者ID:npotts,项目名称:SpectralSignalHound-Viewer,代码行数:59,代码来源:SweepInspector.cpp
示例8: QwtPlot
StPlot::StPlot(QWidget* parent):
QwtPlot(parent),
viewFactor(-1.0)
{
setMinimumHeight(10);
setMinimumWidth(10);
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin(true);
grid->setMajPen(QPen(Qt::white, 0, Qt::DotLine));
grid->setMinPen(QPen(Qt::gray, 0 , Qt::DotLine));
grid->attach(this);
setAxisTitle(QwtPlot::xBottom, "Czas [s]");
setAxisTitle(QwtPlot::yLeft, "Amplituda [mv]");
curve = new QwtPlotCurve("Filtered signal");
curve->setYAxis(QwtPlot::yLeft);
curve->attach(this);
ISOPoints = new QwtPlotCurve("ISO");
ISOPoints->setStyle(QwtPlotCurve::NoCurve);
ISOPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::green), QColor(Qt::green), QSize(5, 5)));
ISOPoints->setYAxis(QwtPlot::yLeft);
ISOPoints->attach(this);
JPoints = new QwtPlotCurve("J");
JPoints->setStyle(QwtPlotCurve::NoCurve);
JPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::blue), QColor(Qt::blue), QSize(5, 5)));
JPoints->setYAxis(QwtPlot::yLeft);
JPoints->attach(this);
STPoints = new QwtPlotCurve("ST");
STPoints->setStyle(QwtPlotCurve::NoCurve);
STPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::red), QColor(Qt::red), QSize(5, 5)));
STPoints->setYAxis(QwtPlot::yLeft);
STPoints->attach(this);
RPoints = new QwtPlotCurve("R");
RPoints->setStyle(QwtPlotCurve::NoCurve);
RPoints->setSymbol(new QwtSymbol(QwtSymbol::Ellipse,QColor(Qt::yellow), QColor(Qt::yellow), QSize(5, 5)));
RPoints->setYAxis(QwtPlot::yLeft);
//RPoints->attach(this);
legend = new QwtLegend();
legend->setItemMode(QwtLegend::ReadOnlyItem);
legend->setWhatsThis("Click on an item to show/hide the plot");
this->insertLegend(legend, QwtPlot::RightLegend);
samples = new QVector<QPointF>;
data = new QwtPointSeriesData;
replot();
zoomer = new QwtPlotZoomer(QwtPlot::xBottom, QwtPlot::yLeft, canvas());
zoomer->setMousePattern(QwtEventPattern::MouseSelect1, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect4, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect5, Qt::NoButton);
zoomer->setMousePattern(QwtEventPattern::MouseSelect6, Qt::NoButton);
}
开发者ID:Aniseed,项目名称:ECG-analyzer,代码行数:59,代码来源:stplot.cpp
示例9: setZoomBase
void QcepPlot::updateZoomer()
{
if (m_Zoomer && m_Zoomer -> zoomRectIndex() == 0) {
m_Zoomer -> setZoomBase();
}
replot();
}
开发者ID:guyjennings,项目名称:qceplib,代码行数:8,代码来源:qcepplot.cpp
示例10: enableAxis
void
RealtimePlot::showSpeed(int state)
{
showSpeedState = state;
spdCurve->setVisible(state == Qt::Checked);
enableAxis(yRight2, state == Qt::Checked);
replot();
}
开发者ID:FuzzyBunnys,项目名称:GoldenCheetah,代码行数:8,代码来源:RealtimePlot.cpp
示例11: replot
void PerformanceManagerWindow::configChanged()
{
if (active) {
days = 0; // force replot
replot();
}
PMpicker->setRubberBandPen(GColor(CPLOTSELECT));
}
开发者ID:Gerryboy1964,项目名称:GoldenCheetah,代码行数:8,代码来源:PerformanceManagerWindow.cpp
示例12: replot
void Plot::setResampleMode( int mode )
{
RasterData *data = static_cast<RasterData *>( d_spectrogram->data() );
data->setResampleMode(
static_cast<QwtMatrixRasterData::ResampleMode>( mode ) );
replot();
}
开发者ID:0vermind,项目名称:NeoLoader,代码行数:8,代码来源:plot.cpp
示例13: replot
void SaxsviewImage::setMajorTicksVisible(bool on) {
for (int i = QwtPlot::yLeft; i < QwtPlot::axisCnt; ++i) {
QwtScaleDraw *draw = p->scales[i]->scaleDraw();
draw->setTickLength(QwtScaleDiv::MajorTick, on ? 8 : 0);
}
replot();
}
开发者ID:emblsaxs,项目名称:saxsview,代码行数:8,代码来源:saxsview_image.cpp
示例14: replot
void Oscilloscope::on_new_data(double * d)
{
for (int i = 0; i < channels;i++) {
channel_data[i].erase(channel_data[i].begin());
channel_data[i].push_back(d[i]);
}
replot();
}
开发者ID:MCL88,项目名称:psr,代码行数:8,代码来源:oxill.cpp
示例15: canvasPalette
void caStripPlot::setBackground(QColor c)
{
thisBackColor = c;
QPalette canvasPalette(c);
canvasPalette.setColor(QPalette::Foreground, QColor(133, 190, 232));
canvas()->setPalette(canvasPalette);
replot();
}
开发者ID:boiarino17,项目名称:epics,代码行数:8,代码来源:castripplot.cpp
示例16: replot
void caStripPlot::showCurve(int number, bool on)
{
if(number < 0 || number > (MAXCURVES-1)) return;
curve[number]->setVisible(on);
fillcurve[number]->setVisible(on);
errorcurve[number]->setVisible(on);
replot();
}
开发者ID:boiarino17,项目名称:epics,代码行数:8,代码来源:castripplot.cpp
示例17: setTitle
/*!
This method is intended for manipulating the plot widget
from a specific editor in the Qwt designer plugin.
\warning The plot editor has never been implemented.
*/
void QwtPlot::applyProperties( const QString & /* xmlDocument */ )
{
#if 0
// Temporary dummy code, for designer tests
setTitle( xmlDocument );
replot();
#endif
}
开发者ID:facontidavide,项目名称:PlotJuggler,代码行数:14,代码来源:qwt_plot_xml.cpp
示例18: QPen
void Plot::showSpectrogram( bool on )
{
d_spectrogram->setDisplayMode( QwtPlotSpectrogram::ImageMode, on );
d_spectrogram->setDefaultContourPen(
on ? QPen( Qt::black, 0 ) : QPen( Qt::NoPen ) );
replot();
}
开发者ID:richelbilderbeek,项目名称:CppTests,代码行数:8,代码来源:plot.cpp
示例19: legend
void QwtGrapher::showCurve(QwtPlotItem *item, bool on) {
item->setVisible(on);
QWidget *w = legend()->find(item);
if (w && w->inherits("QwtLegendItem") )
((QwtLegendItem *)w)->setChecked(on);
replot();
}
开发者ID:jesloper,项目名称:CGP,代码行数:8,代码来源:QwtGrapher.cpp
示例20: QwtInterval
void Spectrogramplot::setYAxisRange(double yMin, double yMax)
{
yMin_ = yMin;
yMax_ = yMax;
data_->setInterval( Qt::YAxis, QwtInterval( yMin_, yMax_ ) );
plotLayout()->setAlignCanvasToScales(true);
replot();
}
开发者ID:andrepuschmann,项目名称:srsGUI,代码行数:8,代码来源:Spectrogramplot.cpp
注:本文中的replot函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论