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