Merge branch 'development' into mueller/generic-filesyste-message

This commit is contained in:
Steffen Gaisser 2021-06-14 15:14:37 +02:00
commit 3076c423c0
9 changed files with 770 additions and 734 deletions

View File

@ -18,6 +18,13 @@ add_library(${LIB_FSFW_NAME})
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos) set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
elseif(${CMAKE_CXX_STANDARD} LESS 11)
message(FATAL_ERROR "Compiling the FSFW requires a minimum of C++11 support")
endif()
if(NOT OS_FSFW) if(NOT OS_FSFW)
message(STATUS "No OS for FSFW via OS_FSFW set. Assuming host OS") message(STATUS "No OS for FSFW via OS_FSFW set. Assuming host OS")
# Assume host OS and autodetermine from OS_FSFW # Assume host OS and autodetermine from OS_FSFW

View File

@ -66,6 +66,10 @@ protected:
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override = 0; LocalDataPoolManager& poolManager) override = 0;
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override = 0; virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override = 0;
// Mode abstract functions
virtual ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t *msToReachTheMode) override = 0;
}; };

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,15 @@
void arrayprinter::print(const uint8_t *data, size_t size, OutputType type, void arrayprinter::print(const uint8_t *data, size_t size, OutputType type,
bool printInfo, size_t maxCharPerLine) { bool printInfo, size_t maxCharPerLine) {
if(size == 0) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Size is zero, nothing to print" << std::endl;
#else
sif::printInfo("Size is zero, nothing to print\n");
#endif
return;
}
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
if(printInfo) { if(printInfo) {
sif::info << "Printing data with size " << size << ": " << std::endl; sif::info << "Printing data with size " << size << ": " << std::endl;

View File

@ -119,9 +119,9 @@ void ObjectManager::initialize() {
result = it.second->checkObjectConnections(); result = it.second->checkObjectConnections();
if ( result != RETURN_OK ) { if ( result != RETURN_OK ) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "ObjectManager::ObjectManager: Object " << std::hex << sif::error << "ObjectManager::ObjectManager: Object 0x" << std::hex <<
(int) it.first << " connection check failed with code 0x" (int) it.first << " connection check failed with code 0x" << result <<
<< result << std::dec << std::endl; std::dec << std::endl;
#endif #endif
errorCount++; errorCount++;
} }

View File

@ -35,7 +35,7 @@ ServiceInterfaceBuffer::ServiceInterfaceBuffer(std::string setMessage,
colorPrefix = sif::ANSI_COLOR_GREEN; colorPrefix = sif::ANSI_COLOR_GREEN;
} }
else if(setMessage.find("WARNING") != std::string::npos) { else if(setMessage.find("WARNING") != std::string::npos) {
colorPrefix = sif::ANSI_COLOR_YELLOW; colorPrefix = sif::ANSI_COLOR_MAGENTA;
} }
else if(setMessage.find("ERROR") != std::string::npos) { else if(setMessage.find("ERROR") != std::string::npos) {
colorPrefix = sif::ANSI_COLOR_RED; colorPrefix = sif::ANSI_COLOR_RED;
@ -171,6 +171,10 @@ bool ServiceInterfaceBuffer::crAdditionEnabled() const {
return addCrToPreamble; return addCrToPreamble;
} }
void ServiceInterfaceBuffer::setAsciiColorPrefix(std::string colorPrefix) {
this->colorPrefix = colorPrefix;
}
#ifdef UT699 #ifdef UT699
#include "../osal/rtems/Interrupt.h" #include "../osal/rtems/Interrupt.h"

View File

@ -48,6 +48,7 @@ private:
#if FSFW_COLORED_OUTPUT == 1 #if FSFW_COLORED_OUTPUT == 1
std::string colorPrefix; std::string colorPrefix;
void setAsciiColorPrefix(std::string colorPrefix);
#endif #endif
// For EOF detection // For EOF detection

View File

@ -19,5 +19,9 @@ bool ServiceInterfaceStream::crAdditionEnabled() const {
return streambuf.crAdditionEnabled(); return streambuf.crAdditionEnabled();
} }
void ServiceInterfaceStream::setAsciiColorPrefix(std::string asciiColorCode) {
streambuf.setAsciiColorPrefix(asciiColorCode);
}
#endif #endif

View File

@ -46,6 +46,8 @@ public:
*/ */
bool crAdditionEnabled() const; bool crAdditionEnabled() const;
void setAsciiColorPrefix(std::string asciiColorCode);
protected: protected:
ServiceInterfaceBuffer streambuf; ServiceInterfaceBuffer streambuf;
}; };