Commit 35bc1480 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

MedicinaMinorServo management of connecctions and disconnections

parent e3f4f045
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -113,8 +113,10 @@
    <xs:complexType name="MinorServoBossType">
        <xs:sequence>
            <xs:element name="status" type="mng:SystemStatusType" />
            <xs:element name="actualSetup" type="baci:ROstring" />
            <xs:element name="ready" type="mng:BooleanType" />
            <xs:element name="actualSetup" type="baci:ROstring" />
            <xs:element name="motionInfo" type="baci:ROstring" />
            <xs:element name="tracking" type="mng:BooleanType" />
            <xs:element name="starting" type="mng:BooleanType" />
            <xs:element name="asConfiguration" type="mng:BooleanType" />
            <xs:element name="elevationTrack" type="mng:BooleanType" />
+7 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include <IRA>

#include "MedMinorServoParameters.hpp"
#include "MedMinorServoControl.hpp"

using namespace baci;

@@ -17,7 +18,9 @@ class DevIOMotionInfo: public virtual DevIO<ACE_CString>
{
public:

	DevIOMotionInfo(MedMinorServoStatus *status): m_status(status) {
	DevIOMotionInfo(MedMinorServoStatus *status, 
                    MedMinorServoControl_sp control): m_status(status),
                                                      m_control(control){
		AUTO_TRACE("DevIOMotionInfo::DevIOMotionInfo()");
	}

@@ -32,6 +35,8 @@ public:
	ACE_CString read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) {
		AUTO_TRACE("DevIOMotionInfo::read()");
		timestamp=getTimeStamp();
        if((!(m_control)) || (!(m_control->is_connected())))
            return "DISCONNECTED";
        if(m_status){
		    return (m_status->getStatusString()).c_str();
        }else{
@@ -45,6 +50,7 @@ public:

private:
	MedMinorServoStatus *m_status;
    MedMinorServoControl_sp m_control;
};


+9 −6
Original line number Diff line number Diff line
@@ -26,12 +26,15 @@ public:
	Management::TBoolean read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) {
		AUTO_TRACE("DevIOTracking::read()");
		timestamp=getTimeStamp();
        if(m_control)
            if (m_control->is_tracking()) {
                m_val=Management::MNG_TRUE;
            }
            else {
                m_val=Management::MNG_FALSE;
            }
        else
            m_val = Management::MNG_FALSE;
		return m_val;
    }
	
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ class MedMinorServoControl
        MedMinorServoControl(const char* server_ip = "192.168.51.30", 
                             const int server_port = MODBUS_TCP_DEFAULT_PORT,
                             double position_buffer_length = 300.0,
                             double position_refresh_time = 0.1,
                             double position_refresh_time = 0.01,
                             double elevation_refresh_time = 0.1); //throw ServoConnectionError, ServoTimeoutError
        virtual ~MedMinorServoControl();
        /**
+1 −0
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ class MedMinorServoPosition
        bool earlier(const ACS::Time& time) const;
        bool later(const MedMinorServoPosition& position);
        bool later(const ACS::Time& time);
        const char * getStatusString();
        /**
         * check wether the mode is an error code or a success code
         */ 
Loading