#ifndef OBTSDEVICE_H #define OBTSDEVICE_H #include "ofMain.h" /* created with icon, colour, linesize etc in order to draw need to know: time now: in order to draw relatively (this is not actual time as it can draw historically) scale: fixed (defined at object creation) or always zoom out? (begin time defined at object creation) events: connect(is create) disconnect() call(* obtsDevice) hangup() sms(* obtsDevice) 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(){ 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; }; class obtsDevice { public: obtsDevice(); 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: 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