How to save datas in QChart into a txt file?
-
I have a chart and in my drone are many values comes to the graph.
I want to save them.
How can i do such a thing?@firsnur96 said in How to save datas in QChart into a txt file?:
How can i do such a thing?
Using https://doc.qt.io/qt-5/qfile.html
You can also use https://doc.qt.io/qt-5/qdatastream.html if you want to store in binary format. -
@firsnur96 said in How to save datas in QChart into a txt file?:
How can i do such a thing?
Using https://doc.qt.io/qt-5/qfile.html
You can also use https://doc.qt.io/qt-5/qdatastream.html if you want to store in binary format. -
``` QFile file("Sakla/Info." + QTime::currentTime().toString("hh.mm.ss.'txt'")); if(file.open(QIODevice::WriteOnly | QIODevice::Text)) { for (int i=0; i<160; i++ ) { QTextStream out(&file); out << pars.t[i].f; } } file.close();
Is it true?
-
@jsulm actually i try, it write some datas on the file but i dont know they are true or not.
I have this function
void Main:Avi_veri_isle() { q_x++; grafige_deger_ekle(147, pars.t[TM_AV_1_vol_rpm].f); grafige_deger_ekle(116, pars.t[TM_AV_1_vtol_bat_vol].f); grafige_deger_ekle(117, pars.t[TM_AV_2_vol_rpm].f); grafige_deger_ekle(118, pars.t[TM_AV_2_vtol_bat_vol].f); }
in grafige_deger_ekle function, i will append the numbers on the series
here is itvoid Main:grafige_deger_ekle(int i, double number) { seri[i]->append(q_x, number); }
I want to write these numbers into the file.
-
@jsulm actually i try, it write some datas on the file but i dont know they are true or not.
I have this function
void Main:Avi_veri_isle() { q_x++; grafige_deger_ekle(147, pars.t[TM_AV_1_vol_rpm].f); grafige_deger_ekle(116, pars.t[TM_AV_1_vtol_bat_vol].f); grafige_deger_ekle(117, pars.t[TM_AV_2_vol_rpm].f); grafige_deger_ekle(118, pars.t[TM_AV_2_vtol_bat_vol].f); }
in grafige_deger_ekle function, i will append the numbers on the series
here is itvoid Main:grafige_deger_ekle(int i, double number) { seri[i]->append(q_x, number); }
I want to write these numbers into the file.
@firsnur96 said in How to save datas in QChart into a txt file?:
but i dont know they are true or not
How should I know? It is your data.
You should define a format you want to use to store these numbers in a file. For example one number per line in text file, or coma separated list or whatever you like. -
@firsnur96 said in How to save datas in QChart into a txt file?:
but i dont know they are true or not
How should I know? It is your data.
You should define a format you want to use to store these numbers in a file. For example one number per line in text file, or coma separated list or whatever you like. -
@jsulm said in How to save datas in QChart into a txt file?:
How should I know? It is your data.
you are right.
I want to ask another thing, i was confused about where should i do the write operation.
Where should be placed my write function@firsnur96 said in How to save datas in QChart into a txt file?:
Where should be placed my write function
I don't know. Depends when you want to store the data in a file.