MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/systemic/SignalLogger.cpp
2024-06-07 11:12:56 +03:00

54 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* SignalLogger.cpp
*
* Created on: 31 мар. 2021 г.
* Author: titov
*/
#include "SignalLogger.hh"
systemic::SignalManager::Record & systemic::SignalLogger::search( Id id ) const {
systemic::SignalManager::Record & record = systemic::SignalManager::search(id);
if( not record.exist() ) {
ErrorMessage message;
message.signal = id;
logger->log_error( reinterpret_cast<char *>(&message), sizeof(message) );
}
return record;
}
systemic::SignalLogger::SignalLogger(
Record * records, std::size_t size,
std::pmr::memory_resource* allocator,
NotificationInterface &herald) :
SignalManager(records, size, allocator, herald)
{
}
bool systemic::SignalLogger::add( Id id, InterfaceType * interface,
InterfaceOverrideType * override,
const volatile Type * value ) {
bool result = systemic::SignalManager::add(id, interface, override, value);
if( not result ) {
CriticalMessage message;
message.signal = id;
logger->log_critical( reinterpret_cast<char *>(&message), sizeof(message) );
}
return true;
}