You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
/***************************************************************************************
|
|
*
|
|
* main.cc is part of SimpleSkyCam.
|
|
*
|
|
*****************************************************************************************/
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include "config.h"
|
|
#include "gui.h"
|
|
#include "filter.h"
|
|
#include "detect.h"
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// global variables
|
|
//
|
|
|
|
GtkBuilder *_builder_ = NULL; // work around for the thread situation
|
|
Filter filter;
|
|
Detect detect;
|
|
|
|
int main (int argc, char **argv) {
|
|
GtkBuilder *builder;
|
|
GObject *window;
|
|
|
|
#ifdef BUILD_WINDOWS
|
|
char buffer[16];
|
|
setvbuf (stdout, buffer, _IONBF, 16);
|
|
#endif
|
|
|
|
printf ("SimpleSkyCam - %s\n", VERSION);
|
|
printf (" written by Steffen Pohle <steffen@gulpe.de>\n");
|
|
|
|
gtk_init (&argc, &argv);
|
|
_builder_ = builder = gtk_builder_new ();
|
|
gtk_builder_add_from_file (builder, BUILDER_FILE, NULL);
|
|
gtk_builder_connect_signals(builder, builder);
|
|
|
|
//
|
|
// #if defined _WIN32 || defined _WIN64 || defined __CYGWIN__
|
|
// #else
|
|
// #endif
|
|
//
|
|
|
|
window = gtk_builder_get_object (builder, "window-main");
|
|
gtk_widget_show_all (GTK_WIDGET(window));
|
|
|
|
gtk_main ();
|
|
|
|
return 0;
|
|
}
|
|
|
|
|
|
float get_cycletime(struct timeval *t) {
|
|
struct timeval t1;
|
|
float f = 0.0;
|
|
|
|
t1 = *t;
|
|
gettimeofday(t, NULL);
|
|
f = (float)(t->tv_sec - t1.tv_sec) + ((t->tv_usec - t1.tv_usec) / 1000000.0);
|
|
|
|
return f;
|
|
}
|
|
|