kopia lustrzana https://gitlab.com/Zwarf/picplanner
Add date label on top of sun, moon and milky way few
rodzic
22b91556ed
commit
d28ad4b7de
|
@ -27,6 +27,9 @@
|
|||
struct _PicplannerMilkyway
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkWidget *label_date;
|
||||
|
||||
GtkWidget *label_rise_time;
|
||||
GtkWidget *label_rise_azimuth;
|
||||
GtkWidget *label_upper_time;
|
||||
|
@ -42,6 +45,22 @@ struct _PicplannerMilkyway
|
|||
G_DEFINE_TYPE (PicplannerMilkyway, picplanner_milkyway, GTK_TYPE_BOX)
|
||||
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_date (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time)
|
||||
{
|
||||
char *char_label_date;
|
||||
|
||||
char_label_date = g_strdup_printf ("Date: %d.%d.%d",
|
||||
g_date_time_get_day_of_month (date_time),
|
||||
g_date_time_get_month (date_time),
|
||||
g_date_time_get_year (date_time));
|
||||
gtk_label_set_text (GTK_LABEL (milky_way->label_date), char_label_date);
|
||||
|
||||
g_free (char_label_date);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_rise_upper_set (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time,
|
||||
|
@ -265,6 +284,7 @@ picplanner_milkyway_class_init (PicplannerMilkywayClass *class)
|
|||
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_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);
|
||||
}
|
||||
|
||||
PicplannerMilkyway *
|
||||
|
|
|
@ -27,20 +27,26 @@ G_BEGIN_DECLS
|
|||
#define PICPLANNER_MILKYWAY_TYPE (picplanner_milkyway_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (PicplannerMilkyway, picplanner_milkyway, PICPLANNER, MILKYWAY, GtkBox)
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_rise_upper_set (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time_noon,
|
||||
int *dark_blue_golden_index_sun,
|
||||
int *rise_upper_set_index_moon,
|
||||
int *rise_upper_set_index_milky_way,
|
||||
double elevation_sun,
|
||||
double elevation_moon);
|
||||
picplanner_milky_way_set_date (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time);
|
||||
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_rise_upper_set (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
|
||||
void
|
||||
picplanner_milky_way_set_disturbance (PicplannerMilkyway *milky_way,
|
||||
GDateTime *date_time_noon,
|
||||
int *dark_blue_golden_index_sun,
|
||||
int *rise_upper_set_index_moon,
|
||||
int *rise_upper_set_index_milky_way,
|
||||
double elevation_sun,
|
||||
double elevation_moon);
|
||||
|
||||
|
||||
PicplannerMilkyway *picplanner_milkyway_new ();
|
||||
|
|
|
@ -15,6 +15,16 @@
|
|||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_date">
|
||||
<property name="label">Date: 01.01.2000</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-top">10</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Important Positions</property>
|
||||
|
|
|
@ -29,6 +29,9 @@
|
|||
struct _PicplannerMoon
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkWidget *label_date;
|
||||
|
||||
GtkWidget *label_rise_time;
|
||||
GtkWidget *label_rise_azimuth;
|
||||
GtkWidget *label_upper_time;
|
||||
|
@ -43,6 +46,22 @@ struct _PicplannerMoon
|
|||
G_DEFINE_TYPE (PicplannerMoon, picplanner_moon, GTK_TYPE_BOX)
|
||||
|
||||
|
||||
void
|
||||
picplanner_moon_set_date (PicplannerMoon *moon,
|
||||
GDateTime *date_time)
|
||||
{
|
||||
char *char_label_date;
|
||||
|
||||
char_label_date = g_strdup_printf ("Date: %d.%d.%d",
|
||||
g_date_time_get_day_of_month (date_time),
|
||||
g_date_time_get_month (date_time),
|
||||
g_date_time_get_year (date_time));
|
||||
gtk_label_set_text (GTK_LABEL (moon->label_date), char_label_date);
|
||||
|
||||
g_free (char_label_date);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
picplanner_moon_set_rise_upper_set (PicplannerMoon *moon,
|
||||
GDateTime *date_time,
|
||||
|
@ -158,6 +177,7 @@ picplanner_moon_class_init (PicplannerMoonClass *class)
|
|||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMoon, label_set_azimuth);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMoon, label_illumination);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMoon, label_phase);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerMoon, label_date);
|
||||
}
|
||||
|
||||
PicplannerMoon *
|
||||
|
|
|
@ -29,15 +29,20 @@ G_DECLARE_FINAL_TYPE (PicplannerMoon, picplanner_moon, PICPLANNER, MOON, GtkBox)
|
|||
|
||||
|
||||
void
|
||||
picplanner_moon_set_rise_upper_set (PicplannerMoon *moon,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
picplanner_moon_set_date (PicplannerMoon *moon,
|
||||
GDateTime *date_time);
|
||||
|
||||
|
||||
void
|
||||
picplanner_moon_set_illumination_intensity (PicplannerMoon *moon,
|
||||
double illumination,
|
||||
char *phase);
|
||||
picplanner_moon_set_rise_upper_set (PicplannerMoon *moon,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
|
||||
void
|
||||
picplanner_moon_set_illumination_intensity (PicplannerMoon *moon,
|
||||
double illumination,
|
||||
char *phase);
|
||||
|
||||
|
||||
PicplannerMoon *picplanner_moon_new ();
|
||||
|
|
|
@ -15,6 +15,16 @@
|
|||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_date">
|
||||
<property name="label">Date: 01.01.2000</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-top">10</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Important Positions</property>
|
||||
|
|
|
@ -270,6 +270,13 @@ calculate_positions (PicplannerWindow *window)
|
|||
rise_upper_set_index_sun = picplanner_get_index_rise_upper_set (array_coordinates_sun);
|
||||
dark_blue_golden_index = picplanner_get_index_dark_blue_golden (array_coordinates_sun);
|
||||
|
||||
picplanner_sun_set_date (PICPLANNER_SUN (window->sun_box),
|
||||
date_time_noon);
|
||||
picplanner_moon_set_date (PICPLANNER_MOON (window->moon_box),
|
||||
date_time_noon);
|
||||
picplanner_milky_way_set_date (PICPLANNER_MILKYWAY (window->milky_way_box),
|
||||
date_time_noon);
|
||||
|
||||
picplanner_overview_set_current_coordinates_sun (PICPLANNER_OVERVIEW (window->overview_box),
|
||||
array_coordinates_sun,
|
||||
rise_upper_set_index_sun,
|
||||
|
|
|
@ -21,13 +21,16 @@
|
|||
|
||||
|
||||
/*
|
||||
* TODO: Azimuth is "wrong" on the south half of the earth. Measuring from North!
|
||||
* TODO: Add lower culmination for night photography
|
||||
*/
|
||||
|
||||
|
||||
struct _PicplannerSun
|
||||
{
|
||||
GtkBox parent_instance;
|
||||
|
||||
GtkWidget *label_date;
|
||||
|
||||
GtkWidget *label_morning_rise_time;
|
||||
GtkWidget *label_morning_rise_azimuth;
|
||||
GtkWidget *label_upper_time;
|
||||
|
@ -48,6 +51,21 @@ struct _PicplannerSun
|
|||
G_DEFINE_TYPE (PicplannerSun, picplanner_sun, GTK_TYPE_BOX)
|
||||
|
||||
|
||||
void
|
||||
picplanner_sun_set_date (PicplannerSun *sun,
|
||||
GDateTime *date_time)
|
||||
{
|
||||
char *char_label_date;
|
||||
|
||||
char_label_date = g_strdup_printf ("Date: %d.%d.%d",
|
||||
g_date_time_get_day_of_month (date_time),
|
||||
g_date_time_get_month (date_time),
|
||||
g_date_time_get_year (date_time));
|
||||
gtk_label_set_text (GTK_LABEL (sun->label_date), char_label_date);
|
||||
|
||||
g_free (char_label_date);
|
||||
}
|
||||
|
||||
void
|
||||
picplanner_sun_set_rise_upper_set (PicplannerSun *sun,
|
||||
GDateTime *date_time,
|
||||
|
@ -337,6 +355,7 @@ picplanner_sun_class_init (PicplannerSunClass *class)
|
|||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerSun, label_evening_golden);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerSun, label_evening_blue);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerSun, label_evening_dark);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), PicplannerSun, label_date);
|
||||
}
|
||||
|
||||
PicplannerSun *
|
||||
|
|
|
@ -27,17 +27,20 @@ G_BEGIN_DECLS
|
|||
#define PICPLANNER_SUN_TYPE (picplanner_sun_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (PicplannerSun, picplanner_sun, PICPLANNER, SUN, GtkBox)
|
||||
|
||||
void
|
||||
picplanner_sun_set_date (PicplannerSun *sun,
|
||||
GDateTime *date_time);
|
||||
|
||||
void
|
||||
picplanner_sun_set_rise_upper_set (PicplannerSun *sun,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
picplanner_sun_set_rise_upper_set (PicplannerSun *sun,
|
||||
GDateTime *date_time,
|
||||
double *coordinates_array,
|
||||
int *index_rise_upper_set);
|
||||
|
||||
void
|
||||
picplanner_sun_set_dark_blue_golden (PicplannerSun *sun,
|
||||
GDateTime *date_time,
|
||||
int *index_dark_blue_golden);
|
||||
picplanner_sun_set_dark_blue_golden (PicplannerSun *sun,
|
||||
GDateTime *date_time,
|
||||
int *index_dark_blue_golden);
|
||||
|
||||
|
||||
PicplannerSun *picplanner_sun_new ();
|
||||
|
|
|
@ -14,6 +14,16 @@
|
|||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label_date">
|
||||
<property name="label">Date: 01.01.2000</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-top">10</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="ultrabold"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Morning</property>
|
||||
|
|
Ładowanie…
Reference in New Issue