PT-Cooling-Log 1.0
PTCoolingLogViewer
|
00001 00005 #ifndef _LogViewer_hh_ 00006 #define _LogViewer_hh_ 00007 00008 #include "Switch.hh" 00009 #include "PtView.hh" 00010 00011 #include <vector> 00012 #include <string> 00013 #include <map> 00014 00015 #include <TApplication.h> 00016 00017 class TSQLServer; 00018 class Switch; 00019 class ArgParser; 00020 class TGraph; 00021 class TCanvas; 00022 00042 class LogViewer : public Switch, public TApplication { 00043 public: 00044 00045 LogViewer( int& argc, char* argv[] ); 00046 virtual ~LogViewer(); 00047 00048 void run(); 00049 00050 std::string url() const; 00051 00052 double labelSize(); 00053 double titleSize(); 00054 double titleOffset(); 00055 00056 //-------------------------------------------------------------- 00057 // TAG for SQL tables, views 00058 //-------------------------------------------------------------- 00059 static const std::string tgCoolingData; 00060 static const std::string tgCryoTmpr; 00061 static const std::string tgFlwHe4; 00062 static const std::string tgMw; 00063 static const std::string tgPrssCryo; 00064 static const std::string tgPrssHe3; 00065 static const std::string tgPrssHe4; 00066 00067 static const std::string sqlEpoch; 00068 static const std::string sqlTimeZone; 00069 00070 00071 private: 00072 00073 Switch& option() { return *this; } 00074 00075 TSQLServer *server_; 00076 00077 std::vector< PtView* > ptViews_; 00078 00079 //---------------------------------------------------------------- 00080 // List of Argument Parser 00081 // it may be better to put a super class.... 00082 //---------------------------------------------------------------- 00083 ArgParser *opHost_; 00084 ArgParser *opPort_; 00085 ArgParser *opUser_; 00086 ArgParser *opPass_; 00087 ArgParser *opDB_; 00088 ArgParser *opTable_; 00089 ArgParser *opStart_; 00090 ArgParser *opEnd_; 00091 ArgParser *opList_; 00092 ArgParser *opView_; 00093 ArgParser *opTitleSize_; 00094 ArgParser *opTitleOffset_; 00095 ArgParser *opLabelSize_; 00096 ArgParser *opEventLog_; 00097 ArgParser *opTLeftMargin_; 00098 ArgParser *opTRightMargin_; 00099 ArgParser *opOutput_; 00100 00104 void setupOptions( const int& argc, char* argv[] ); 00105 00106 TCanvas *c_; 00107 00108 double tmin_; 00109 double tmax_; 00110 double twidth_; 00111 double toffset_; 00112 00113 double tLeftMargin_; 00114 double tRightMargin_; 00115 00116 00117 PtView* addView(); 00118 PtView* addView( PtView *view ); 00119 00120 PtView* setupCryoTmprView(); 00121 PtView* setupPrssCryoView(); 00122 PtView* setupPrssHe3View(); 00123 PtView* setupPrssHe4View(); 00124 00125 void printList(); 00126 00127 public: 00128 std::string startTime(); 00129 std::string endTime(); 00130 double tleft(); 00131 double tright(); 00132 00133 double tmin(); 00134 double tmax(); 00135 00136 double toffset() const { return toffset_; } 00137 double& toffset() { return toffset_; } 00138 00139 std::string output(); 00140 std::string eventLog(); 00141 00142 TSQLServer* server() { return server_; } 00143 void connect(); 00144 00145 private: 00147 int parseTimeStr( const std::string& data ); 00148 00149 }; 00150 00151 #endif // _LogViewer_hh_