Compare commits
No commits in common. "1508ffc620875ff2bcc4e6bf016e571f71a01c2f" and "a332f3c3fbfe241098cc0c63d88a0e489b75d5d5" have entirely different histories.
1508ffc620
...
a332f3c3fb
|
@ -56,6 +56,7 @@ void fsm_set_exec_edit (int value);
|
||||||
void fsm_set_state_rules_data (int value);
|
void fsm_set_state_rules_data (int value);
|
||||||
void fsm_set_store_restore_reset (int target, int value);
|
void fsm_set_store_restore_reset (int target, int value);
|
||||||
|
|
||||||
|
void fsm_reset_all_situations_transparencies_at_value (int value); // provisoire...
|
||||||
|
|
||||||
bool fsm_get_preferences_state ();
|
bool fsm_get_preferences_state ();
|
||||||
void fsm_set_preferences_state (bool value);
|
void fsm_set_preferences_state (bool value);
|
||||||
|
|
|
@ -34,7 +34,3 @@
|
||||||
|
|
||||||
void pref_set_store_restore_reset (int choice, int value);
|
void pref_set_store_restore_reset (int choice, int value);
|
||||||
const char get_button_icon_name (int n);
|
const char get_button_icon_name (int n);
|
||||||
|
|
||||||
void fsm_reset_all_situations_transparencies_at_value (int value); // provisoire...
|
|
||||||
|
|
||||||
void *prefer_add_measure (char *measure_name);
|
|
||||||
|
|
|
@ -144,6 +144,3 @@ void on_start_new_measure (GtkWidget *btt_new_measure, gpointer data);
|
||||||
void on_select_rules_first (GtkWidget *btt_new_measure, gpointer data);
|
void on_select_rules_first (GtkWidget *btt_new_measure, gpointer data);
|
||||||
void on_measure_depends_on_a_single_event (GtkWidget *btt, gpointer data);
|
void on_measure_depends_on_a_single_event (GtkWidget *btt, gpointer data);
|
||||||
void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data);
|
void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data);
|
||||||
void on_measure_single_event_occurences_nb (GtkWidget *btt, gpointer data);
|
|
||||||
void on_measure_single_event_occurences_dates (GtkWidget *btt, gpointer data);
|
|
||||||
|
|
||||||
|
|
|
@ -257,5 +257,3 @@ void *widget_measure_do_select_rules_first();
|
||||||
void *widget_measure_do_depends_on_one_or_two_events();
|
void *widget_measure_do_depends_on_one_or_two_events();
|
||||||
void *widget_measure_do_depends_on_a_single_event();
|
void *widget_measure_do_depends_on_a_single_event();
|
||||||
void *widget_measure_do_depends_on_two_events();
|
void *widget_measure_do_depends_on_two_events();
|
||||||
void *widget_measure_single_event_occurences_nb();
|
|
||||||
void *widget_measure_single_event_occurences_dates();
|
|
||||||
|
|
30
src/fsm.c
30
src/fsm.c
|
@ -75,6 +75,23 @@ void fsm_set_state_rules_data (int choice)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ------------------------- O B J E C T S ------------------------------//
|
||||||
|
// >> transferred to prefer.c
|
||||||
|
|
||||||
|
|
||||||
|
// ---------------------- S I T U A T I O N S ---------------------------//
|
||||||
|
|
||||||
|
static int reset_situations_to_value = -1;
|
||||||
|
|
||||||
|
void fsm_reset_all_situations_transparencies_at_value (int value)
|
||||||
|
{
|
||||||
|
debug_printing (reset_situations_to_value, value, 3);
|
||||||
|
// SITUATIONS_box_RESTORE_VALUES is sub_automaton 3
|
||||||
|
reset_situations_to_value = value;
|
||||||
|
widget_reset_all_situations_transparencies_to_value (value);
|
||||||
|
preferences_have_been_modified = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* D E B U G G E R S */
|
/* D E B U G G E R S */
|
||||||
|
@ -99,8 +116,8 @@ static void debug_printing (int choice, int value, int sub_automaton)
|
||||||
tab_0 [choice_EXEC_EDIT],
|
tab_0 [choice_EXEC_EDIT],
|
||||||
tab_1 [choice]);
|
tab_1 [choice]);
|
||||||
break;
|
break;
|
||||||
case (2) : break;
|
case (2) : printf("fsm_set_store_restore_reset >> prefer.c\n"); break;
|
||||||
case (3) : break;
|
case (3) : printf("fsm_reset_all_situations_transparencies_at_value : %3d\n", value); break;
|
||||||
|
|
||||||
default : printf("default in automaton.debug_printing()\n");
|
default : printf("default in automaton.debug_printing()\n");
|
||||||
}
|
}
|
||||||
|
@ -112,12 +129,3 @@ static void debug_printing (int choice, int value, int sub_automaton)
|
||||||
/* N O N E X C L U S I V E S E L E C T I O N S */
|
/* N O N E X C L U S I V E S E L E C T I O N S */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
// ?
|
// ?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* M E A S U R E S */
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
34
src/prefer.c
34
src/prefer.c
|
@ -58,7 +58,6 @@ static const char *icon_name [3] = {
|
||||||
// transtypage vers un pointeur depuis un entier de taille différente vvv TODO
|
// transtypage vers un pointeur depuis un entier de taille différente vvv TODO
|
||||||
const char *get_button_icon_name (int n) {return (const char*) icon_name [n];}
|
const char *get_button_icon_name (int n) {return (const char*) icon_name [n];}
|
||||||
|
|
||||||
// ------------------------- O B J E C T S ------------------------------//
|
|
||||||
|
|
||||||
struct preferences { int transparency [n_objects]; }; // may become a long, long list...
|
struct preferences { int transparency [n_objects]; }; // may become a long, long list...
|
||||||
struct preferences *pref_jean = NULL; // TODO (voir graphics_init(...))
|
struct preferences *pref_jean = NULL; // TODO (voir graphics_init(...))
|
||||||
|
@ -70,19 +69,19 @@ void pref_set_store_restore_reset (int choice, int value)
|
||||||
{
|
{
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case (STORE) :
|
case (STORE) :
|
||||||
printf("Objects transparencies STORE (value = %3d) (see prefer.c)\n", value);
|
printf("STORE (value = %d)\n", value);
|
||||||
for (int i = 0; i < n_objects; i++) {
|
for (int i = 0; i < n_objects; i++) {
|
||||||
p [i] = widget_get_object_transparency (i);
|
p [i] = widget_get_object_transparency (i);
|
||||||
widget_set_object_transparency_to_value (i, p [i]);
|
widget_set_object_transparency_to_value (i, p [i]);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case (RESTORE) :
|
case (RESTORE) :
|
||||||
printf("Objects transparencies RESTORE (value = %3d) (see prefer.c)\n", value);
|
printf("RESTORE (value = %d)\n", value);
|
||||||
for (int i = 0; i < n_objects; i++)
|
for (int i = 0; i < n_objects; i++)
|
||||||
widget_set_object_transparency_to_value (i, p [i]);
|
widget_set_object_transparency_to_value (i, p [i]);
|
||||||
break;
|
break;
|
||||||
case (RESET) :
|
case (RESET) :
|
||||||
printf("Objects transparencies RESET (value = %3d) (see prefer.c)\n", value);
|
printf("RESET (value = %d)\n", value);
|
||||||
for (int i = 0; i < n_objects; i++)
|
for (int i = 0; i < n_objects; i++)
|
||||||
widget_set_object_transparency_to_value (i, value); // i * 4 // rand() % 127
|
widget_set_object_transparency_to_value (i, value); // i * 4 // rand() % 127
|
||||||
break;
|
break;
|
||||||
|
@ -92,30 +91,3 @@ void pref_set_store_restore_reset (int choice, int value)
|
||||||
fsm_set_preferences_state (TRUE);
|
fsm_set_preferences_state (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ---------------------- S I T U A T I O N S ---------------------------//
|
|
||||||
|
|
||||||
static int reset_situations_to_value = -1;
|
|
||||||
|
|
||||||
void fsm_reset_all_situations_transparencies_at_value (int value)
|
|
||||||
{
|
|
||||||
printf("reset_all_situations_transparencies_at_value %3d (see prefer.c)\n", value);
|
|
||||||
reset_situations_to_value = value;
|
|
||||||
widget_reset_all_situations_transparencies_to_value (value);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
|
||||||
/* M E A S U R E S */
|
|
||||||
/******************************************************************************/
|
|
||||||
|
|
||||||
static void *list_measures;
|
|
||||||
|
|
||||||
void *prefer_add_measure (char *measure_name)
|
|
||||||
{
|
|
||||||
printf("prefer_add_measure %p <<< %s (see prefer.c)\n", list_measures, measure_name);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
14
src/signal.c
14
src/signal.c
|
@ -393,17 +393,3 @@ void on_measure_depends_on_two_events (GtkWidget *btt, gpointer data)
|
||||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
||||||
GTK_WIDGET (widget_measure_do_depends_on_two_events()));
|
GTK_WIDGET (widget_measure_do_depends_on_two_events()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_measure_single_event_occurences_nb (GtkWidget *btt, gpointer data)
|
|
||||||
{
|
|
||||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
|
||||||
GTK_WIDGET (widget_measure_single_event_occurences_nb()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void on_measure_single_event_occurences_dates (GtkWidget *btt, gpointer data)
|
|
||||||
{
|
|
||||||
gtk_window_set_child (GTK_WINDOW (widget_get_main_window ()),
|
|
||||||
GTK_WIDGET (widget_measure_single_event_occurences_dates()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,14 @@
|
||||||
#include "../../../include/base.h"
|
#include "../../../include/base.h"
|
||||||
#include "../../../include/signal.h"
|
#include "../../../include/signal.h"
|
||||||
#include "../../../include/widget.h"
|
#include "../../../include/widget.h"
|
||||||
#include "../../../include/prefer.h"
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* M E A S U R E S */
|
/* M E A S U R E S */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
#define PARTITION_MEASURE 40
|
||||||
|
|
||||||
static GtkBox *measure_page;
|
static GtkBox *measure_page;
|
||||||
|
|
||||||
static GtkBox *edit_a_new_measure_box;
|
static GtkBox *edit_a_new_measure_box;
|
||||||
|
@ -53,70 +54,11 @@ static GtkWidget *balance;
|
||||||
static GtkWidget *btt_select_first_of_two;
|
static GtkWidget *btt_select_first_of_two;
|
||||||
static GtkWidget *btt_select_second_of_two;
|
static GtkWidget *btt_select_second_of_two;
|
||||||
|
|
||||||
static GtkBox *select_nb_or_date_box;
|
void *widget_measure_do_depends_on_a_single_event() {printf("measure depends on a single event\n"); return measure_page;}
|
||||||
static GtkWidget *scale;
|
void *widget_measure_do_depends_on_two_events() {printf("measure depends on two events\n"); return measure_page;}
|
||||||
static GtkWidget *btt_select_nb;
|
|
||||||
static GtkWidget *btt_select_date;
|
|
||||||
|
|
||||||
// Measure concerns
|
|
||||||
// - nb of occurences of the rule
|
|
||||||
// - nb of objects / situations before / after > select target
|
|
||||||
// - time (date) of event
|
|
||||||
// - time elapsed between two events
|
|
||||||
// - occurence of events C between events A and B
|
|
||||||
|
|
||||||
// Then, add this new measure to the list of measures
|
|
||||||
|
|
||||||
// Is this measure to be correlated to some others ?
|
|
||||||
|
|
||||||
|
|
||||||
void *widget_measure_single_event_occurences_nb()
|
|
||||||
{
|
|
||||||
printf("measure single_event_occurences_nb\n");
|
|
||||||
return measure_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *widget_measure_single_event_occurences_dates()
|
|
||||||
{
|
|
||||||
printf("measure single_event_occurences_dates\n");
|
|
||||||
return measure_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *widget_measure_do_depends_on_a_single_event()
|
|
||||||
{
|
|
||||||
prefer_add_measure ("new measure from a single event");
|
|
||||||
gtk_box_remove (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_second_of_two));
|
|
||||||
select_nb_or_date_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
|
||||||
scale = gtk_picture_new_for_filename
|
|
||||||
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/camera icon.png");
|
|
||||||
btt_select_nb = gtk_toggle_button_new_with_label ("count the number of occurences");
|
|
||||||
btt_select_date = gtk_toggle_button_new_with_label ("save occurences dates");
|
|
||||||
g_signal_connect (btt_select_nb, "toggled",
|
|
||||||
G_CALLBACK (on_measure_single_event_occurences_nb), NULL);
|
|
||||||
g_signal_connect (btt_select_date, "toggled",
|
|
||||||
G_CALLBACK (on_measure_single_event_occurences_dates), NULL);
|
|
||||||
|
|
||||||
gtk_box_append (select_nb_or_date_box, GTK_WIDGET (scale));
|
|
||||||
gtk_box_append (select_nb_or_date_box, GTK_WIDGET (btt_select_nb));
|
|
||||||
gtk_box_append (select_nb_or_date_box, GTK_WIDGET (btt_select_date));
|
|
||||||
gtk_box_append (measure_page, GTK_WIDGET (select_nb_or_date_box));
|
|
||||||
return measure_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *widget_measure_do_depends_on_two_events()
|
|
||||||
{
|
|
||||||
printf("measure depends on two events\n");
|
|
||||||
prefer_add_measure ("new measure from two events");
|
|
||||||
gtk_box_remove (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_first_of_two));
|
|
||||||
scale = gtk_picture_new_for_filename
|
|
||||||
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/measure tool scale icon.png");
|
|
||||||
return measure_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void *widget_measure_do_depends_on_one_or_two_events()
|
void *widget_measure_do_depends_on_one_or_two_events()
|
||||||
{
|
{
|
||||||
gtk_box_append (select_rules_first_box,
|
|
||||||
gtk_toggle_button_new_with_label ("< done > a set of rules was selected"));
|
|
||||||
select_one_or_two_rules_events_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
select_one_or_two_rules_events_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2));
|
||||||
balance = gtk_picture_new_for_filename
|
balance = gtk_picture_new_for_filename
|
||||||
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/balance icon.png");
|
("/home/jean/Gem-Graph/gem-graph-client/data/stamp/balance icon.png");
|
||||||
|
@ -130,6 +72,7 @@ void *widget_measure_do_depends_on_one_or_two_events()
|
||||||
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (balance));
|
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (balance));
|
||||||
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_first_of_two));
|
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_first_of_two));
|
||||||
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_second_of_two));
|
gtk_box_append (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_second_of_two));
|
||||||
|
measure_page = widget_get_measure_page();
|
||||||
gtk_box_append (measure_page, GTK_WIDGET (select_one_or_two_rules_events_box));
|
gtk_box_append (measure_page, GTK_WIDGET (select_one_or_two_rules_events_box));
|
||||||
|
|
||||||
return measure_page;
|
return measure_page;
|
||||||
|
@ -146,6 +89,7 @@ void *widget_measure_do_select_rules_first ()
|
||||||
|
|
||||||
gtk_box_append (select_rules_first_box, GTK_WIDGET (pressure));
|
gtk_box_append (select_rules_first_box, GTK_WIDGET (pressure));
|
||||||
gtk_box_append (select_rules_first_box, GTK_WIDGET (btt_select_rules_first));
|
gtk_box_append (select_rules_first_box, GTK_WIDGET (btt_select_rules_first));
|
||||||
|
measure_page = widget_get_measure_page();
|
||||||
gtk_box_append (measure_page, GTK_WIDGET (select_rules_first_box));
|
gtk_box_append (measure_page, GTK_WIDGET (select_rules_first_box));
|
||||||
|
|
||||||
return measure_page;
|
return measure_page;
|
||||||
|
|
|
@ -36,7 +36,8 @@
|
||||||
void *widget_get_rule_analyse()
|
void *widget_get_rule_analyse()
|
||||||
{
|
{
|
||||||
return gtk_label_new (" ______________________\n RULE INVESTIGATION\n\
|
return gtk_label_new (" ______________________\n RULE INVESTIGATION\n\
|
||||||
tools\n '''''''''''''''''''''''''''''''''''''''");
|
tools\n '''''''''''''''''''''''''''''''''''''''\n\
|
||||||
|
(camera, transparencies)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue