Commit b5f568e2 authored by aorlati's avatar aorlati Committed by GitHub
Browse files

fix #205: fixed for both TotalPower and XArcos (#207)

* fix #205: fixed for both TotalPower and XArcos

* Fix #125, removed some remaining references to `THeaderRecord` structure and objects.
Another reference can be found in XarcosThread.h, used in XarcosThread.cpp, but I believe the methods that uses it are no longer needed. Also, a reference can be found in Common/Servers/HolographyBackend but I'm leaving it there because the component does not build correctly (see #208).

* Roach updated with latest TRUNK modifications.
parent 4b53bf4a
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -74,17 +74,18 @@ void CDataCollection::saveMainHeaders(Backends::TMainHeader const * h,Backends::
	printf("sampleSize: %ld\n",(long)m_mainH.sampleSize);

	for (long j=0;j<m_mainH.sections;j++) {
		printf("id: %ld\n",(long)m_sectionH->id);
		printf("bins: %ld\n",(long)m_sectionH->bins);
		printf("polarization: %ld\n",(long)m_sectionH->polarization);
		printf("bandWidth: %lf\n",(double)m_sectionH->bandWidth);
		printf("frequency: %lf\n",(double)m_sectionH->frequency);
		printf("attenuation: %lf, %lf\n",(double)m_sectionH->attenuation[0],(double)m_sectionH->attenuation[1]);
		printf("sampleRate: %lf\n",(double)m_sectionH->sampleRate);
		printf("feed: %ld\n",(long)m_sectionH->feed);
		printf("inputs: %ld\n",(long)m_sectionH->inputs);
		printf("IF: %ld %ld\n",(long)m_sectionH->IF[0],(long)m_sectionH->IF[1]);
		printf("id: %ld\n",(long)m_sectionH[j].id);
		printf("bins: %ld\n",(long)m_sectionH[j].bins);
		printf("polarization: %d\n",m_sectionH[j].polarization);
		printf("bandWidth: %lf\n",m_sectionH[j].bandWidth);
		printf("frequency: %lf\n",m_sectionH[j].frequency);
		printf("attenuation: %lf, %lf\n",m_sectionH[j].attenuation[0],m_sectionH[j].attenuation[1]);
		printf("sampleRate: %lf\n",m_sectionH[j].sampleRate);
		printf("feed: %ld\n",(long)m_sectionH[j].feed);
		printf("inputs: %ld\n",(long)m_sectionH[j].inputs);
		printf("IF: %ld %ld\n",(long)m_sectionH[j].IF[0],(long)m_sectionH[j].IF[1]);
	}*/

	m_ready=true; // main headers are saved....before that no activity can take place	
	//if (getIsNoData()) {
	//	m_start=true;
+0 −4
Original line number Diff line number Diff line
@@ -401,10 +401,6 @@ protected:
    virtual void stopSend()  throw (CORBA::SystemException, AVStopSendErrorEx) { };
	
private:
	struct THeaderRecord {
		Backends::TMainHeader header;
		Backends::TSectionHeader chHeader[MAX_SECTION_NUMBER];
	};
	SmartPropertyPointer<ROuLongLong> m_ptime;
	SmartPropertyPointer<ROstring> m_pbackendName;
	SmartPropertyPointer<ROdoubleSeq> m_pbandWidth;
+13 −8
Original line number Diff line number Diff line
@@ -236,9 +236,9 @@ void NoiseGeneratorImpl::setTargetFileName (const char * fileName) throw (CORBA:
void NoiseGeneratorImpl::sendHeader() throw (CORBA::SystemException, BackendsErrors::BackendsErrorsEx, ComponentErrors::ComponentErrorsEx)
{
	AUTO_TRACE("NoiseGeneratorImpl::sendHeader()");
	//Backends::TMainHeader header;
	//Backends::TChannelHeader chHeader[MAX_INPUT_NUMBER];
	THeaderRecord buffer;
	Backends::TMainHeader header;
	Backends::TSectionHeader chHeader[MAX_SECTION_NUMBER];

	ACS::doubleSeq tpi;
	try {
		m_commandLine->startDataAcquisition();
@@ -247,12 +247,17 @@ void NoiseGeneratorImpl::sendHeader() throw (CORBA::SystemException, BackendsErr
		ex.log(LM_DEBUG);
		throw ex.getBackendsErrorsEx();		
	}
	m_commandLine->fillMainHeader(buffer.header);
	m_commandLine->fillChannelHeader(buffer.chHeader,MAX_SECTION_NUMBER);
	m_commandLine->fillMainHeader(header);
	m_commandLine->fillChannelHeader(chHeader,MAX_SECTION_NUMBER);
	m_commandLine->setTime();

    char buffer[sizeof(Backends::TMainHeader)+header.sections*sizeof(Backends::TSectionHeader)];
    memcpy(buffer,(void *)&header,sizeof(Backends::TMainHeader));
    memcpy(buffer+sizeof(Backends::TMainHeader),(void *)chHeader,header.sections*sizeof(Backends::TSectionHeader));

	try {
		getSender()->startSend(FLOW_NUMBER,(const char*)&buffer,
				sizeof(Backends::TMainHeader)+buffer.header.sections*sizeof(Backends::TSectionHeader));
		getSender()->startSend(FLOW_NUMBER,(const char*)buffer,
				sizeof(Backends::TMainHeader)+header.sections*sizeof(Backends::TSectionHeader));
		//getSender()->startSend(FLOW_NUMBER,(const char*)&header,sizeof(header));
	}
	catch (AVStartSendErrorExImpl& ex) {
@@ -268,7 +273,7 @@ void NoiseGeneratorImpl::sendHeader() throw (CORBA::SystemException, BackendsErr
	}
	ACS_LOG(LM_FULL_INFO,"NoiseGeneratorImpl::sendHeader()",(LM_INFO,"HEADERS_SENT"));
	// inform the sender thread about the configuration......
	m_senderThread->saveDataHeader(&(buffer.header),(buffer.chHeader));
	m_senderThread->saveDataHeader(&header,chHeader);
}

void NoiseGeneratorImpl::terminate() throw (CORBA::SystemException, BackendsErrors::BackendsErrorsEx,
+2 −0
Original line number Diff line number Diff line
@@ -739,10 +739,12 @@ private:
	 */
	inline void clearStatusField(TstatusFields field) { m_backendStatus &= ~(1 << field); }

    bool m_RK77;
    bool m_RK00;
    bool m_RC00;
    bool m_RL00;
    bool m_RP00;
    bool m_RK77S;
    bool m_RK00S;
    bool m_RC00S;
    bool m_RL00S;
+0 −4
Original line number Diff line number Diff line
@@ -469,10 +469,6 @@ protected:
    virtual void stopSend()  throw (CORBA::SystemException, AVStopSendErrorEx) { };
	
private:
	struct THeaderRecord {
		Backends::TMainHeader header;
		Backends::TSectionHeader chHeader[MAX_SECTION_NUMBER];
	};
	SmartPropertyPointer<ROuLongLong> m_ptime;
	SmartPropertyPointer<ROstring> m_pbackendName;
	SmartPropertyPointer<ROdoubleSeq> m_pbandWidth;
Loading