diff --git a/include/widget.h b/include/widget.h index 135fc94..5e18065 100644 --- a/include/widget.h +++ b/include/widget.h @@ -192,12 +192,10 @@ void *widget_get_selected_rule_images(); /******************************************************************************/ // called by : widget / data / dispatch / widget_get_data_page() // defined in : widget / data / measures.c -// operations.c // results.c void *widget_get_measures_page(); void *widget_get_results_page(); -void *widget_get_operations_on_results_page(); /******************************************************************************/ @@ -253,6 +251,7 @@ void widget_let_us_create_a_complex_useless_and_expensive_tree (struct TreeNode_ // defined in : widget / measure / dispatch.c void *widget_measure_new(); +// La séquence logique à suivre pour créer une nouvelle mesure void *widget_measure_do_select_rules_first(); void *widget_measure_do_depends_on_one_or_two_events(); void *widget_measure_do_depends_on_a_single_event(); @@ -263,6 +262,7 @@ void *widget_measure_do_correlate(); void *widget_measure_do_insert_in_measurements_list(); void *widget_measure_do_end_creation_of_measurement_process(); +// Les cinq types de mesures possibles void *widget_measure_event_occurences_nb(); void *widget_measure_event_occurences_dates(); void *widget_measure_event_occurences_situations(); diff --git a/src/widget/data/dispatch.c b/src/widget/data/dispatch.c index 3eb5041..0b59a1d 100644 --- a/src/widget/data/dispatch.c +++ b/src/widget/data/dispatch.c @@ -34,7 +34,7 @@ // "graph", "chart", "plot" and "diagram" are ambiguous terms, sometimes used interchangeably. // https://www.mathsisfun.com/data/data-graph.php -#define PARTITION_700 700 +#define H_PARTITION_RESULTS 200 void *widget_get_data_page() @@ -42,7 +42,7 @@ void *widget_get_data_page() GtkWidget *measures_and_results = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_paned_set_start_child (GTK_PANED(measures_and_results), GTK_WIDGET (widget_get_measures_page())); gtk_paned_set_end_child (GTK_PANED(measures_and_results), GTK_WIDGET (widget_get_results_page())); - gtk_paned_set_position (GTK_PANED (measures_and_results), PARTITION_700); + gtk_paned_set_position (GTK_PANED (measures_and_results), H_PARTITION_RESULTS); gtk_paned_set_shrink_start_child (GTK_PANED (measures_and_results), FALSE); gtk_paned_set_shrink_end_child (GTK_PANED (measures_and_results), FALSE); diff --git a/src/widget/data/measure.c b/src/widget/data/measure.c index 8f8ad26..33b8bf1 100644 --- a/src/widget/data/measure.c +++ b/src/widget/data/measure.c @@ -50,17 +50,10 @@ void *widget_get_measures_page () gtk_box_append (rule_topic_box, gtk_button_new_with_label ("objects")); gtk_box_append (rule_topic_box, gtk_button_new_with_label ("situations")); - GtkWidget *btt_B = gtk_toggle_button_new (); - gtk_button_set_icon_name (GTK_BUTTON (btt_B), "folder-saved-search-symbolic"); - - gtk_box_append (data_box, GTK_WIDGET (btt_B)); gtk_box_append (data_box, GTK_WIDGET (frame_rule_effect)); gtk_box_append (data_box, GTK_WIDGET (frame_rule_topic)); - GtkWidget* frame_measures = gtk_frame_new ("measures"); - gtk_frame_set_child (GTK_FRAME (frame_measures), GTK_WIDGET (data_box)); - - return GTK_WIDGET (frame_measures); + return GTK_WIDGET (data_box); } diff --git a/src/widget/data/operations.c b/src/widget/data/operations.c deleted file mode 100644 index a66a37c..0000000 --- a/src/widget/data/operations.c +++ /dev/null @@ -1,50 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * -* * -* Gem-graph client * -* * -* Stock * -* * -* Copyright © 2021 Libre en Communs * -* Copyright © 2021 Jean Sirmai * -* * -* This file is part of Gem-graph. * -* * -* This program is free software: you can redistribute it and/or modify it * -* under the terms of the GNU Affero General Public License * -* as published by the Free Software Foundation, * -* either version 3 of the License, * -* or (at your option) any later version. * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; * -* without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. * -* See the GNU Affero General Public License for more details. * -* * -* You should have received a copy of the GNU Affero General Public License * -* along with this program. If not, see . * -* * -* * * * * * * * * * * * * * * * * * * * * * * * * * */ - - -#include "../../../include/base.h" -#include "../../../include/signal.h" -#include "../../../include/widget.h" - -void *widget_get_operations_on_results_page () { - - GtkWidget *btt_A = gtk_toggle_button_new (); - gtk_button_set_icon_name (GTK_BUTTON (btt_A), "view-refresh-symbolic"); - -// GtkWidget *data_chart = GTK_WIDGET (gtk_picture_new_for_filename -// ("/home/jean/Gem-Graph/gem-graph-client/data/image/data charts.png")); - - GtkWidget* frame_analysis = gtk_frame_new ("analysis"); -// GtkBox *analysis_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 8)); - gtk_frame_set_child (GTK_FRAME (frame_analysis), GTK_WIDGET (btt_A)); -// gtk_frame_set_child (GTK_FRAME (frame_analysis), GTK_WIDGET (data_chart)); - - return GTK_WIDGET (frame_analysis); -} - - diff --git a/src/widget/data/results.c b/src/widget/data/results.c index f69990b..fcd8392 100644 --- a/src/widget/data/results.c +++ b/src/widget/data/results.c @@ -34,25 +34,18 @@ void *widget_get_results_page () { GtkBox *data_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); - GtkWidget* frame_data_type = gtk_frame_new ("about the fsm / about the model"); - GtkBox *data_type_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 2)); - gtk_frame_set_child (GTK_FRAME (frame_data_type), GTK_WIDGET (data_type_box)); - - gtk_box_append (data_box, GTK_WIDGET (frame_data_type)); - - gtk_box_append (data_type_box, gtk_button_new_with_label ("evolutions")); - gtk_box_append (data_type_box, GTK_WIDGET (gtk_picture_new_for_filename + gtk_box_append (data_box, gtk_button_new_with_label ("evolutions")); + gtk_box_append (data_box, GTK_WIDGET (gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/data évolutions parallèles (n > 30) étendu.png"))); - gtk_box_append (data_type_box, gtk_button_new_with_label ("repartitions (1D, 2D)")); - gtk_box_append (data_type_box, GTK_WIDGET (gtk_picture_new_for_filename + gtk_box_append (data_box, gtk_button_new_with_label ("repartitions (1D, 2D)")); + gtk_box_append (data_box, GTK_WIDGET (gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/data bar graph vertical.png"))); - gtk_box_append (data_type_box, gtk_button_new_with_label ("correlations")); - gtk_box_append (data_type_box, GTK_WIDGET (gtk_picture_new_for_filename + gtk_box_append (data_box, gtk_button_new_with_label ("correlations")); + gtk_box_append (data_box, GTK_WIDGET (gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/image/data correlations (4, horizontal).png"))); - gtk_widget_set_size_request (GTK_WIDGET (data_box), 1800, 700); // provisoire TODO return GTK_WIDGET (data_box); } diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c index 787ced6..8aea4e9 100644 --- a/src/widget/measure/dispatch.c +++ b/src/widget/measure/dispatch.c @@ -37,9 +37,51 @@ /******************************************************************************/ /* M E A S U R E S */ /******************************************************************************/ +// 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 + +// When a list is established, it is possible to evaluate +// if the results of this measure are correlated with some other results. static GtkBox *measure_page; +void *widget_measure_event_occurences_nb() +{ + prefer_add_measure ("new measure count one event occurences"); + return measure_page; +} + +void *widget_measure_event_occurences_dates() +{ + prefer_add_measure ("new measure one event occurences dates"); + return measure_page; +} + +void *widget_measure_event_occurences_situations() +{ + prefer_add_measure ("new measure one event occurences situations"); + return measure_page; +} + +void *widget_measure_time_elapsed_between_two_events() +{ + prefer_add_measure ("new measure time elapsed between two events"); + return measure_page; +} + +void *widget_measure_third_event_occurences_in_between() +{ + prefer_add_measure ("new measure of the frequency of a third event\ + occurring between two other events"); + return measure_page; +} + static GtkBox *edit_a_new_measure_box; static GtkWidget *caliper; static GtkWidget *btt_edit_a_new_measure; @@ -76,22 +118,10 @@ static GtkBox *insertion_in_list_measurements_box; static GtkWidget *insert; static GtkWidget *btt_insert_in_measurements_list; -static GtkBox *last_one; //TODO +static GtkBox *last_one; static GtkWidget *clean; static GtkWidget *btt_end; -// 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 with some others ? - - void *widget_measure_do_end_creation_of_measurement_process() { last_one = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); @@ -104,7 +134,7 @@ void *widget_measure_do_end_creation_of_measurement_process() gtk_box_append (last_one, GTK_WIDGET (clean)); gtk_box_append (last_one, GTK_WIDGET (btt_end)); gtk_box_append (last_one, GTK_WIDGET (gtk_label_new - (" < will be redirected to the 'SYNTY' page"))); + (" < triggers redirection to the 'SYNTY' page"))); gtk_box_append (measure_page, GTK_WIDGET (last_one)); return measure_page; @@ -112,7 +142,6 @@ void *widget_measure_do_end_creation_of_measurement_process() void *widget_measure_do_insert_in_measurements_list() { -// printf("insert in measurements list\n"); insertion_in_list_measurements_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); insert = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/data collection.png"); @@ -132,7 +161,6 @@ void *widget_measure_do_insert_in_measurements_list() void *widget_measure_do_correlate() { -// printf("Could this measurement be related to another one ?\n"); correlation_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); correl = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/harbor.png"); @@ -151,42 +179,6 @@ Two measurements or more can be selected there to study potential correlations." return measure_page; } -void *widget_measure_event_occurences_nb() -{ -// printf("measure event_occurences_nb\n"); - prefer_add_measure ("new measure count one event occurences"); - return measure_page; -} - -void *widget_measure_event_occurences_dates() -{ -// printf("measure event_occurences_dates\n"); - prefer_add_measure ("new measure one event occurences dates"); - return measure_page; -} - -void *widget_measure_event_occurences_situations() -{ -// printf("measure event_occurences_situations\n"); - prefer_add_measure ("new measure one event occurences situations"); - return measure_page; -} - -void *widget_measure_time_elapsed_between_two_events() -{ -// printf("measure time_elapsed_between_two_events\n"); - prefer_add_measure ("new measure time elapsed between two events"); - return measure_page; -} - -void *widget_measure_third_event_occurences_in_between() -{ -// printf("measure third_event_occurences_in_between\n"); - prefer_add_measure ("new measure of the frequency of a third event\ - occurring between two other events"); - return measure_page; -} - void *widget_measure_do_depends_on_a_single_event() { gtk_box_remove (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_second_of_two)); @@ -239,7 +231,7 @@ void *widget_measure_do_select_a_second_rules_set() void *widget_measure_do_choose_an_event_type() { gtk_box_remove (select_one_or_two_rules_events_box, GTK_WIDGET (btt_select_first_of_two)); -// ici, il faut inactiver le btt_select_second_of_two +// ici, il faudrait inactiver le btt_select_second_of_two gtk_box_append (select_second_rules_set_box, gtk_label_new (" < done. A second set of rules was selected")); two_rules_measures_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); @@ -269,7 +261,7 @@ void *widget_measure_do_depends_on_one_or_two_events() { gtk_box_append (select_rules_first_box, gtk_label_new ("< done. A set of rules was selected")); -// ici, il faut inactiver le btt_select_rules_first +// ici, il faudrait inactiver le btt_select_rules_first select_one_or_two_rules_events_box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2)); balance = gtk_picture_new_for_filename ("/home/jean/Gem-Graph/gem-graph-client/data/stamp/balance icon.png"); diff --git a/src/widget/synth/dispatch.c b/src/widget/synth/dispatch.c index e87a054..99e15c0 100644 --- a/src/widget/synth/dispatch.c +++ b/src/widget/synth/dispatch.c @@ -47,7 +47,8 @@ static void *widget_get_non_time_dependent_analysis_elements() // for fun ! return results_box; } -#define PARTITION_SYNTH 1540 +#define H_PARTITION_SYNTH 1600 +#define W_PARTITION_SYNTH 600 static void *widget_get_space_vs_non_time_dependent_analysis() { @@ -56,7 +57,7 @@ static void *widget_get_space_vs_non_time_dependent_analysis() GTK_WIDGET (widget_get_space_view())); gtk_paned_set_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), GTK_WIDGET (widget_get_non_time_dependent_analysis_elements())); - gtk_paned_set_position (GTK_PANED (space_vs_non_time_dependent_analysis), PARTITION_SYNTH); + gtk_paned_set_position (GTK_PANED (space_vs_non_time_dependent_analysis), H_PARTITION_SYNTH); gtk_paned_set_shrink_start_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE); gtk_paned_set_shrink_end_child (GTK_PANED (space_vs_non_time_dependent_analysis), FALSE); // TRUE @@ -70,7 +71,7 @@ void *widget_get_synth_page() GTK_WIDGET (widget_get_space_vs_non_time_dependent_analysis())); gtk_paned_set_end_child (GTK_PANED (space_and_analysis_vs_history), GTK_WIDGET (widget_get_time_dependent_results_and_time_controls())); - gtk_paned_set_position (GTK_PANED (space_and_analysis_vs_history), PARTITION_SYNTH); + gtk_paned_set_position (GTK_PANED (space_and_analysis_vs_history), W_PARTITION_SYNTH); gtk_paned_set_shrink_start_child (GTK_PANED (space_and_analysis_vs_history), FALSE); gtk_paned_set_shrink_end_child (GTK_PANED (space_and_analysis_vs_history), FALSE); gtk_widget_set_size_request (space_and_analysis_vs_history, 0, H_MY_SCREEN); // OK (required))