569 |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
TGTextEntry *entry = (TGTextEntry*)gTQSender; |
570 |
TString text = entry->GetText(); |
TString text = entry->GetText(); |
571 |
cvar->thefilename=text.Data(); |
cvar->thefilename=text.Data(); |
572 |
|
cvar->i = 0; |
573 |
cvar->nevents = 0; |
cvar->nevents = 0; |
574 |
cvar->firstevno = 0; |
cvar->firstevno = 0; |
575 |
cvar->lastevno = 0; |
cvar->lastevno = 0; |
602 |
cout<<"PSW "<<psw<<endl; |
cout<<"PSW "<<psw<<endl; |
603 |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl; |
604 |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
TSQLServer *dbc = TSQLServer::Connect(host.Data(),user.Data(),psw.Data()); |
605 |
|
// |
606 |
|
TSQLResult *pResult; |
607 |
|
TSQLRow *Row; |
608 |
|
// |
609 |
if( dbc && dbc->IsConnected() ){ |
if( dbc && dbc->IsConnected() ){ |
610 |
// |
// |
611 |
// Starting from level2 |
// Retrieve the file |
612 |
// |
// |
613 |
if ( clev->file == 2 ){ |
if ( clev->file == 2 ){ |
614 |
|
// |
615 |
|
// Starting from level2 |
616 |
|
// |
617 |
GL_ROOT glroot = GL_ROOT(); |
GL_ROOT glroot = GL_ROOT(); |
618 |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
if( !glroot.Query_GL_ROOT(cvar->idroot,dbc) ){ |
619 |
// |
// |
632 |
cvar->thefilter=""; |
cvar->thefilter=""; |
633 |
cvar->selex = true; |
cvar->selex = true; |
634 |
}; |
}; |
635 |
cvar->i = -(cvar->EVF + cvar->i -1); |
cvar->i = cvar->EVF + cvar->i ; |
636 |
//cvar->refresh = true; |
//cvar->refresh = true; |
637 |
// cvar->file = 0; |
// cvar->file = 0; |
638 |
// |
// |
639 |
} else { |
} else { |
640 |
stringstream warning; |
stringstream warning; |
641 |
warning.str(""); |
warning.str(""); |
642 |
warning << " Problems getting Level0 file "; |
warning << " Problems getting Level0 file "; |
643 |
DIALOG(2,warning.str().c_str()); |
DIALOG(2,warning.str().c_str()); |
644 |
}; |
}; |
645 |
} else { |
} else { |
646 |
// |
// |
647 |
// starting from L0 |
// starting from L0 |
648 |
// |
// |
649 |
stringstream warning; |
stringstream query; |
650 |
warning.str(""); |
query.str(""); |
651 |
warning << " Not yet implemented "; |
query << " SELECT ID FROM GL_ROOT WHERE NAME='"<< gSystem->BaseName(cvar->thefilename.Data()) <<"' order by INSERT_TIME desc limit 1;"; |
652 |
DIALOG(2,warning.str().c_str()); |
// printf(" query is %s \n",query.str().c_str()); |
653 |
|
pResult = dbc->Query(query.str().c_str()); |
654 |
|
Row = pResult->Next(); |
655 |
|
UInt_t idrl0 = 0; |
656 |
|
if ( Row ){ |
657 |
|
idrl0 = (UInt_t)atoll(Row->GetField(0)); |
658 |
|
}; |
659 |
|
// |
660 |
|
query.str(""); |
661 |
|
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 <<";"; |
662 |
|
// printf(" query is %s \n",query.str().c_str()); |
663 |
|
pResult = dbc->Query(query.str().c_str()); |
664 |
|
Row = pResult->Next(); |
665 |
|
UInt_t idrl2 = 0; |
666 |
|
UInt_t idrlun = 0; |
667 |
|
UInt_t evfrom = 0; |
668 |
|
if ( Row ){ |
669 |
|
idrlun = (UInt_t)atoll(Row->GetField(0)); |
670 |
|
idrl2 = (UInt_t)atoll(Row->GetField(1)); |
671 |
|
evfrom = (UInt_t)atoll(Row->GetField(2)); |
672 |
|
}; |
673 |
|
// |
674 |
|
query.str(""); |
675 |
|
query << " SELECT ID,NEVENTS FROM GL_RUN WHERE ID_ROOT_L2="<< idrl2 <<" order by RUNHEADER_TIME asc;"; |
676 |
|
// printf(" query is %s \n",query.str().c_str()); |
677 |
|
pResult = dbc->Query(query.str().c_str()); |
678 |
|
Row = pResult->Next(); |
679 |
|
UInt_t coren = 0; |
680 |
|
while ( Row ){ |
681 |
|
if ( (UInt_t)atoll(Row->GetField(0)) == idrlun ) break; |
682 |
|
coren += (UInt_t)atoll(Row->GetField(1)); |
683 |
|
Row = pResult->Next(); |
684 |
|
}; |
685 |
|
coren += cvar->i - evfrom; |
686 |
|
// |
687 |
|
GL_ROOT glroot = GL_ROOT(); |
688 |
|
if( !glroot.Query_GL_ROOT(idrl2,dbc) ){ |
689 |
|
// |
690 |
|
cvar->i = coren; |
691 |
|
// |
692 |
|
cvar->thefilename= glroot.PATH + glroot.NAME; |
693 |
|
cvar->nevents = 0; |
694 |
|
cvar->firstevno = 0; |
695 |
|
cvar->lastevno = 0; |
696 |
|
if ( cvar->fl0 ) { |
697 |
|
cvar->fl0 = false; |
698 |
|
ffl0->SetState(kButtonUp); |
699 |
|
}; |
700 |
|
cvar->restart = true; |
701 |
|
cvar->waitforever = false; |
702 |
|
// |
703 |
|
if ( cvar->thefilter != "" ){ |
704 |
|
cvar->thefilter=""; |
705 |
|
cvar->selex = true; |
706 |
|
}; |
707 |
|
// |
708 |
|
} else { |
709 |
|
stringstream warning; |
710 |
|
warning.str(""); |
711 |
|
warning << " Problems getting Level2 file "; |
712 |
|
DIALOG(2,warning.str().c_str()); |
713 |
|
}; |
714 |
|
// stringstream warning; |
715 |
|
// warning.str(""); |
716 |
|
// warning << " Not yet implemented "; |
717 |
|
// DIALOG(2,warning.str().c_str()); |
718 |
}; |
}; |
719 |
// |
// |
720 |
} else { |
} else { |
760 |
void PAMevcontrol::RefreshButtons() { |
void PAMevcontrol::RefreshButtons() { |
761 |
if ( cvar->jumprog ){ |
if ( cvar->jumprog ){ |
762 |
jbwc1->SetState(kButtonDown); |
jbwc1->SetState(kButtonDown); |
763 |
|
jbwc0->SetState(kButtonUp); |
764 |
} else { |
} else { |
765 |
|
jbwc1->SetState(kButtonUp); |
766 |
jbwc0->SetState(kButtonDown); |
jbwc0->SetState(kButtonDown); |
767 |
}; |
}; |
768 |
if ( cvar->fl0 ){ |
if ( cvar->fl0 ){ |
773 |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
// if ( cvar->tracknds4) ftrks4->SetState(kButtonDown); |
774 |
if ( cvar->bw ){ |
if ( cvar->bw ){ |
775 |
bwc1->SetState(kButtonDown); |
bwc1->SetState(kButtonDown); |
776 |
|
bwc0->SetState(kButtonUp); |
777 |
} else { |
} else { |
778 |
bwc0->SetState(kButtonDown); |
bwc0->SetState(kButtonDown); |
779 |
|
bwc1->SetState(kButtonUp); |
780 |
}; |
}; |
781 |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
if ( cvar->PALETTE) fchkpalette->SetState(kButtonDown); else fchkpalette->SetState(kButtonUp); |
782 |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |
if ( cvar->VINFOS ) fchknames->SetState(kButtonDown); else fchknames->SetState(kButtonUp); |