kopia lustrzana https://gitlab.com/Zwarf/picplanner
Preparing the calculations to present the necessary information. Icon update
rodzic
a24a380863
commit
f8a2c9f317
Plik diff jest za duży
Load Diff
Przed Szerokość: | Wysokość: | Rozmiar: 25 KiB Po Szerokość: | Wysokość: | Rozmiar: 82 KiB |
BIN
icon.png
BIN
icon.png
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 120 KiB Po Szerokość: | Wysokość: | Rozmiar: 98 KiB |
|
@ -43,18 +43,18 @@ double
|
|||
{
|
||||
GDateTime *iteration_time;
|
||||
double *coordinates_milky_way;
|
||||
double *array_coordinates_milky_way = malloc (sizeof (double) * 2 * NUM_DATA_POINTS_MILKY_WAY);
|
||||
double *array_coordinates_milky_way = malloc (sizeof (double) * 2 * NUM_DATA_POINTS);
|
||||
|
||||
iteration_time = g_date_time_add_hours (date_time, -12);
|
||||
|
||||
for (int i=0; i<NUM_DATA_POINTS_MILKY_WAY; i++)
|
||||
for (int i=0; i<NUM_DATA_POINTS; i++)
|
||||
{
|
||||
coordinates_milky_way = picplanner_get_coordinates_milky_way (iteration_time,
|
||||
longitude,
|
||||
latitude);
|
||||
array_coordinates_milky_way[2*i] = coordinates_milky_way[0];
|
||||
array_coordinates_milky_way[2*i+1] = coordinates_milky_way[1];
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS_MILKY_WAY);
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS);
|
||||
}
|
||||
|
||||
g_print ("Milky Way: Azimuth now: %f, Elevation now: %f\n",
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
#include "calculations_transformations.h"
|
||||
|
||||
/*
|
||||
* NUM_DATA_POINTS: The plots always show 24 hour. Therfore this value gives the amount of
|
||||
* datapoints which have to be calculated. (24*60)min / 5min = 288 --> Step every 5 min.
|
||||
*/
|
||||
#define NUM_DATA_POINTS_MILKY_WAY 288
|
||||
|
||||
double
|
||||
*picplanner_get_coordinates_rotational_milky_way (void);
|
||||
|
|
|
@ -73,18 +73,18 @@ double
|
|||
{
|
||||
GDateTime *iteration_time;
|
||||
double *coordinates_moon;
|
||||
double *array_coordinates_moon = malloc (sizeof (double) * 2 * NUM_DATA_POINTS_MOON);
|
||||
double *array_coordinates_moon = malloc (sizeof (double) * 2 * NUM_DATA_POINTS);
|
||||
|
||||
iteration_time = g_date_time_add_hours (date_time, -12);
|
||||
|
||||
for (int i=0; i<NUM_DATA_POINTS_MOON; i++)
|
||||
for (int i=0; i<NUM_DATA_POINTS; i++)
|
||||
{
|
||||
coordinates_moon = picplanner_get_coordinates_moon (iteration_time,
|
||||
longitude,
|
||||
latitude);
|
||||
array_coordinates_moon[2*i] = coordinates_moon[0];
|
||||
array_coordinates_moon[2*i+1] = coordinates_moon[1];
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS_MOON);
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS);
|
||||
}
|
||||
|
||||
g_print ("MOON: Azimuth now: %f, Elevation now: %f\n",
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
#include "calculations_transformations.h"
|
||||
|
||||
/*
|
||||
* NUM_DATA_POINTS: The plots always show 24 hour. Therfore this value gives the amount of
|
||||
* datapoints which have to be calculated. (24*60)min / 5min = 288 --> Step every 5 min.
|
||||
*/
|
||||
#define NUM_DATA_POINTS_MOON 288
|
||||
|
||||
double
|
||||
*picplanner_get_coordinates_rotational_moon (GDateTime *date_time);
|
||||
|
|
|
@ -65,18 +65,18 @@ double
|
|||
{
|
||||
GDateTime *iteration_time;
|
||||
double *coordinates_sun;
|
||||
double *array_coordinates_sun = malloc (sizeof (double) * 2 * NUM_DATA_POINTS_SUN);
|
||||
double *array_coordinates_sun = malloc (sizeof (double) * 2 * NUM_DATA_POINTS);
|
||||
|
||||
iteration_time = g_date_time_add_hours (date_time, -12);
|
||||
|
||||
for (int i=0; i<NUM_DATA_POINTS_SUN; i++)
|
||||
for (int i=0; i<NUM_DATA_POINTS; i++)
|
||||
{
|
||||
coordinates_sun = picplanner_get_coordinates_sun (iteration_time,
|
||||
longitude,
|
||||
latitude);
|
||||
array_coordinates_sun[2*i] = coordinates_sun[0];
|
||||
array_coordinates_sun[2*i+1] = coordinates_sun[1];
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS_SUN);
|
||||
iteration_time = g_date_time_add_minutes (iteration_time, 24*60/NUM_DATA_POINTS);
|
||||
}
|
||||
|
||||
g_print ("SUN: Azimuth now: %f, Elevation now: %f\n",
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
#include "calculations_transformations.h"
|
||||
|
||||
|
||||
/*
|
||||
* NUM_DATA_POINTS: The plots always show 24 hour. Therfore this value gives the amount of
|
||||
* datapoints which have to be calculated. (24*60)min / 5min = 288 --> Step every 5 min.
|
||||
*/
|
||||
#define NUM_DATA_POINTS_SUN 288
|
||||
|
||||
|
||||
double
|
||||
*picplanner_get_coordinates_rotational_sun (GDateTime *date_time);
|
||||
|
||||
|
|
|
@ -204,15 +204,22 @@ double
|
|||
|
||||
|
||||
int
|
||||
*picplanner_get_rise_set_index (double *coordinates_array)
|
||||
*picplanner_get_rise_upper_set_index (double *coordinates_array)
|
||||
{
|
||||
int rise = -1;
|
||||
int upper = -1;
|
||||
int set = -1;
|
||||
int *rise_set_array = malloc (sizeof (int) * 2);
|
||||
int *rise_upper_set_array = malloc (sizeof (int) * 2);
|
||||
|
||||
for (int i=0; i<NUM_DATA_POINTS; i++)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
rise_set_array[0] = rise;
|
||||
rise_set_array[1] = set;
|
||||
rise_upper_set_array[0] = rise;
|
||||
rise_upper_set_array[1] = upper;
|
||||
rise_upper_set_array[1] = set;
|
||||
|
||||
return rise_set_array;
|
||||
return rise_upper_set_array;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
#include <glib.h>
|
||||
|
||||
|
||||
/*
|
||||
* NUM_DATA_POINTS: The plots always show 24 hour. Therfore this value gives the amount of
|
||||
* datapoints which have to be calculated. (24*60)min / 5min = 288 --> Step every 5 min.
|
||||
*/
|
||||
#define NUM_DATA_POINTS 288
|
||||
|
||||
|
||||
double
|
||||
calc_deg_to_rad (double deg);
|
||||
|
||||
|
@ -37,4 +44,4 @@ double
|
|||
double time_sidereal);
|
||||
|
||||
int
|
||||
*picplanner_get_rise_set_index (double *coordinates_array);
|
||||
*picplanner_get_rise_upper_set_index (double *coordinates_array);
|
||||
|
|
|
@ -67,31 +67,32 @@ GDateTime
|
|||
}
|
||||
|
||||
void
|
||||
picplanner_overview_set_sun_rise_set_current (GDateTime *date_time_rise, GDateTime *date_time_set, double *coordinates)
|
||||
picplanner_overview_set_sun (GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set)
|
||||
{
|
||||
(void) date_time_rise;
|
||||
(void) date_time_set;
|
||||
(void) coordinates;
|
||||
GDateTime *date_time_rise;
|
||||
GDateTime *date_time_upper;
|
||||
GDateTime *date_time_set;
|
||||
(void) coordinates_array;
|
||||
|
||||
date_time_rise = g_date_time_add_minutes (date_time, -12+index_rise_upper_set[0]*24*60/NUM_DATA_POINTS);
|
||||
date_time_upper = g_date_time_add_minutes (date_time, -12+index_rise_upper_set[1]*24*60/NUM_DATA_POINTS);
|
||||
date_time_set = g_date_time_add_minutes (date_time, -12+index_rise_upper_set[2]*24*60/NUM_DATA_POINTS);
|
||||
|
||||
g_print ("Rise: %d:%d\n",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
g_print ("Upper: %d:%d\n",
|
||||
g_date_time_get_hour (date_time_upper),
|
||||
g_date_time_get_minute (date_time_upper));
|
||||
g_print ("Set: %d:%d\n",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
picplanner_overview_set_moon_rise_set_current (GDateTime *date_time_rise, GDateTime *date_time_set, double *coordinates)
|
||||
{
|
||||
(void) date_time_rise;
|
||||
(void) date_time_set;
|
||||
(void) coordinates;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
picplanner_overview_set_milky_way_rise_set_current (GDateTime *date_time_rise, GDateTime *date_time_set, double *coordinates)
|
||||
{
|
||||
(void) date_time_rise;
|
||||
(void) date_time_set;
|
||||
(void) coordinates;
|
||||
}
|
||||
|
||||
/*
|
||||
* Changing the date_time variable and longitude/latitude after a user input was recognized.
|
||||
* Afterwards, emit a signal to start the calculations.
|
||||
|
|
|
@ -20,4 +20,9 @@ picplanner_overview_get_latitude (PicplannerOverview *overview);
|
|||
GDateTime
|
||||
*picplanner_overview_get_date_time (PicplannerOverview *overview);
|
||||
|
||||
void
|
||||
picplanner_overview_set_sun (GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -112,6 +112,8 @@ input_changed (GtkWidget *self,
|
|||
array_coordinates_sun = picplanner_get_array_coordinates_sun (date_time, longitude, latitude);
|
||||
array_coordinates_moon = picplanner_get_array_coordinates_moon (date_time, longitude, latitude);
|
||||
array_coordinates_milky_way = picplanner_get_array_coordinates_milky_way (date_time, longitude, latitude);
|
||||
|
||||
picplanner_overview_set_sun (date_time, array_coordinates_sun, 1);
|
||||
}
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue