PDA

View Full Version : QT Creator Serial Port Plotter



PvanGritte
26th December 2018, 22:43
I'm new to QT Creator I have never ussed it before. I need to change a little thing of this amazing program I'm ussing to graph serial data comming from an Arduino sensor:

https://os.mbed.com/users/borislav/n...r/#commentform

Basically I'm doing an electrocardiogram and this program works perfectly but I need to change the X-axis scale cause is a standard medical thing, I need to modify the graph in that way so every little square values actually worth 40 milliseconds (in red), is there a way to do this? That would mean that after 25 squares there's 1 second.

I was recommended to add this lines in the mainwindow.cpp code (around line 221):

QSharedPointer fixedTicker(new QCPAxisTickerFixed);
ui->plot->xAxis->setTicker(fixedTicker);
fixedTicker->setTickStep(40.0);
fixedTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone);

But it doesn't work as needed, it changed as shown in the image below .


13003

d_stranz
28th December 2018, 00:50
Your link doesn't work and I'm not going to try to figure out where the code is on the mbed site. And your image is so faint that it isn't apparent what you think is wrong.

Why don't you copy and post the actual code in question? The instructions in my signature (below) explain how to do that so it creates a readable post.