From 74b9797991ceaabf98613a70a10a4b329a254c93 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 28 Jun 2012 20:48:25 +0100 Subject: drawing calls and sms --- src/obtsDevice.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 5 deletions(-) (limited to 'src/obtsDevice.h') diff --git a/src/obtsDevice.h b/src/obtsDevice.h index 884600b..b300d64 100644 --- a/src/obtsDevice.h +++ b/src/obtsDevice.h @@ -16,15 +16,50 @@ functions: draw(time) getPosition(time) variables: pointer to icon image +//draw the icons - passed the IMEI +//colours for networks +//connect & disconnect + */ +class obtsDevice; //forward declaration + struct timeseg{ - timeseg(float _st,float _et){ - startTime=_st; - endTime=_et; + timeseg(){ + startTime=ofGetElapsedTimef(); + endTime=0.0f; + } + float startTime; + float endTime; +}; + +struct tsms{ + tsms(obtsDevice* to){ + recipient=to; + time=ofGetElapsedTimef(); } + obtsDevice *recipient; + float time; +}; + +struct tcall{ + tcall(obtsDevice* to,bool _connected){ + recipient=to; + startTime=ofGetElapsedTimef(); + endTime=0.0f; + connected=_connected; + if (connected) connectedTime=startTime; + else connectedTime=0.0f; + } + void connect(){ + connected=true; + connectedTime=ofGetElapsedTimef(); + } + obtsDevice *recipient; float startTime; + float connectedTime; float endTime; + bool connected; }; @@ -32,17 +67,32 @@ class obtsDevice { public: obtsDevice(); - obtsDevice(string &imsi,ofImage *_icon,ofVec2f _coords); + obtsDevice(string &imsi,string &imei,string &num,ofImage *_icon,ofVec2f _coords); virtual ~obtsDevice(); void draw(float timeScale); //units per second void connect(); void disconnect(); + void ringing(obtsDevice *to); + void call(obtsDevice *to); + void connectCall(); + void endCall(); + void sms(obtsDevice *to); + void excite(float amount=1.0); protected: private: - string IMSI; + float exciteLevel; + string IMSI,IMEI,number; ofVec2f coords; //angular coords vector connectionHistory; + vector smsHistory; //argle + vector callHistory; ofImage *icon; + bool active,calling; + + float lastTime; }; + + + #endif // OBTSDEVICE_H -- cgit v1.2.3