mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 12:36:52 +03:00
Improve data logging
This commit is contained in:
@@ -980,17 +980,20 @@ string ClassFlowCNNGeneral::getReadoutRawString(int _analog)
|
|||||||
{
|
{
|
||||||
if (CNNType == Analogue || CNNType == Analogue100)
|
if (CNNType == Analogue || CNNType == Analogue100)
|
||||||
{
|
{
|
||||||
rt = rt + "\t" + std::to_string(GENERAL[_analog]->ROI[i]->result_float);
|
rt = rt + "\t" + RundeOutput(GENERAL[_analog]->ROI[i]->result_float, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CNNType == Digital)
|
if (CNNType == Digital)
|
||||||
{
|
{
|
||||||
rt = rt + "\t" + std::to_string(GENERAL[_analog]->ROI[i]->result_klasse);
|
if (GENERAL[_analog]->ROI[i]->result_klasse == 10)
|
||||||
|
rt = rt + "\tN";
|
||||||
|
else
|
||||||
|
rt = rt + "\t" + RundeOutput(GENERAL[_analog]->ROI[i]->result_klasse, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((CNNType == DoubleHyprid10) || (CNNType == Digital100))
|
if ((CNNType == DoubleHyprid10) || (CNNType == Digital100))
|
||||||
{
|
{
|
||||||
rt = rt + "\t" + std::to_string(GENERAL[_analog]->ROI[i]->result_float);
|
rt = rt + "\t" + RundeOutput(GENERAL[_analog]->ROI[i]->result_float, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rt;
|
return rt;
|
||||||
|
|||||||
@@ -927,6 +927,8 @@ string ClassFlowPostProcessing::getReadoutParam(bool _rawValue, bool _noerror, i
|
|||||||
return NUMBERS[_number]->ReturnValue;
|
return NUMBERS[_number]->ReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Jetzt als globale Funktion in Helper.h
|
||||||
|
|
||||||
string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){
|
string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){
|
||||||
std::stringstream stream;
|
std::stringstream stream;
|
||||||
int _zw = _in;
|
int _zw = _in;
|
||||||
@@ -949,6 +951,7 @@ string ClassFlowPostProcessing::RundeOutput(double _in, int _anzNachkomma){
|
|||||||
|
|
||||||
return stream.str();
|
return stream.str();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
string ClassFlowPostProcessing::ErsetzteN(string input, double _prevalue)
|
string ClassFlowPostProcessing::ErsetzteN(string input, double _prevalue)
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ protected:
|
|||||||
|
|
||||||
string ErsetzteN(string, double _prevalue);
|
string ErsetzteN(string, double _prevalue);
|
||||||
float checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue);
|
float checkDigitConsistency(double input, int _decilamshift, bool _isanalog, double _preValue);
|
||||||
string RundeOutput(double _in, int _anzNachkomma);
|
|
||||||
|
|
||||||
void InitNUMBERS();
|
void InitNUMBERS();
|
||||||
void handleDecimalSeparator(string _decsep, string _value);
|
void handleDecimalSeparator(string _decsep, string _value);
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#include <iomanip>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@@ -695,3 +698,28 @@ string SDCardParseManufacturerIDs(int id)
|
|||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string RundeOutput(double _in, int _anzNachkomma)
|
||||||
|
{
|
||||||
|
std::stringstream stream;
|
||||||
|
int _zw = _in;
|
||||||
|
// ESP_LOGD(TAG, "AnzNachkomma: %d", _anzNachkomma);
|
||||||
|
|
||||||
|
if (_anzNachkomma < 0) {
|
||||||
|
_anzNachkomma = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_anzNachkomma > 0)
|
||||||
|
{
|
||||||
|
stream << std::fixed << std::setprecision(_anzNachkomma) << _in;
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stream << _zw;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return stream.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ void RenameFile(string from, string to);
|
|||||||
void MakeDir(std::string _what);
|
void MakeDir(std::string _what);
|
||||||
|
|
||||||
|
|
||||||
|
string RundeOutput(double _in, int _anzNachkomma);
|
||||||
|
|
||||||
|
|
||||||
FILE* OpenFileAndWait(const char* nm, const char* _mode, int _waitsec = 1);
|
FILE* OpenFileAndWait(const char* nm, const char* _mode, int _waitsec = 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user