3 #define _CRT_SECURE_NO_WARNINGS 4 #define _USE_MATH_DEFINES 41 fout = fopen(filename.c_str(),
"w");
67 char asciiBuffer[255] = {0};
68 for (
int i = 0; i < bufLen; i++)
75 printf(
"%02x ", buffer[i]);
78 if ((buffer[i] >= 0x20) && (buffer[i] < 0x80))
82 int iStrLen = strlen(asciiBuffer);
83 asciiBuffer[iStrLen] = ch;
84 asciiBuffer[iStrLen+1] =
'\0';
88 printf(
"%s\n", asciiBuffer);
89 strcpy(asciiBuffer,
"");
95 printf(
"%s\n", asciiBuffer);
103 double sampleRate = 1000.0;
108 for (
double t = 0; t < 5.0; t += 1.0 / sampleRate)
111 testSignal = 1.0 * cos(2 * M_PI*freq*t);
117 testSignal = 1.0 * sin(2 * M_PI*freq*t);
123 #ifdef TEST_DATA_DUMPER 124 int main(
int argc,
char *argv)
int pushData(double timeStamp, std::string info, double val)
std::vector< std::string > infoVec
int main(int argc, char **argv)
Startup routine - if called with no argmuments we assume debug session. Set scanner name variable by ...
int writeDataToCsv(std::string fileName)
int writeToFileNameWhenBufferIsFull(std::string filename)
static DataDumper & instance()
std::vector< double > timeStampVec
std::vector< double > dataVec
int dumpUcharBufferToConsole(unsigned char *buffer, int bufLen)