Commit db669afa authored by Andrea Orlati's avatar Andrea Orlati
Browse files

fix issue #655: Also included the check for power outage snd in case the sytem...

fix issue #655: Also included the check for power outage snd in case the sytem tries to recover from it. some test still required before merging.
parent fbb5cfea
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ public:
	/** Returns the section which the antenna is located in, at present */
	CACUInterface::TAntennaSection getSection() const;
	
	/** Return true if the driver power is on */
	bool getDrivePower() const;
	
	/**Returns the number of free stack slots reserved for time tagged program track positions */
	WORD getFreeStackPositions() const;
	
+6 −1
Original line number Diff line number Diff line
@@ -186,10 +186,15 @@ public:
	static TAxeModes getMode(BYTE mode);
	
	/**
	 * This function returns the antenna presnt section given the control word
	 * This function returns the antenna present section given the control word
	*/
	static TAntennaSection getSection(WORD controlWord);

	/**
	 * This function returns true i drive power is on, false otherwise
	*/	
	static bool getDrivePower(WORD controlWord);
			
};

#endif
+19 −3
Original line number Diff line number Diff line
@@ -453,7 +453,7 @@ public:

	/**
	 * This method has been added to detect the event the ACU mode differs from previously commanded. In case it tries to
	 * recover from this event by commandind the correct mode.
	 * recover from this event by commanding the correct mode.
	 * @throw AntennaErrors::ConnectionExImpl
	 * @throw ComponentErrors::SocketErrorExImpl
	 * @throw ComponentErrors::TimeoutExImpl
@@ -463,6 +463,17 @@ public:
	void checkCommandedMode() throw (AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl,
	  ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,AntennaErrors::AntennaBusyExImpl);

	/**
	 * This method has been added to detect a power failure in the servo system. In case it tries to
	 * recover from this event by reseting the servo.
	 * @throw AntennaErrors::ConnectionExImpl
	 * @throw ComponentErrors::SocketErrorExImpl
	 * @throw ComponentErrors::TimeoutExImpl
	 * @throw AntennaErrors::NakExImpl
	*/
	void checkPowerFailure() throw (ComponentErrors::TimeoutExImpl,AntennaErrors::NakExImpl,
	  AntennaErrors::ConnectionExImpl,ComponentErrors::SocketErrorExImpl);

	/** 
	 * This member function is used by the control thread in order to check if a long job that was started as completed or not.
	 * @param job job identifier
@@ -624,6 +635,11 @@ private:
	 */	
	bool m_modeCheckRecover;

	/**
	 * this flag indicates that a power failure has been detected
	 */		
	bool m_powerFailDetected;
	
	/**
	 * Stores the epoch of the last scan. Used in oscillation prevention
	 */
+8 −0
Original line number Diff line number Diff line
@@ -115,6 +115,14 @@ CACUInterface::TAntennaSection CACUData::getSection() const
	return CACUInterface::getSection(Value);	
}

bool CACUData::getDrivePower() const
{
	WORD val;
	memcpy(&val,(m_MonitorData+36),2);
	return CACUInterface::getDrivePower(val);
}

	
WORD CACUData::getFreeStackPositions() const
{
	WORD Value;
+6 −0
Original line number Diff line number Diff line
@@ -247,3 +247,9 @@ CACUInterface::TAntennaSection CACUInterface::getSection(WORD controlWord)
	else return CACUInterface::CCW;
}

bool CACUInterface::getDrivePower(WORD controlWord)
{
	if (controlWord & (1 << 15)) return true;
	else return false;
}
Loading