Commit 3147e96a authored by Andrea Orlat's avatar Andrea Orlat
Browse files

reviewed the goOff command in AntennaBoss. The telescope never went onsource...

reviewed the goOff command in AntennaBoss. The telescope never went onsource if the current scan is an OTF
parent e1fff585
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -142,9 +142,21 @@ public:
	 * @throw ComponentErrors::CORBAProblemExImpl
	 * @throw ComponentErrors::UnexpectedExImpl
	 * @throw AntennaErrors::NoTargetCommandedYetExImpl
	 * @throw ComponentErrors::CouldntReleaseComponentExImpl
	 * @throw ComponentErrors::CouldntGetComponentExImpl
	 * @throw ComponentErrors::CORBAProblemExImpl
	 * @throw ComponentErrors::UnexpectedExImpl
	 * @throw ComponentErrors::CouldntCallOperationExImpl
	 * @throw ComponentErrors::OperationErrorExImpl
	 * @throw AntennaErrors::ScanErrorExImpl
	 * @throw AntennaErrors::SecondaryScanErrorExImpl
	 * @throw AntennaErrors::MissingTargetExImpl
	 * @throw AntennaErrors::LoadGeneratorErrorExImpl
	 * @throw AntennaErrors::NoTargetCommandedYetExImpl
	 */
	void goOff(const Antenna::TCoordinateFrame& frame,const double& beams) throw (ComponentErrors::UnexpectedExImpl,
			ComponentErrors::CORBAProblemExImpl,ComponentErrors::OperationErrorExImpl,AntennaErrors::NoTargetCommandedYetExImpl);
	void goOff(const Antenna::TCoordinateFrame& frame,const double& beams) throw (ComponentErrors::CouldntReleaseComponentExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ComponentErrors::UnexpectedExImpl,ComponentErrors::CouldntCallOperationExImpl,ComponentErrors::OperationErrorExImpl,AntennaErrors::ScanErrorExImpl,AntennaErrors::SecondaryScanErrorExImpl,
		AntennaErrors::MissingTargetExImpl,AntennaErrors::LoadGeneratorErrorExImpl,AntennaErrors::NoTargetCommandedYetExImpl);


	/**
+0 −32
Original line number Diff line number Diff line
@@ -1108,38 +1108,6 @@ void CBossCore::setGalacticOffsets(const double& lonOff,const double& latOff) th
	setOffsets(lonOff,latOff,Antenna::ANT_GALACTIC); // could throw(ComponentErrors::UnexpectedExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::OperationErrorExImpl)	
}

void CBossCore::goOff(const Antenna::TCoordinateFrame& frame,const double& beams) throw (ComponentErrors::UnexpectedExImpl,
		ComponentErrors::CORBAProblemExImpl,ComponentErrors::OperationErrorExImpl,AntennaErrors::NoTargetCommandedYetExImpl)
{
	// this is a workaround in order to make sure there is a target already commanded
	if (m_rawCoordinates.isEmpty()) {
		_EXCPT(AntennaErrors::NoTargetCommandedYetExImpl,impl,"CBossCore::goOff");
		throw impl;
	}
	double skyOffset=m_FWHM*beams;
	double lonOff,latOff;
	if (frame==Antenna::ANT_HORIZONTAL) {
		if (m_lastEncoderElevation>m_config->getCutOffElevation()) {
			latOff=skyOffset;
			lonOff=0.0;
		}
		else {
			latOff=0.0;
			lonOff=skyOffset;
		}
	}
	else if (frame==Antenna::ANT_EQUATORIAL) {
		latOff=0.0;
		lonOff=skyOffset;
	}
	else if (frame==Antenna::ANT_GALACTIC) {
		latOff=0.0;
		lonOff=skyOffset;
	}
	// could throw(ComponentErrors::UnexpectedExImpl,ComponentErrors::CORBAProblemExImpl,ComponentErrors::OperationErrorExImpl)
	setOffsets(lonOff,latOff,frame);
}

#include "BossCore_startScan.i"

#include "BossCore_prepareScan.i"
+37 −42
Original line number Diff line number Diff line
#ifndef _BOSS_CORE_STARTSCANWRAPPERS_I_
#define _BOSS_CORE_STARTSCANWRAPPERS_I_


/*ACS::Time  CBossCore::skydip(const double& el1, const double& el2,const ACS::TimeInterval& duration) throw (ComponentErrors::CouldntReleaseComponentExImpl,ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
void CBossCore::goOff(const Antenna::TCoordinateFrame& frame,const double& beams) throw (ComponentErrors::CouldntReleaseComponentExImpl,
		ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,
		ComponentErrors::UnexpectedExImpl,ComponentErrors::CouldntCallOperationExImpl,ComponentErrors::OperationErrorExImpl,AntennaErrors::ScanErrorExImpl,AntennaErrors::SecondaryScanErrorExImpl,
		AntennaErrors::MissingTargetExImpl,AntennaErrors::LoadGeneratorErrorExImpl)
		AntennaErrors::MissingTargetExImpl,AntennaErrors::LoadGeneratorErrorExImpl,AntennaErrors::NoTargetCommandedYetExImpl)
{
	// this is a workaround in order to make sure there is a target already commanded
	if (m_rawCoordinates.isEmpty()) {
		_EXCPT(AntennaErrors::NoTargetCommandedYetExImpl,impl,"CBossCore::goOff");
		throw impl;
	}
	double skyOffset=m_FWHM*beams;
	double lonOff=0.0,latOff=0.0;
    ACS::Time startUt=0;
	Antenna::TTrackingParameters par,second;
	double rel1,rel2;
	double defEl1,defEl2;
	second.type=Antenna::ANT_NONE;
	second.secondary=false;
	second.applyOffsets=false;
	second.paramNumber=0;
	second.enableCorrection=true;
	m_config->getSkydipRange(defEl1,defEl2);
	if (el1<0) {
		rel1=defEl1;
    Antenna::TTrackingParameters prim,second;
    second.secondary=false; second.paramNumber=0; second.applyOffsets=false; second.type=Antenna::ANT_NONE; second.enableCorrection=true;
    prim.type=Antenna::ANT_NONE;
    prim.paramNumber=0;
    prim.secondary=true;
    prim.applyOffsets=true;
	if (frame==Antenna::ANT_HORIZONTAL) {
		if (m_lastEncoderElevation>m_config->getCutOffElevation()) {
			latOff=skyOffset;
			lonOff=0.0;
		}
		else {
		rel1=el1;
			latOff=0.0;
			lonOff=skyOffset;
		}
	if (el2<0) {
		rel2=defEl2;
	}
	else {
		rel2=el2;
	else if (frame==Antenna::ANT_EQUATORIAL) {
		latOff=0.0;
		lonOff=skyOffset;
	}
	else if (frame==Antenna::ANT_GALACTIC) {
		latOff=0.0;
		lonOff=skyOffset;
	}
	prim.longitudeOffset=lonOff;
	prim.latitudeOffset=latOff;
    prim.offsetFrame=frame;
    prim.enableCorrection=true;
    startScan(startUt,prim,second);
}
	par.targetName=CORBA::string_dup("skydip");
	par.type=Antenna::ANT_OTF;
	par.paramNumber=0;
	par.otf.lon1=m_lastEncoderAzimuth;
	par.otf.lat1=GETMAX(rel1,rel2);
	par.otf.lon2=m_lastEncoderAzimuth;
	par.otf.lat2=GETMIN(rel1,rel2);
	par.otf.coordFrame=Antenna::ANT_HORIZONTAL;
	par.otf.geometry=Antenna::SUBSCAN_CONSTLON;
	par.otf.subScanFrame=Antenna::ANT_HORIZONTAL;
	par.otf.description=Antenna::SUBSCAN_STARTSTOP;
	par.otf.direction=Antenna::SUBSCAN_DECREASE;
	par.otf.subScanDuration=duration;
	par.secondary=false;
	par.applyOffsets=false;
	par.section=Antenna::ACU_NEUTRAL;
	par.enableCorrection=false; // disable correction just for this can
	//in this case we skip the scan check because we want to pass over the scan suggested limits.....
	startScan(startUt,par,second);
	return startUt;
}*/

#endif