Commit c6ecb699 authored by Andrea Orlat's avatar Andrea Orlat
Browse files

patch to TotalPower component that supports mark control from external sources

parent fb0dd339
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1094,14 +1094,16 @@ void CCommandLine::activateCalSwitching(const char * argument) throw (BackendsEr
	}
	IRA::CString arg(argument);
	arg.MakeUpper();
	cout << arg << endl;
	cout << (const char *)argument << endl;
	if (arg=="EXT") {
		externalCalibrationSwitching(1);
		ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"EXTERNAL_CALIBRATION_DIODE_SWITCHING"));
		ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"EXTERNAL_CALIBRATION_DIODE_SWITCHING_ENABLED"));
	}
	else if (arg=="OFF") {
		externalCalibrationSwitching(0);
		m_calPeriod=0;
		ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"CALIBRATION_DIODE_SWITCHING_OFF"));
		ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"CALIBRATION_DIODE_SWITCHING_TURNED_OFF"));
	}
	else {
		long interleave;
@@ -1115,11 +1117,12 @@ void CCommandLine::activateCalSwitching(const char * argument) throw (BackendsEr
		}
		if (interleave>=0) {
			m_calPeriod=interleave;
			externalCalibrationSwitching(0);
			if (m_calPeriod>0) {
				ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"INTERNAL_CALIBRATION_DIODE_SWITCHING_ON"));
				ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"INTERNAL_CALIBRATION_DIODE_SWITCHING_TURNED_ON"));
			}
			else {
				ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"INTERNAL_CALIBRATION_DIODE_SWITCHING_OFF"));
				ACS_LOG(LM_FULL_INFO,"CCommandLine::activateCalSwitching()",(LM_NOTICE,"INTERNAL_CALIBRATION_DIODE_SWITCHING_TURNED_OFF"));
			}
		}
	}
+10 −8
Original line number Diff line number Diff line
@@ -230,18 +230,20 @@ bool CProtocol::decodeBackendConfiguration(const char *rBuff,const long& section
	}
	if (!CIRATools::getNextToken(str,start,PROT_SEPARATOR_CH,ret)) {
		return false;
		cout << "errore nella decodifica della status word" << endl;
		//cout << "errore nella decodifica della status word" << endl;
	}
	else {
		//cout << "token: " << (const char *) ret << endl;
		
		BYTE word8=ret.ToLong();
		cout << "word 8 bit :" << word8 << endl;
		//cout << "word 8 bit :" << word8 << endl;
		if (!decodeStatusWord(word8,status.zero,status.calon,status.fastSwitch,status.externalNoise)) {
			return false;
		}
		cout << "word.zero :" << status.zero << endl;
		cout << "word.calon :" << status.calon << endl;
		cout << "word.fastSwitch :" << status.fastSwitch << endl;
		cout << "word,externalNoise :" << status.externalNoise << endl;
		//cout << "word.zero :" << status.zero << endl;
		//cout << "word.calon :" << status.calon << endl;
		//cout << "word.fastSwitch :" << status.fastSwitch << endl;
		//cout << "word,externalNoise :" << status.externalNoise << endl;
	}
	// get the sample rate in millisecs.......
	if (!CIRATools::getNextToken(str,start,PROT_SEPARATOR_CH,ret)) {
@@ -359,10 +361,10 @@ bool CProtocol::checkBackendTime(const char * rBuff,const long threshold,bool& r
bool CProtocol::decodeStatusWord(const BYTE& word,bool& zero,bool& calon,bool& fastSwitch,bool& externalNoise)
{

	zero=(((word & 0x02) >> 1)==1);
	zero=(((word & 0x08) >> 3)==1);
	calon=(((word & 0x04) >> 2)==1);
	fastSwitch=(((word & 0x01))==1);
	externalNoise=(((word & 0x08) >> 3)==1);
	externalNoise=(((word & 0x10) >> 4)==1);
	return true;
}