46 |
#include <TArrow.h> |
#include <TArrow.h> |
47 |
#include <TStyle.h> |
#include <TStyle.h> |
48 |
// |
// |
49 |
|
#include <PamLevel2.h> |
50 |
|
// |
51 |
#include <FEVpamevcontrol.h> |
#include <FEVpamevcontrol.h> |
52 |
// |
// |
53 |
ClassImp(PAMevcontrol); |
ClassImp(PAMevcontrol); |
267 |
// Software infos |
// Software infos |
268 |
// |
// |
269 |
fshowsi = new TGTextButton(hframedec[9], "Show Data"); |
fshowsi = new TGTextButton(hframedec[9], "Show Data"); |
270 |
fshowsi->Connect("Clicked()","PAMevcontrol", this,"showorbdata()"); |
fshowsi->Connect("Clicked()","PAMevcontrol", this,"showsidata()"); |
271 |
if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled); |
if ( !cvar->RUN ) fshoworb->SetState(kButtonDisabled); |
272 |
hframedec[9]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
hframedec[9]->AddFrame(fshoworb, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
273 |
// |
// |
274 |
// All data |
// All data |
275 |
// |
// |
276 |
fshowall = new TGTextButton(hframedec[10], "Show Data"); |
fshowall = new TGTextButton(hframedec[10], "Show Data"); |
277 |
fshowall->Connect("Clicked()","PAMevcontrol", this,"showorbdata()"); |
fshowall->Connect("Clicked()","PAMevcontrol", this,"showalldata()"); |
278 |
hframedec[10]->AddFrame(fshowall, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
hframedec[10]->AddFrame(fshowall, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
279 |
// |
// |
280 |
// for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,1,1,1)); |
// for (Int_t fr=0; fr<11; fr++) gf->AddFrame(hframedec[fr], new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,1,1,1)); |
310 |
}; |
}; |
311 |
bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()"); |
bwc0->Connect("Pressed()", "PAMevcontrol",this,"radiocolor()"); |
312 |
bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()"); |
bwc1->Connect("Pressed()", "PAMevcontrol",this,"radiobw()"); |
313 |
hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,1,5,5,5)); |
hframe4->AddFrame(group,new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
314 |
// |
// |
315 |
// |
// |
316 |
ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND"); |
// ftrks4 = new TGCheckButton(hframe5, "Track in S4/ND"); |
317 |
ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()"); |
// ftrks4->Connect("Clicked()","PAMevcontrol",this,"radiotrack()"); |
318 |
if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
319 |
hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
// hframe5->AddFrame(ftrks4, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
320 |
ffl0 = new TGCheckButton(hframe5, "Force LEVEL0"); |
|
321 |
|
fgetl0 = new TGTextButton(hframe5, "Get L0 file"); |
322 |
|
fgetl0->Connect("Clicked()","PAMevcontrol", this,"getl0file()"); |
323 |
|
hframe5->AddFrame(fgetl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,5,5,5)); |
324 |
|
|
325 |
|
ffl0 = new TGCheckButton(hframe5, "Force RAW"); |
326 |
ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()"); |
ffl0->Connect("Clicked()","PAMevcontrol",this,"forcel0()"); |
327 |
if ( cvar->fl0 ) ffl0->SetState(kButtonDown); |
if ( cvar->fl0 ) ffl0->SetState(kButtonDown); |
328 |
if ( !cvar->fl0 ) ffl0->SetState(kButtonUp); |
if ( !cvar->fl0 ) ffl0->SetState(kButtonUp); |
329 |
hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,5,2,5,5)); |
hframe5->AddFrame(ffl0, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,2,5,5,5)); |
330 |
// |
// |
331 |
hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5)); |
hframe4->AddFrame(hframe5, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsCenterY|kLHintsExpandX,10,5,5,5)); |
332 |
gf2->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX)); |
gf2->AddFrame(hframe4, new TGLayoutHints(kLHintsExpandX)); |
441 |
// |
// |
442 |
} |
} |
443 |
|
|
444 |
|
void PAMevcontrol::Refresh(){ |
445 |
|
// bah |
446 |
|
return; |
447 |
|
this->Clear(); |
448 |
|
MapSubwindows(); |
449 |
|
// Initialize the layout algorithm |
450 |
|
Resize(GetDefaultSize()); |
451 |
|
// Map main frame |
452 |
|
MapWindow(); |
453 |
|
} |
454 |
|
|
455 |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
void PAMevcontrol::DIALOG(Int_t ty, TString warn){ |
456 |
// |
// |
457 |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 3 -> ERROR |
// ty = 0 -> INFO, ty = 1 -> WARNING, ty = 2 -> ERROR |
458 |
// |
// |
459 |
Int_t retval; |
Int_t retval; |
460 |
TString title; |
TString title; |
461 |
EMsgBoxIcon mb_icon = kMBIconStop; |
EMsgBoxIcon mb_icon = kMBIconStop; |
462 |
if ( ty == 0 ){ |
if ( ty == 2 || ty == 3 ){ |
463 |
|
if ( ty == 2 ){ |
464 |
|
title="ERROR!!"; |
465 |
|
mb_icon = kMBIconStop; |
466 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
467 |
|
} else { |
468 |
|
title="HELP"; |
469 |
|
mb_icon = kMBIconQuestion; |
470 |
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
471 |
|
}; |
472 |
|
} else { |
473 |
|
if ( ty == 0 ){ |
474 |
title="INFO"; |
title="INFO"; |
475 |
mb_icon = kMBIconAsterisk; |
mb_icon = kMBIconAsterisk; |
476 |
}; |
}; |
477 |
if ( ty == 1 ){ |
if ( ty == 1 ){ |
478 |
title="WARNING!"; |
title="WARNING!"; |
479 |
mb_icon = kMBIconExclamation; |
mb_icon = kMBIconExclamation; |
480 |
|
}; |
481 |
|
if ( ty == 4 ){ |
482 |
|
title="DATA"; |
483 |
|
mb_icon = kMBIconExclamation; |
484 |
|
}; |
485 |
|
const TGPicture *icon_pic; |
486 |
|
switch (mb_icon) { |
487 |
|
case kMBIconStop: |
488 |
|
icon_pic = gClient->GetPicture("mb_stop_s.xpm"); |
489 |
|
if (!icon_pic) Error("TGMsgBox", "mb_stop_s.xpm not found"); |
490 |
|
break; |
491 |
|
|
492 |
|
case kMBIconQuestion: |
493 |
|
icon_pic = gClient->GetPicture("mb_question_s.xpm"); |
494 |
|
if (!icon_pic) Error("TGMsgBox", "mb_question_s.xpm not found"); |
495 |
|
break; |
496 |
|
|
497 |
|
case kMBIconExclamation: |
498 |
|
icon_pic = gClient->GetPicture("mb_exclamation_s.xpm"); |
499 |
|
if (!icon_pic) Error("TGMsgBox", "mb_exclamation_s.xpm not found"); |
500 |
|
break; |
501 |
|
|
502 |
|
case kMBIconAsterisk: |
503 |
|
icon_pic = gClient->GetPicture("mb_asterisk_s.xpm"); |
504 |
|
if (!icon_pic) Error("TGMsgBox", "mb_asterisk_s.xpm not found"); |
505 |
|
break; |
506 |
|
|
507 |
|
default: |
508 |
|
icon_pic = 0; |
509 |
|
break; |
510 |
|
} |
511 |
|
// |
512 |
|
if ( ty == 4 ){// non funziona il recupero dei puntatori a questi oggetti come e` possibile? |
513 |
|
// gObjectTable->Print(); |
514 |
|
TGLabel *la=dynamic_cast<TGLabel*>(gDirectory->FindObject("la")); |
515 |
|
TGHorizontalFrame *fLabelFrame=dynamic_cast<TGHorizontalFrame*>(gDirectory->FindObject("fLabelFrame")); |
516 |
|
TGTransientFrame *compofra=dynamic_cast<TGTransientFrame*>(gDirectory->FindObject("compofra")); |
517 |
|
if ( la ) la->Delete(); |
518 |
|
if ( fLabelFrame ) fLabelFrame->Delete(); |
519 |
|
if ( compofra ){ |
520 |
|
compofra->DestroyWindow(); |
521 |
|
compofra->Delete(); |
522 |
|
}; |
523 |
|
}; |
524 |
|
TGTransientFrame *compofra = new TGTransientFrame(gClient->GetRoot(), 0, 200, 80, kHorizontalFrame); |
525 |
|
TGHorizontalFrame *fIconFrame = NULL; |
526 |
|
TGIcon *fIcon = NULL; |
527 |
|
if ( ty != 4 ){ |
528 |
|
compofra->DontCallClose(); |
529 |
|
fIconFrame = new TGHorizontalFrame(compofra, 98, 78); |
530 |
|
fIcon = new TGIcon(fIconFrame, icon_pic, icon_pic->GetWidth(), icon_pic->GetHeight()); |
531 |
|
fIconFrame->AddFrame(fIcon, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
532 |
|
compofra->AddFrame(fIconFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
533 |
|
}; |
534 |
|
// |
535 |
|
TGHorizontalFrame *fLabelFrame = new TGHorizontalFrame(compofra, 98, 78); |
536 |
|
TGLabel *la=new TGLabel(fLabelFrame,warn.Data()); |
537 |
|
la->SetTextJustify(kLHintsCenterX); |
538 |
|
fLabelFrame->AddFrame(la, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
539 |
|
compofra->AddFrame(fLabelFrame, new TGLayoutHints(kLHintsCenterX|kLHintsCenterY, 1, 1, 1, 1)); |
540 |
|
// |
541 |
|
compofra->SetWindowName(title.Data()); |
542 |
|
compofra->MapSubwindows(); |
543 |
|
if ( ty != 4 ){ |
544 |
|
compofra->Resize(compofra->GetDefaultWidth(),80); |
545 |
|
} else { |
546 |
|
compofra->Resize(compofra->GetDefaultSize()); |
547 |
|
}; |
548 |
|
compofra->CenterOnParent(); |
549 |
|
compofra->MapWindow(); |
550 |
|
// |
551 |
|
if ( ty != 4 ){ |
552 |
|
Int_t kkk = 0; |
553 |
|
while ( kkk < 200 ){ |
554 |
|
gSystem->ProcessEvents(); |
555 |
|
gSystem->Sleep(10); |
556 |
|
kkk++; |
557 |
|
}; |
558 |
|
}; |
559 |
|
if ( compofra && ty != 4 ){ |
560 |
|
la->Delete(); |
561 |
|
fLabelFrame->Delete(); |
562 |
|
if ( fIcon ) fIcon->Delete(); |
563 |
|
if ( fIconFrame ) fIconFrame->Delete(); |
564 |
|
compofra->DestroyWindow(); |
565 |
|
compofra->Delete(); |
566 |
|
}; |
567 |
}; |
}; |
568 |
if ( ty == 2 ){ |
// |
|
title="ERROR!!"; |
|
|
mb_icon = kMBIconStop; |
|
|
}; |
|
|
new TGMsgBox(gClient->GetRoot(), this, title.Data(), warn.Data(), mb_icon, kMBOk, &retval); |
|
569 |
} |
} |
570 |
|
|
571 |
void PAMevcontrol::refreshdec(Int_t n){ |
void PAMevcontrol::refreshdec(Int_t n){ |
581 |
|
|
582 |
|
|
583 |
void PAMevcontrol::showorbdata(){ |
void PAMevcontrol::showorbdata(){ |
584 |
printf("orb \n"); |
cvar->showorb = !cvar->showorb; |
585 |
|
if ( !cvar->showorb ) fshoworb->SetText("Show Data"); |
586 |
|
if ( cvar->showorb ) fshoworb->SetText("Hide Data"); |
587 |
|
// printf("orb \n"); |
588 |
}; |
}; |
589 |
|
|
590 |
void PAMevcontrol::showtrgdata(){ |
void PAMevcontrol::showtrgdata(){ |
591 |
printf("trg \n"); |
cvar->showtrg = !cvar->showtrg; |
592 |
|
if ( !cvar->showtrg ) fshowtrg->SetText("Show Data"); |
593 |
|
if ( cvar->showtrg ) fshowtrg->SetText("Hide Data"); |
594 |
|
// printf("trg \n"); |
595 |
}; |
}; |
596 |
|
|
597 |
void PAMevcontrol::showrundata(){ |
void PAMevcontrol::showrundata(){ |
598 |
printf("run \n"); |
cvar->showrun = !cvar->showrun; |
599 |
|
if ( !cvar->showrun ) fshowrun->SetText("Show Data"); |
600 |
|
if ( cvar->showrun ) fshowrun->SetText("Hide Data"); |
601 |
|
// printf("run \n"); |
602 |
}; |
}; |
603 |
|
|
604 |
void PAMevcontrol::showcaldata(){ |
void PAMevcontrol::showcaldata(){ |
605 |
printf("cal \n"); |
cvar->showcal = !cvar->showcal; |
606 |
|
if ( !cvar->showcal ) fshowcal->SetText("Show Data"); |
607 |
|
if ( cvar->showcal ) fshowcal->SetText("Hide Data"); |
608 |
|
// printf("cal \n"); |
609 |
}; |
}; |
610 |
|
|
611 |
void PAMevcontrol::chkcalost(){ |
void PAMevcontrol::chkcalost(){ |
612 |
if ( cvar->CALO ) { |
if ( cvar->CALOT ) { |
613 |
cvar->CALO = 0; |
cvar->CALOT = 0; |
614 |
} else { |
} else { |
615 |
cvar->CALO = 1; |
cvar->CALOT = 1; |
616 |
}; |
}; |
617 |
cvar->i--; |
cvar->i--; |
618 |
cvar->nevents = 0; |
cvar->nevents = 0; |
622 |
}; |
}; |
623 |
|
|
624 |
void PAMevcontrol::showtrkdata(){ |
void PAMevcontrol::showtrkdata(){ |
625 |
printf("trk \n"); |
cvar->showtrk = !cvar->showtrk; |
626 |
|
if ( !cvar->showtrk ) fshowtrk->SetText("Show Data"); |
627 |
|
if ( cvar->showtrk ) fshowtrk->SetText("Hide Data"); |
628 |
|
// printf("trk \n"); |
629 |
}; |
}; |
630 |
|
|
631 |
void PAMevcontrol::showtofdata(){ |
void PAMevcontrol::showtofdata(){ |
632 |
printf("tof \n"); |
cvar->showtof = !cvar->showtof; |
633 |
|
if ( !cvar->showtof ) fshowtof->SetText("Show Data"); |
634 |
|
if ( cvar->showtof ) fshowtof->SetText("Hide Data"); |
635 |
|
// printf("tof \n"); |
636 |
}; |
}; |
637 |
|
|
638 |
void PAMevcontrol::showacdata(){ |
void PAMevcontrol::showacdata(){ |
639 |
printf("ac \n"); |
cvar->showac = !cvar->showac; |
640 |
|
if ( !cvar->showac ) fshowac->SetText("Show Data"); |
641 |
|
if ( cvar->showac ) fshowac->SetText("Hide Data"); |
642 |
|
// printf("ac \n"); |
643 |
}; |
}; |
644 |
|
|
645 |
void PAMevcontrol::shownddata(){ |
void PAMevcontrol::shownddata(){ |
646 |
printf("nd \n"); |
cvar->shownd = !cvar->shownd; |
647 |
|
if ( !cvar->shownd ) fshownd->SetText("Show Data"); |
648 |
|
if ( cvar->shownd ) fshownd->SetText("Hide Data"); |
649 |
|
// printf("nd \n"); |
650 |
}; |
}; |
651 |
|
|
652 |
void PAMevcontrol::shows4data(){ |
void PAMevcontrol::shows4data(){ |
653 |
printf("s4 \n"); |
cvar->shows4 = !cvar->shows4; |
654 |
|
if ( !cvar->shows4 ) fshows4->SetText("Show Data"); |
655 |
|
if ( cvar->shows4 ) fshows4->SetText("Hide Data"); |
656 |
|
// printf("s4 \n"); |
657 |
}; |
}; |
658 |
|
|
659 |
void PAMevcontrol::showsidata(){ |
void PAMevcontrol::showsidata(){ |
660 |
printf("si \n"); |
cvar->showsi = !cvar->showsi; |
661 |
|
if ( !cvar->showsi ) fshowsi->SetText("Show Data"); |
662 |
|
if ( cvar->showsi ) fshowsi->SetText("Hide Data"); |
663 |
|
// printf("si \n"); |
664 |
}; |
}; |
665 |
|
|
666 |
void PAMevcontrol::showalldata(){ |
void PAMevcontrol::showalldata(){ |
667 |
printf("all \n"); |
cvar->showall = !cvar->showall; |
668 |
|
if ( !cvar->showall ) fshowall->SetText("Show Data"); |
669 |
|
if ( cvar->showall ) fshowall->SetText("Hide Data"); |
670 |
|
// printf("all \n"); |
671 |
}; |
}; |
672 |
|
|
673 |
void PAMevcontrol::SetFilename() { |
void PAMevcontrol::SetFilename() { |
674 |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
675 |
TString text = entry->GetText(); |
TString text = entry->GetText(); |
676 |
cvar->thefilename=text.Data(); |
cvar->thefilename=text.Data(); |
677 |
|
cvar->i = 0; |
678 |
cvar->nevents = 0; |
cvar->nevents = 0; |
679 |
cvar->firstevno = 0; |
cvar->firstevno = 0; |
680 |
cvar->lastevno = 0; |
cvar->lastevno = 0; |
686 |
cvar->waitforever = false; |
cvar->waitforever = false; |
687 |
} |
} |
688 |
|
|
689 |
|
void PAMevcontrol::getl0file() { |
690 |
|
// |
691 |
|
TString host = "mysql://localhost/pamelaprod"; |
692 |
|
TString user = "anonymous"; |
693 |
|
TString psw = ""; |
694 |
|
const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); |
695 |
|
const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); |
696 |
|
const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); |
697 |
|
if ( !pamdbhost ) pamdbhost = ""; |
698 |
|
if ( !pamdbuser ) pamdbuser = ""; |
699 |
|
if ( !pamdbpsw ) pamdbpsw = ""; |
700 |
|
if ( strcmp(pamdbhost,"") ) host = pamdbhost; |
701 |
|
if ( strcmp(pamdbuser,"") ) user = pamdbuser; |
702 |
|
if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; |
703 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
704 |
|
cout<<"Connecting to DB"<<endl; |
705 |
|
cout<<"HOST "<<host<<endl; |
706 |
|
cout<<"USER "<<user<<endl; |
707 |
|
cout<<"PSW "<<psw<<endl; |
708 |
|
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
709 |
|
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
710 |
|
// |
711 |
|
TSQLResult *pResult; |
712 |
|
TSQLRow *Row; |
713 |
|
// |
714 |
|
if( dbc && dbc->IsConnected() ){ |
715 |
|
// |
716 |
|
// Retrieve the file |
717 |
|
// |
718 |
|
if ( clev->file == 2 ){ |
719 |
|
// |
720 |
|
// Starting from level2 |
721 |
|
// |
722 |
|
GL_ROOT glroot = GL_ROOT(); |
723 |
|
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
724 |
|
// |
725 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
726 |
|
cvar->nevents = 0; |
727 |
|
cvar->firstevno = 0; |
728 |
|
cvar->lastevno = 0; |
729 |
|
if ( cvar->fl0 ) { |
730 |
|
cvar->fl0 = false; |
731 |
|
ffl0->SetState(kButtonUp); |
732 |
|
}; |
733 |
|
cvar->restart = true; |
734 |
|
cvar->waitforever = false; |
735 |
|
// |
736 |
|
if ( cvar->thefilter != "" ){ |
737 |
|
cvar->thefilter=""; |
738 |
|
cvar->selex = true; |
739 |
|
}; |
740 |
|
cvar->i = cvar->EVF + cvar->i ; |
741 |
|
//cvar->refresh = true; |
742 |
|
// cvar->file = 0; |
743 |
|
// |
744 |
|
} else { |
745 |
|
stringstream warning; |
746 |
|
warning.str(""); |
747 |
|
warning << " Problems getting Level0 file "; |
748 |
|
DIALOG(2,warning.str().c_str()); |
749 |
|
}; |
750 |
|
} else { |
751 |
|
// |
752 |
|
// starting from L0 |
753 |
|
// |
754 |
|
stringstream query; |
755 |
|
query.str(""); |
756 |
|
query << " SELECT ID FROM GL_ROOT WHERE NAME='"<< gSystem->BaseName(cvar->thefilename.Data()) <<"' order by INSERT_TIME desc limit 1;"; |
757 |
|
// printf(" query is %s \n",query.str().c_str()); |
758 |
|
pResult = dbc->Query(query.str().c_str()); |
759 |
|
Row = pResult->Next(); |
760 |
|
UInt_t idrl0 = 0; |
761 |
|
if ( Row ){ |
762 |
|
idrl0 = (UInt_t)atoll(Row->GetField(0)); |
763 |
|
}; |
764 |
|
// |
765 |
|
query.str(""); |
766 |
|
query << " SELECT ID,ID_ROOT_L2,EV_FROM FROM GL_RUN WHERE EV_FROM<="<<cvar->i<<" AND EV_TO>="<< cvar->i<<" AND ID_ROOT_L0="<< idrl0 <<";"; |
767 |
|
// printf(" query is %s \n",query.str().c_str()); |
768 |
|
pResult = dbc->Query(query.str().c_str()); |
769 |
|
Row = pResult->Next(); |
770 |
|
UInt_t idrl2 = 0; |
771 |
|
UInt_t idrlun = 0; |
772 |
|
UInt_t evfrom = 0; |
773 |
|
if ( Row ){ |
774 |
|
idrlun = (UInt_t)atoll(Row->GetField(0)); |
775 |
|
idrl2 = (UInt_t)atoll(Row->GetField(1)); |
776 |
|
evfrom = (UInt_t)atoll(Row->GetField(2)); |
777 |
|
}; |
778 |
|
// |
779 |
|
query.str(""); |
780 |
|
query << " SELECT ID,NEVENTS FROM GL_RUN WHERE ID_ROOT_L2="<< idrl2 <<" order by RUNHEADER_TIME asc;"; |
781 |
|
// printf(" query is %s \n",query.str().c_str()); |
782 |
|
pResult = dbc->Query(query.str().c_str()); |
783 |
|
Row = pResult->Next(); |
784 |
|
UInt_t coren = 0; |
785 |
|
while ( Row ){ |
786 |
|
if ( (UInt_t)atoll(Row->GetField(0)) == idrlun ) break; |
787 |
|
coren += (UInt_t)atoll(Row->GetField(1)); |
788 |
|
Row = pResult->Next(); |
789 |
|
}; |
790 |
|
coren += cvar->i - evfrom; |
791 |
|
// |
792 |
|
GL_ROOT glroot = GL_ROOT(); |
793 |
|
if( !glroot.Query_GL_ROOT(idrl2,dbc) ){ |
794 |
|
// |
795 |
|
cvar->i = coren; |
796 |
|
// |
797 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
798 |
|
cvar->nevents = 0; |
799 |
|
cvar->firstevno = 0; |
800 |
|
cvar->lastevno = 0; |
801 |
|
if ( cvar->fl0 ) { |
802 |
|
cvar->fl0 = false; |
803 |
|
ffl0->SetState(kButtonUp); |
804 |
|
}; |
805 |
|
cvar->restart = true; |
806 |
|
cvar->waitforever = false; |
807 |
|
// |
808 |
|
if ( cvar->thefilter != "" ){ |
809 |
|
cvar->thefilter=""; |
810 |
|
cvar->selex = true; |
811 |
|
}; |
812 |
|
// |
813 |
|
} else { |
814 |
|
stringstream warning; |
815 |
|
warning.str(""); |
816 |
|
warning << " Problems getting Level2 file "; |
817 |
|
DIALOG(2,warning.str().c_str()); |
818 |
|
}; |
819 |
|
// stringstream warning; |
820 |
|
// warning.str(""); |
821 |
|
// warning << " Not yet implemented "; |
822 |
|
// DIALOG(2,warning.str().c_str()); |
823 |
|
}; |
824 |
|
// |
825 |
|
} else { |
826 |
|
stringstream warning; |
827 |
|
warning.str(""); |
828 |
|
warning << " Problems connectiong to DB! "; |
829 |
|
DIALOG(2,warning.str().c_str()); |
830 |
|
}; |
831 |
|
dbc->Close(); |
832 |
|
}; |
833 |
|
|
834 |
void PAMevcontrol::CheckLevel() { |
void PAMevcontrol::CheckLevel() { |
835 |
if ( clev->file == 2 ){ |
if ( clev->file == 2 ){ |
836 |
ffl0->SetState(kButtonDisabled); |
ffl0->SetState(kButtonDisabled); |
837 |
if ( !cvar->tracknds4 ) { |
// if ( !cvar->tracknds4 ) { |
838 |
ftrks4->SetState(kButtonUp); |
// ftrks4->SetState(kButtonUp); |
839 |
} else { |
// } else { |
840 |
ftrks4->SetState(kButtonDown); |
// ftrks4->SetState(kButtonDown); |
841 |
}; |
// }; |
842 |
} else { |
} else { |
843 |
ftrks4->SetState(kButtonDisabled); |
//ftrks4->SetState(kButtonDisabled); |
844 |
if ( !cvar->fl0 ) { |
if ( !cvar->fl0 ) { |
845 |
ffl0->SetState(kButtonUp); |
ffl0->SetState(kButtonUp); |
846 |
} else { |
} else { |
847 |
ffl0->SetState(kButtonDown); |
ffl0->SetState(kButtonDown); |
848 |
}; |
}; |
849 |
}; |
}; |
850 |
|
if ( clev->file == 2 ){ |
851 |
|
fgetl0->SetText("Get L0 file"); |
852 |
|
} else { |
853 |
|
fgetl0->SetText("Get L2 file"); |
854 |
|
}; |
855 |
} |
} |
856 |
|
|
857 |
void PAMevcontrol::SetSearching() { |
void PAMevcontrol::SetSearching() { |
865 |
void PAMevcontrol::RefreshButtons() { |
void PAMevcontrol::RefreshButtons() { |
866 |
if ( cvar->jumprog ){ |
if ( cvar->jumprog ){ |
867 |
jbwc1->SetState(kButtonDown); |
jbwc1->SetState(kButtonDown); |
868 |
|
jbwc0->SetState(kButtonUp); |
869 |
} else { |
} else { |
870 |
|
jbwc1->SetState(kButtonUp); |
871 |
jbwc0->SetState(kButtonDown); |
jbwc0->SetState(kButtonDown); |
872 |
}; |
}; |
873 |
if ( cvar->fl0 ){ |
if ( cvar->fl0 ){ |
875 |
} else { |
} else { |
876 |
ffl0->SetState(kButtonUp); |
ffl0->SetState(kButtonUp); |
877 |
}; |
}; |
878 |
if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
879 |
if ( cvar->bw ){ |
if ( cvar->bw ){ |
880 |
bwc1->SetState(kButtonDown); |
bwc1->SetState(kButtonDown); |
881 |
|
bwc0->SetState(kButtonUp); |
882 |
} else { |
} else { |
883 |
bwc0->SetState(kButtonDown); |
bwc0->SetState(kButtonDown); |
884 |
|
bwc1->SetState(kButtonUp); |
885 |
}; |
}; |
886 |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
887 |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
888 |
if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp); |
if ( cvar->INFOS ) fchkinfo->SetState(kButtonDown); else fchkinfo->SetState(kButtonUp); |
889 |
if ( cvar->CALO ) fchkcalo->SetState(kButtonDown); else fchkcalo->SetState(kButtonUp); |
// |
890 |
if ( cvar->CALOT ) fchkcalost->SetState(kButtonDown); else fchkcalost->SetState(kButtonUp); |
if ( cvar->CALOT ) fchkcalost->SetState(kButtonDown); else fchkcalost->SetState(kButtonUp); |
891 |
if ( cvar->ND ) fchknd->SetState(kButtonDown); else fchknd->SetState(kButtonUp); |
if ( cvar->CALO ){ |
892 |
if ( cvar->S4 ) fchks4->SetState(kButtonDown); else fchks4->SetState(kButtonUp); |
fchkcalo->SetState(kButtonDown); |
893 |
if ( cvar->TRK ) fchktrk->SetState(kButtonDown); else fchktrk->SetState(kButtonUp); |
fshowcal->SetState(kButtonUp); |
894 |
if ( cvar->AC ) fchkac->SetState(kButtonDown); else fchkac->SetState(kButtonUp); |
} else { |
895 |
if ( cvar->TOF ) fchktof->SetState(kButtonDown); else fchktof->SetState(kButtonUp); |
fchkcalo->SetState(kButtonUp); |
896 |
|
fchkcalost->SetState(kButtonDisabled); |
897 |
|
fshowcal->SetState(kButtonDisabled); |
898 |
|
}; |
899 |
|
// |
900 |
|
if ( cvar->ND ){ |
901 |
|
fchknd->SetState(kButtonDown); |
902 |
|
fshownd->SetState(kButtonUp); |
903 |
|
} else { |
904 |
|
fchknd->SetState(kButtonUp); |
905 |
|
fshownd->SetState(kButtonDisabled); |
906 |
|
}; |
907 |
|
// |
908 |
|
if ( cvar->S4 ){ |
909 |
|
fchks4->SetState(kButtonDown); |
910 |
|
fshows4->SetState(kButtonUp); |
911 |
|
} else { |
912 |
|
fchks4->SetState(kButtonUp); |
913 |
|
fshows4->SetState(kButtonDisabled); |
914 |
|
}; |
915 |
|
// |
916 |
|
if ( cvar->TRK ){ |
917 |
|
fchktrk->SetState(kButtonDown); |
918 |
|
fshowtrk->SetState(kButtonUp); |
919 |
|
} else { |
920 |
|
fchktrk->SetState(kButtonUp); |
921 |
|
fshowtrk->SetState(kButtonDisabled); |
922 |
|
} |
923 |
|
// |
924 |
|
if ( cvar->AC ){ |
925 |
|
fchkac->SetState(kButtonDown); |
926 |
|
fshowac->SetState(kButtonUp); |
927 |
|
} else { |
928 |
|
fchkac->SetState(kButtonUp); |
929 |
|
fshowac->SetState(kButtonDisabled); |
930 |
|
}; |
931 |
|
// |
932 |
|
if ( cvar->TOF ){ |
933 |
|
fchktof->SetState(kButtonDown); |
934 |
|
fshowtof->SetState(kButtonUp); |
935 |
|
} else { |
936 |
|
fchktof->SetState(kButtonUp); |
937 |
|
fshowtof->SetState(kButtonDisabled); |
938 |
|
}; |
939 |
|
// |
940 |
|
CheckLevel(); |
941 |
|
// |
942 |
}; |
}; |
943 |
|
|
944 |
void PAMevcontrol::SetFilter() { |
void PAMevcontrol::SetFilter() { |
1121 |
} |
} |
1122 |
|
|
1123 |
void PAMevcontrol::forcel0() { |
void PAMevcontrol::forcel0() { |
1124 |
if ( cvar->fl0 ) { |
cvar->fl0 = !cvar->fl0; |
1125 |
cvar->fl0 = false; |
cvar->alrforc = false; |
1126 |
} else { |
cvar->i--; |
1127 |
cvar->fl0 = true; |
cvar->nevents = 0; |
1128 |
}; |
cvar->firstevno = 0; |
1129 |
cvar->alrforc = false; |
cvar->lastevno = 0; |
1130 |
cvar->i--; |
cvar->refresh = true; |
|
cvar->nevents = 0; |
|
|
cvar->firstevno = 0; |
|
|
cvar->lastevno = 0; |
|
|
cvar->refresh = true; |
|
1131 |
} |
} |
1132 |
|
|
1133 |
void PAMevcontrol::clearselfi(){ |
void PAMevcontrol::clearselfi(){ |