kopia lustrzana https://gitlab.com/Zwarf/picplanner
Error handling if no (moon and milky way) rise and set can be seen during the day
rodzic
ccf387101b
commit
0ef3a9653c
|
@ -27,7 +27,7 @@ This small program should answer all these questions.
|
|||
```diff
|
||||
-1. Automatic timezone selection is not very precise. For the timezone selection libgweather is used and the offline list has just a limited amount of datapoints which can result in a selection of the wrong timezone.
|
||||
-2. Map has some zoome levels which appear blurred. This could might be solved by switching to another renderer.
|
||||
-3. Docking PicPlanner to one half of the screen can result in a wrong, buggy view. I have no idea how this can happen.
|
||||
-3. Docking PicPlanner to one half of the screen can result in a wrong, buggy view. Probably a problem with Xorg. Does not appear with Wayland.
|
||||
```
|
||||
|
||||
## Formulas used
|
||||
|
|
|
@ -42,12 +42,26 @@ picplanner_milky_way_set_rise_upper_set (PicplannerMilkyway *milky_way,
|
|||
date_time_upper = g_date_time_add_minutes (date_time, index_rise_upper_set[1]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set = g_date_time_add_minutes (date_time, index_rise_upper_set[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
/*
|
||||
* Rise
|
||||
*/
|
||||
if (index_rise_upper_set[0]>0)
|
||||
{
|
||||
char_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_rise_time = g_strdup_printf ("--:--");
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
/*
|
||||
* Upper culmination
|
||||
*/
|
||||
char_upper_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_upper),
|
||||
g_date_time_get_minute (date_time_upper));
|
||||
|
@ -56,11 +70,22 @@ picplanner_milky_way_set_rise_upper_set (PicplannerMilkyway *milky_way,
|
|||
char_upper_elevation = g_strdup_printf ("Elevation: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[1]*2+1]);
|
||||
|
||||
char_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
/*
|
||||
* Set
|
||||
*/
|
||||
if (index_rise_upper_set[2]>0)
|
||||
{
|
||||
char_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_set_time = g_strdup_printf ("--:--");
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (milky_way->label_rise_time), char_rise_time);
|
||||
gtk_label_set_text (GTK_LABEL (milky_way->label_rise_azimuth), char_rise_azimuth);
|
||||
|
|
|
@ -43,12 +43,26 @@ picplanner_moon_set_rise_upper_set (PicplannerMoon *moon,
|
|||
date_time_upper = g_date_time_add_minutes (date_time, index_rise_upper_set[1]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set = g_date_time_add_minutes (date_time, index_rise_upper_set[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
/*
|
||||
* Rise
|
||||
*/
|
||||
if (index_rise_upper_set[0]>0)
|
||||
{
|
||||
char_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_rise_time = g_strdup_printf ("--:--");
|
||||
char_rise_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
/*
|
||||
* Upper culmination
|
||||
*/
|
||||
char_upper_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_upper),
|
||||
g_date_time_get_minute (date_time_upper));
|
||||
|
@ -57,11 +71,22 @@ picplanner_moon_set_rise_upper_set (PicplannerMoon *moon,
|
|||
char_upper_elevation = g_strdup_printf ("Elevation: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[1]*2+1]);
|
||||
|
||||
char_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
/*
|
||||
* Set
|
||||
*/
|
||||
if (index_rise_upper_set[2]>0)
|
||||
{
|
||||
char_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_set_time = g_strdup_printf ("--:--");
|
||||
char_set_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (moon->label_rise_time), char_rise_time);
|
||||
gtk_label_set_text (GTK_LABEL (moon->label_rise_azimuth), char_rise_azimuth);
|
||||
|
|
|
@ -57,11 +57,19 @@ picplanner_sun_set_rise_upper_set (PicplannerSun *sun,
|
|||
/*
|
||||
* Morning
|
||||
*/
|
||||
char_morning_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_morning_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
if (index_rise_upper_set[0]>1)
|
||||
{
|
||||
char_morning_rise_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
char_morning_rise_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[0]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_morning_rise_time = g_strdup_printf ("--:--");
|
||||
char_morning_rise_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
/*
|
||||
* Upper Culmination
|
||||
|
@ -77,12 +85,19 @@ picplanner_sun_set_rise_upper_set (PicplannerSun *sun,
|
|||
/*
|
||||
* Evening
|
||||
*/
|
||||
char_evening_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_evening_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
|
||||
if (index_rise_upper_set[2]>0)
|
||||
{
|
||||
char_evening_set_time = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
char_evening_set_azimuth = g_strdup_printf ("Azimuth: %.0f\u00B0",
|
||||
coordinates_array[index_rise_upper_set[2]*2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
char_evening_set_time = g_strdup_printf ("--:--");
|
||||
char_evening_set_azimuth = g_strdup_printf ("Azimuth: -\u00B0");
|
||||
}
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (sun->label_morning_rise_time), char_morning_rise_time);
|
||||
gtk_label_set_text (GTK_LABEL (sun->label_morning_rise_azimuth), char_morning_rise_azimuth);
|
||||
|
|
Ładowanie…
Reference in New Issue