Commit 26eb01a0 authored by Andrea Orlat's avatar Andrea Orlat
Browse files

small tuning for finalizer, reviewd configuration for CHC revc

parent c537b196
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -121,8 +121,8 @@ void CRecvBossCore::calOn() throw (ComponentErrors::ValidationErrorExImpl,Compon
	}
	else if ((m_currentReceiver=="CCC") || (m_currentReceiver="CHC")){
#ifndef RB_DEBUG
		char buffer [13] = {'s','e','t',' ','m','a','r','c','a',' ','o','n','\n' };
		if (m_recvSocket.Send(err,(const void *)buffer,13)!=13) {
		char buffer [14] = {'s','e','t',' ','m','a','r','c','a','c',' ','o','n','\n' };
		if (m_recvSocket.Send(err,(const void *)buffer,14)!=14) {
			_EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,err);
			dummy.setCode(err.getErrorCode());
			dummy.setDescription((const char*)err.getDescription());
@@ -180,8 +180,8 @@ void CRecvBossCore::calOff() throw (ComponentErrors::ValidationErrorExImpl,Compo
	}
	else if ((m_currentReceiver=="CCC") || (m_currentReceiver="CHC")) {
#ifndef RB_DEBUG
		char buffer [14] = {'s','e','t',' ','m','a','r','c','a',' ','o','f','f','\n' };
		if (m_recvSocket.Send(err,(const void *)buffer,14)!=14) {
		char buffer [15] = {'s','e','t',' ','m','a','r','c','a','c',' ','o','f','f','\n' };
		if (m_recvSocket.Send(err,(const void *)buffer,15)!=15) {
			_EXCPT_FROM_ERROR(ComponentErrors::IRALibraryResourceExImpl,dummy,err);
			dummy.setCode(err.getErrorCode());
			dummy.setDescription((const char*)err.getDescription());
@@ -1036,6 +1036,7 @@ void CRecvBossCore::getCalibrationMark(ACS::doubleSeq& result,ACS::doubleSeq& re
			result[i]=mark;
			resFreq[i]=realFreq;
			resBw[i]=realBw;
			scale=1.0;
		}
	}
	else if (m_currentReceiver=="CCC") {
+5 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ public:
	/*
	 * Duplicate paths are excluded
	 */
	void addScanPath(const IRA::CString scan);
	void addScanPath(const IRA::CString& scan);
	bool activate();
	bool deactivate();
private:
@@ -61,6 +61,10 @@ private:
	bool removeLock();
	bool backupSchedule();
	bool writeReport();
	/**
	 * removes the trailing '/', if present
	 */
	void removeTrailingSlash(IRA::CString& path);
	IRA::CString m_lastError;
	IRA::CString m_logFilePath;
	IRA::CString m_reportPath;
+16 −7
Original line number Diff line number Diff line
@@ -88,14 +88,17 @@ IRA::CString CScheduleReport::getBackupFolder() const
	return m_backupPath+m_scheduleBaseName+"_"+m_currentPostfix;
}

void CScheduleReport::addScanPath(const IRA::CString scan)
void CScheduleReport::addScanPath(const IRA::CString& scan)
{
	CScheduleReport::TInternalListIter it;
	IRA::CString copyStr;	
	copyStr=scan;
	removeTrailingSlash(copyStr);
	if (m_reportEnabled) {
		for (it=m_scanPaths.begin();it!=m_scanPaths.end();++it) {
			if (scan==(*it)) return;
			if (copyStr==(*it)) return;
		}
		m_scanPaths.push_front(scan);
		m_scanPaths.push_front(copyStr);
	}
}

@@ -198,6 +201,7 @@ bool CScheduleReport::writeReport()
	schedFolder=m_backupPath+m_scheduleBaseName+"_"+m_currentPostfix;
	logFile=m_logFilePath+getLogFileName();
	if (!m_reportEnabled) return true; // if the reporting is not enables, just exit.
	if (!m_scheduleProvided) return true;
	dst=getReportFileName();
    std::ofstream out ((const char *)dst);
    if (out.fail()) {
@@ -206,12 +210,12 @@ bool CScheduleReport::writeReport()
    	return false;
    }
    if (m_scheduleProvided) {  // check if the schedule section has to be added
    	out << "[Schedule]" << endl;
    	//out << "[Schedule]" << endl;
    	out <<  (const char *) schedFolder << endl;
    }
    out << "[Log]" << endl;
    //out << "[Log]" << endl;
    out <<  (const char *) logFile << endl;
    out << "[Scans]" << endl;
    //out << "[Scans]" << endl;
    for (it=m_scanPaths.begin();it!=m_scanPaths.end();++it) {
    	out <<  (const char *) (*it) << endl;
   	}
@@ -220,4 +224,9 @@ bool CScheduleReport::writeReport()
    return true;
}

void CScheduleReport::removeTrailingSlash(IRA::CString& path)
{
	if (path[path.GetLength()-1]=='/') {
		path=path.Left(path.GetLength()-1);
	}		 
}
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ public:
			return ::testing::AssertionFailure() << " lock file is not correctly created";
		}
		// let's add another scan
		reportFull.addScanPath("scan6Path");
		reportFull.addScanPath("scan6Path/");
		if (!reportFull.deactivate()) {
			return ::testing::AssertionFailure() << " error deactivating the report, error message is: " <<
					(const char *)reportFull.getLastError();
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
               TimeTollerance="250000"
               RepetitionCacheTime="2000000"
               RepetitionExpireTime="5000000"
               DataPort="6001"
               DataPort="16001"
               DataIPAddress="192.167.189.8"            	   
               DataLatency="3000000"
               SenderSleepTime="300000"
Loading