serial_port_plotter
serial_port_plotter copied to clipboard
Exports CSV + PNG not work on Mac OS 10.13.6
Hello, I'm on linux debian stretch actually. If I run this app from Qtcreator, the different exports work as well. It's save my files in hte home directory. But if I compile it and install it with qmake && make install, no exports work...
I'm trying to find the problem.
Is there anything appearing in the system logs (e.g. permission denied)?
On Tue, Nov 19, 2019, 11:07 PM gilou [email protected] wrote:
Hello, I'm on linux debian stretch actually. If I run this app from Qtcreator, the different exports work as well. It's save my files in hte home directory. But if I compile it and install it with qmake && make install, no exports work...
I'm trying to find the problem.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CieNTi/serial_port_plotter/issues/9?email_source=notifications&email_token=AA7MKN7RGNYY2V6AYWOJRL3QUP6JPA5CNFSM4GDSBGJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEOQGNA#issuecomment-555549492, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7MKNYQPAND7FYPOUSTZSLQUP6JPANCNFSM4GDSBGJQ .
hello,
add QDir::homePath() + '/' +
in the mainwindow.cpp file at line 817 :
convert
m_csvFile = new QFile(QDateTime::currentDateTime().toString("yyyy-MM-d-HH-mm-ss-")+"data-out.csv");
in
m_csvFile = new QFile(QDir::homePath() + '/' + QDateTime::currentDateTime().toString("yyyy-MM-d-HH-mm-ss-")+"data-out.csv");
and at line 553
convert
ui->plot->savePng (QString::number(dataPointNumber) + ".png", 1920, 1080, 2, 50);
in
ui->plot->savePng (QDir::homePath() + '/' + QString::number(dataPointNumber) + ".png", 1920, 1080, 2, 50);
That do the trick but after a stop/play png export is disable...
That it's because in the two lines, only the filename is setted but not the path for the file, on unix system it's trying to write in the /usr/bin folder but it's root access. So it's a better practice to use the environment variable gived by QDir::homePath() before the file name. By the way, using the / character after QDir::homePath() is not a good option in order to be ported on windows...
Is there any function that perform the path operation correctly cross-platform?
On Tue, Nov 19, 2019, 11:57 PM gilou [email protected] wrote:
That it's because in the two lines, only the filename is setted but not the path for the file, on unix system it's trying to write in the /usr/bin folder but it's root access. So it's a better practice to use the environment variable gived by QDir::homePath() before the file name. By the way, using the / character after QDir::homePath() is not a good option in order to be ported on windows...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/CieNTi/serial_port_plotter/issues/9?email_source=notifications&email_token=AA7MKN6MV4Z3KTCPVFCHZVTQUQEGFA5CNFSM4GDSBGJ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEOV6JY#issuecomment-555573031, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7MKN2M2JQUQTHYNWAPJADQUQEGFANCNFSM4GDSBGJQ .
As writted in the Qt documentation, Qt replace the / by \ when is compliling for windows.
See : https://doc.qt.io/qt-5/qdir.html#Separator
@netbomo If you want to make a pull request I can update the repo with your fixes. Thanks for the feedback
I will do that next week, l've update some small things and prepare the repo in order to be compiled on linux debian distro.
Nice, as is the one I'm using so I'll be able to also test your request with not big delay :D