]>
Commit | Line | Data |
---|---|---|
5eb34a26 | 1 | #include "AliStorageAdministratorPanelListEvents.h" |
2 | ||
3 | #include <iostream> | |
4 | #include <sstream> | |
5 | #include <vector> | |
6 | ||
7 | #include <TG3DLine.h> | |
8 | #include <TGButton.h> | |
9 | #include <TGFrame.h> | |
10 | ||
5eb34a26 | 11 | using namespace std; |
5eb34a26 | 12 | |
13 | AliStorageAdministratorPanelListEvents *AliStorageAdministratorPanelListEvents::fInstance=0; | |
14 | ||
15 | ClassImp(AliStorageAdministratorPanelListEvents); | |
16 | ||
17 | #define WINDOWS_WIDTH 400 | |
18 | #define WINDOWS_HEIGHT 500 | |
19 | ||
20 | enum BUTTON{ | |
21 | BUTTON_CLOSE=1, | |
22 | BUTTON_GET_LIST, | |
23 | BUTTON_CHECK_PP, | |
24 | BUTTON_CHECK_PBPB, | |
25 | BUTTON_CHECK_TEMP, | |
26 | BUTTON_CHECK_PERM, | |
164d3d29 | 27 | BUTTON_MARK_EVENT, |
341ffc50 | 28 | BUTTON_LOAD_EVENT |
5eb34a26 | 29 | }; |
30 | ||
341ffc50 | 31 | enum ENTRY{ |
32 | ENTRY_RUN_MIN=1, | |
33 | ENTRY_RUN_MAX, | |
34 | ENTRY_EVENT_MIN, | |
35 | ENTRY_EVENT_MAX, | |
36 | ENTRY_MULTIPLICITY_MIN, | |
37 | ENTRY_MULTIPLICITY_MAX | |
5eb34a26 | 38 | }; |
39 | ||
40 | AliStorageAdministratorPanelListEvents::AliStorageAdministratorPanelListEvents() : | |
a7f93de6 | 41 | TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame), |
5eb34a26 | 42 | fStatusLabel(0), |
a7f93de6 | 43 | fRunMinEntry(0), |
44 | fRunMaxEntry(0), | |
45 | fEventMinEntry(0), | |
46 | fEventMaxEntry(0), | |
5eb34a26 | 47 | fMultiplicityMinEntry(0), |
48 | fMultiplicityMaxEntry(0), | |
a7f93de6 | 49 | fPPcheckbox(0), |
50 | fPbPbcheckbox(0), | |
51 | fTemporaryCheckbox(0), | |
52 | fPermanentCheckbox(0), | |
53 | fListBox(0), | |
5eb34a26 | 54 | fEventsListVector(0), |
164d3d29 | 55 | fServerSocket(SERVER_COMMUNICATION_REQ), |
5eb34a26 | 56 | fEventManager(0) |
57 | { | |
164d3d29 | 58 | fEventManager = AliStorageEventManager::GetEventManagerInstance(); |
59 | fEventManager->CreateSocket(fServerSocket); | |
a7f93de6 | 60 | |
61 | SetName("List"); | |
62 | SetLayoutBroken(kTRUE); | |
63 | ||
5eb34a26 | 64 | InitWindow(); |
65 | } | |
66 | ||
67 | AliStorageAdministratorPanelListEvents::~AliStorageAdministratorPanelListEvents() | |
68 | { | |
69 | cout<<"ADMIN PANEL -- List events descructor called"; | |
5eb34a26 | 70 | cout<<" --- OK"<<endl; |
71 | } | |
72 | ||
73 | AliStorageAdministratorPanelListEvents* AliStorageAdministratorPanelListEvents::GetInstance() | |
74 | { | |
75 | if(!fInstance){fInstance = new AliStorageAdministratorPanelListEvents();} | |
76 | return fInstance; | |
77 | } | |
78 | ||
164d3d29 | 79 | |
80 | void AliStorageAdministratorPanelListEvents::SelectedEvent() | |
5eb34a26 | 81 | { |
164d3d29 | 82 | Emit("SelectedEvent()"); |
5eb34a26 | 83 | } |
84 | ||
85 | void AliStorageAdministratorPanelListEvents::InitWindow() | |
86 | { | |
a7f93de6 | 87 | // "Run" group frame |
88 | TGGroupFrame *fRunGroupFrame = new TGGroupFrame(this,"Run"); | |
89 | fRunGroupFrame->SetLayoutBroken(kTRUE); | |
566ba262 | 90 | |
91 | fRunMinEntry = new TGNumberEntry(fRunGroupFrame,0,9,ENTRY_RUN_MIN,(TGNumberFormat::EStyle) 5); | |
a7f93de6 | 92 | fRunGroupFrame->AddFrame(fRunMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 93 | fRunMinEntry->MoveResize(38,22,80,22); |
566ba262 | 94 | |
341ffc50 | 95 | TGLabel *fRunMinLabel = new TGLabel(fRunGroupFrame,"Min:"); |
96 | fRunMinLabel->SetTextJustify(36); | |
97 | fRunMinLabel->SetMargins(0,0,0,0); | |
98 | fRunMinLabel->SetWrapLength(-1); | |
99 | fRunGroupFrame->AddFrame(fRunMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
100 | fRunMinLabel->MoveResize(8,22,30,18); | |
a7f93de6 | 101 | |
341ffc50 | 102 | TGLabel *fRunMaxLabel = new TGLabel(fRunGroupFrame,"Max:"); |
103 | fRunMaxLabel->SetTextJustify(36); | |
104 | fRunMaxLabel->SetMargins(0,0,0,0); | |
105 | fRunMaxLabel->SetWrapLength(-1); | |
106 | fRunGroupFrame->AddFrame(fRunMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
107 | fRunMaxLabel->MoveResize(120,22,30,24); | |
566ba262 | 108 | |
109 | fRunMaxEntry = new TGNumberEntry(fRunGroupFrame,999999,8,ENTRY_RUN_MAX,(TGNumberFormat::EStyle) 5); | |
a7f93de6 | 110 | fRunGroupFrame->AddFrame(fRunMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 111 | fRunMaxEntry->MoveResize(150,22,72,22); |
a7f93de6 | 112 | |
113 | fRunGroupFrame->SetLayoutManager(new TGVerticalLayout(fRunGroupFrame)); | |
566ba262 | 114 | //fRunGroupFrame->Resize(230,60); |
a7f93de6 | 115 | AddFrame(fRunGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 116 | fRunGroupFrame->MoveResize(8,8,230,60); |
117 | ||
118 | // "Event" group frame | |
a7f93de6 | 119 | TGGroupFrame *fEventGroupFrame = new TGGroupFrame(this,"Event"); |
120 | fEventGroupFrame->SetLayoutBroken(kTRUE); | |
566ba262 | 121 | |
122 | fEventMinEntry = new TGNumberEntry(fEventGroupFrame,0,9,ENTRY_EVENT_MIN,(TGNumberFormat::EStyle) 5); | |
a7f93de6 | 123 | fEventGroupFrame->AddFrame(fEventMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 124 | fEventMinEntry->MoveResize(38,22,80,22); |
566ba262 | 125 | |
a7f93de6 | 126 | TGLabel *fEventMinLabel = new TGLabel(fEventGroupFrame,"Min:"); |
127 | fEventMinLabel->SetTextJustify(36); | |
128 | fEventMinLabel->SetMargins(0,0,0,0); | |
129 | fEventMinLabel->SetWrapLength(-1); | |
130 | fEventGroupFrame->AddFrame(fEventMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 131 | fEventMinLabel->MoveResize(8,22,30,18); |
a7f93de6 | 132 | |
133 | TGLabel *fEventMaxLabel = new TGLabel(fEventGroupFrame,"Max:"); | |
134 | fEventMaxLabel->SetTextJustify(36); | |
135 | fEventMaxLabel->SetMargins(0,0,0,0); | |
136 | fEventMaxLabel->SetWrapLength(-1); | |
137 | fEventGroupFrame->AddFrame(fEventMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 138 | fEventMaxLabel->MoveResize(120,22,30,24); |
566ba262 | 139 | |
140 | fEventMaxEntry = new TGNumberEntry(fEventGroupFrame,999999,8,ENTRY_EVENT_MAX,(TGNumberFormat::EStyle) 5); | |
341ffc50 | 141 | fEventGroupFrame->AddFrame(fEventMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
142 | fEventMaxEntry->MoveResize(150,22,72,22); | |
566ba262 | 143 | |
a7f93de6 | 144 | fEventGroupFrame->SetLayoutManager(new TGVerticalLayout(fEventGroupFrame)); |
566ba262 | 145 | //fEventGroupFrame->Resize(230,60); |
a7f93de6 | 146 | AddFrame(fEventGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 147 | fEventGroupFrame->MoveResize(8,68,230,60); |
148 | ||
149 | // "Multiplicity" group frame | |
a7f93de6 | 150 | TGGroupFrame *fMultiplicityGroupFrame = new TGGroupFrame(this,"Multiplicity"); |
151 | fMultiplicityGroupFrame->SetLayoutBroken(kTRUE); | |
566ba262 | 152 | |
153 | fMultiplicityMinEntry = new TGNumberEntry(fMultiplicityGroupFrame,0,9,ENTRY_MULTIPLICITY_MIN,(TGNumberFormat::EStyle) 5); | |
a7f93de6 | 154 | fMultiplicityGroupFrame->AddFrame(fMultiplicityMinEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 155 | fMultiplicityMinEntry->MoveResize(38,22,80,22); |
566ba262 | 156 | |
a7f93de6 | 157 | TGLabel *fMultiplicityMinLabel = new TGLabel(fMultiplicityGroupFrame,"Min:"); |
158 | fMultiplicityMinLabel->SetTextJustify(36); | |
159 | fMultiplicityMinLabel->SetMargins(0,0,0,0); | |
160 | fMultiplicityMinLabel->SetWrapLength(-1); | |
161 | fMultiplicityGroupFrame->AddFrame(fMultiplicityMinLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 162 | fMultiplicityMinLabel->MoveResize(8,22,30,18); |
566ba262 | 163 | |
a7f93de6 | 164 | TGLabel *fMultiplicityMaxLabel = new TGLabel(fMultiplicityGroupFrame,"Max:"); |
165 | fMultiplicityMaxLabel->SetTextJustify(36); | |
166 | fMultiplicityMaxLabel->SetMargins(0,0,0,0); | |
167 | fMultiplicityMaxLabel->SetWrapLength(-1); | |
168 | fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxLabel, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 169 | fMultiplicityMaxLabel->MoveResize(120,22,30,24); |
566ba262 | 170 | |
171 | fMultiplicityMaxEntry = new TGNumberEntry(fMultiplicityGroupFrame,999999,8,ENTRY_MULTIPLICITY_MAX,(TGNumberFormat::EStyle) 5); | |
341ffc50 | 172 | fMultiplicityGroupFrame->AddFrame(fMultiplicityMaxEntry, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
173 | fMultiplicityMaxEntry->MoveResize(150,22,72,22); | |
a7f93de6 | 174 | |
175 | fMultiplicityGroupFrame->SetLayoutManager(new TGVerticalLayout(fMultiplicityGroupFrame)); | |
566ba262 | 176 | //fMultiplicityGroupFrame->Resize(230,60); |
a7f93de6 | 177 | AddFrame(fMultiplicityGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 178 | fMultiplicityGroupFrame->MoveResize(8,128,230,60); |
a7f93de6 | 179 | |
180 | // "Beam" group frame | |
181 | TGGroupFrame *fBeamGroupFrame = new TGGroupFrame(this,"Beam"); | |
182 | fBeamGroupFrame->SetLayoutBroken(kTRUE); | |
566ba262 | 183 | |
a7f93de6 | 184 | fPPcheckbox = new TGCheckButton(fBeamGroupFrame,"p-p",BUTTON_CHECK_PP); |
185 | fPPcheckbox->SetTextJustify(36); | |
186 | fPPcheckbox->SetMargins(0,0,0,0); | |
187 | fPPcheckbox->SetWrapLength(-1); | |
188 | fBeamGroupFrame->AddFrame(fPPcheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 189 | fPPcheckbox->MoveResize(8,22,40,19); |
566ba262 | 190 | |
a7f93de6 | 191 | fPbPbcheckbox = new TGCheckButton(fBeamGroupFrame,"Pb-Pb",BUTTON_CHECK_PBPB); |
192 | fPbPbcheckbox->SetTextJustify(36); | |
193 | fPbPbcheckbox->SetMargins(0,0,0,0); | |
194 | fPbPbcheckbox->SetWrapLength(-1); | |
195 | fBeamGroupFrame->AddFrame(fPbPbcheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 196 | fPbPbcheckbox->MoveResize(60,22,55,19); |
a7f93de6 | 197 | |
198 | fBeamGroupFrame->SetLayoutManager(new TGVerticalLayout(fBeamGroupFrame)); | |
566ba262 | 199 | //fBeamGroupFrame->Resize(230,60); |
a7f93de6 | 200 | AddFrame(fBeamGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 201 | fBeamGroupFrame->MoveResize(8,188,230,60); |
202 | ||
203 | // "Storage" group frame | |
204 | TGGroupFrame *fStorageGroupFrame = new TGGroupFrame(this,"Storage"); | |
205 | fStorageGroupFrame->SetLayoutBroken(kTRUE); | |
566ba262 | 206 | |
341ffc50 | 207 | fPermanentCheckbox = new TGCheckButton(fStorageGroupFrame,"Permanent",BUTTON_CHECK_PERM); |
208 | fPermanentCheckbox->SetTextJustify(36); | |
209 | fPermanentCheckbox->SetMargins(0,0,0,0); | |
210 | fPermanentCheckbox->SetWrapLength(-1); | |
211 | fStorageGroupFrame->AddFrame(fPermanentCheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
212 | fPermanentCheckbox->MoveResize(8,22,80,19); | |
566ba262 | 213 | |
341ffc50 | 214 | fTemporaryCheckbox = new TGCheckButton(fStorageGroupFrame,"Temporary",BUTTON_CHECK_TEMP); |
215 | fTemporaryCheckbox->SetTextJustify(36); | |
216 | fTemporaryCheckbox->SetMargins(0,0,0,0); | |
217 | fTemporaryCheckbox->SetWrapLength(-1); | |
218 | fStorageGroupFrame->AddFrame(fTemporaryCheckbox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
219 | fTemporaryCheckbox->MoveResize(120,22,80,19); | |
220 | ||
221 | fStorageGroupFrame->SetLayoutManager(new TGVerticalLayout(fStorageGroupFrame)); | |
566ba262 | 222 | // fStorageGroupFrame->Resize(230,60); |
341ffc50 | 223 | AddFrame(fStorageGroupFrame, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
224 | fStorageGroupFrame->MoveResize(8,248,230,60); | |
a7f93de6 | 225 | |
341ffc50 | 226 | // buttons |
227 | fMarkButton = new TGTextButton(this,"Mark event",BUTTON_MARK_EVENT); | |
a7f93de6 | 228 | fMarkButton->SetTextJustify(36); |
229 | fMarkButton->SetMargins(0,0,0,0); | |
230 | fMarkButton->SetWrapLength(-1); | |
341ffc50 | 231 | fMarkButton->Resize(100,24); |
a7f93de6 | 232 | AddFrame(fMarkButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 233 | fMarkButton->MoveResize(8,310,100,24); |
a7f93de6 | 234 | |
235 | fLoadButton = new TGTextButton(this,"Load selected event",BUTTON_LOAD_EVENT); | |
236 | fLoadButton->SetTextJustify(36); | |
237 | fLoadButton->SetMargins(0,0,0,0); | |
238 | fLoadButton->SetWrapLength(-1); | |
239 | fLoadButton->Resize(130,24); | |
240 | AddFrame(fLoadButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
341ffc50 | 241 | fLoadButton->MoveResize(108,310,130,24); |
242 | ||
243 | fGetListButton = new TGTextButton(this,"List events",BUTTON_GET_LIST); | |
244 | fGetListButton->SetTextJustify(36); | |
245 | fGetListButton->SetMargins(0,0,0,0); | |
246 | fGetListButton->SetWrapLength(-1); | |
247 | fGetListButton->Resize(100,24); | |
248 | AddFrame(fGetListButton, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); | |
249 | fGetListButton->MoveResize(8,334,100,24); | |
a7f93de6 | 250 | |
251 | // list box | |
a7f93de6 | 252 | fListBox = new TGListBox(this); |
253 | fListBox->SetName("fListBox"); | |
566ba262 | 254 | fListBox->AddEntry(new TGString("Run Event System Mult Marked"),0); |
255 | //fListBox->Resize(230,436); | |
a7f93de6 | 256 | AddFrame(fListBox, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2)); |
341ffc50 | 257 | fListBox->MoveResize(8,360,230,436); |
a7f93de6 | 258 | |
566ba262 | 259 | // SetMWMHints(kMWMDecorAll,kMWMFuncAll,kMWMInputModeless); |
260 | ||
a7f93de6 | 261 | MapSubwindows(); |
262 | Resize(GetDefaultSize()); | |
263 | MapWindow(); | |
341ffc50 | 264 | Resize(252,809); |
5eb34a26 | 265 | } |
266 | ||
267 | ||
268 | ||
269 | ||
270 | void AliStorageAdministratorPanelListEvents::onGetListButton() | |
271 | { | |
272 | //prepare and send request message | |
273 | struct serverRequestStruct *requestMessage = new struct serverRequestStruct; | |
274 | struct listRequestStruct list; | |
275 | ||
566ba262 | 276 | //build query |
a7f93de6 | 277 | list.runNumber[0]=fRunMinEntry->GetIntNumber(); |
278 | list.runNumber[1]=fRunMaxEntry->GetIntNumber(); | |
279 | list.eventNumber[0]=fEventMinEntry->GetIntNumber(); | |
280 | list.eventNumber[1]=fEventMaxEntry->GetIntNumber(); | |
566ba262 | 281 | if(fTemporaryCheckbox->GetState()==1){list.marked[0]=0;} |
282 | else{list.marked[0]=-1;} | |
283 | if(fPermanentCheckbox->GetState()==1){list.marked[1]=1;} | |
284 | else{list.marked[1]=-1;} | |
5eb34a26 | 285 | list.multiplicity[0]=fMultiplicityMinEntry->GetIntNumber(); |
286 | list.multiplicity[1]=fMultiplicityMaxEntry->GetIntNumber(); | |
566ba262 | 287 | if(fPPcheckbox->GetState()==1){strcpy(list.system[0],"p-p");} |
288 | else{strcpy(list.system[0],"");} | |
289 | if(fPbPbcheckbox->GetState()==1){strcpy(list.system[1],"A-A");} | |
290 | else{strcpy(list.system[1],"");} | |
5eb34a26 | 291 | |
292 | requestMessage->messageType = REQUEST_LIST_EVENTS; | |
293 | requestMessage->list = list; | |
294 | ||
566ba262 | 295 | if(!fEventManager->Send(requestMessage,fServerSocket,1000)){return;} |
5eb34a26 | 296 | |
a7f93de6 | 297 | fListBox->RemoveAll(); |
298 | fListBox->AddEntry(new TGString("Run Event System Mult Marked"),0); | |
566ba262 | 299 | |
5eb34a26 | 300 | vector<serverListStruct> receivedList = fEventManager->GetServerListVector(fServerSocket); |
566ba262 | 301 | |
5eb34a26 | 302 | for(unsigned int i=0;i<receivedList.size();i++) |
303 | { | |
566ba262 | 304 | fListBox->AddEntry(new TGString(Form("%d %d %s %d %d ", |
5eb34a26 | 305 | receivedList[i].runNumber, |
306 | receivedList[i].eventNumber, | |
307 | receivedList[i].system, | |
308 | receivedList[i].multiplicity, | |
566ba262 | 309 | receivedList[i].marked)),i+1); |
5eb34a26 | 310 | } |
311 | ||
312 | fEventsListVector = receivedList; | |
313 | ||
314 | gClient->HandleInput(); | |
a7f93de6 | 315 | gClient->NeedRedraw(fListBox, kTRUE); |
5eb34a26 | 316 | gClient->HandleInput(); |
317 | MapSubwindows(); | |
318 | MapWindow(); | |
319 | Layout(); | |
a410aca4 | 320 | delete requestMessage; |
5eb34a26 | 321 | } |
322 | ||
323 | ||
324 | void AliStorageAdministratorPanelListEvents::onMarkButton() | |
325 | { | |
326 | int runNumber; | |
327 | int eventNumber; | |
328 | ||
329 | //get run and event number from selected row | |
a7f93de6 | 330 | int selectedEventNumber = fListBox->GetSelected()-1; |
5eb34a26 | 331 | |
332 | if(selectedEventNumber<0)return; | |
333 | ||
334 | runNumber=fEventsListVector[selectedEventNumber].runNumber; | |
335 | eventNumber=fEventsListVector[selectedEventNumber].eventNumber; | |
336 | ||
337 | struct serverRequestStruct *requestMessage = new struct serverRequestStruct; | |
338 | struct eventStruct mark; | |
339 | mark.runNumber = runNumber; | |
340 | mark.eventNumber = eventNumber; | |
341 | requestMessage->messageType = REQUEST_MARK_EVENT; | |
342 | requestMessage->event = mark; | |
343 | ||
344 | fEventManager->Send(requestMessage,fServerSocket); | |
345 | ||
164d3d29 | 346 | bool response = fEventManager->GetBool(fServerSocket); |
347 | ||
348 | if(response) | |
5eb34a26 | 349 | { |
350 | fStatusLabel->SetText("Event marked"); | |
351 | cout<<"ADMIN PANEL -- Event marked succesfully"<<endl; | |
352 | } | |
353 | else | |
354 | { | |
355 | fStatusLabel->SetText("Couldn't mark this event"); | |
356 | cout<<"ADMIN PANEL -- Could not matk event"<<endl; | |
357 | } | |
358 | } | |
359 | ||
164d3d29 | 360 | void AliStorageAdministratorPanelListEvents::onLoadButton() |
361 | { | |
a7f93de6 | 362 | int selectedEventNumber = fListBox->GetSelected()-1; |
164d3d29 | 363 | int runNumber=fEventsListVector[selectedEventNumber].runNumber; |
364 | int eventNumber=fEventsListVector[selectedEventNumber].eventNumber; | |
365 | ||
366 | ||
367 | struct serverRequestStruct *requestMessage = new struct serverRequestStruct; | |
368 | struct eventStruct eventToLoad; | |
369 | eventToLoad.runNumber = runNumber; | |
370 | eventToLoad.eventNumber = eventNumber; | |
371 | requestMessage->messageType = REQUEST_GET_EVENT; | |
372 | requestMessage->event = eventToLoad; | |
373 | ||
374 | fEventManager->Send(requestMessage,fServerSocket); | |
375 | AliESDEvent *resultEvent = fEventManager->GetEvent(fServerSocket); | |
376 | ||
377 | if(resultEvent) | |
378 | { | |
379 | cout<<"ADMIN -- received event"<<endl; | |
380 | fCurrentEvent = resultEvent; | |
381 | } | |
382 | else | |
383 | { | |
384 | cout<<"ADMIN -- received no event"<<endl; | |
385 | } | |
386 | ||
387 | SelectedEvent(); | |
388 | } | |
389 | ||
566ba262 | 390 | //void AliStorageAdministratorPanelListEvents::onCloseButton(){onExit();} |
5eb34a26 | 391 | void AliStorageAdministratorPanelListEvents::CloseWindow(){onExit();} |
392 | ||
393 | void AliStorageAdministratorPanelListEvents::onExit() | |
394 | { | |
395 | cout<<"Quiting list events"; | |
396 | if(fInstance){delete fInstance;fInstance=0;} | |
397 | cout<<" -- OK"<<endl; | |
398 | } | |
399 | ||
400 | Bool_t AliStorageAdministratorPanelListEvents::ProcessMessage(Long_t msg, Long_t parm1, Long_t) | |
401 | { | |
402 | switch (GET_MSG(msg)) | |
403 | { | |
404 | case kC_COMMAND: | |
405 | switch (GET_SUBMSG(msg)) | |
406 | { | |
407 | case kCM_BUTTON: | |
408 | switch(parm1) | |
409 | { | |
566ba262 | 410 | // case BUTTON_CLOSE:onCloseButton();break; |
5eb34a26 | 411 | case BUTTON_GET_LIST:onGetListButton();break; |
412 | case BUTTON_MARK_EVENT:onMarkButton();break; | |
164d3d29 | 413 | case BUTTON_LOAD_EVENT:onLoadButton();break; |
5eb34a26 | 414 | default:break; |
415 | } | |
416 | break; | |
417 | default:break; | |
418 | } | |
419 | break; | |
420 | default:break; | |
421 | } | |
422 | ||
423 | return false; | |
424 | } | |
01ca7d6f | 425 | |
426 | void AliStorageAdministratorPanelListEvents::SetOfflineMode(Bool_t ison) | |
427 | { | |
428 | ||
429 | if (ison) { | |
a7f93de6 | 430 | fPPcheckbox->SetDisabledAndSelected(ison); |
431 | fPbPbcheckbox->SetDisabledAndSelected(ison); | |
432 | fTemporaryCheckbox->SetDisabledAndSelected(ison); | |
433 | fPermanentCheckbox->SetDisabledAndSelected(ison); | |
01ca7d6f | 434 | } |
435 | else { | |
a7f93de6 | 436 | fPPcheckbox->SetEnabled(!ison); |
437 | fPbPbcheckbox->SetEnabled(!ison); | |
438 | fTemporaryCheckbox->SetEnabled(!ison); | |
439 | fPermanentCheckbox->SetEnabled(!ison); | |
440 | fPPcheckbox->SetOn(); | |
441 | fPbPbcheckbox->SetOn(); | |
442 | fTemporaryCheckbox->SetOn(); | |
443 | fPermanentCheckbox->SetOn(); | |
01ca7d6f | 444 | } |
445 | ||
a7f93de6 | 446 | fRunMinEntry->SetState(!ison); |
447 | fRunMaxEntry->SetState(!ison); | |
448 | fEventMinEntry->SetState(!ison); | |
449 | fEventMaxEntry->SetState(!ison); | |
01ca7d6f | 450 | fMultiplicityMinEntry->SetState(!ison); |
451 | fMultiplicityMaxEntry->SetState(!ison); | |
452 | ||
a7f93de6 | 453 | // fCloseButton->SetEnabled(!ison); |
01ca7d6f | 454 | fGetListButton->SetEnabled(!ison); |
455 | fMarkButton->SetEnabled(!ison); | |
456 | fLoadButton->SetEnabled(!ison); | |
457 | } |