Commit a4af184a authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Some improvements to the SRT active surface servers and clients (#430)

parent f05e21b7
Loading
Loading
Loading
Loading
+43 −39
Original line number Diff line number Diff line
@@ -72,44 +72,8 @@ void SRTActiveSurfaceCore::run(void)
    ACS::pattern asProfile_val;


    while (monitor == true) {

        bossStatus_var = tASBoss->status();
        bossStatus_val = bossStatus_var->get_sync(completion.out());
        switch (bossStatus_val) {
            case (Management::MNG_OK):
                ASstatusCode = 0;
                break;
            case (Management::MNG_WARNING):
                ASstatusCode = -1;
                break;
            case (Management::MNG_FAILURE):
                ASstatusCode = -2;
                break;
        }
        emit setGUIasStatusCode();

        asProfile_var = tASBoss->pprofile();
        asProfile_val = asProfile_var->get_sync(completion.out());
        switch (asProfile_val) {
            case (ActiveSurface::AS_SHAPED):
                asProfileCode = 0;
                break;
            case (ActiveSurface::AS_SHAPED_FIXED):
                asProfileCode = 1;
                break;
            case (ActiveSurface::AS_PARABOLIC):
                asProfileCode = 2;
                break;
            case (ActiveSurface::AS_PARABOLIC_FIXED):
                asProfileCode = 3;
                break;
            case (ActiveSurface::AS_PARK):
                asProfileCode = 4;
                break;
        }
        emit setGUIasProfileCode();

    while (monitor == true)
    {
        if (totalactuators >= 1 && totalactuators <= 24) // 1 circle
            i= 1;
        if (totalactuators >= 25 && totalactuators <= 48)  // 2 circle
@@ -152,6 +116,47 @@ void SRTActiveSurfaceCore::run(void)
            totalactuators == 1105 || totalactuators == 1113 || totalactuators == 1117)      
            l = 1;

        //set the current USD color to yellow to identify which one is being checked
        theActuatorStatusColorString = "background-color: rgb(255, 255, 0);";
        emit setGUIActuatorColor(i, l, theActuatorStatusColorString);
		CIRATools::Wait(0,10000);

        bossStatus_var = tASBoss->status();
        bossStatus_val = bossStatus_var->get_sync(completion.out());
        switch (bossStatus_val) {
            case (Management::MNG_OK):
                ASstatusCode = 0;
                break;
            case (Management::MNG_WARNING):
                ASstatusCode = -1;
                break;
            case (Management::MNG_FAILURE):
                ASstatusCode = -2;
                break;
        }
        emit setGUIasStatusCode();

        asProfile_var = tASBoss->pprofile();
        asProfile_val = asProfile_var->get_sync(completion.out());
        switch (asProfile_val) {
            case (ActiveSurface::AS_SHAPED):
                asProfileCode = 0;
                break;
            case (ActiveSurface::AS_SHAPED_FIXED):
                asProfileCode = 1;
                break;
            case (ActiveSurface::AS_PARABOLIC):
                asProfileCode = 2;
                break;
            case (ActiveSurface::AS_PARABOLIC_FIXED):
                asProfileCode = 3;
                break;
            case (ActiveSurface::AS_PARK):
                asProfileCode = 4;
                break;
        }
        emit setGUIasProfileCode();

        try {
            tASBoss->usdStatus4GUIClient(i,l,status);
            if ((status & ENBL) == 0)  {// usd not enabled
@@ -216,7 +221,6 @@ void SRTActiveSurfaceCore::run(void)
		actuatorcounter = l;
		totacts = totalactuators;

		CIRATools::Wait(0,100000);
	} // end of while
}

+10 −0
Original line number Diff line number Diff line
@@ -185,6 +185,16 @@ module ActiveSurface
    	*/
    	oneway void top();
    	oneway void bottom();

        /**
        *   Get the last read status of the USD
        */
        long getStatus();

        /**
        *   Update the status of the USD
        */
        oneway void updateStatus();
	};

};
+4 −0
Original line number Diff line number Diff line
@@ -121,6 +121,10 @@ public:

    void sectorActiveSurface(int sector) throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx);

    void checkUSD(int sector, int lanIndex, int circleIndex, int usdCircleIndex, std::string serial_usd) throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::ComponentErrorsEx);

    void sectorSetupCompleted(int sector);

    void watchingActiveSurfaceStatus() throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl);

    void usdStatus4GUIClient(int circle, int actuator, CORBA::Long_out status) throw (ComponentErrors::CORBAProblemExImpl, ComponentErrors::CouldntGetAttributeExImpl, ComponentErrors::ComponentNotActiveExImpl);
+6 −3
Original line number Diff line number Diff line
@@ -49,18 +49,21 @@ public:
      * This method overrides the thread implementation class.
      * The thread can be exited by calling ACS::ThreadBase::stop or ACS::ThreadBase::exit command.
     */
     virtual void run();
     virtual void runLoop();

     /**
      * This method is used to set the sector to be initialized. It MUST be called before starting the thread execution
     */
     virtual void setSector(int sector);
     virtual void prepare(int sector);

private:

    IRA::CSecureArea<CSRTActiveSurfaceBossCore> *m_core;
    CSRTActiveSurfaceBossCore *boss;
    int m_sector;
    int m_sector, m_index, m_usd_count;
    bool m_ready;
    std::vector<int> m_lanIndexes, m_circleIndexes, m_usdCircleIndexes;
    std::vector<std::string> m_serial_usds;
};

#endif /*_SRTACTIVESURFACEBOSSSECTORTHREAD_H_*/
+2 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ public:
     * @param responseTime thread's heartbeat response time in 100ns unit. Default value is 1s.
     * @param sleepTime thread's sleep time in 100ns unit. Default value is 100ms.
    */
	CSRTActiveSurfaceBossWorkingThread(const ACE_CString& name,IRA::CSecureArea<CSRTActiveSurfaceBossCore>  *param, 
	CSRTActiveSurfaceBossWorkingThread(const ACE_CString& name,CSRTActiveSurfaceBossCore *param,
			const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime,const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime);

	/**
@@ -52,8 +52,7 @@ public:
     virtual void runLoop();

private:

	IRA::CSecureArea<CSRTActiveSurfaceBossCore> *m_core;
	CSRTActiveSurfaceBossCore *boss;
};

#endif /*_SRTACTIVESURFACEBOSSWORKINGTHREAD_H_*/
Loading