Commit acad4d57 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

Added logMessage command to Scheduler

parent eea8763f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -201,6 +201,12 @@ void _chooseDefaultDataRecorder(const char *rcvInstance) throw (ComponentErrors:
 */
void _changeLogFile(const char *fileName) throw (ComponentErrors::CouldntGetComponentExImpl,ComponentErrors::CORBAProblemExImpl,ManagementErrors::LogFileErrorExImpl);

/**
 * Log a message to custom log with default level of NOTICE
 * @param message the log message
 */
void _logMessage(const char *message);

/**
 * Allows to read out from weather station.
 * @throw ComponentErrors::CouldntGetComponentExImpl
+1 −0
Original line number Diff line number Diff line
@@ -106,6 +106,7 @@ void CCore::execute() throw (ComponentErrors::TimerErrorExImpl,ComponentErrors::
			I<interval_type> >(this,&CCore::crossScan),3);
	m_parser->add("peakerScan",new function3<CCore,non_constant,void_type,I<string_type>,I<double_type >,I<interval_type> >(this,&CCore::peakerScan),3);
	m_parser->add("log",new function1<CCore,non_constant,void_type,I<string_type> >(this,&CCore::_changeLogFile),1);
	m_parser->add("logMessage",new function1<CCore,non_constant,void_type,I<string_type> >(this,&CCore::_logMessage),1);
	m_parser->add("wx",new function4<CCore,non_constant,void_type,O<double_type>,O<double_type>,O<double_type>,O<double_type> >(this,&CCore::_getWeatherStationParameters),0);
	m_parser->add("project",new function1<CCore,non_constant,void_type,I<string_type> >(this,&CCore::_setProjectCode),1);
	// no range checks because * is allowed
+6 −0
Original line number Diff line number Diff line
@@ -320,6 +320,12 @@ void CCore::_changeLogFile(const char *fileName) throw (ComponentErrors::Couldnt
	}
}

void CCore::_logMessage(const char *message) {
    CUSTOM_LOG(LM_FULL_INFO, 
               "CCore::_logMessage",
               (LM_NOTICE, message));
}

void CCore::_getWeatherStationParameters(double &temp,double& hum,double& pres, double& wind) throw (ComponentErrors::CouldntGetComponentExImpl,
		ManagementErrors::WeatherStationErrorExImpl,ComponentErrors::CORBAProblemExImpl)
{