/*-------------------------------------------------------------------------------*/ /* MessageCoorPrinter.cpp 7-Oct-99 28-Oct-99 Coor Command Parsing split onto separate files */ /*-------------------------------------------------------------------------------*/ #include "stdafx.h" #include "GlobalConstants.h" #include "CustomDataTypes.h" #include "MessageCommand.h" #include "MessageCoorPrinter.h" #include "HandleConsole.h" #include "UtilsStrings.h" /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::L1FW_Configure ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::Initialize ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SCL_Initialize ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::StartRun ( const unsigned long _uiRunNumber, EItemPolarity* _pubListItemPolarity, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->CopyReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::StopRun ( const unsigned long _uiRunNumber, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::PauseRun ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ResumeRun ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::L1fwPause ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::L1fwResume ( CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::BeginStore ( const unsigned long _uiStoreNumber, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::EndStore ( const unsigned long _uiStoreNumber, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ExpoGroupAndOrList ( const unsigned int _uiExpoGroupNum, EItemPolarity* _pubListItemPolarity, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ExpoGroupGeoSectList ( const unsigned int _uiExpoGroupNum, EItemPolarity* _pubListItemPolarity, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ExpoGroupDeallocate ( const unsigned int _uiExpoGroupNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigAndOrList ( const unsigned int _uiSpTrgNum, EItemPolarity* _pubListItemPolarity, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigL1Qualifier ( const unsigned int _uiSpTrgNum, EItemPolarity* _pubListItemPolarity, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigExpoGroup ( const unsigned int _uiSpTrgNum, const unsigned int _uiExpGroupNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigCoorEnable ( const unsigned int _uiSpTrgNum, const EDisableEnable _eNewEnableState , CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; else strcat ( sReplyText, " Disabled>" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigObeyFeBusy ( const unsigned int _uiSpTrgNum, const EIgnoreObey _eNewObeyState, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; else strcat ( sReplyText, " Ignore Front-End Busy>" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigObeyCorrDis ( const unsigned int _uiSpTrgNum, const EIgnoreObey _eNewObeyState, const unsigned long _ulDisableNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigObeyDeCorrDis ( const unsigned int _uiSpTrgNum, const EIgnoreObey _eNewObeyState, const unsigned long _ulDisableNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigObeyIndivDis ( const unsigned int _uiSpTrgNum, const EIgnoreObey _eNewObeyState, const unsigned long _ulDisableNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigAutoDisable ( const unsigned int _uiSpTrgNum, const EIgnoreObey _eNewObeyState, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; else strcat ( sReplyText, " Ignore Auto-Disable>" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigPrescale ( const unsigned int _uiSpTrgNum, const unsigned long _ulNewPrescaleRatio, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigReEnable ( const unsigned int _uiSpTrgNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::SpecTrigDeallocate ( const unsigned int _uiSpTrgNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ /* void CMessageCoorPrinter::BuildItemList ( char* _psReplyText, EItemPolarity* _pubListItemPolarity ) { EItemPolarity eItemPolarity ; int ilastItem = -2 ; bool bRangeStarted = false ; //\\// for ( int iItemNum = 0 ; iItemNum <= KiMaxItemIndexInCoorCommand ; iItemNum++ ) { eItemPolarity = _pubListItemPolarity[iItemNum] ; // add the number itself if ( eItemPolarity != ItemNotPresent ) { // see if the previous index was also included // which mean we are inside a range, and there is nothing to add yet if ( ( iItemNum == ilastItem+1 ) && ( eItemPolarity != ItemNegated ) ) // continue or start a new range bRangeStarted = true ; else { // terminate the previous range, if there was one started if ( bRangeStarted == true ) { bRangeStarted = false ; strcat ( _psReplyText, ":" ) ; strcat ( _psReplyText, I_to_A ( ilastItem ) ) ; } // add a leading space, with veto sign if necessary if ( eItemPolarity == ItemNegated ) strcat ( _psReplyText, " -" ) ; else strcat ( _psReplyText, " " ) ; // add the value itself strcat ( _psReplyText, I_to_A ( iItemNum ) ) ; } // remember this being the last item, // while a negated value cannot start a range if ( eItemPolarity != ItemNegated ) ilastItem = iItemNum ; } } // terminate the last range, if there was one still open if ( bRangeStarted == true ) { strcat ( _psReplyText, ":" ) ; strcat ( _psReplyText, I_to_A ( ilastItem ) ) ; strcat ( _psReplyText, " " ) ; } return ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ void CMessageCoorPrinter::Add_Formatted_Item_List ( char* _psReplyText, EItemPolarity* _pubListItemPolarity ) { int iItemNum ; EItemPolarity eItemPolarity ; int iRangeLower ; int iRangeUpper ; EItemPolarity eRangePolarity ; bool bRangeStarted = false ; //\\// for ( iItemNum = 0 ; iItemNum <= KiMaxItemIndexInMessageCommand ; iItemNum++ ) { eItemPolarity = _pubListItemPolarity[iItemNum] ; if ( eItemPolarity != ItemNotPresent ) { if ( bRangeStarted == false ) { iRangeLower = iItemNum ; eRangePolarity = eItemPolarity ; bRangeStarted = true ; } else // ( bRangeStarted == true ) { if ( eItemPolarity != eRangePolarity ) {// we have switched polarity -> close previous range and open new one iRangeUpper = iItemNum - 1 ; Add_Formatted_Range ( _psReplyText, iRangeLower, iRangeUpper, eRangePolarity ) ; iRangeLower = iItemNum ; eRangePolarity = eItemPolarity ; //bRangeStarted = true ; already set } else {// no change in polarity -> nothing to do } } } else // ( eItemPolarity == ItemNotPresent ) { if ( bRangeStarted == true ) {// the previous range has ended iRangeUpper = iItemNum - 1 ; Add_Formatted_Range ( _psReplyText, iRangeLower, iRangeUpper, eRangePolarity ) ; bRangeStarted = false ; } } } // terminate the last range, if there was one still open if ( bRangeStarted == true ) Add_Formatted_Range ( _psReplyText, iRangeLower, KiMaxItemIndexInMessageCommand, eRangePolarity ) ; return ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetEMEt ( const unsigned int _uiRefSetNum, TAllTriggerTowers* _xTT, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetHDVeto ( const unsigned int _uiRefSetNum, TAllTriggerTowers* _xTT, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetTOTEt ( const unsigned int _uiRefSetNum, TAllTriggerTowers* _xTT, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetLgTile ( const unsigned int _uiRefSetNum, TAllTriggerTowers* _xTT, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetEMEtDeallocate ( const unsigned int _uiRefSetNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetHDVetoDeallocate ( const unsigned int _uiRefSetNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetTOTEtDeallocate ( const unsigned int _uiRefSetNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::RefSetLgTileDeallocate ( const unsigned int _uiRefSetNum, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdCountEMEt ( const unsigned int _uiRefSetNum, const unsigned int _uiComparatorNum, const unsigned int _uiThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdCountTOTEt ( const unsigned int _uiRefSetNum, const unsigned int _uiComparatorNum, const unsigned int _uiThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdEnergyEMEt ( const unsigned int _uiComparatorNum, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdEnergyHDEt ( const unsigned int _uiComparatorNum, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdEnergyTOTEt ( const unsigned int _uiComparatorNum, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ ECoorMessageStatus CMessageCoorPrinter::ThresholdEnergyMissPt ( const unsigned int _uiComparatorNum, const double _fdThreshold, CMessageCommandLine* _poCoorCommandLine ) { ECoorMessageStatus eReturnStatus = Reply_Ok ; char sReplyText[KiMaxLengthReplyTextToCoor] ; //\\// strcpy ( sReplyText, "" ) ; CConsoleAccess::WriteLine ( sReplyText ) ; if ( _poCoorCommandLine != NULL ) _poCoorCommandLine->AppendReplyText ( sReplyText ) ; return eReturnStatus ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ void CMessageCoorPrinter::Add_Formatted_TT_Eta ( char* _psReplyText, TAllTriggerTowers* _xTT ) { int iTT_Eta_Magn ; int iRangeLower ; int iRangeUpper ; bool bRangeStarted = false ; //\\// for ( iTT_Eta_Magn = KiMax_TT_Eta_Magn ; iTT_Eta_Magn > 0 ; iTT_Eta_Magn-- ) { if ( _xTT->aalTT_Eta[eTT_Eta_Neg][iTT_Eta_Magn] == true ) { if ( bRangeStarted == false ) { iRangeLower = - iTT_Eta_Magn ; bRangeStarted = true ; } } else { if ( bRangeStarted == true ) { iRangeUpper = - ( iTT_Eta_Magn + 1 ) ; Add_Formatted_Range ( _psReplyText, iRangeLower, iRangeUpper ) ; bRangeStarted = false ; } } } for ( iTT_Eta_Magn = 1 ; iTT_Eta_Magn <= KiMax_TT_Eta_Magn ; iTT_Eta_Magn++ ) { if ( _xTT->aalTT_Eta[eTT_Eta_Pos][iTT_Eta_Magn] == true ) { if ( bRangeStarted == false ) { iRangeLower = iTT_Eta_Magn ; bRangeStarted = true ; } } else { if ( bRangeStarted == true ) { iRangeUpper = iTT_Eta_Magn - 1 ; if ( iRangeUpper == 0 ) iRangeUpper = -1 ; Add_Formatted_Range ( _psReplyText, iRangeLower, iRangeUpper ) ; bRangeStarted = false ; } } } // terminate the last range, if there was one still open if ( bRangeStarted == true ) Add_Formatted_Range ( _psReplyText, iRangeLower, KiMax_TT_Eta_Magn ) ; return ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ void CMessageCoorPrinter::Add_Formatted_TT_Phi ( char* _psReplyText, TAllTriggerTowers* _xTT ) { int iTT_Phi ; int iRangeLower ; int iRangeUpper ; bool bRangeStarted = false ; //\\// for ( iTT_Phi = 1 ; iTT_Phi <= KiMax_TT_Phi ; iTT_Phi++ ) { if ( _xTT->alTT_Phi[iTT_Phi] == true ) { if ( bRangeStarted == false ) { iRangeLower = iTT_Phi ; bRangeStarted = true ; } } else { if ( bRangeStarted == true ) { iRangeUpper = iTT_Phi - 1 ; Add_Formatted_Range ( _psReplyText, iRangeLower, iRangeUpper ) ; bRangeStarted = false ; } } } // terminate the last range, if there was one still open if ( bRangeStarted == true ) Add_Formatted_Range ( _psReplyText, iRangeLower, KiMax_TT_Phi ) ; return ; } /*-------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------*/ void CMessageCoorPrinter::Add_Formatted_Range ( char* _psReplyText, int _iRangeLower, int _iRangeUpper, EItemPolarity _ePolarity ) { strcat ( _psReplyText, " " ) ; if ( _ePolarity == ItemNegated ) strcat ( _psReplyText, "-" ) ; strcat ( _psReplyText, I_to_A ( _iRangeLower ) ) ; if ( _iRangeLower != _iRangeUpper ) { strcat ( _psReplyText, ":" ) ; if ( _ePolarity == ItemNegated ) strcat ( _psReplyText, "-" ) ; strcat ( _psReplyText, I_to_A ( _iRangeUpper ) ) ; } return ; }