kopia lustrzana https://gitlab.com/Zwarf/picplanner
Error handling if no sunset, sunset, etc. can be seen during the day
rodzic
20f03e1094
commit
436e9f1ebb
|
@ -16,6 +16,15 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Save window state (position and size)
|
||||
* Startup loading time error?
|
||||
* Docking on side error?
|
||||
* Remove first-run or make a first run info dialog?
|
||||
* Add title if used in small view
|
||||
*/
|
||||
|
||||
#include "picplanner-application.h"
|
||||
#include "window/picplanner-window.h"
|
||||
#include "window/preferences-dialog/preferences-dialog.h"
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
/* TODO:
|
||||
* Error handling for no rise and set
|
||||
* Visibility feature
|
||||
*/
|
||||
|
||||
#include "milky-way-view.h"
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/* TODO:
|
||||
* Error handling for no rise and set
|
||||
* Illumination
|
||||
*/
|
||||
|
||||
|
||||
#include "moon-view.h"
|
||||
|
||||
|
||||
|
|
|
@ -182,16 +182,31 @@ picplanner_overview_set_current_coordinates_sun (PicplannerOverview *overview,
|
|||
g_date_time_get_day_of_month (overview->date_time),
|
||||
12, 0, 0);
|
||||
|
||||
|
||||
date_time_rise = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_sun_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
if (rise_upper_set_index[0]>0)
|
||||
{
|
||||
char_sun_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_sun_rise = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_sun_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
if (rise_upper_set_index[2]>0)
|
||||
{
|
||||
char_sun_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_sun_set = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_elevation_sun = g_strdup_printf ("%.0f\u00B0", array_coordinates_sun[current_index*2+1]);
|
||||
char_azimuth_sun = g_strdup_printf ("%.0f\u00B0", array_coordinates_sun[current_index*2]);
|
||||
|
@ -234,13 +249,27 @@ picplanner_overview_set_current_coordinates_moon (PicplannerOverview *overview,
|
|||
date_time_rise = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_moon_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
if (rise_upper_set_index[0]>0)
|
||||
{
|
||||
char_moon_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_moon_rise = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_moon_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
if (rise_upper_set_index[2]>0)
|
||||
{
|
||||
char_moon_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_moon_set = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_elevation_moon = g_strdup_printf ("%.0f\u00B0", array_coordinates_moon[current_index*2+1]);
|
||||
char_azimuth_moon = g_strdup_printf ("%.0f\u00B0", array_coordinates_moon[current_index*2]);
|
||||
|
@ -284,13 +313,27 @@ picplanner_overview_set_current_coordinates_milky_way (PicplannerOverview *overv
|
|||
date_time_rise = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[0]*24*60/NUM_DATA_POINTS-12*60);
|
||||
date_time_set = g_date_time_add_minutes (date_time_noon, rise_upper_set_index[2]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_milky_way_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
if (rise_upper_set_index[0]>0)
|
||||
{
|
||||
char_milky_way_rise = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_rise),
|
||||
g_date_time_get_minute (date_time_rise));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_milky_way_rise = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_milky_way_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
if (rise_upper_set_index[2]>0)
|
||||
{
|
||||
char_milky_way_set = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (date_time_set),
|
||||
g_date_time_get_minute (date_time_set));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_milky_way_set = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_elevation_milky_way = g_strdup_printf ("%.0f\u00B00", array_coordinates_milky_way[current_index*2+1]);
|
||||
char_azimuth_milky_way = g_strdup_printf ("%.0f\u00B00", array_coordinates_milky_way[current_index*2]);
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
/*
|
||||
* TODO:
|
||||
* TimeZone manual mode?
|
||||
*/
|
||||
|
||||
|
||||
#include "preferences-dialog.h"
|
||||
|
||||
|
||||
|
|
|
@ -138,33 +138,127 @@ picplanner_sun_set_dark_blue_golden (PicplannerSun *sun,
|
|||
dark_night_evening_begin = g_date_time_add_minutes (date_time,
|
||||
index_dark_blue_golden[7]*24*60/NUM_DATA_POINTS-12*60);
|
||||
|
||||
char_dark_night_morning = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (dark_night_morning_end),
|
||||
g_date_time_get_minute (dark_night_morning_end));
|
||||
char_blue_hour_morning = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (blue_hour_morning_begin),
|
||||
g_date_time_get_minute (blue_hour_morning_begin),
|
||||
g_date_time_get_hour (blue_hour_golden_hour_morning_switch),
|
||||
g_date_time_get_minute (blue_hour_golden_hour_morning_switch));
|
||||
char_golden_hour_morning = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (blue_hour_golden_hour_morning_switch),
|
||||
g_date_time_get_minute (blue_hour_golden_hour_morning_switch),
|
||||
g_date_time_get_hour (golden_hour_morning_end),
|
||||
g_date_time_get_minute (golden_hour_morning_end));
|
||||
/*
|
||||
* Morning events
|
||||
*/
|
||||
if (index_dark_blue_golden[0]>0)
|
||||
{
|
||||
char_dark_night_morning = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (dark_night_morning_end),
|
||||
g_date_time_get_minute (dark_night_morning_end));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_dark_night_morning = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[1]>0)
|
||||
{
|
||||
char_blue_hour_morning = g_strdup_printf ("%02d:%02d -",
|
||||
g_date_time_get_hour (blue_hour_morning_begin),
|
||||
g_date_time_get_minute (blue_hour_morning_begin));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_blue_hour_morning = g_strdup_printf ("--:-- -");
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[2]>0)
|
||||
{
|
||||
char_blue_hour_morning = g_strdup_printf ("%s %02d:%02d",
|
||||
char_blue_hour_morning,
|
||||
g_date_time_get_hour (blue_hour_golden_hour_morning_switch),
|
||||
g_date_time_get_minute (blue_hour_golden_hour_morning_switch));
|
||||
char_golden_hour_morning = g_strdup_printf ("%02d:%02d -",
|
||||
g_date_time_get_hour (blue_hour_golden_hour_morning_switch),
|
||||
g_date_time_get_minute (blue_hour_golden_hour_morning_switch));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_blue_hour_morning = g_strdup_printf ("%s --:--", char_blue_hour_morning);
|
||||
char_golden_hour_morning = g_strdup_printf ("--:-- -");
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[3]>0)
|
||||
{
|
||||
char_golden_hour_morning = g_strdup_printf ("%s %02d:%02d",
|
||||
char_golden_hour_morning,
|
||||
g_date_time_get_hour (golden_hour_morning_end),
|
||||
g_date_time_get_minute (golden_hour_morning_end));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_golden_hour_morning = g_strdup_printf ("%s --:--", char_golden_hour_morning);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Evening events
|
||||
*/
|
||||
if (index_dark_blue_golden[4]>0)
|
||||
{
|
||||
char_golden_hour_evening = g_strdup_printf ("%02d:%02d -",
|
||||
g_date_time_get_hour (golden_hour_evening_begin),
|
||||
g_date_time_get_minute (golden_hour_evening_begin));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_golden_hour_evening = g_strdup_printf ("--:-- -");
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[5]>0)
|
||||
{
|
||||
char_golden_hour_evening = g_strdup_printf ("%s %02d:%02d",
|
||||
char_golden_hour_evening,
|
||||
g_date_time_get_hour (golden_hour_blue_hour_evening_switch),
|
||||
g_date_time_get_minute (golden_hour_blue_hour_evening_switch));
|
||||
char_blue_hour_evening = g_strdup_printf ("%02d:%02d -",
|
||||
g_date_time_get_hour (golden_hour_blue_hour_evening_switch),
|
||||
g_date_time_get_minute (golden_hour_blue_hour_evening_switch));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
char_golden_hour_evening = g_strdup_printf ("%s --:--",
|
||||
char_golden_hour_evening);
|
||||
char_blue_hour_evening = g_strdup_printf ("--:-- -");
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[6]>0)
|
||||
{
|
||||
char_blue_hour_evening = g_strdup_printf ("%s %02d:%02d",
|
||||
char_blue_hour_evening,
|
||||
g_date_time_get_hour (blue_hour_evening_end),
|
||||
g_date_time_get_minute (blue_hour_evening_end));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
char_blue_hour_evening = g_strdup_printf ("%s --:--",
|
||||
char_blue_hour_evening);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (index_dark_blue_golden[7]>0)
|
||||
{
|
||||
char_dark_night_evening = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (dark_night_evening_begin),
|
||||
g_date_time_get_minute (dark_night_evening_begin));
|
||||
}
|
||||
else
|
||||
{
|
||||
char_dark_night_evening = g_strdup_printf ("--:--");
|
||||
}
|
||||
|
||||
char_golden_hour_evening = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (golden_hour_evening_begin),
|
||||
g_date_time_get_minute (golden_hour_evening_begin),
|
||||
g_date_time_get_hour (golden_hour_blue_hour_evening_switch),
|
||||
g_date_time_get_minute (golden_hour_blue_hour_evening_switch));
|
||||
char_blue_hour_evening = g_strdup_printf ("%02d:%02d - %02d:%02d",
|
||||
g_date_time_get_hour (golden_hour_blue_hour_evening_switch),
|
||||
g_date_time_get_minute (golden_hour_blue_hour_evening_switch),
|
||||
g_date_time_get_hour (blue_hour_evening_end),
|
||||
g_date_time_get_minute (blue_hour_evening_end));
|
||||
char_dark_night_evening = g_strdup_printf ("%02d:%02d",
|
||||
g_date_time_get_hour (dark_night_evening_begin),
|
||||
g_date_time_get_minute (dark_night_evening_begin));
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (sun->label_morning_dark), char_dark_night_morning);
|
||||
gtk_label_set_text (GTK_LABEL (sun->label_morning_blue), char_blue_hour_morning);
|
||||
|
|
Ładowanie…
Reference in New Issue