Check-in [b1db98431a]

Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Start and close session where added.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b1db98431a31258efb3dce272300f9d515e971e2
User & Date: azadok 2013-12-11 18:58:52
Context
2013-12-11
19:06
Credit for the TimeConversion(int msecs) method was added check-in: db6d295ecb user: azadok tags: trunk
18:58
Start and close session where added. check-in: b1db98431a user: azadok tags: trunk
2013-12-10
21:58
CSV file handle was Added to Session class check-in: a12a941a62 user: azadok tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to RapidReporter2/main.cpp.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53


54
55
56
57
58
59
60

int main(int argc, char *argv[])
{
    //for later use
//    QString absoluteFilePath = QDir::currentPath();
//    QString exeFilePath = qApp->applicationDirPath();


//    QString static const INFO_MSG = " [INFO] ";
//    QString static const ERR_MSG = " [ERROR] ";

    //AppLauncher appLauncher(argc,argv);




    ///todo - add identation func
    ///
    ///
    ///
    ///

    QApplication app(argc, argv);

    Session s("Avi","Test RR2");
    s.StartSession();



    //    QString wd = qApp->applicationDirPath();

//     Csv2HtmlConverter converter("20131110_132124.csv");
//     converter.writeHtmlTag(Flags::html,Flags::OPEN);

//    Screenshot s;







<
<
<
<
<
<
<
<
<










>
>







28
29
30
31
32
33
34









35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

int main(int argc, char *argv[])
{
    //for later use
//    QString absoluteFilePath = QDir::currentPath();
//    QString exeFilePath = qApp->applicationDirPath();










    ///todo - add identation func
    ///
    ///
    ///
    ///

    QApplication app(argc, argv);

    Session s("Avi","Test RR2");
    s.StartSession();
    QThread::sleep(2);
    s.CloseSession();

    //    QString wd = qApp->applicationDirPath();

//     Csv2HtmlConverter converter("20131110_132124.csv");
//     converter.writeHtmlTag(Flags::html,Flags::OPEN);

//    Screenshot s;

Changes to RapidReporter2/session.cpp.

1
2

3
4
5
6
7
8
9
..
60
61
62
63
64
65
66






67























68
69
70
71
72
73


















74
75

















76
77
78
79
80
81
82
#include "session.h"
#include <QDebug>



QString Session::GenerateCsvFileName()
{

    QString time = QTime::currentTime().toString();
    QString date = QDate::currentDate().toString(Qt::SystemLocaleShortDate);
................................................................................
}


void Session::StartSession()
{    
    csvFileName = GenerateCsvFileName();
    CreateCsvFile(csvFileName);






    AddLineToCsvfile("Time,Reporter,Type,Content,Screenshot,RTF Note");























    qDebug() << "StartSession was called!\n";
}


void Session::CloseSession()
{


















    qDebug() << "CloseSession was called!\n";
}


















void Session::StartSessionSlot()
{
    StartSession();
}

void Session::CloseSessionSlot()


>







 







>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#include "session.h"
#include <QDebug>
#include <QCoreApplication>


QString Session::GenerateCsvFileName()
{

    QString time = QTime::currentTime().toString();
    QString date = QDate::currentDate().toString(Qt::SystemLocaleShortDate);
................................................................................
}


void Session::StartSession()
{    
    csvFileName = GenerateCsvFileName();
    CreateCsvFile(csvFileName);

    QString currentTime = QDate::currentDate().toString(Qt::SystemLocaleShortDate)
            + " " + QTime::currentTime().toString();
    QString COMMA = ",";

    QString version = QCoreApplication::applicationVersion();
    QString columnHeaders = "Time,Reporter,Type,Content,Screenshot,RTF Note";

    QString versionLine = currentTime + COMMA
            + reporter + COMMA
            + "(Rapid Reporter version)" + COMMA
            + version + COMMA + COMMA;

    QString reporterLine =  currentTime + COMMA
            + reporter + COMMA
            + "Session Reporter" + COMMA
            + reporter + COMMA + COMMA;

    QString charterLine =  currentTime + COMMA
            + reporter + COMMA
            + "Session Charter" + COMMA
            + charter + COMMA + COMMA;

    AddLineToCsvfile(columnHeaders);
    AddLineToCsvfile(versionLine);
    AddLineToCsvfile(reporterLine);
    AddLineToCsvfile(charterLine);

    sessionStartTime = QDateTime::currentDateTime();

    qDebug() << "StartSession was called!\n";
}


void Session::CloseSession()
{
    QString currentTime = QDate::currentDate().toString(Qt::SystemLocaleShortDate)
            + " " + QTime::currentTime().toString();
    QString COMMA = ",";

    qint64 start = sessionStartTime.toMSecsSinceEpoch();
    qint64 end = QDateTime::currentDateTime().toMSecsSinceEpoch();

    qint64 sessionTotaltime = end - start;
    //QString sessionTotaltimeString = QString::number(sessionTotaltime);
    QString sessionTotaltimeString = TimeConversion(sessionTotaltime);

    QString summeryLine =  currentTime + COMMA
            + reporter + COMMA
            + "Session End. Duration" + COMMA
            + sessionTotaltimeString + COMMA + COMMA;

    AddLineToCsvfile(summeryLine);

    qDebug() << "CloseSession was called!\n";
}

QString Session::TimeConversion(int msecs)
{
    QString formattedTime;

      int hours = msecs/(1000*60*60);
      int minutes = (msecs-(hours*1000*60*60))/(1000*60);
      int seconds = (msecs-(minutes*1000*60)-(hours*1000*60*60))/1000;
      int milliseconds = msecs-(seconds*1000)-(minutes*1000*60)-(hours*1000*60*60);

      formattedTime.append(QString("%1").arg(hours, 2, 10, QLatin1Char('0')) + ":" +
                           QString( "%1" ).arg(minutes, 2, 10, QLatin1Char('0')) + ":" +
                           QString( "%1" ).arg(seconds, 2, 10, QLatin1Char('0')));
                           //+ ":" + QString( "%1" ).arg(milliseconds, 3, 10, QLatin1Char('0')));

      return formattedTime;
}

void Session::StartSessionSlot()
{
    StartSession();
}

void Session::CloseSessionSlot()

Changes to RapidReporter2/session.h.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
..
40
41
42
43
44
45
46


47
48
49
50
51
52
53

class Session : public QObject
{
    Q_OBJECT

    // util members
    QString startTime;

    QDateTime dateTimeGenerator;
    QTimer sessionTimer;

    QString reporter;
    QString charter;
    QString csvFileName;
    QFile * csvFile;
................................................................................
    explicit Session(QObject *parent = 0);
    explicit Session(QString Reporter, QString Charter, QObject *parent = 0);
    void StartSession();
    void CloseSession();
    void SaveToSessionNotes(QString note);
    void UpdateNotes(int type, QString note, QString screenshot, QString RTFNote);
    void UpdateNotes(QString type, QString note, QString screenshot = "", QString RTFNote = "");



    QString getNextUserType(QString userTypes[], int count);
    QString getPrevUserType(QString userTypes[], int count);
    QString getSpecificUserType (QString userTypes[], int &index,int count);

signals:








>







 







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

class Session : public QObject
{
    Q_OBJECT

    // util members
    QString startTime;
    QDateTime sessionStartTime;
    QDateTime dateTimeGenerator;
    QTimer sessionTimer;

    QString reporter;
    QString charter;
    QString csvFileName;
    QFile * csvFile;
................................................................................
    explicit Session(QObject *parent = 0);
    explicit Session(QString Reporter, QString Charter, QObject *parent = 0);
    void StartSession();
    void CloseSession();
    void SaveToSessionNotes(QString note);
    void UpdateNotes(int type, QString note, QString screenshot, QString RTFNote);
    void UpdateNotes(QString type, QString note, QString screenshot = "", QString RTFNote = "");

    QString TimeConversion(int msecs);

    QString getNextUserType(QString userTypes[], int count);
    QString getPrevUserType(QString userTypes[], int count);
    QString getSpecificUserType (QString userTypes[], int &index,int count);

signals: