#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
static void Exithandler(int sig);
#ifdef WIN32
BOOL WINAPI ConsoleHandler(DWORD CEvent)
{
Exithandler(CEvent);
return TRUE;
}
#endif
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <signal.h>
static sig_atomic_t running = 1;
static const uint32_t numberOfSamplesToGrab = 1000;
{
static uint32_t samplesGrabbed = 0;
if (samplesGrabbed++ >= numberOfSamplesToGrab)
running = 0;
}
static void Exithandler(int sig)
{
running = 0;
}
void PrintLastErrorMessage()
{
char* last_error_message = NULL;
{
last_error_message = "Failed to allocate memory error.";
}
printf("last error message: %s \n", last_error_message);
}
{
{
PrintLastErrorMessage();
exit(status);
}
}
int main(int argc, char *argv[])
{
#ifdef WIN32
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE);
#else
signal(SIGTERM, Exithandler);
signal(SIGKILL, Exithandler);
signal(SIGQUIT, Exithandler);
signal(SIGINT, Exithandler);
#endif
#ifdef WIN32
#else
CheckErrorCode(
pst_tracker_init4(&ctracker,
"",
"config.cfg",
"models.db", argv[1]));
#endif
char* version_string;
printf("Running PST Server version %s \n", version_string);
printf("***************************\n\n");
double fps;
printf("Frame rate set to %f Hz\n", fps);
double min, max;
printf("Exposure range: %f s - %f s\n", min, max);
printf("Set exposure to %f \n", max);
double exposure;
printf("Check new exposure: %f s\n\n", exposure);
printf("***************************\n\n");
printf("Set frame rate to 60 Hz\n");
printf("Frame rate set to %f Hz\n", fps);
printf("Check exposure: %f s\n", exposure);
printf("New exposure range %f s - %f s\n\n", min, max);
printf("***************************\n\n");
double exposureHalf = min + (max - min) / 2.0;
printf("Set exposure half way: %f s\n", exposureHalf);
printf("New exposure: %f s\n\n", exposure);
printf("***************************\n\n");
while (running == 1)
{
#ifdef WIN32
Sleep(100);
#else
usleep(100000);
#endif
}
printf("Press enter to continue...\n");
getchar();
return 0;
}