Mercurial > hg > soniczoomios
comparison eventLogger.h @ 33:92dba082d957
Added trail and EVALUATION_POINT event type.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 26 Mar 2013 18:41:42 +0000 |
parents | ab7c86d0f3d8 |
children | 94df2cd72d7b |
comparison
equal
deleted
inserted
replaced
32:ab7c86d0f3d8 | 33:92dba082d957 |
---|---|
24 #include "2dvector.h" | 24 #include "2dvector.h" |
25 #include "json.h" | 25 #include "json.h" |
26 #include "testApp.h" | 26 #include "testApp.h" |
27 #include "presetManager.h" | 27 #include "presetManager.h" |
28 #import "ServerComms.h" | 28 #import "ServerComms.h" |
29 | 29 #include "grid.h" |
30 #define EVENT_THIN_FACTOR 10 | 30 |
31 #define EVENT_THIN_FACTOR 15 | |
31 #define EVENT_LOG_FILENAME "log.json" | 32 #define EVENT_LOG_FILENAME "log.json" |
32 //#define LOGGING_SERVER_URL "http://www.isophonics.net/datacollector/" | |
33 #define LOGGING_SERVER_URL "http://127.0.0.1:8080/testservice/" | |
34 #define UPLOAD_CHUNK_SIZE 1000 | 33 #define UPLOAD_CHUNK_SIZE 1000 |
35 | |
36 #define APP_CREATION_TIME 381429000000 // milliseconds to the time i wrote this wee blighter. saves digits | 34 #define APP_CREATION_TIME 381429000000 // milliseconds to the time i wrote this wee blighter. saves digits |
37 | 35 #define SCROLL_TRAIL_LENGTH 200 |
38 #define PROGRAM_VERSION 0.3 // IMPORTANT TOCHNAGE! | 36 #define PROGRAM_VERSION 0.3 // IMPORTANT TOCHNAGE! |
37 | |
38 #define SUPERVISED // this def will save files | |
39 | |
39 | 40 |
40 // can add but don't change ordering - this will invalidate logs | 41 // can add but don't change ordering - this will invalidate logs |
41 enum leventType {SAVE_PRESET, // 0 | 42 enum leventType {SAVE_PRESET, // 0 |
42 SAVE_DESET, // 1 | 43 SAVE_DESET, // 1 |
43 SCROLL, // 2 | 44 SCROLL, // 2 |
56 SEQ_LOCKED, // 15 | 57 SEQ_LOCKED, // 15 |
57 SYNTH_LOCKED, // 16 | 58 SYNTH_LOCKED, // 16 |
58 PLAY_PRESSED, // 17 | 59 PLAY_PRESSED, // 17 |
59 PAUSE_PRESSED, // 18 | 60 PAUSE_PRESSED, // 18 |
60 HELP_PRESSED, // 19 | 61 HELP_PRESSED, // 19 |
61 QUESTIONNAIRE_COMPLETED}; // 20 | 62 QUESTIONNAIRE_COMPLETED, // 20 |
63 EVALUATION_POINT, // 21 | |
64 EMPTY_EVENT}; // 22 | |
62 | 65 |
63 //--------------------------------------------------------------------------- | 66 //--------------------------------------------------------------------------- |
64 | 67 |
65 class lEvent{ | 68 class lEvent{ |
66 public: | 69 public: |
100 jevt["v2"] = val2; | 103 jevt["v2"] = val2; |
101 jevt["sID"] = sliderID; | 104 jevt["sID"] = sliderID; |
102 jevt["eTime"] = eventTime; | 105 jevt["eTime"] = eventTime; |
103 return jevt; | 106 return jevt; |
104 } | 107 } |
108 void draw(); | |
105 }; | 109 }; |
106 //--------------------------------------------------------------------------- | 110 //--------------------------------------------------------------------------- |
107 // streams no longer used | 111 // streams no longer used |
108 inline istream& operator>>(istream & is, lEvent& e){ | 112 inline istream& operator>>(istream & is, lEvent& e){ |
109 is.setf(ios_base::fixed,ios_base::floatfield); | 113 is.setf(ios_base::fixed,ios_base::floatfield); |
165 void eventlogNotOK(); | 169 void eventlogNotOK(); |
166 void testConnectionNotOK(); | 170 void testConnectionNotOK(); |
167 | 171 |
168 void printAll(); | 172 void printAll(); |
169 void saveSessionToFile(); | 173 void saveSessionToFile(); |
174 void drawTrail(const TwoVector min, const TwoVector max); | |
175 vector<lEvent> getDrawableEventsInRange(const TwoVector min, const TwoVector max); | |
176 vector<TwoVector> getRecentPath(int numEvents); | |
170 private: | 177 private: |
171 | 178 |
172 vector<lEvent> theEvents; | 179 vector<lEvent> theEvents; |
173 | 180 |
174 void thinnedLogEvent(lEvent nextEvent); | 181 void thinnedLogEvent(lEvent nextEvent); |
182 void thinnedScrollEvent(lEvent nextEvent); | |
175 unsigned int nextUploadQty; | 183 unsigned int nextUploadQty; |
176 | 184 |
177 string questionnaireComments; | 185 string questionnaireComments; |
178 | 186 |
179 ofxiPhoneDeviceType iOSdeviceType; | 187 ofxiPhoneDeviceType iOSdeviceType; |