WIP: in_depth <> machine à états

This commit is contained in:
Jean Sirmai 2024-06-09 11:23:42 +02:00
parent bbac7d71da
commit c7bbc8b1e6
Signed by: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 26 additions and 22 deletions

View File

@ -148,7 +148,7 @@ GtkWidget *get_SPACE_EDIT_controls_box() {
void window_main_child_bottom (GtkBox *page_box){
if (get_exec_edit_mode ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
if (! get_exec_edit_mode ()) gtk_box_append (page_box, GTK_WIDGET (get_TIME_EXEC_controls_box()));
else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_controls_box()));
}

View File

@ -4,36 +4,40 @@
/******************************************************************************/
/* EXEC / EDIT */
/* S T A T E S */
/******************************************************************************/
enum { EXEC_MODE, EDIT_MODE};
static int exec_edit_mode = EXEC_MODE;
/*
(exec / edit) X (state / rules / measure) X (observ / interpret / read / write)
*/
int get_exec_edit_mode () {return exec_edit_mode;}
void set_exec_edit_mode (int prescribed) {exec_edit_mode = prescribed;}
// EXEC, EDIT, RUN, STOP, STATE, RULES, MEASURE, OBSERVE, INTERPRET, HELP, CONFIG
enum {
EXEC_STOP, EXEC_RUN,
EXEC_STOP_EDIT_RULE, EXEC_RUN_EDIT_RULE,
EXEC_STOP_EDIT_MEASURE, EXEC_RUN_EDIT_MEASURE,
EDIT_STATE, EDIT_RULE,
OBSERVE,
INTERPRET,
HELP,
CONFIGURE
};
static int status = EXEC_STOP;
/******************************************************************************/
/* RUN / STOP */
/* T R A N S I T I O N S */
/******************************************************************************/
enum { STOP, RUN };
static int run_stop = STOP;
int get_run_xor_stop_exec () {return run_stop;}
void set_run_xor_stop_exec (int prescribed) {run_stop = prescribed;}
int get_exec_edit_mode () {return status;}
void set_exec_edit_mode (int prescribed) {status = prescribed;}
int get_run_xor_stop_exec () {return status;}
void set_run_xor_stop_exec (int prescribed) {status = prescribed;}
/******************************************************************************/
/* STATE / RULES / MEASURES / INTERPRETATIONS */
/******************************************************************************/
int get_observ_interpret () {return status;}
void set_observ_interpret (int prescribed) {status = prescribed;}
enum { STATE, RULES, MEASURE, OBSERVE, INTERPRET, HELP, CONFIGURE };
static int switch_observ_interpret = STATE;
int get_observ_interpret () {return switch_observ_interpret;}
void set_observ_interpret (int prescribed) {switch_observ_interpret = prescribed;}
// if (0) printf ("switch_observ_interpret = %d\n", switch_observ_interpret);
// if (0) printf ("status = %d\n", status);