journal use MESSAGE, SOURCE, VALUE ?

This commit is contained in:
Jean Sirmai 2024-09-20 05:27:36 +02:00
parent 6061e78958
commit 167ee1254e
Signed by: jean
GPG Key ID: FB3115C340E057E3
4 changed files with 24 additions and 137 deletions

View File

@ -50,53 +50,6 @@ typedef struct disp_list {int value; struct disp_list *suiv;} disp_list ;
/* J O U R N A L */
/******************************************************************************/
enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
// ****************** - SEVERITY - ****************************************/
//
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW (see: fsm.h)
// 0 1 2 3 4 5 6 (fsm_journal_event)
/*
#define CRITICAL 0 // THE HIGHER THE PRIORITY, THE LOWER THE INDEX
#define ERROR 1
#define WARNING 2
#define MESSAGE 3
#define INFO 4
#define DEBUG 5
#define SPEW 6 // THE_LOWER THE PRIORITY, THE HIGHER THE INDEX
*/
/* * * * * * * - F I L T E R S - * * * * * * *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* *
*
* MAIN, FSM_INIT (in fsm/dispatch) & WINDOW ACTIVATION (in widget/dispatch) 0
* MAIN_WINDOW DIALOG_WINDOW MODAL_WINDOW 10 11 12
*
* TOPBAR TOPBAR_LEFT TOPBAR_RIGHT TOPBAR_CENTER 20 21 22 23
*
* SYNTH_PAGE STATE_PAGE RULES_PAGE RESULTS_PAGE 30 31 32 33
* SYNTH_GLAREA SYNTH_ALL_RESULTS 34 35
* SYNTH_TIME_DEP_RESULTS SYNTH_TIME_INDEP_RESULTS 36 37
*
* STATE_PAGE STATE_TOP STATE_BOTTOM 40 41 42
* STATE_GLAREA STATE_CAMERA 43 44
*
* RULES_PAGE RULE_GLAREA RULE_CAMERA 50 51 52
* RULES_TREE RULES_COMPARE RULES_USE 53 54 55
*
* MEASURES_PAGE _TOOLS _ACTIVITY _DISPLAY 60 61 62 63
* TIME_DEP_RESULTS TIME_INDEP_RESULTS 64 65
*
* WIDGET BUTTON SCROLL GLAREA TEXT LABEL 70 71 72 73 74 75
*
* AUTO_NOTIFICATION 80
*
* FSM 90
* *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * * * * * * * * * * * * * * */
/* * * * * - J O U R N A L M E T A R U L E S - * * * *
*
* Un seul fsm_journal_event() par fonction
@ -108,51 +61,22 @@ enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
* * * * * - J O U R N A L M E T A R U L E S - * * * */
enum severity {CRITICAL, ERROR, WARNING, INFO, MESSAGE, DEBUG, SPEW};
enum source {
SOURCE, MAIN, APP, WIDGETS, MAIN_4, MAIN_5, MAIN_6, MAIN_7, MAIN_8, MAIN_9,
SOURCE, TARGET, VALUE, JOURNAL, FSM,
MAIN, APP, WIDGETS,
MAIN_WINDOW, DIALOG_WINDOW, MODAL_WINDOW, TEXT_WINDOW, AUTO_NOTIFICATION,
W_15, W_16, W_17, W_18, W_19,
TOPBAR, TOPBAR_LEFT, TOPBAR_RIGHT, TOPBAR_CENTER,
TB_24, TB_25, TB_26, TB_27, TB_28, TB_29,
SYNTH_PAGE, SY_31, SY_32, SY_33, SY_34, SY_35, SY_36, SY_37, SY_38, SY_39,
STATE_PAGE, ST_41, ST_42, ST_43, ST_44, ST_45, ST_46, ST_47, ST_48, ST_49,
RULES_PAGE, RL_51, RL_52, RL_53, RL_54, RL_55, RL_56, RL_57, RL_58, RL_59,
MEASURES_PAGE, MP_61, MP_62, MP_63, MP_64, MP_65, MP_66, MP_67, MP_68, MP_69,
RESULTS_PAGE, RS_71, RS_72, RS_73, RS_74, RS_75, RS_76, RS_77, RS_78, RS_79,
SYNTH_PAGE, STATE_PAGE, RULES_PAGE, MEASURES_PAGE, RESULTS_PAGE,
SYNTH_GLAREA, SYNTH_ALL_RESULTS, SYNTH_TIME_DEP_RESULTS, SYNTH_TIME_INDEP_RESULTS,
STATE_TOP, STATE_BOTTOM, STATE_GLAREA, STATE_CAMERA,
RULE_GLAREA, RULE_CAMERA, RULES_TREE, RULES_COMPARE, RULES_USE,
MEASURES_TOOLS, MEASURES__ACTIVITY, MEASURES__DISPLAY,
TIME_DEP_RESULTS, TIME_INDEP_RESULTS,
WIDGET, BUTTON, SCROLL, GLAREA, TEXT, LABEL, TREE, EXPANDER
};
enum target {JOURNAL, FSM}; // INFO, SOURCE, TARGET
#define SOURCE 0
#define TARGET 0
#define JOURNAL 0
#define MAIN 0
#define APP 0
#define WIDGETS 0
#define FSM 0
#define AUTO_NOTIFICATION 0
#define MAIN_WINDOW 10
#define DIALOG_WINDOW 11
#define MODAL_WINDOW 12
#define TEXT_WINDOW 13
#define TOPBAR 20
#define TOPBAR_LEFT 21
#define TOPBAR_RIGHT 22
#define TOPBAR_CENTER 23
#define SYNTH_PAGE 50
#define STATE_PAGE 60
#define RULES_PAGE 70
#define MEASURES_PAGE 80
#define RESULTS_PAGE 90
#define BUTTON 101
#define SCROLL 102
#define GLAREA 103
#define TEXT 104
#define LABEL 105
#define JOURNAL_DATE_MAX_LENGTH 255

