From c7bbc8b1e67b226c87eee4935d310668185bd358 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Sun, 9 Jun 2024 11:23:42 +0200 Subject: [PATCH] =?UTF-8?q?WIP:=20in=5Fdepth=20=20<>=20=20machine=20=C3=A0?= =?UTF-8?q?=20=C3=A9tats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contain.c | 4 ++-- in_depth.c | 44 ++++++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/contain.c b/contain.c index bc52738..dffb487 100644 --- a/contain.c +++ b/contain.c @@ -148,8 +148,8 @@ 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())); - else gtk_box_append (page_box, GTK_WIDGET (get_SPACE_EDIT_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())); } static void icons_for_fun (GtkHeaderBar *header_bar); diff --git a/in_depth.c b/in_depth.c index e61b14b..1d97059 100644 --- a/in_depth.c +++ b/in_depth.c @@ -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);