Add possible milky way visibility

The milky way is best visible during the dark night. However, under certain circumstances it is also possible to make good milky way pictures earlier or during illumination due to the moon.
Therfore, additional information is shown now.
Furthermore, some slight UI changes and comments were made.
merge-requests/3/head
Zwarf 2022-06-24 23:21:15 +02:00
rodzic 0d3f9ce938
commit 5aa1c98aae
5 zmienionych plików z 85 dodań i 1 usunięć

Wyświetl plik

@ -164,6 +164,10 @@ picplanner_application_show_preferences (GSimpleAction *action,
gtk_window_present (GTK_WINDOW (prefs));
}
/*
* Inverte the color scheme (light/dark) dependent on which scheme is set globaly.
*/
static void
picplanner_inverte_scheme (GSettings *settings,
gchar *key,

Wyświetl plik

@ -38,6 +38,7 @@ struct _PicplannerMilkyway
GtkWidget *label_set_time;
GtkWidget *label_set_azimuth;
GtkWidget *label_disturbance_sun;
GtkWidget *label_possible_disturbance_sun;
GtkWidget *label_disturbance_moon;
GtkWidget *label_visibility_time;
};
@ -152,12 +153,16 @@ picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
g_print("Elevation Sun: %f, Elevation Moon: %f", elevation_sun, elevation_moon);
char *char_label_disturbance_sun;
char *char_label_possible_disturbance_sun;
char *char_label_disturbance_moon;
char *char_label_visibility_time;
GDateTime *date_time_dark_end;
GDateTime *date_time_dark_begin;
GDateTime *date_time_blue_hour_begin_morning;
GDateTime *date_time_blue_hour_end_evening;
GDateTime *date_time_rise_moon;
GDateTime *date_time_set_moon;
@ -209,6 +214,52 @@ picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
gtk_label_set_text (GTK_LABEL (milky_way->label_disturbance_sun), char_label_disturbance_sun);
date_time_blue_hour_begin_morning = g_date_time_add_minutes (date_time_noon,
dark_blue_golden_index_sun[1]*24*60/NUM_DATA_POINTS-12*60);
date_time_blue_hour_end_evening = g_date_time_add_minutes (date_time_noon,
dark_blue_golden_index_sun[6]*24*60/NUM_DATA_POINTS-12*60);
if (dark_blue_golden_index_sun[1]>=0 || dark_blue_golden_index_sun[6]>=0)
{
if (dark_blue_golden_index_sun[6]>=0)
{
char_label_possible_disturbance_sun = g_strdup_printf ("%02d:%02d",
g_date_time_get_hour (date_time_blue_hour_end_evening),
g_date_time_get_minute (date_time_blue_hour_end_evening));
}
else
{
char_label_possible_disturbance_sun = g_strdup_printf ("00:00");
}
if (dark_blue_golden_index_sun[1]>=0)
{
char_label_possible_disturbance_sun = g_strdup_printf ("%s - %02d:%02d",
char_label_possible_disturbance_sun,
g_date_time_get_hour (date_time_blue_hour_begin_morning),
g_date_time_get_minute (date_time_blue_hour_begin_morning));
}
else
{
char_label_possible_disturbance_sun = g_strdup_printf ("%s - 23:59",
char_label_possible_disturbance_sun);
}
}
else
{
if (elevation_sun < 0)
{
char_label_possible_disturbance_sun = g_strdup_printf ("00:00 - 23:59");
}
else
{
char_label_possible_disturbance_sun = g_strdup_printf ("--:-- - --:--");
}
}
gtk_label_set_text (GTK_LABEL (milky_way->label_possible_disturbance_sun), char_label_possible_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,
@ -282,6 +333,7 @@ picplanner_milkyway_class_init (PicplannerMilkywayClass *class)
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_set_time);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_set_azimuth);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_disturbance_sun);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_possible_disturbance_sun);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_disturbance_moon);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_visibility_time);
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMilkyway, label_date);

Wyświetl plik

@ -194,7 +194,7 @@
<child>
<object class="AdwActionRow">
<property name="title">Milky Way visibility time</property>
<property name="title">Milky Way clearly visible between</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
@ -209,6 +209,24 @@
</object>
</child>
<child>
<object class="AdwActionRow">
<property name="title">Milky Way eventually visible between</property>
<property name="subtitle">Begin - End</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="valign">center</property>
<child>
<object class="GtkLabel" id="label_possible_disturbance_sun">
<property name="label">Feature will be available soon!</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>

Wyświetl plik

@ -131,6 +131,7 @@ picplanner_update_date_time (PicplannerOverview *overview)
/*
* Save the information into the date_time variable.
* The time zone is either selected automatically or taken from the input spin button in the preference dialog.
*/
if (!g_settings_get_boolean (overview->settings, "time-zone-manual"))
{

Wyświetl plik

@ -19,6 +19,9 @@
<object class="GtkLabel">
<property name="margin-top">10</property>
<property name="label">Data settings</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
@ -68,6 +71,9 @@
<object class="GtkLabel">
<property name="margin-top">10</property>
<property name="label">Map Settings</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>
@ -114,6 +120,9 @@
<object class="GtkLabel">
<property name="margin-top">10</property>
<property name="label">General Appearance</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
</object>
</child>
<child>