Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports CSV + PNG not work on Mac OS 10.13.6 #9

Open
turbyho opened this issue Nov 13, 2018 · 9 comments
Open

Exports CSV + PNG not work on Mac OS 10.13.6 #9

turbyho opened this issue Nov 13, 2018 · 9 comments

Comments

@turbyho
Copy link

turbyho commented Nov 13, 2018

No description provided.

@netbomo
Copy link

netbomo commented Nov 19, 2019

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.

@lwchkg
Copy link

lwchkg commented Nov 19, 2019 via email

@netbomo
Copy link

netbomo commented Nov 19, 2019

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...

@netbomo
Copy link

netbomo commented Nov 19, 2019

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...

@lwchkg
Copy link

lwchkg commented Nov 19, 2019 via email

@netbomo
Copy link

netbomo commented Nov 19, 2019

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

@CieNTi
Copy link
Owner

CieNTi commented Nov 20, 2019

@netbomo If you want to make a pull request I can update the repo with your fixes. Thanks for the feedback

@netbomo
Copy link

netbomo commented Nov 20, 2019

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.

@CieNTi
Copy link
Owner

CieNTi commented Nov 20, 2019

Nice, as is the one I'm using so I'll be able to also test your request with not big delay :D

netbomo added a commit to netbomo/serial_port_plotter that referenced this issue Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants