Il y a des préférences qui sont des états de la fsm... How to ?
This commit is contained in:
parent
2d269755f1
commit
635ff8f076
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -46,7 +47,12 @@ enum fsm_choice_STORE_RESTORE_RESET { STORE, RESTORE, RESET }; // xor
|
||||||
#define n_objects 32 // arbitrary too,
|
#define n_objects 32 // arbitrary too,
|
||||||
#define n_situations 128 // and so on...
|
#define n_situations 128 // and so on...
|
||||||
|
|
||||||
|
bool fsm_init ();
|
||||||
|
|
||||||
|
void fsm_measures_list_init ();
|
||||||
|
void fsm_results_list_init ();
|
||||||
|
void prefer_displayable_list_init ();
|
||||||
|
// TODO Eh oui ! Il y a des préférences qui sont des états de la fsm... How to ?
|
||||||
|
|
||||||
int fsm_get_exec_edit ();
|
int fsm_get_exec_edit ();
|
||||||
int fsm_get_state_rules_data ();
|
int fsm_get_state_rules_data ();
|
||||||
|
|
|
@ -38,3 +38,6 @@ const char get_button_icon_name (int n);
|
||||||
void fsm_reset_all_situations_transparencies_at_value (int value); // provisoire...
|
void fsm_reset_all_situations_transparencies_at_value (int value); // provisoire...
|
||||||
|
|
||||||
void *fsm_add_displayable (char *displayable_name);
|
void *fsm_add_displayable (char *displayable_name);
|
||||||
|
|
||||||
|
void prefer_init ();
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,18 @@
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* F S M I N I T */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
bool fsm_init ()
|
||||||
|
{
|
||||||
|
fsm_measures_list_init ();
|
||||||
|
fsm_results_list_init ();
|
||||||
|
// prefer_displayable_list_init (); <> see prefer_init ()
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* S T A T E S */
|
/* S T A T E S */
|
||||||
|
|
|
@ -28,12 +28,7 @@
|
||||||
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
* * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "../../include/fsm.h"
|
#include "../../include/fsm.h"
|
||||||
#include "../../include/prefer.h"
|
|
||||||
#include "../../include/widget.h"
|
|
||||||
#include "../../include/fsm.h"
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* */
|
/* */
|
||||||
|
@ -76,8 +71,9 @@
|
||||||
// When a list of measurements is established, it is possible to evaluate
|
// When a list of measurements is established, it is possible to evaluate
|
||||||
// if the results of a measurement are correlated with some other results.
|
// if the results of a measurement are correlated with some other results.
|
||||||
|
|
||||||
|
// https://fr.wikibooks.org/wiki/Structures_de_donn%C3%A9es_en_C/Les_listes_simples
|
||||||
|
|
||||||
// structure de données : tableau ? Si oui, chaque "item" comprtera :
|
// structure de données : chaque "item" comportera :
|
||||||
|
|
||||||
// - identifiant (clé) (+/- pointeur vers : date de création, auteur,...)
|
// - identifiant (clé) (+/- pointeur vers : date de création, auteur,...)
|
||||||
|
|
||||||
|
@ -98,11 +94,18 @@
|
||||||
// - pointeur vers des données, des représentations de données ?
|
// - pointeur vers des données, des représentations de données ?
|
||||||
|
|
||||||
|
|
||||||
static void *list_measures;
|
void *fsm_add_measure (char *measure_name) {fsm_debug (2, 0, measure_name, 2); return NULL;}
|
||||||
|
|
||||||
void *fsm_add_measure (char *measure_name)
|
//static void *list_measures;
|
||||||
|
typedef struct s_List List;
|
||||||
|
struct s_List
|
||||||
{
|
{
|
||||||
fsm_debug (2, 0, measure_name, 2);
|
List *next; /* pointeur sur le reste de la liste */
|
||||||
return NULL;
|
void *data; /* pointeur sur une donnée générique */
|
||||||
|
};
|
||||||
|
|
||||||
|
void fsm_measures_list_init ()
|
||||||
|
{
|
||||||
|
fsm_debug (0,0, "fsm_measures_list_init()", 2); // sub_automaton 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,3 +74,8 @@ void *fsm_add_result (char *result_name)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fsm_results_list_init ()
|
||||||
|
{
|
||||||
|
fsm_debug (0,0, "fsm_results_list_init()", 2); // sub_automaton 2
|
||||||
|
}
|
||||||
|
|
||||||
|
|
15
src/main.c
15
src/main.c
|
@ -45,7 +45,7 @@
|
||||||
* model_get_dim_value()
|
* model_get_dim_value()
|
||||||
*
|
*
|
||||||
* Le fichier 'state.c' est devenu un dossier contenant
|
* Le fichier 'state.c' est devenu un dossier contenant
|
||||||
* les fichiers 'top.c', 'middle.c', 'bottom.c' et 'distrib.c'
|
* les fichiers 'top.c', 'middle.c', 'bottom.c' et 'distrib.c' (2024-08)
|
||||||
*
|
*
|
||||||
* 'middle.c' deviendra, s'il est trop volumineux, un dossier 'middle'
|
* 'middle.c' deviendra, s'il est trop volumineux, un dossier 'middle'
|
||||||
* contenant, par exemple, les fichiers 'camera.c' ou 'contrasts.c' et d'autres
|
* contenant, par exemple, les fichiers 'camera.c' ou 'contrasts.c' et d'autres
|
||||||
|
@ -92,7 +92,8 @@
|
||||||
* 2) Les structures transversales.
|
* 2) Les structures transversales.
|
||||||
* --------------------------------
|
* --------------------------------
|
||||||
*
|
*
|
||||||
* Les fonctions 'transversales' comme celles de 'graphics', 'parse', 'fsm', 'prefer'
|
* Les fonctions 'transversales' comme celles de 'graphics', 'parse', 'fsm', 'prefer',
|
||||||
|
* et peut-être des structures communes à tous les arbres, listes, etc.
|
||||||
* doivent pouvoir être accédées directement
|
* doivent pouvoir être accédées directement
|
||||||
* sans avoir à passer par la hiérarchie des widgets et/ou callbacks.
|
* sans avoir à passer par la hiérarchie des widgets et/ou callbacks.
|
||||||
* Elles restent à la racine: 'src/
|
* Elles restent à la racine: 'src/
|
||||||
|
@ -132,16 +133,18 @@
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* L I S T E D E S F O N C T I O N S A P P E L É E S *
|
* L I S T E D E S F O N C T I O N S A P P E L É E S *
|
||||||
* *****************************************************************************
|
*******************************************************************************
|
||||||
*
|
*
|
||||||
*******************************************************************************
|
*******************************************************************************
|
||||||
* L I S T E D E S A P P E L S D E F O N C T I O N S *
|
* L I S T E D E S A P P E L S D E F O N C T I O N S *
|
||||||
* *****************************************************************************
|
*******************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "../include/widget.h"
|
#include "../include/widget.h"
|
||||||
#include "../include/signal.h"
|
#include "../include/signal.h"
|
||||||
|
#include "../include/prefer.h"
|
||||||
|
#include "../include/fsm.h"
|
||||||
|
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
|
@ -151,7 +154,11 @@ int main (int argc, char **argv)
|
||||||
|
|
||||||
app = gtk_application_new ("org.gem-graph", G_APPLICATION_DEFAULT_FLAGS);
|
app = gtk_application_new ("org.gem-graph", G_APPLICATION_DEFAULT_FLAGS);
|
||||||
|
|
||||||
|
fsm_init (); // fsm = finite state machine (see src/fsm/dispatch)
|
||||||
|
prefer_init (); // preferences (see src/prefer/dispatch)
|
||||||
|
|
||||||
g_signal_connect (app, "activate", G_CALLBACK (on_windows_activation), NULL);
|
g_signal_connect (app, "activate", G_CALLBACK (on_windows_activation), NULL);
|
||||||
|
// on_windows_activation <> is in src/widget/dispatch
|
||||||
|
|
||||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||||
g_object_unref (app);
|
g_object_unref (app);
|
||||||
|
|
|
@ -124,3 +124,7 @@ void *fsm_add_displayable (char *displayable_name)
|
||||||
printf("fsm_add_displayable %p <<< %s (see prefer.c)\n", list_displayables, displayable_name);
|
printf("fsm_add_displayable %p <<< %s (see prefer.c)\n", list_displayables, displayable_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void prefer_init () {prefer_displayable_list_init ();}
|
||||||
|
void prefer_displayable_list_init () { printf("prefer <> prefer_displayable_list_init()\n");}
|
||||||
|
|
|
@ -350,7 +350,7 @@ void on_resetting_XYZ_in_state_page ()
|
||||||
widget_state_XYZ_reset_all();
|
widget_state_XYZ_reset_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------- S IT U A T I O N S ------------------------ //
|
// -------------------------- S I T U A T I O N S ----------------------- //
|
||||||
|
|
||||||
void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar)
|
void on_situations_box_do_reset (GtkWidget *btt_reset, GtkScrollbar *reset_scrollbar)
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,20 @@
|
||||||
#include "../../include/widget.h"
|
#include "../../include/widget.h"
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* # # ### ##### ###### ######## ######## */
|
||||||
|
/* # # # # ## ## ## # # */
|
||||||
|
/* # # # # ## ## # # */
|
||||||
|
/* # # # # ## ## #### # */
|
||||||
|
/* # # # # # # # # # */
|
||||||
|
/* # # # # # # ## ## #### # # */
|
||||||
|
/* ## ## # # ## ## ## # # */
|
||||||
|
/* ## ## ### ###### ####### ######## # */
|
||||||
|
/* */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* W I N D O W S */
|
/* W I N D O W S */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue