Mercurial > hg > soniczoomios
comparison eventLogger.h @ 30:c0a6f7c66719
Josh M test "in house" version 0.1
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 27 Feb 2013 11:39:07 +0000 |
parents | fabb3a5cdfc9 |
children | 23ef179c3748 |
comparison
equal
deleted
inserted
replaced
29:fabb3a5cdfc9 | 30:c0a6f7c66719 |
---|---|
29 | 29 |
30 #define EVENT_THIN_FACTOR 10 | 30 #define EVENT_THIN_FACTOR 10 |
31 #define EVENT_LOG_FILENAME "log.json" | 31 #define EVENT_LOG_FILENAME "log.json" |
32 //#define LOGGING_SERVER_URL "http://www.isophonics.net/datacollector/" | 32 //#define LOGGING_SERVER_URL "http://www.isophonics.net/datacollector/" |
33 #define LOGGING_SERVER_URL "http://127.0.0.1:8080/testservice/" | 33 #define LOGGING_SERVER_URL "http://127.0.0.1:8080/testservice/" |
34 #define UPLOAD_CHUNK_SIZE 100 | 34 #define UPLOAD_CHUNK_SIZE 20 |
35 | 35 |
36 #define QUESTIONNAIRE_ENABLE_TIME 100000 // milliseconds | 36 #define QUESTIONNAIRE_ENABLE_TIME 100000 // milliseconds |
37 #define APP_CREATION_TIME 381429000000 // milliseconds to the time i wrote this wee blighter saves digits | 37 #define APP_CREATION_TIME 381429000000 // milliseconds to the time i wrote this wee blighter saves digits |
38 | 38 |
39 #define PROGRAM_VERSION 0.1 // IMPORTANT TOCHNAGE! | 39 #define PROGRAM_VERSION 0.1 // IMPORTANT TOCHNAGE! |
157 void setUsername(const char *u); | 157 void setUsername(const char *u); |
158 void newUser(); | 158 void newUser(); |
159 void logEvent(const leventType& evtType,const TwoVector& centre = TwoVector(), const double& scale = 1.0, const int& sliderID = -1, const double& sliderVal = 0.0); | 159 void logEvent(const leventType& evtType,const TwoVector& centre = TwoVector(), const double& scale = 1.0, const int& sliderID = -1, const double& sliderVal = 0.0); |
160 void questionnaireAnswersObtained(vector<int> answers, const char* userComments); | 160 void questionnaireAnswersObtained(vector<int> answers, const char* userComments); |
161 void urlResponse(ofHttpResponse & response); | 161 void urlResponse(ofHttpResponse & response); |
162 | |
163 void questionnaireOK(); | |
164 void eventlogOK(); | |
165 void testConnectionOK(); | |
166 void questionnaireNotOK(); | |
167 void eventlogNotOK(); | |
168 void testConnectionNotOK(); | |
169 | |
170 void printAll(); | |
162 private: | 171 private: |
163 | 172 |
164 int currentHTTPRequestID; | 173 int currentHTTPRequestID; |
165 | 174 |
166 | 175 |
180 | 189 |
181 void checkLogFile(); | 190 void checkLogFile(); |
182 void deleteLogs(); // new user | 191 void deleteLogs(); // new user |
183 bool uploadEventLog(bool async); | 192 bool uploadEventLog(bool async); |
184 void firstEverAppOpen(); | 193 void firstEverAppOpen(); |
185 void readJsonToLog(const string &jsonFile); | 194 void checkExistingLogFile(const string &jsonFile); |
186 void uploadQuestionnaire(); | 195 void uploadQuestionnaire(); |
187 bool sendToServer(string functionName, Json::Value jsonData, bool async); | 196 bool sendToServer(string functionName, Json::Value jsonData, bool async); |
197 | |
198 | |
199 | |
200 | |
188 Json::Value logsToJson(); | 201 Json::Value logsToJson(); |
189 Json::Value questionnaireToJson(); | 202 Json::Value questionnaireToJson(); |
190 void printAll(){ | 203 |
191 cout << "ALL LOGGED EVENTS!: \n"; | |
192 vector<lEvent>::iterator evIter; | |
193 for(evIter = theEvents.begin(); evIter < theEvents.end(); evIter++){ | |
194 cout << *evIter; | |
195 | |
196 } | |
197 }; | |
198 | 204 |
199 // | 205 // |
200 ServerComms *serverComms; | 206 ServerComms *serverComms; |
201 | 207 |
202 }; | 208 }; |