@@ -361,6 +361,48 @@ class AppWrapper : public CMOOSApp {
361361 return true ;
362362 }
363363
364+ // Configuration reading methods
365+ bool GetConfigurationParam (const std::string& sParam , std::string& sVal ) {
366+ return m_MissionReader.GetConfigurationParam (sParam , sVal );
367+ }
368+
369+ bool GetConfigurationParam (const std::string& sParam , double & dVal) {
370+ return m_MissionReader.GetConfigurationParam (sParam , dVal);
371+ }
372+
373+ bool GetConfigurationParam (const std::string& sParam , int & nVal) {
374+ return m_MissionReader.GetConfigurationParam (sParam , nVal);
375+ }
376+
377+ bool GetConfigurationParam (const std::string& sParam , bool & bVal) {
378+ return m_MissionReader.GetConfigurationParam (sParam , bVal);
379+ }
380+
381+ // Python-friendly wrappers that return tuples (success, value)
382+ py::tuple GetConfigurationString (const std::string& sParam ) {
383+ std::string sVal ;
384+ bool bSuccess = m_MissionReader.GetConfigurationParam (sParam , sVal );
385+ return py::make_tuple (bSuccess, sVal );
386+ }
387+
388+ py::tuple GetConfigurationDouble (const std::string& sParam ) {
389+ double dVal = 0.0 ;
390+ bool bSuccess = m_MissionReader.GetConfigurationParam (sParam , dVal);
391+ return py::make_tuple (bSuccess, dVal);
392+ }
393+
394+ py::tuple GetConfigurationInt (const std::string& sParam ) {
395+ int nVal = 0 ;
396+ bool bSuccess = m_MissionReader.GetConfigurationParam (sParam , nVal);
397+ return py::make_tuple (bSuccess, nVal);
398+ }
399+
400+ py::tuple GetConfigurationBool (const std::string& sParam ) {
401+ bool bVal = false ;
402+ bool bSuccess = m_MissionReader.GetConfigurationParam (sParam , bVal);
403+ return py::make_tuple (bSuccess, bVal);
404+ }
405+
364406private:
365407 /* * callback functions (stored) */
366408 py::object on_new_mail_object_;
@@ -741,6 +783,34 @@ PYBIND11_MODULE(pymoos, m) {
741783 " This is the main work loop of the application." ,
742784 py::arg (" func" ))
743785
786+ .def (" get_configuration_string" ,
787+ &MOOS::AppWrapper::GetConfigurationString,
788+ " Read a string parameter from the mission file configuration block. "
789+ " Returns a tuple (success, value) where success is True if the "
790+ " parameter was found." ,
791+ py::arg (" param" ))
792+
793+ .def (" get_configuration_double" ,
794+ &MOOS::AppWrapper::GetConfigurationDouble,
795+ " Read a double parameter from the mission file configuration block. "
796+ " Returns a tuple (success, value) where success is True if the "
797+ " parameter was found." ,
798+ py::arg (" param" ))
799+
800+ .def (" get_configuration_int" ,
801+ &MOOS::AppWrapper::GetConfigurationInt,
802+ " Read an integer parameter from the mission file configuration block. "
803+ " Returns a tuple (success, value) where success is True if the "
804+ " parameter was found." ,
805+ py::arg (" param" ))
806+
807+ .def (" get_configuration_bool" ,
808+ &MOOS::AppWrapper::GetConfigurationBool,
809+ " Read a boolean parameter from the mission file configuration block. "
810+ " Returns a tuple (success, value) where success is True if the "
811+ " parameter was found." ,
812+ py::arg (" param" ))
813+
744814 ;
745815
746816
0 commit comments