gem-graph-client/in_depth.c

73 lines
1.8 KiB
C
Raw Normal View History

#include <gtk-4.0/gtk/gtk.h>
#include <assert.h>
#include "callback.h"
2024-06-04 06:25:47 +02:00
/******************************************************************************/
2024-06-09 11:23:42 +02:00
/* S T A T E S */
2024-06-04 06:25:47 +02:00
/******************************************************************************/
2024-06-09 13:27:15 +02:00
// (exec / edit) X (state / rules / measure) X (observ / interpret / read / write)
2024-06-09 11:23:42 +02:00
enum {
2024-06-09 13:27:15 +02:00
EXEC_STOP,
EXEC_RUN,
EXEC_STOP_EDIT_RULE,
EXEC_RUN_EDIT_RULE,
EXEC_STOP_EDIT_MEASURE,
EXEC_RUN_EDIT_MEASURE,
EDIT_STATE,
EDIT_RULE,
2024-06-09 11:23:42 +02:00
OBSERVE,
INTERPRET,
HELP,
CONFIGURE
};
2024-06-04 06:25:47 +02:00
2024-06-09 11:23:42 +02:00
static int status = EXEC_STOP;
2024-06-09 13:27:15 +02:00
int get_status () {return status;}
2024-06-04 06:25:47 +02:00
/******************************************************************************/
2024-06-09 11:23:42 +02:00
/* T R A N S I T I O N S */
2024-06-04 06:25:47 +02:00
/******************************************************************************/
2024-06-09 13:27:15 +02:00
void set_status (int prescribed) {
status = prescribed; if (0) printf ("status = %d\n", status);
2024-06-09 13:27:15 +02:00
switch (status) {
case (0) : /* EXEC_STOP */
status = EXEC_RUN;
break;
case (1) : /* EXEC_RUN */
status = EXEC_STOP;
break;
case (2) : /* EXEC_STOP_EDIT_STOP */
status = EXEC_RUN_EDIT_RULE;
break;
case (3) : /* EXEC_RUN_EDIT_RULE */
status = EXEC_STOP_EDIT_RULE;
break;
case (4) : /* EXEC_STOP_EDIT_MEASURE */
status = EXEC_RUN_EDIT_MEASURE;
break;
case (5) : /* EXEC_RUN_EDIT_MEASURE */
status = EXEC_STOP_EDIT_MEASURE;
break;
case (6) : /* EDIT_STATE */
break;
case (7) : /* EDIT_RULE */
break;
case (8) : /* OBSERVE */
break;
case (9) : /* INTERPRET */
break;
case (10) : /* HELP */
break;
case (11) : /* CONFIGURE */
break;
case (12) : /* OTHER */
break;
default : ;
}
}