Unverified Commit 87dc57a1 authored by Carlo Migoni's avatar Carlo Migoni Committed by GitHub
Browse files

Fix #619, Active Surface can change LUT on the fly (#800)



* Fix #619, Active Surface can change LUT on the fly

This feature was added in both Medicina and SRT components

* Fix #619, updated CHANGELOG.md

---------

Co-authored-by: default avatarGiuseppe Carboni <giuseppecarboni89@live.com>
parent 9ef4cf31
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -101,6 +101,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/
    issue #791 - Nodding added for TotalPower and Sardara components via the `enable` command. This command can only be issued from a schedule and not via the operatorInput CLI.
                 The syntax for the command is the following: `enable=X;Y` with X and Y representing the 2 feeds the user would like to use for the Nodding observation.
                 This command must be placed in the <schedule_name>.bck file in order to work properly.
    issue #619 - Active surface components are now capable of changing look-up tables on the fly via the `asSetLUT` command

## Fixed
## Changed
	issue #689 - The dataset provided by weather station has been enlarged by the wind direction. The correctponding RAL 'wx' command will noe provided wind direction readout, as well
+1 −0
Original line number Diff line number Diff line
@@ -223,6 +223,7 @@ void CCore::execute() throw(ComponentErrors::TimerErrorExImpl, ComponentErrors::
	m_parser->add("asPark", "activesurface", 5, &CCore::remoteCall);
	m_parser->add("asOn", "activesurface", 5, &CCore::remoteCall);
	m_parser->add("asOff", "activesurface", 5, &CCore::remoteCall);
	m_parser->add("asSetLUT", "activesurface", 5, &CCore::remoteCall);

	// procedures
	loadProcedures(m_config->getDefaultProceduresFile()); // throws ManagementErrors::ProcedureFileLoadingErrorExImpl
+6 −0
Original line number Diff line number Diff line
@@ -169,6 +169,8 @@ public:

    void setProfile (const ActiveSurface::TASProfile& profile) throw (ComponentErrors::ComponentErrorsExImpl);

    void asSetLUT (const char* newlut);
    
private:
    std::map<int, std::string> m_error_strings;
    ContainerServices* m_services;
@@ -223,6 +225,10 @@ private:
    bool m_profileSetted;

    bool m_ASup;

    bool m_newlut;

    const char* m_lut;
};

#endif /*MEDICINAACTIVESURFACEBOSSCORE_H_*/
+14 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ void CMedicinaActiveSurfaceBossCore::initialize()
    }
    m_profileSetted = false;
    m_ASup = false;
    m_newlut = false;
}

void CMedicinaActiveSurfaceBossCore::execute() throw (ComponentErrors::CouldntGetComponentExImpl)
@@ -1334,6 +1335,12 @@ void CMedicinaActiveSurfaceBossCore::workingActiveSurface() throw (ComponentErro
    }
}

void CMedicinaActiveSurfaceBossCore::asSetLUT(const char *newlut)
{
    m_lut= (CDBPATH + "alma/AS/" + newlut).c_str();
    m_newlut = true;
}

void CMedicinaActiveSurfaceBossCore::setProfile(const ActiveSurface::TASProfile& newProfile) throw (ComponentErrors::ComponentErrorsExImpl)
{
    bool all_sectors = true;
@@ -1342,12 +1349,17 @@ void CMedicinaActiveSurfaceBossCore::setProfile(const ActiveSurface::TASProfile&
        if(!m_sector[i]) all_sectors = false;
    }

    if (m_newlut == false)
        m_lut = USDTABLECORRECTIONS;

    if(all_sectors) // USD tables has not been loaded yet
    {
        ifstream usdCorrections (USDTABLECORRECTIONS);
        ifstream usdCorrections (m_lut);
        //ifstream usdCorrections (USDTABLECORRECTIONS);
        if(!usdCorrections)
        {
            ACS_SHORT_LOG ((LM_INFO, "File %s not found", USDTABLECORRECTIONS));
            ACS_SHORT_LOG ((LM_INFO, "File %s not found", m_lut));
            //ACS_SHORT_LOG ((LM_INFO, "File %s not found", USDTABLECORRECTIONS));
            exit(-1);
        }
        actuatorsCorrections.length(NPOSITIONS);
+1 −0
Original line number Diff line number Diff line
@@ -139,6 +139,7 @@ void MedicinaActiveSurfaceBossImpl::initialize() throw (ACSErr::ACSbaseExImpl)
    m_parser->add("asOn",new function0<CMedicinaActiveSurfaceBossCore,non_constant,void_type >(boss,&CMedicinaActiveSurfaceBossCore::asOn),0);
    m_parser->add("asOff",new function0<CMedicinaActiveSurfaceBossCore,non_constant,void_type >(boss,&CMedicinaActiveSurfaceBossCore::asOff),0);
    m_parser->add("asPark",new function0<CMedicinaActiveSurfaceBossCore,non_constant,void_type >(boss,&CMedicinaActiveSurfaceBossCore::asPark),0);
	m_parser->add("asSetLUT",new function1<CMedicinaActiveSurfaceBossCore,non_constant,void_type,I<string_type> >(boss,&CMedicinaActiveSurfaceBossCore::asSetLUT),1 );

    ACS_LOG(LM_FULL_INFO, "MedicinaActiveSurfaceBossImpl::initialize()", (LM_INFO,"COMPSTATE_INITIALIZED"));
}
Loading