commit
cadb264211
@ -0,0 +1,6 @@
|
||||
|
||||
The license model for this software (SimpleSkyCam) is not yet choosen.
|
||||
At the moment you can use this software free of charge at your own risk.
|
||||
|
||||
06.Sep.2021 Steffen Pohle
|
||||
|
||||
@ -0,0 +1,77 @@
|
||||
.SILENT: help
|
||||
VERSION = 0.0.1
|
||||
APP = simpleskycam
|
||||
|
||||
-include Makefile.rules
|
||||
|
||||
OBJECTS = gui.oo main.oo
|
||||
DISTNAME=simpleskycam-$(VERSION)
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
noconfig: help
|
||||
endif
|
||||
|
||||
all: Makefile.rules $(TARGET)
|
||||
|
||||
help:
|
||||
echo "set up configuration"
|
||||
echo " make configlinux to generate the linix build"
|
||||
|
||||
configlinux: clean
|
||||
cp -f Makefile.rules.linux Makefile.rules
|
||||
make config
|
||||
|
||||
configwindows: clean
|
||||
cp -f Makefile.rules.windows Makefile.rules
|
||||
make config
|
||||
|
||||
configcross: clean
|
||||
cp -f Makefile.rules.crosswindows Makefile.rules
|
||||
make config
|
||||
|
||||
config: Makefile.rules
|
||||
echo "#ifndef _CONFIG_H_" > config.h
|
||||
echo "#define _CONFIG_H_" >> config.h
|
||||
echo "" >> config.h
|
||||
echo "#define VERSION \"$(VERSION)\"" >> config.h
|
||||
echo "" >> config.h
|
||||
echo "#endif" >> config.h
|
||||
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CPP) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(LIBS)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .cc .C .cpp .oo
|
||||
|
||||
.cc.oo : $(INCLUDES)
|
||||
$(CPP) -o $@ -c $(CPPFLAGS) $<
|
||||
|
||||
clean:
|
||||
rm -f *.o *.oo *.c~ *.h~ *.cc~ *.ui~ $(APP) Makefile~
|
||||
rm -rf config.h
|
||||
rm -rf *.dll
|
||||
rm -rf *.exe
|
||||
rm -rf Makefile.rules
|
||||
|
||||
dist: clean
|
||||
rm -rf $(DISTNAME)
|
||||
mkdir $(DISTNAME)
|
||||
cp Makefile* $(DISTNAME)
|
||||
cp Readme $(DISTNAME)
|
||||
cp COPYING $(DISTNAME)
|
||||
cp Changelog $(DISTNAME)
|
||||
cp *.ui $(DISTNAME)
|
||||
cp -rf *.h $(DISTNAME)
|
||||
cp -rf *.cc $(DISTNAME)
|
||||
tar cvzf $(DISTNAME).tgz $(DISTNAME)
|
||||
rm -rf $(DISTNAME)
|
||||
|
||||
dep:
|
||||
$(CXX) -MM `ls *.cc` $(CXXFLAGS) > $(DEPENDFILE)
|
||||
|
||||
-include $(DEPENDFILE)
|
||||
|
||||
.PHONY: all
|
||||
.PHONY: count
|
||||
.PHONY: clean
|
||||
@ -0,0 +1,9 @@
|
||||
|
||||
TARGET = $(APP)
|
||||
|
||||
CPP = c++
|
||||
CPPFLAGS = -ggdb -Wall -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -I/usr/include -DBUILD_LINUX=1
|
||||
INCLUDES =
|
||||
LDFLAGS =
|
||||
LIBS = `pkg-config --libs gtk+-3.0 gmodule-export-2.0` -L/usr/lib
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
# SimpleSkyCam
|
||||
|
||||
Simple application to create images using a teleskope and a cameramodul.
|
||||
@ -0,0 +1,47 @@
|
||||
/***************************************************************************************
|
||||
*
|
||||
* main.cc is part of SimpleSkyCam.
|
||||
*
|
||||
*****************************************************************************************/
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
|
||||
#else
|
||||
#include <unistd.h> /* close() */
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <list>
|
||||
#include "gui.h"
|
||||
#include "config.h"
|
||||
|
||||
extern GtkBuilder *_builder_; // work around for threads
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// call back functions
|
||||
//
|
||||
|
||||
gboolean cb_window_delete_event (GtkWidget *widget, GdkEvent *event, gpointer data) {
|
||||
// GtkBuilder *builder = (GtkBuilder *) data;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void cb_window_show (GtkWidget *widget, gpointer data) {
|
||||
// GtkBuilder *builder = (GtkBuilder *) data;
|
||||
// g_timeout_add(100, gui_loop, NULL);
|
||||
};
|
||||
|
||||
void displayerror (std::string error) {
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *window = GTK_WIDGET (gtk_builder_get_object (_builder_, "main-window"));
|
||||
dialog = gtk_message_dialog_new(GTK_WINDOW(window),
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
error.c_str());
|
||||
gtk_window_set_title(GTK_WINDOW(dialog), "Error");
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
/***************************************************************************************
|
||||
*
|
||||
* gui.h is part of SimpleSkyCam.
|
||||
*
|
||||
*****************************************************************************************/
|
||||
|
||||
#ifndef _GUI_H_
|
||||
#define _GUI_H_
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdk.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#define BUILDER_FILE "simpleskycam.ui"
|
||||
|
||||
void displayerror (std::string error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// ***********************************************************************
|
||||
//
|
||||
// main windows call backs
|
||||
//
|
||||
G_MODULE_EXPORT void cb_window_show (GtkWidget *widget, gpointer data);
|
||||
G_MODULE_EXPORT gboolean cb_window_delete_event (GtkWidget *widget,
|
||||
GdkEvent *event, gpointer data);
|
||||
|
||||
//
|
||||
// thread handles
|
||||
G_MODULE_EXPORT gboolean cb_thread_video (gpointer data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,61 @@
|
||||
/***************************************************************************************
|
||||
*
|
||||
* main.cc is part of SimpleSkyCam.
|
||||
*
|
||||
*****************************************************************************************/
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "gui.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// global variables
|
||||
//
|
||||
|
||||
GtkBuilder *_builder_ = NULL; // work around for the thread situation
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkWindow" id="window-main">
|
||||
<property name="can-focus">False</property>
|
||||
<property name="default-width">1024</property>
|
||||
<property name="default-height">786</property>
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="position">700</property>
|
||||
<property name="position-set">True</property>
|
||||
<property name="wide-handle">True</property>
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="position">250</property>
|
||||
<property name="position-set">True</property>
|
||||
<property name="wide-handle">True</property>
|
||||
<child>
|
||||
<object class="GtkDrawingArea">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkNotebook">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="spacing">7</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Device:</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="has-entry">True</property>
|
||||
<child internal-child="entry">
|
||||
<object class="GtkEntry">
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_devicescan">
|
||||
<property name="label">gtk-refresh</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="btn_device_connect">
|
||||
<property name="label">gtk-apply</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
<property name="always-show-image">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">3</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">page 1</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">page 2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
<property name="tab-fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">page 3</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
<property name="tab-fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkPaned">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="position">500</property>
|
||||
<property name="position-set">True</property>
|
||||
<property name="wide-handle">True</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Video Object</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">False</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">Image Filtered</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">button</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">6</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">4</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="resize">True</property>
|
||||
<property name="shrink">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
Loading…
Reference in new issue