journal filtrer ? quoi ? comment ? pourquoi ? (fsm/dispatch)
This commit is contained in:
parent
42f7b9dba8
commit
bc6b6082ec
|
@ -64,33 +64,37 @@ typedef struct disp_list {int value; struct disp_list *suiv;} disp_list ;
|
|||
#define SPEW 6 // THE_LOWER THE PRIORITY, THE HIGHER THE INDEX
|
||||
|
||||
// ****************** - WIDGET FILTER - **********************************/
|
||||
//
|
||||
// MAIN_WINDOW DIALOG_WINDOW MODAL_WINDOW
|
||||
// TOPBAR TOPBAR_LEFT TOPBAR_RIGHT
|
||||
// SYNTH_PAGE STATE_PAGE RULES_PAGE RESULTS_PAGE
|
||||
// SYNTH_GLAREA SYNTH_ALL_RESULTS SYNTH_TIME_DEP_RESULTS SYNTH_TIME_INDEP_RESULTS
|
||||
// STATE_TOP STATE_GLAREA STATE_CAMERA STATE_BOTTOM
|
||||
// RULE_CAMERA RULE_GLAREA RULES_MANAGE RULES_TREE RULES_COMPARE RULES_USE
|
||||
// MEASURES_TOOLS MEASURES_ACTIVE TIME_DEP_RESULTS TIME_INDEP_RESULTS
|
||||
//
|
||||
// BUTTON GLIDER GLAREA etc.
|
||||
|
||||
#define MAIN_WINDOW 0
|
||||
#define DIALOG_WINDOW 1
|
||||
#define MODAL_WINDOW 2
|
||||
#define TOPBAR 3
|
||||
#define TOPBAR_LEFT 4
|
||||
#define TOPBAR_RIGHT 5
|
||||
#define SYNTH_PAGE 6
|
||||
#define STATE_PAGE 7
|
||||
#define RULES_PAGE 8
|
||||
#define RESULTS_PAGE 9
|
||||
// MAIN 0
|
||||
// MAIN_WINDOW DIALOG_WINDOW MODAL_WINDOW 1 2 3
|
||||
// TOPBAR TOPBAR_LEFT TOPBAR_RIGHT 4 5 6
|
||||
// SYNTH_PAGE STATE_PAGE RULES_PAGE RESULTS_PAGE 7 8 9 10
|
||||
// SYNTH_GLAREA SYNTH_ALL_RESULTS 11 12
|
||||
// SYNTH_TIME_DEP_RESULTS SYNTH_TIME_INDEP_RESULTS 13 14 15
|
||||
// STATE_TOP STATE_GLAREA STATE_CAMERA STATE_BOTTOM 16 17 18 19
|
||||
// RULES_MANAGE RULE_GLAREA RULE_CAMERA 20 21 22
|
||||
// RULES_TREE RULES_COMPARE RULES_USE 23 24 25
|
||||
// MEASURES_TOOLS MEASURES_ACTIVE 26 27
|
||||
// TIME_DEP_RESULTS TIME_INDEP_RESULTS 28 29
|
||||
// BUTTON SCROLL GLAREA TEXT LABEL 30 31 32 33 34
|
||||
|
||||
#define BUTTON 31
|
||||
#define SCROLL 32
|
||||
#define GLAREA 33
|
||||
#define TEXT 34
|
||||
#define LABEL 35
|
||||
#define MAIN 0
|
||||
#define MAIN_WINDOW 1
|
||||
#define DIALOG_WINDOW 2
|
||||
#define MODAL_WINDOW 3
|
||||
#define TOPBAR 4
|
||||
#define TOPBAR_LEFT 5
|
||||
#define TOPBAR_RIGHT 6
|
||||
#define SYNTH_PAGE 7
|
||||
#define STATE_PAGE 8
|
||||
#define RULES_PAGE 9
|
||||
#define RESULTS_PAGE 10
|
||||
|
||||
#define BUTTON 30
|
||||
#define SCROLL 31
|
||||
#define GLAREA 32
|
||||
#define TEXT 33
|
||||
#define LABEL 34
|
||||
|
||||
#define JOURNAL_DATE_MAX_LENGTH 255
|
||||
|
||||
|
@ -119,7 +123,7 @@ void fsm_journal_test (char *message);
|
|||
// ref: sudo cat /var/log/messages
|
||||
// journal fsm_get_journal(); // def: fsm/dispatch call: fsm/prefer/fsm_store_restore_reset()
|
||||
void fsm_journal_publication_request (); // def: fsm/dispatch call: main;
|
||||
void fsm_journal_event (char *message, int priority, int specificity);
|
||||
void fsm_journal_event (char *message, int priority, int filter);
|
||||
// def: fsm/dispatch call: widget/dispatch;
|
||||
// --------------------------------------------------------------- WIP ------
|
||||
|
||||
|
|
|
@ -56,18 +56,32 @@
|
|||
/******************************************************************************/
|
||||
static journal gg_logs;
|
||||
|
||||
void fsm_journal_push (char *message) {fsm_journal_push_front (&gg_logs, message);}
|
||||
|
||||
void fsm_journal_publication_request () {fsm_journal_publish (gg_logs);}
|
||||
|
||||
void fsm_journal_push (char *message) {fsm_journal_push_front (&gg_logs, message);}
|
||||
|
||||
#define CRITICAL___ERROR____WARNING___INFO____MESSAGE___DEBUG ___SPEW____😄️ 0
|
||||
void fsm_journal_event (char *message, int priority, int filter)
|
||||
{
|
||||
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW 😄️
|
||||
// 0 1 2 3 4 5 6
|
||||
|
||||
if (priority < DEBUG
|
||||
|| filter == 3)
|
||||
|
||||
// MAIN 0
|
||||
// MAIN_WINDOW DIALOG_WINDOW MODAL_WINDOW 1 2 3
|
||||
// TOPBAR TOPBAR_LEFT TOPBAR_RIGHT 4 5 6
|
||||
// SYNTH_PAGE STATE_PAGE RULES_PAGE RESULTS_PAGE 7 8 9 10
|
||||
// SYNTH_GLAREA SYNTH_ALL_RESULTS 11 12
|
||||
// SYNTH_TIME_DEP_RESULTS SYNTH_TIME_INDEP_RESULTS 13 14 15
|
||||
// STATE_TOP STATE_GLAREA STATE_CAMERA STATE_BOTTOM 16 17 18 19
|
||||
// RULES_MANAGE RULE_GLAREA RULE_CAMERA 20 21 22
|
||||
// RULES_TREE RULES_COMPARE RULES_USE 23 24 25
|
||||
// MEASURES_TOOLS MEASURES_ACTIVE 26 27
|
||||
// TIME_DEP_RESULTS TIME_INDEP_RESULTS 28 29
|
||||
// BUTTON SCROLL GLAREA TEXT LABEL 30 31 32 33 34
|
||||
|
||||
&& filter == MAIN)
|
||||
fsm_journal_push (message);
|
||||
}
|
||||
#define _CRITICAL___ERROR____WARNING___INFO____MESSAGE___DEBUG ___SPEW____👋️ 0
|
||||
|
@ -79,23 +93,23 @@ void fsm_journal_event (char *message, int priority, int filter)
|
|||
void fsm_init (char *initial_message_from_main)
|
||||
{
|
||||
fsm_journal_init (&gg_logs);
|
||||
fsm_journal_push (initial_message_from_main);
|
||||
fsm_journal_event (initial_message_from_main, 4, 0);
|
||||
|
||||
fsm_journal_push ("fsm/dispatch initialisation fsm has began");
|
||||
fsm_journal_event ("fsm/dispatch initialisation fsm has began", 4, 0);
|
||||
|
||||
fsm_measures_list_init();
|
||||
fsm_journal_push ("fsm/dispatch measures list init()");
|
||||
fsm_journal_event ("fsm/dispatch measures list init()", 4, 0);
|
||||
|
||||
fsm_results_list_init();
|
||||
fsm_journal_push ("fsm/dispatch results list init()");
|
||||
fsm_journal_event ("fsm/dispatch results list init()", 4, 0);
|
||||
|
||||
fsm_displayable_list_init();
|
||||
fsm_journal_push ("fsm/dispatch displayable list init()");
|
||||
fsm_journal_event ("fsm/dispatch displayable list init()", 4, 0);
|
||||
|
||||
fsm_preferences_list_init();
|
||||
fsm_journal_push ("fsm/dispatch preferences list init()");
|
||||
fsm_journal_event ("fsm/dispatch preferences list init()", 4, 0);
|
||||
|
||||
fsm_journal_push ("fsm/dispatch initialisation fsm has ended");
|
||||
fsm_journal_event ("fsm/dispatch initialisation fsm has ended", 4, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -110,9 +124,9 @@ void fsm_set_preferences_modified (bool value)
|
|||
{
|
||||
preferences_have_been_modified = value;
|
||||
/*
|
||||
if (value) fsm_journal_push (
|
||||
if (value) fsm_journal_event (
|
||||
"fsm/dispatch set preferences modified (TRUE)"); // TODO concat value
|
||||
else fsm_journal_push (
|
||||
else fsm_journal_event (
|
||||
"fsm/dispatch set preferences modified (FALSE)");
|
||||
*/
|
||||
}
|
||||
|
@ -138,7 +152,7 @@ int fsm_get_state_rules_data() {return choice_STATE_RULES_DATA;}
|
|||
void fsm_set_exec_edit (int choice)
|
||||
{
|
||||
if (choice_EXEC_EDIT != choice) {
|
||||
fsm_journal_push ("fsm/dispatch set_exec_edit()"); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch set_exec_edit()", 4, 0); // TODO print choice
|
||||
choice_EXEC_EDIT = choice;
|
||||
}
|
||||
}
|
||||
|
@ -146,7 +160,7 @@ void fsm_set_exec_edit (int choice)
|
|||
void fsm_set_state_rules_data (int choice)
|
||||
{
|
||||
if (choice_STATE_RULES_DATA != choice) {
|
||||
fsm_journal_push ("fsm/dispatch set_state_rules_data()"); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch set_state_rules_data()", 4, 0); // TODO print choice
|
||||
choice_STATE_RULES_DATA = choice;
|
||||
}
|
||||
}
|
||||
|
@ -165,7 +179,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
// sub_automaton 1 is STATE_RULES_DATA
|
||||
// sub_automaton 2 is MEASURE
|
||||
case (0) :
|
||||
fsm_journal_push ("fsm/dispatch switch EXEC_EDIT (TODO)"); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch switch EXEC_EDIT (TODO)", 4, 0); // TODO print choice
|
||||
printf ("fsm/dispatch (message) |\
|
||||
switch %5s x %5s > %5s x %5s\n",
|
||||
tab_0 [choice_EXEC_EDIT], tab_1 [choice_STATE_RULES_DATA],
|
||||
|
@ -173,7 +187,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
break;
|
||||
|
||||
case (1) :
|
||||
fsm_journal_push ("fsm/dispatch switch STATE_RULES_DATA (TODO)"); // TODO print choice
|
||||
fsm_journal_event ("fsm/dispatch switch STATE_RULES_DATA (TODO)", 4, 0); // TODO print choice
|
||||
printf ("fsm/dispatch (message) |\
|
||||
switch %5s x %5s > %5s x %5s\n",
|
||||
tab_0 [choice_EXEC_EDIT], tab_1 [choice_STATE_RULES_DATA],
|
||||
|
@ -188,7 +202,7 @@ void fsm_msg (int choice, int value, char *string, int sub_automaton)
|
|||
|
||||
|
||||
default : printf ("default in fsm/dispatch.fsm_msg()\n");
|
||||
fsm_journal_push ("fsm/dispatch fsm_msg () default in switch (sub_automaton)");
|
||||
fsm_journal_event ("fsm/dispatch fsm_msg () default in switch (sub_automaton)", 4, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
printf(" Current time: %s", ctime(¤t_time));
|
||||
*/
|
||||
|
||||
|
||||
void fsm_journal_init (journal *jj)
|
||||
{
|
||||
jj->first = NULL;
|
||||
|
@ -139,7 +138,7 @@ void fsm_journal_publish (journal jj)
|
|||
while (a_unit)
|
||||
{
|
||||
strftime(buf, sizeof(buf), "%D %T", localtime(&a_unit->yy_dd_mm));
|
||||
printf ("%s + %6ld %6d %s\n", buf, a_unit->usec, nb, a_unit->message);
|
||||
g_message ("%s + %6ld %6d %s", buf, a_unit->usec, nb, a_unit->message);
|
||||
a_unit = a_unit->prev;
|
||||
nb ++;
|
||||
}
|
||||
|
|
|
@ -73,28 +73,28 @@ void fsm_store_restore_reset (int choice, int value)
|
|||
{
|
||||
switch (choice) {
|
||||
case (STORE) :
|
||||
fsm_journal_push (
|
||||
"fsm/prefer store restore reset(): switch (STORE)");
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (STORE)", 5, 0);
|
||||
for (int i = 0; i < n_objects; i++) {
|
||||
p [i] = widget_get_object_transparency (i);
|
||||
widget_set_object_transparency_to_value (i, p [i]);
|
||||
}
|
||||
break;
|
||||
case (RESTORE) :
|
||||
fsm_journal_push (
|
||||
"fsm/prefer store restore reset(): switch (RESTORE)");
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (RESTORE)", 5, 0);
|
||||
for (int i = 0; i < n_objects; i++)
|
||||
widget_set_object_transparency_to_value (i, p [i]);
|
||||
break;
|
||||
case (RESET) :
|
||||
fsm_journal_push (
|
||||
"fsm/prefer store restore reset(): switch (RESET)");
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (RESET)", 5, 0);
|
||||
for (int i = 0; i < n_objects; i++)
|
||||
widget_set_object_transparency_to_value (i, value); // i * 4 // rand() % 127
|
||||
break;
|
||||
default :
|
||||
fsm_journal_push (
|
||||
"fsm/prefer store restore reset(): switch (default)");
|
||||
fsm_journal_event (
|
||||
"fsm/prefer store restore reset(): switch (default)", 5, 0);
|
||||
}
|
||||
|
||||
fsm_set_preferences_modified (TRUE);
|
||||
|
@ -111,7 +111,7 @@ void fsm_reset_all_situations_transparencies_at_value (int value)
|
|||
{
|
||||
char str1[140] = "fsm/prefer reset all situations transparencies at value() ";
|
||||
char str2[10]; sprintf(str2, "%d, ", value); strcat(str1, str2);
|
||||
fsm_journal_push ("fsm/prefer reset all situations transparencies at value() "); // TODO
|
||||
fsm_journal_event ("fsm/prefer reset all situations transparencies at value() ", 5, 0); // TODO
|
||||
reset_situations_to_value = value;
|
||||
widget_reset_all_situations_transparencies_to_value (value);
|
||||
}
|
||||
|
@ -126,8 +126,8 @@ void fsm_reset_all_situations_transparencies_at_value (int value)
|
|||
|
||||
void fsm_add_displayable (char *displayable_name)
|
||||
{
|
||||
fsm_journal_push (
|
||||
strcat("fsm/prefer add displayable() ", displayable_name)); // TODO
|
||||
fsm_journal_event (
|
||||
strcat("fsm/prefer add displayable() ", displayable_name), 5, 0); // TODO
|
||||
}
|
||||
|
||||
|
||||
|
@ -136,11 +136,11 @@ void fsm_add_displayable (char *displayable_name)
|
|||
/******************************************************************************/
|
||||
void fsm_preferences_list_init ()
|
||||
{
|
||||
fsm_journal_push ("fsm/prefer preferences list required()");
|
||||
fsm_journal_event ("fsm/prefer preferences list required()", 5, 0);
|
||||
}
|
||||
|
||||
void fsm_displayable_list_init ()
|
||||
{
|
||||
fsm_journal_push ("fsm/prefer displayable list required()");
|
||||
fsm_journal_event ("fsm/prefer displayable list required()", 5, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,11 +135,11 @@ int main (int argc, char **argv)
|
|||
// def: src/fsm/dispatch fsm = finite state machine
|
||||
fsm_init ("main first instruction in main() & first log");
|
||||
|
||||
fsm_journal_push ("main *app = gtk_application_new ()");
|
||||
fsm_journal_event ("main *app = gtk_application_new ()", 3, -1);
|
||||
GtkApplication *app = gtk_application_new ("org.gem-graph",
|
||||
G_APPLICATION_DEFAULT_FLAGS);
|
||||
|
||||
fsm_journal_push ("main g signal connect (app <--> on_windows_startup)");
|
||||
fsm_journal_event ("main g signal connect (app <--> on_windows_startup)", 3, -1);
|
||||
g_signal_connect (app, "startup", G_CALLBACK (on_windows_startup), NULL);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (on_windows_activation), NULL);
|
||||
// ! WARNING ! 'on_windows_activation()'
|
||||
|
@ -148,9 +148,9 @@ int main (int argc, char **argv)
|
|||
|
||||
int status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
fsm_journal_push ("main g object unref (app)");
|
||||
fsm_journal_event ("main g object unref (app)", 3, -1);
|
||||
|
||||
fsm_journal_push ("main That'all folks ! 👋️😄️");
|
||||
fsm_journal_event ("main That'all folks ! 👋️😄️", 3, -1);
|
||||
fsm_journal_publication_request();
|
||||
|
||||
return status;
|
||||
|
|
Loading…
Reference in New Issue