Subversion Repositories Projects

Rev

Rev 239 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 239 Rev 240
Line 18... Line 18...
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
18
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19
 ***************************************************************************/
19
 ***************************************************************************/
Line 20... Line 20...
20
 
20
 
Line 21... Line 21...
21
#include "CSVLogger.h"
21
#include "CSVLogger.h"
22
 
22
 
23
CSVLogger::CSVLogger(cSettings * settings) {
23
CSVLogger::CSVLogger(cSettings * settings, sMode * mode) {
24
    // QFile-Instanz (Log-Datei)
24
    // QFile-Instanz (Log-Datei)
-
 
25
    csvfile = new QFile("");
25
    csvfile = new QFile("");
26
    this->settings = settings;
Line 26... Line 27...
26
    this->settings = settings;
27
    this->mode = mode;
27
}
28
}
28
 
29
 
Line 41... Line 42...
41
    if (csvfile->isOpen())
42
    if (csvfile->isOpen())
42
        csvfile->close();
43
        csvfile->close();
43
}
44
}
Line 44... Line 45...
44
 
45
 
45
//neuen Log erstellen
46
//neuen Log erstellen
46
void CSVLogger::newLog(QString filename) {
47
void CSVLogger::newLog() {
47
    if (!csvfile->isOpen())
48
    if (!csvfile->isOpen())
-
 
49
    {
-
 
50
        QString mode_name = mode->Hardware;
-
 
51
        if (mode_name.size() == 0) {
-
 
52
            mode_name = QString("groundstation_log");
-
 
53
        }
-
 
54
        QString filename = settings->DIR.Logging +
-
 
55
                           mode_name + "_" +
-
 
56
                           QDate::currentDate().toString(("yyyy-MM-dd")) + "_" +
48
    {
57
                           QTime::currentTime().toString("hh-mm") + ".csv";
49
        csvfile = new QFile(filename);
58
        csvfile = new QFile(filename);
50
        if (!csvfile->exists())
59
        if (!csvfile->exists())
51
        {
60
        {
52
            csvfile->open(QIODevice::Append | QIODevice::Text);
61
            csvfile->open(QIODevice::Append | QIODevice::Text);