vmonitor.h
Go to the documentation of this file.00001 #ifndef V_MONITOR_H
00002 #define V_MONITOR_H
00003
00014 #include "guiCtrl.h"
00015 #include "monitorTask.h"
00016 #include "logCtrl.h"
00017 #include "environmentManage.h"
00018 #include "propertyInfo.h"
00019 #include "monitorMode.h"
00020
00021
00022 namespace VXV {
00023 enum {
00024 InvalidLayerId = 0,
00025 TextLayer = 1,
00026 GraphixLayer = 2,
00027 AllLayer = 3,
00028 };
00029 }
00030
00031
00032 class ScreenTask;
00033
00037 class vmonitor : public SDL_Base {
00038 friend class MonitorTask;
00039 friend class mRunCtrl;
00040 friend class mURGCtrl;
00041 friend class ScreenTask;
00042
00043 WindowInterface* win;
00044 TTF_Draw* ttf;
00045 MonitorTask* task;
00046 ScreenTask* scr;
00047 int task_count;
00048 int mode;
00049 bool is_pause;
00050 const char* fname;
00051 LogCtrl* log;
00052 EnvironmentManage* env;
00053 SDL_sem* pause_sem;
00054
00055 static std::string ttf_path;
00056 const char* getURGType(void);
00057
00058 class VMonitorProperty : public PropertyInfo {
00059 void evaluate(void);
00060 public:
00061 std::string ttf_file;
00062 std::string urg_type;
00063 int crd_index;
00064 };
00065 VMonitorProperty* property;
00066 static void terminate(void);
00067 static vmonitor* obj;
00068 vmonitor(void);
00069
00070 public:
00071 ~vmonitor(void);
00072
00076 static vmonitor* getObject(void);
00077
00086 static int connect(int argc, char *argv[]);
00087
00094 void setMonitorMode(int monitorMode, const char* logfile);
00095
00101 static int getMonitorMode(void);
00102
00106 static unsigned long getTicks(void);
00107
00113 void add(TaskInterface* monitor_task);
00114
00120 void del(TaskInterface* monitor_task);
00121
00125 static void show(void);
00126
00130 static void hide(void);
00131
00135 static void pause(void);
00136
00140 static void start(void);
00141
00147 static void setTimeMagnify(double magnify);
00148
00154 static void setViewMagnify(double magnify);
00155
00163 static void clear(unsigned long layer = 3);
00164
00175 static unsigned long drawPoints(const std::vector<VXV::Grid3D>& points,
00176 unsigned long color = White, int r = 1);
00177
00188 static unsigned long drawLine(const VXV::Grid3D& p0, const VXV::Grid3D& p1,
00189 unsigned long color = White);
00190
00200 static unsigned long drawContLine(const std::deque<VXV::Grid3D>& points,
00201 unsigned long color = White);
00202
00203 static unsigned long drawCircle(const VXV::Grid& center, int r,
00204 unsigned long color = White);
00205
00218 static unsigned long drawText(const char* text, const VXV::Grid& pos,
00219 int pxSize = 16, bool pin = false,
00220 unsigned long color = White,
00221 unsigned long background = Black);
00222
00223 static int printf(const char* fmt, ...);
00224
00225 static void scrollWithRobot(bool on);
00226 };
00227
00228 #endif
00229