kopia lustrzana https://gitlab.com/Zwarf/picplanner
Add milky way disturbance feature
rodzic
e3fec8f232
commit
3f0cf7d271
|
@ -127,9 +127,13 @@ picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
|
|||
int *dark_blue_golden_index_sun,
|
||||
int *rise_upper_set_index_moon,
|
||||
int *rise_upper_set_index_milky_way,
|
||||
double illumination_moon)
|
||||
double elevation_sun,
|
||||
double elevation_moon)
|
||||
{
|
||||
|
||||
g_print("Elevation Sun: %f, Elevation Moon: %f", elevation_sun, elevation_moon);
|
||||
char *char_label_disturbance_sun;
|
||||
char *char_label_disturbance_moon;
|
||||
char *char_label_visibility_time;
|
||||
|
||||
GDateTime *date_time_dark_end;
|
||||
|
@ -145,17 +149,58 @@ picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
|
|||
dark_blue_golden_index_sun[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_dark_begin = g_date_time_add_minutes (date_time_noon,
|
||||
dark_blue_golden_index_sun[7]*24*60/NUM_DATA_POINTS-12*60);
|
||||
char_label_disturbance_sun = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (date_time_dark_end),
|
||||
g_date_time_get_minute (date_time_dark_end),
|
||||
g_date_time_get_hour (date_time_dark_begin),
|
||||
g_date_time_get_minute (date_time_dark_begin));
|
||||
|
||||
if (dark_blue_golden_index_sun[0]>=0 && dark_blue_golden_index_sun[7]>=0)
|
||||
{
|
||||
if (dark_blue_golden_index_sun[7]>=0)
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_dark_begin),
|
||||
g_date_time_get_minute (date_time_dark_begin));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("00:00");
|
||||
}
|
||||
if (dark_blue_golden_index_sun[0]>=0)
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("%s - %02d:%02d",
|
||||
char_label_disturbance_sun,
|
||||
g_date_time_get_hour (date_time_dark_end),
|
||||
g_date_time_get_minute (date_time_dark_end));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("%s - 23:59",
|
||||
char_label_disturbance_sun);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (elevation_sun < 0)
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("00:00 - 23:59");
|
||||
}
|
||||
else
|
||||
{
|
||||
char_label_disturbance_sun = g_strdup_printf ("--:-- - --:--");
|
||||
}
|
||||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (milky_way->label_disturbance_sun), char_label_disturbance_sun);
|
||||
|
||||
|
||||
date_time_rise_moon = g_date_time_add_minutes (date_time_noon,
|
||||
rise_upper_set_index_moon[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set_moon = g_date_time_add_minutes (date_time_noon,
|
||||
rise_upper_set_index_moon[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
char_label_disturbance_moon = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (date_time_set_moon),
|
||||
g_date_time_get_minute (date_time_set_moon),
|
||||
g_date_time_get_hour (date_time_rise_moon),
|
||||
g_date_time_get_minute (date_time_rise_moon));
|
||||
gtk_label_set_text (GTK_LABEL (milky_way->label_disturbance_moon), char_label_disturbance_moon);
|
||||
|
||||
|
||||
date_time_rise_milky_way = g_date_time_add_minutes (date_time_noon,
|
||||
rise_upper_set_index_milky_way[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
|
|
@ -39,7 +39,8 @@ picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
|
|||
int *dark_blue_golden_index_sun,
|
||||
int *rise_upper_set_index_moon,
|
||||
int *rise_upper_set_index_milky_way,
|
||||
double illumination_moon);
|
||||
double elevation_sun,
|
||||
double elevation_moon);
|
||||
|
||||
|
||||
PicplannerMilkyway *picplanner_milkyway_new ();
|
||||
|
|
|
@ -147,7 +147,8 @@
|
|||
<property name="margin-bottom">5</property>
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title">Disturbance by Sun</property>
|
||||
<property name="title">No disturbance by Sun</property>
|
||||
<property name="subtitle">Begin - End</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
@ -164,7 +165,8 @@
|
|||
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title">Disturbance by Moon</property>
|
||||
<property name="title">No disturbance by Moon</property>
|
||||
<property name="subtitle">Begin - End</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
|
|
|
@ -349,14 +349,15 @@ calculate_positions (PicplannerWindow *window)
|
|||
array_coordinates_milky_way,
|
||||
rise_upper_set_index_milky_way);
|
||||
|
||||
/*
|
||||
|
||||
picplanner_milky_way_set_disturbance (PICPLANNER_MILKYWAY (window->milky_way_box),
|
||||
date_time_noon,
|
||||
dark_blue_golden_index,
|
||||
rise_upper_set_index_moon,
|
||||
rise_upper_set_index_milky_way,
|
||||
illumination_moon);
|
||||
*/
|
||||
array_coordinates_sun[NUM_DATA_POINTS+1],
|
||||
array_coordinates_moon[NUM_DATA_POINTS+1]);
|
||||
|
||||
|
||||
/*
|
||||
* Update Shumate Map
|
||||
|
|
Ładowanie…
Reference in New Issue