00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 void TGo4DockBrowsers::init()
00024 {
00025
00026 QGridLayout *DiskLayout= new QGridLayout( Disk, 1, 1, 11, 6, "tabLayout");
00027 fxTGo4DiskFileBrowser = new TGo4DiskFileBrowser(Disk);
00028 DiskLayout->addWidget( fxTGo4DiskFileBrowser , 0, 0 );
00029
00030 QGridLayout *MemLayout= new QGridLayout( Memory, 1, 1, 11, 6, "tabLayout");
00031 fxTGo4Browser = new TGo4Browser(Memory);
00032 MemLayout->addWidget( fxTGo4Browser , 0, 0 );
00033
00034 QGridLayout *OnLayout= new QGridLayout( Online, 1, 1, 11, 6, "tabLayout");
00035 fxTGo4MonitoredList = new TGo4MonitoredList(Online);
00036 OnLayout->addWidget(fxTGo4MonitoredList,0,0);
00037
00038 QGridLayout *RemLayout= new QGridLayout( Remote, 1, 1, 11, 6, "tabLayout");
00039 fxTGo4RemoteBrowser = new TGo4RemoteBrowser(Remote);
00040 RemLayout->addWidget( fxTGo4RemoteBrowser, 0,0);
00041
00042 QGridLayout *HistLayout= new QGridLayout( HistClient, 1, 1, 11, 6, "tabLayout");
00043 fxTGo4GSIHistoClient = new TGo4GSIHistoClient(HistClient);
00044 HistLayout->addWidget(fxTGo4GSIHistoClient,0,0);
00045 }
00046
00047 void TGo4DockBrowsers::SetActiveBrowser( QWidget *SelectedTab)
00048 {
00049
00050 if (SelectedTab==Disk){
00051 fxTGo4DiskFileBrowser->SetListFocus();
00052 emit DiskTab();
00053 }else if(SelectedTab==Memory){
00054 fxTGo4Browser->SetListFocus();
00055 emit MemoryTab();
00056 }else if(SelectedTab==Remote){
00057 fxTGo4RemoteBrowser->SetListFocus();
00058 emit RemoteTab();
00059 }else if(SelectedTab==Online){
00060 fxTGo4MonitoredList->SetListFocus();
00061 emit OnlineTab();
00062 }else if(SelectedTab==HistClient){
00063 fxTGo4GSIHistoClient->SetListFocus();
00064 emit HistClientTab();
00065 }
00066
00067
00068 }
00069
00070 void TGo4DockBrowsers::destroy()
00071 {
00072 }
00073
00074 void TGo4DockBrowsers::closeEvent( QCloseEvent *ce )
00075 {
00076 ce->accept();
00077 emit Go4BrowsersClosed();
00078 delete this;
00079 }
00080
00081 TGo4QItem * TGo4DockBrowsers::CreateListViewItem( QListView *parent, QString Name, QString ClassName)
00082 {
00083 TGo4QItem *item1=0;
00084 if(strncmp(ClassName.data(),"TH1",3)==0){
00085 item1= new TGo4QTH1Item(parent,Name,ClassName.data());
00086 }else if (strncmp(ClassName.data(), "TH2",3)==0){
00087 item1= new TGo4QTH2Item(parent,Name,ClassName.data());
00088 }else if (strncmp(ClassName.data(), "TH3",3)==0){
00089 item1= new TGo4QTH3Item(parent ,Name,ClassName.data());
00090 }else if (!strcmp(ClassName.data(),"THStack")){
00091 item1 = new TGo4QTHStackItem(parent,Name,ClassName.data());
00092 }else if (!strcmp(ClassName.data(),"TProfile")){
00093 item1 = new TGo4QProfileItem(parent,Name,ClassName.data());
00094 }else if (!strcmp(ClassName.data(),"TGo4Fitter")){
00095 item1 = new TGo4QFitterItem(parent,Name,ClassName.data());
00096 }else if (!strcmp(ClassName.data(),"TGraph")){
00097 item1 = new TGo4QGraphItem(parent,Name,ClassName.data());
00098 }else if (!strcmp(ClassName.data(),"TMultiGraph")){
00099 item1 = new TGo4QMultiGraphItem(parent,Name,ClassName.data());
00100 }else if(strstr(ClassName.data(),"Canvas")){
00101 item1 = new TGo4QCanvasItem(parent, Name,"TCanvas");
00102 }else if(!strcmp(ClassName.data(),"TGo4Picture")){
00103 item1 = new TGo4QPicItem(parent, Name,ClassName.data());
00104 }else if(!strcmp(ClassName.data(),"TGo4PolyCond")){
00105 item1 = new TGo4QPolyItem(parent,Name,ClassName.data());
00106 }else if(!strcmp(ClassName.data(),"TGo4WinCond")){
00107 item1 = new TGo4QWinConItem(parent,Name,ClassName.data());
00108 }else if(!strcmp(ClassName.data(),"TGo4CondArray-1")){
00109 item1 = new TGo4QWinArrayItem(parent,Name);
00110 }else if(!strcmp(ClassName.data(),"TGo4CondArray-2")){
00111 item1 = new TGo4QPolyArrayItem(parent,Name);
00112 }else if(!strcmp(ClassName.data(),"TGo4Parameter")){
00113 item1 = new TGo4QParaItem(parent,Name,"Parameter");
00114 }else if(!strcmp(ClassName.data(),"TGo4Picture")){
00115 item1 = new TGo4QPicItem(parent,Name,ClassName.data());
00116 }else if(!strcmp(ClassName.data(),"TNtuple")){
00117 item1 = new TGo4QTreeItem(parent,Name);
00118 }else if(!strcmp(ClassName.data(),"TTree")){
00119 item1 = new TGo4QTreeItem(parent,Name);
00120 }else if(!strcmp(ClassName.data(),"TGo4Fitter")){
00121 item1 = new TGo4QFitterItem(parent,Name,ClassName.data());
00122 }else if(!strcmp(ClassName.data(),"TGo4HistogramEntry")){
00123 item1 = new TGo4QDynEntryItem(parent,Name,ClassName.data());
00124 }else if(!strcmp(ClassName.data(),"TGo4TreeHistogramEntry")){
00125 item1 = new TGo4QDynEntryItem(parent,Name,ClassName.data());
00126 }else if(!strcmp(ClassName.data(),"TDirectory")){
00127 item1 = new TGo4QDirItem(parent,Name,ClassName.data());
00128 }else if(!strcmp(ClassName.data(),"TFolder")){
00129 item1 = new TGo4QFolderItem(parent,Name,ClassName.data());
00130 }else{
00131
00132 }
00133
00134 return item1;
00135
00136 }
00137
00138
00139 TGo4QItem * TGo4DockBrowsers::CreateListViewItem( QListViewItem *parent, QString Name, QString ClassName)
00140 {
00141 TGo4QItem *item1=0;
00142 if(strncmp(ClassName.data(),"TH1",3)==0){
00143 item1= new TGo4QTH1Item(parent,Name,ClassName.data());
00144 }else if (strncmp(ClassName.data(), "TH2",3)==0){
00145 item1= new TGo4QTH2Item(parent,Name,ClassName.data());
00146 }else if (strncmp(ClassName.data(), "TH3",3)==0){
00147 item1= new TGo4QTH3Item(parent ,Name,ClassName.data());
00148 }else if (!strcmp(ClassName.data(),"THStack")){
00149 item1 = new TGo4QTHStackItem(parent,Name,ClassName.data());
00150 }else if (!strcmp(ClassName.data(),"TProfile")){
00151 item1 = new TGo4QProfileItem(parent,Name,ClassName.data());
00152 }else if (!strcmp(ClassName.data(),"TGo4Fitter")){
00153 item1 = new TGo4QFitterItem(parent,Name,ClassName.data());
00154 }else if (!strcmp(ClassName.data(),"TGraph")){
00155 item1 = new TGo4QGraphItem(parent,Name,ClassName.data());
00156 }else if (!strcmp(ClassName.data(),"TMultiGraph")){
00157 item1 = new TGo4QMultiGraphItem(parent,Name,ClassName.data());
00158 }else if(strstr(ClassName.data(),"Canvas")){
00159 item1 = new TGo4QCanvasItem(parent, Name,"TCanvas");
00160 }else if(!strcmp(ClassName.data(),"TGo4Picture")){
00161 item1 = new TGo4QPicItem(parent, Name,ClassName.data());
00162 }else if(!strcmp(ClassName.data(),"TGo4PolyCond")){
00163 item1 = new TGo4QPolyItem(parent,Name,ClassName.data());
00164 }else if(!strcmp(ClassName.data(),"TGo4WinCond")){
00165 item1 = new TGo4QWinConItem(parent,Name,ClassName.data());
00166 }else if(!strcmp(ClassName.data(),"TGo4CondArray-1")){
00167 item1 = new TGo4QWinArrayItem(parent,Name);
00168 }else if(!strcmp(ClassName.data(),"TGo4CondArray-2")){
00169 item1 = new TGo4QPolyArrayItem(parent,Name);
00170 }else if(!strcmp(ClassName.data(),"TGo4CondArray")){
00171 item1 = new TGo4QPolyArrayItem(parent,Name);
00172 }else if(!strcmp(ClassName.data(),"TGo4Parameter")){
00173 item1 = new TGo4QParaItem(parent,Name,ClassName.data());
00174 }else if(!strcmp(ClassName.data(),"TGo4Picture")){
00175 item1 = new TGo4QPicItem(parent,Name,ClassName.data());
00176 }else if(!strcmp(ClassName.data(),"TGo4Fitter")){
00177 item1 = new TGo4QFitterItem(parent,Name,ClassName.data());
00178 }else if(!strcmp(ClassName.data(),"TGo4HistogramEntry")){
00179 item1 = new TGo4QDynEntryItem(parent,Name,ClassName.data());
00180 }else if(!strcmp(ClassName.data(),"TGo4TreeHistogramEntry")){
00181 item1 = new TGo4QDynEntryItem(parent,Name,ClassName.data());
00182 }else if(!strcmp(ClassName.data(),"TNtuple")){
00183 item1 = new TGo4QTreeItem(parent,Name);
00184 }else if(!strcmp(ClassName.data(),"TTree")){
00185 item1 = new TGo4QTreeItem(parent,Name);
00186 }else if(!strcmp(ClassName.data(),"TDirectory")){
00187 item1 = new TGo4QDirItem(parent,Name,ClassName.data());
00188 }else if(!strcmp(ClassName.data(),"TFolder")){
00189 item1 = new TGo4QFolderItem(parent,Name,ClassName.data());
00190 }else{
00191
00192 }
00193
00194 return item1;
00195 }
00196
00197 QListView* TGo4DockBrowsers::GetListView(int tabnum) {
00198 switch(tabnum) {
00199 case 0:
00200 return fxTGo4DiskFileBrowser->FileListView;
00201 case 1:
00202 return fxTGo4Browser->ListViewLocal;
00203 case 2:
00204 return fxTGo4MonitoredList->ListViewMonitor;
00205 case 3:
00206 return fxTGo4RemoteBrowser->ListViewRemote;
00207 case 4:
00208 return fxTGo4GSIHistoClient->ClientHistListView;
00209 default:
00210 return 0;
00211 }
00212 return 0;
00213 }
00214
00215
00216 TGo4QItem* TGo4DockBrowsers::FindItem(int tabnum, QString Name) {
00217 if ((Name.length()==0) || (tabnum<0) || (tabnum>4)) return 0;
00218 QListViewItem* res = 0;
00219
00220 switch(tabnum) {
00221 case 0:
00222 res = fxTGo4DiskFileBrowser->FileListView->findItem(Name, 0);
00223 break;
00224 case 1:
00225 res = fxTGo4Browser->ListViewLocal->findItem(Name, 0);
00226 break;
00227 case 2:
00228 res = fxTGo4MonitoredList->ListViewMonitor->findItem(Name, 0);
00229 break;
00230 case 3:
00231 res = fxTGo4RemoteBrowser->ListViewRemote->findItem(Name, 0);
00232 break;
00233 case 4:
00234 res = fxTGo4GSIHistoClient->ClientHistListView->findItem(Name, 0);
00235 break;
00236 default:
00237 res = 0;
00238 }
00239
00240 return dynamic_cast<TGo4QItem*> (res);
00241 }
00242
00243 void TGo4DockBrowsers::StopAllMonitoring()
00244 {
00245 if (fxTGo4MonitoredList!=0) fxTGo4MonitoredList->StopMonitoring();
00246 if (fxTGo4GSIHistoClient!=0) fxTGo4GSIHistoClient->StopMonitoring();
00247 }
00248
00249
00250