2024-06-02 22:49:16 +02:00
|
|
|
#include <gtk-4.0/gtk/gtk.h>
|
|
|
|
#include <assert.h>
|
2024-06-03 05:46:01 +02:00
|
|
|
#include "callback.h"
|
2024-06-13 00:08:10 +02:00
|
|
|
#include "automaton.h"
|
2024-06-02 22:49:16 +02:00
|
|
|
|
|
|
|
|
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-03 05:46:01 +02:00
|
|
|
|
2024-06-28 08:16:45 +02:00
|
|
|
static int choice_EXEC_EDIT = EXEC;
|
|
|
|
static int choice_STATE_RULES_DATA = STATE;
|
2024-06-03 05:46:01 +02:00
|
|
|
|
2024-06-28 08:16:45 +02:00
|
|
|
void set_EXEC_EDIT (int prescribed) {
|
|
|
|
choice_EXEC_EDIT = prescribed;
|
|
|
|
SWITCH_TO (choice_EXEC_EDIT, choice_STATE_RULES_DATA);
|
|
|
|
}
|
|
|
|
int get_EXEC_EDIT () {return choice_EXEC_EDIT;}
|
2024-06-16 00:06:49 +02:00
|
|
|
|
2024-06-28 08:16:45 +02:00
|
|
|
void set_STATE_RULES_DATA (int prescribed) {
|
|
|
|
choice_STATE_RULES_DATA = prescribed;
|
|
|
|
SWITCH_TO (choice_EXEC_EDIT, choice_STATE_RULES_DATA);
|
|
|
|
}
|
|
|
|
int get_STATE_RULES_DATA () {return choice_STATE_RULES_DATA;}
|
2024-06-16 00:06:49 +02:00
|
|
|
|
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-28 08:16:45 +02:00
|
|
|
void SWITCH_TO (int choice_EXEC_EDIT, int choice_STATE_RULES_DATA)
|
|
|
|
{
|
|
|
|
switch (choice_STATE_RULES_DATA) {
|
|
|
|
|
|
|
|
case (STATE) :
|
|
|
|
choice_STATE_RULES_DATA = STATE;
|
|
|
|
if (choice_EXEC_EDIT ) choice_EXEC_EDIT = EXEC;
|
|
|
|
else choice_EXEC_EDIT = EDIT;
|
2024-06-11 00:11:50 +02:00
|
|
|
break;
|
2024-06-28 08:16:45 +02:00
|
|
|
|
|
|
|
case (RULES) :
|
|
|
|
choice_STATE_RULES_DATA = RULES;
|
|
|
|
if (choice_EXEC_EDIT ) choice_EXEC_EDIT = EXEC;
|
|
|
|
else choice_EXEC_EDIT = EDIT;
|
2024-06-11 00:11:50 +02:00
|
|
|
break;
|
2024-06-28 08:16:45 +02:00
|
|
|
|
|
|
|
case (DATA) :
|
|
|
|
choice_STATE_RULES_DATA = DATA;
|
|
|
|
if (choice_EXEC_EDIT ) choice_EXEC_EDIT = EXEC;
|
|
|
|
else choice_EXEC_EDIT = EDIT;
|
2024-06-09 15:55:36 +02:00
|
|
|
break;
|
2024-06-28 08:16:45 +02:00
|
|
|
|
|
|
|
default : printf("default in automaton.SWITCH_TO()\n");
|
2024-06-09 15:55:36 +02:00
|
|
|
}
|
2024-06-11 00:11:50 +02:00
|
|
|
|
2024-06-28 08:16:45 +02:00
|
|
|
printf("SWITCH_TO %d X %d (EXEC_EDIT X STATE_RULES_DATA)\n",
|
|
|
|
choice_EXEC_EDIT,
|
|
|
|
choice_STATE_RULES_DATA);
|
2024-06-09 15:55:36 +02:00
|
|
|
}
|