View File

@ -60,58 +60,20 @@ 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 source, int target)
{
// CRITICAL ERROR WARNING INFO MESSAGE DEBUG SPEW 😄️
// 0 1 2 3 4 5 6
if (priority < 6
#define MAIN___DIALOG___MODAL___TOPBAR___SYNTH___RULES___MEASURES___RESULTS___😄 0
/* * * * * * * - S O U R C E - * * * * * * *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* *
*
* MAIN, FSM_INIT (in fsm/dispatch) & WINDOW ACTIVATION (in widget/dispatch) 0
* MAIN_WINDOW DIALOG_WINDOW MODAL_WINDOW 10 11 12
*
* TOPBAR TOPBAR_LEFT TOPBAR_RIGHT TOPBAR_CENTER 20 21 22 23
*
* SYNTH_PAGE STATE_PAGE RULES_PAGE RESULTS_PAGE 30 31 32 33
* SYNTH_GLAREA SYNTH_ALL_RESULTS 34 35
* SYNTH_TIME_DEP_RESULTS SYNTH_TIME_INDEP_RESULTS 36 37
*
* STATE_PAGE STATE_TOP STATE_BOTTOM 40 41 42
* STATE_GLAREA STATE_CAMERA 43 44
*
* RULES_PAGE RULE_GLAREA RULE_CAMERA 50 51 52
* RULES_TREE RULES_COMPARE RULES_USE 53 54 55
*
* MEASURES_PAGE _TOOLS _ACTIVITY _DISPLAY 60 61 62 63
* TIME_DEP_RESULTS TIME_INDEP_RESULTS 64 65
*
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * - S O U R C E - * * * * * * */
&& source == 0
/* * * * * * * - T A R G E T - * * * * * * *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
*
* ANY WIDGET BUTTON SCROLL GLAREA TEXT LABEL TREE
* EXPANDER TOPBAR
* AUTO_NOTIFICATION
* FSM
* *
* This list is duplicated in both /fsm.h and /fsm/dispatch *
* * * * * * * - T A R G E T - * * * * * * */
&& target == 0)
#define CRITICAL___ERROR____WARNING___INFO____MESSAGE___DEBUG ___SPEW____😄 0
void fsm_journal_event (char *message, int severity, int source, int target)
{
if (severity < SPEW
&& source == MAIN
// || source == FSM
// && target == APP
)
fsm_journal_push (message);
}
#define _CRITICAL___ERROR____WARNING___INFO____MESSAGE___DEBUG ___SPEW____👋 0
#define MAIN___DIALOG___MODAL___TOPBAR___SYNTH___RULES___MEASURES___RESULTS___😄 0
/******************************************************************************/
@ -119,8 +81,8 @@ void fsm_journal_event (char *message, int priority, int source, int target)
/******************************************************************************/
void fsm_init (char *initial_message_from_main)
{
fsm_journal_init (&gg_logs);
fsm_journal_event (initial_message_from_main, MESSAGE, SOURCE, TARGET);
fsm_journal_init (&gg_logs);
fsm_journal_event (initial_message_from_main, MESSAGE, MAIN, TARGET);
fsm_journal_event ("fsm/dispatch fsm initialisation has began", MESSAGE, SOURCE, TARGET);

View File

@ -76,7 +76,7 @@ void on_bind_user_tree_factory (GtkSignalListItemFactory *factory,
GObject* object,
gpointer user_data)
{
fsm_journal_event ("signal bind user tree factory()",
fsm_journal_event ("signal bind user tree factory()",
SPEW, SOURCE, TARGET);
GtkListItem *list_item = GTK_LIST_ITEM (object);
assert (list_item);

View File

@ -30,6 +30,7 @@
// void *widget_get_user_rules_tree() < est à la racine (dans src/widget/)
// TODO pas la bonne place
// Il faut faire le tri entre
// - ce qui appartient à "cet" arbre, et