2024-10-19 16:05:49 +02:00
.TH "include/fsm.h" 3 "Version 0.1.0" "Gem-graph" \" -*- nroff -*-
.ad l
.nh
.SH NAME
2024-10-25 17:32:30 +02:00
include/fsm.h \- FSM (Finite State Machine) header\& .
2024-10-19 16:05:49 +02:00
.SH SYNOPSIS
.br
.PP
\fC #include <stdbool\& .h>\fP
.br
\fC #include <stddef\& .h>\fP
.br
\fC #include <string\& .h>\fP
.br
\fC #include <gtk\- 4\& .0/gtk/gtk\& .h>\fP
.br
.SS "Classes"
.in +1c
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "struct \fBfsm_log_struct_unit\fP"
2024-10-19 16:05:49 +02:00
.br
2024-10-27 04:18:58 +01:00
.RI "structure of a log element "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "struct \fBfsm_log_struct\fP"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "required to initialise a double-chained list "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_tool\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_data\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "struct \fBfsm_struct_list_disp\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Macros"
.in +1c
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "#define \fBLOG_MAX_LENGTH\fP 255"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_rules\fP 128"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_objects\fP 32"
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary too, "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "#define \fBn_situations\fP 128"
.br
2024-10-20 01:05:12 +02:00
.RI "and so on\&.\&.\&. "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Typedefs"
.in +1c
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "typedef struct \fBfsm_log_struct_unit\fP \fBfsm_log_struct_unit\fP"
2024-10-19 16:05:49 +02:00
.br
2024-10-27 04:18:58 +01:00
.RI "structure of a log element "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_tool\fP \fBfsm_struct_list_tool\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_data\fP \fBfsm_struct_list_data\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "typedef struct \fBfsm_struct_list_disp\fP \fBfsm_struct_list_disp\fP"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Enumerations"
.in +1c
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "enum \fBfsm_enum_log_severity\fP { \fBFATAL\fP, \fBERROR\fP, \fBWARN\fP, \fBINFO\fP, \fBDEBUG\fP, \fBTRACE\fP }"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "Conforms to canonical log levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE\&. "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "enum \fBfsm_enum_log_source\fP { \fBSOURCE\fP, \fBTARGET\fP, \fBLOG\fP, \fBFSM\fP, \fBPREFER\fP, \fBMAIN\fP, \fBAPP\fP, \fBWIDGETS\fP, \fBSIGNAL\fP, \fBWINDOW\fP, \fBDIALOG_WINDOW\fP, \fBMODAL_WINDOW\fP, \fBTEXT_WINDOW\fP, \fBAUTO_NOTIFICATION\fP, \fBTOPBAR\fP, \fBTOPBAR_LEFT\fP, \fBTOPBAR_CENTER\fP, \fBTOPBAR_RIGHT\fP, \fBPAGE\fP, \fBSYNTH_PAGE\fP, \fBSTATE_PAGE\fP, \fBRULES_PAGE\fP, \fBMEASURES_PAGE\fP, \fBRESULTS_PAGE\fP, \fBSYNTH_GLAREA\fP, \fBSYNTH_ALL_RESULTS\fP, \fBSYNTH_TIME_DEP_RESULTS\fP, \fBSYNTH_TIME_INDEP_RESULTS\fP, \fBSTATE_TOP\fP, \fBSTATE_BOTTOM\fP, \fBSTATE_GLAREA\fP, \fBSTATE_CAMERA\fP, \fBRULE_GEOMETRY\fP, \fBRULE_GLAREA\fP, \fBRULE_CAMERA\fP, \fBRULE_ALGEBRA\fP, \fBRULE_CONDITION\fP, \fBRULE_ASSIGN\fP, \fBRULE_ID\fP, \fBRULES_TREE\fP, \fBRULES_COMPARE\fP, \fBRULES_USE\fP, \fBMEASURES_TOOLS\fP, \fBMEASURES__ACTIVITY\fP, \fBMEASURES__DISPLAY\fP, \fBRESULTS\fP, \fBTIME_DEP_RESULTS\fP, \fBTIME_INDEP_RESULTS\fP, \fBWIDGET\fP, \fBBUTTON\fP, \fBSCROLL\fP, \fBGLAREA\fP, \fBTEXT\fP, \fBLABEL\fP, \fBTREE\fP, \fBSLIDER\fP, \fBEXPANDER\fP, \fBENTRY\fP, \fBON_SWITCH_STATE_RULES_DATA\fP, \fBSLIDER_X\fP, \fBSLIDER_Y\fP, \fBSLIDER_Z\fP, \fBSLIDER_A\fP, \fBSLIDER_B\fP, \fBSLIDER_C\fP }"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "arbitrary values that can help the logging filter work more efficiently "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_exec_edit\fP { \fBEXEC\fP, \fBEDIT\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_state_rules_data\fP { \fBSYNTH\fP, \fBSTATE\fP, \fBRULES\fP, \fBDATA\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_store_restore_reset\fP { \fBSTORE\fP, \fBRESTORE\fP, \fBRESET\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "enum \fBfsm_enum_measure_type\fP { \fBDATE_RULE_EXEC\fP, \fBRULE_EXEC_NB\fP, \fBOBJECT_NB\fP, \fBELAPSED_TIME\fP }"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SS "Functions"
.in +1c
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_publish_log\fP (\fBfsm_log_struct\fP jj)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "publish all the logs today just print in the console TODO > in a file "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_init_log\fP (\fBfsm_log_struct\fP *jj)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "init the journal "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_add_log_event\fP (\fBfsm_log_struct\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "add an event "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_clear_log\fP (\fBfsm_log_struct\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "usefulness ? (systematic ^c) "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "long \fBfsm_pop_back_log\fP (\fBfsm_log_struct\fP *jj, const char *file_source, const char *function_source, const char *string_value)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "remove an event "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "int \fBfsm_length_log\fP (\fBfsm_log_struct\fP jj)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "get journal_length "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_seek_log\fP (\fBfsm_log_struct\fP jj, long usec, const char *file_source, const char *function_source, const char *string_value)"
2024-10-19 16:05:49 +02:00
.br
2024-10-20 01:05:12 +02:00
.RI "seek for an event "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_log_publication_request\fP ()"
2024-10-19 16:05:49 +02:00
.br
2024-10-27 04:18:58 +01:00
.RI "This request is called only once, by \fBmain()\fP, just after closing the app and before ending the program\&. "
2024-10-19 16:05:49 +02:00
.ti -1c
2024-10-27 04:18:58 +01:00
.RI "void \fBfsm_add_log\fP (int severity, int source, const char *file_source, const char *function_source, const char *string_value)"
2024-10-19 16:05:49 +02:00
.br
.RI "It is mandatory for any event to call this function to be published in the journal\&. "
.ti -1c
.RI "void \fBfsm_init\fP (char *message)"
.br
.RI "fsm init is the first function called by \fBmain\&.c\fP It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'\&. "
.ti -1c
.RI "void \fBfsm_list_init_preferences\fP ()"
.br
.ti -1c
.RI "void \fBfsm_list_init_measures\fP ()"
.br
.ti -1c
.RI "void \fBfsm_list_init_results\fP ()"
.br
.ti -1c
.RI "void \fBfsm_list_init_displayables\fP ()"
.br
.ti -1c
.RI "int \fBfsm_get_exec_edit\fP ()"
.br
.RI "some client pages (in particular 'state' and 'rules') will be displayed and behave differently depending on whether the fsm is in edit or run state\&. "
.ti -1c
.RI "int \fBfsm_get_state_rules_data\fP ()"
.br
.RI "The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data\&. "
.ti -1c
.RI "void \fBfsm_set_exec_edit\fP (int value)"
.br
.RI "setter for the static value: 'choice_STATE_RULES_DATA' (in this file) "
.ti -1c
.RI "void \fBfsm_set_state_rules_data\fP (int value)"
.br
.RI "setter for the static value: 'choice_STATE_RULES_DATA' (in this file) "
.ti -1c
.RI "void \fBfsm_set_store_restore_reset\fP (int choice, int value)"
.br
.ti -1c
.RI "bool \fBfsm_get_preferences_state\fP ()"
.br
.RI "getter for the static boolean: 'preferences_have_been_modified' "
.ti -1c
.RI "void \fBfsm_set_preferences_modified\fP (bool value)"
.br
.RI "setter for the static boolean: 'preferences_have_been_modified' "
.ti -1c
.RI "void \fBfsm_add_measure\fP (char *measure_name)"
.br
.ti -1c
.RI "void \fBfsm_add_result\fP (char *result_name)"
.br
.ti -1c
.RI "void \fBfsm_add_displayable\fP (char *displayable_name)"
.br
.ti -1c
.RI "void \fBfsm_reset_all_situations_values\fP (int value)"
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_insert\fP (\fBfsm_struct_list_tool\fP **tl, int value)"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "int \fBfsm_tools_list_pop\fP (\fBfsm_struct_list_tool\fP **tl)"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "int \fBfsm_tools_list_length\fP (\fBfsm_struct_list_tool\fP *tl)"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_clear\fP (\fBfsm_struct_list_tool\fP **tl)"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_view\fP (\fBfsm_struct_list_tool\fP *tl)"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
2024-10-20 01:05:12 +02:00
.RI "void \fBfsm_tools_list_test\fP ()"
2024-10-19 16:05:49 +02:00
.br
.ti -1c
.RI "void \fBfsm_rule_trig_measure\fP (int rule_id, int object_id, int measure_id)"
.br
.ti -1c
.RI "void \fBfsm_add_data\fP (\fBfsm_struct_list_data\fP d, int *p_data, int *p_target)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "int \fBfsm_get_data\fP (\fBfsm_struct_list_data\fP d, int from, int to)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.ti -1c
.RI "void \fBfsm_remove_data\fP (\fBfsm_struct_list_data\fP d, int *p_data)"
.br
2024-10-20 01:05:12 +02:00
.RI "phantom documentation "
2024-10-19 16:05:49 +02:00
.in -1c
.SH "Detailed Description"
.PP
2024-10-25 17:32:30 +02:00
FSM (Finite State Machine) header\& .
2024-10-19 16:05:49 +02:00
This file is part of Gem-graph\& .
2024-10-20 01:05:12 +02:00
.SH "Typedef Documentation"
.PP
2024-10-27 04:18:58 +01:00
.SS "typedef struct \fBfsm_log_struct_unit\fP \fBfsm_log_struct_unit\fP"
2024-10-20 01:05:12 +02:00
.PP
2024-10-27 04:18:58 +01:00
structure of a log element
2024-10-20 01:05:12 +02:00
.PP
\fB See also\fP
.RS 4
2024-10-27 04:18:58 +01:00
\fB fsm_add_log()\fP
2024-10-20 01:05:12 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB fsm_add_log_event()\fP
2024-10-20 01:05:12 +02:00
.RE
.PP
2024-10-19 16:05:49 +02:00
.SH "Enumeration Type Documentation"
.PP
2024-10-27 04:18:58 +01:00
.SS "enum \fBfsm_enum_log_severity\fP"
2024-10-19 16:05:49 +02:00
2024-10-20 01:05:12 +02:00
.PP
Conforms to canonical log levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE\& .
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
.SS "J O U R N A L - M E T A - R U L E S"
2024-10-19 16:05:49 +02:00
ref: sudo cat /var/log/messages
.PP
2024-10-27 04:18:58 +01:00
log structure:
2024-10-19 16:05:49 +02:00
.IP "\(bu" 2
date
.IP "\(bu" 2
2024-10-27 04:18:58 +01:00
rank
2024-10-19 16:05:49 +02:00
.IP "\(bu" 2
2024-10-27 04:18:58 +01:00
file
2024-10-19 16:05:49 +02:00
.IP "\(bu" 2
2024-10-27 04:18:58 +01:00
function
2024-10-19 16:05:49 +02:00
.IP "\(bu" 2
2024-10-27 04:18:58 +01:00
value, parameter, description, context,\& .\& .\& . (any value that can qualify the event and provides useful information when reading the log)
2024-10-19 16:05:49 +02:00
.PP
.PP
.PP
.PP
2024-10-27 04:18:58 +01:00
Un seul \fB fsm_add_log()\fP par fonction ? sauf si cette fonction génère plusieurs autres fonctions d'intérêt ?
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
S'il y a deux \fB fsm_add_log()\fP (begin / end) dans une fonction, ils doivent avoir la même étiquette (les mêmes valeurs) : SEVERITY & SOURCE
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
https://betterstack.com/community/guides/logging/logging-best-practices/ https://en.wikipedia.org/wiki/Syslog
2024-10-20 01:05:12 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB See also\fP
.RS 4
\fB fsm_add_log()\fP )
.RE
2024-10-20 01:05:12 +02:00
.PP
2024-10-27 04:18:58 +01:00
2024-10-20 01:05:12 +02:00
.PP
\fB Enumerator\fP
.in +1c
.TP
\fB \fI FATAL \fP \fP
(or CRITICAL) an unrecoverable failure that prevents the whole application from doing any further useful work
.TP
\fB \fI ERROR \fP \fP
2024-10-27 04:18:58 +01:00
a condition that hinders the execution of a specific operation within an application and is unrecoverable
2024-10-20 01:05:12 +02:00
.TP
\fB \fI WARN \fP \fP
something unexpected has occurred, but the application can continue to function normally for the time being
.TP
\fB \fI INFO \fP \fP
(or MESSAGE) a significant event occurs while the system is operating normally
.TP
\fB \fI DEBUG \fP \fP
a description of system states in sufficient detail to give developers clues as to the cause of an error
.TP
\fB \fI TRACE \fP \fP
provides a systematic overview of code execution but comes at a cost in terms of performance
2024-10-27 04:18:58 +01:00
.SS "enum \fBfsm_enum_log_source\fP"
2024-10-20 01:05:12 +02:00
.PP
arbitrary values that can help the logging filter work more efficiently
.PP
\fB See also\fP
.RS 4
2024-10-27 04:18:58 +01:00
\fB fsm_add_log()\fP )
2024-10-20 01:05:12 +02:00
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
.PP
\fB Enumerator\fP
.in +1c
.TP
\fB \fI SOURCE \fP \fP
must each element of this enumeration be commented (enhanced) ?
.TP
\fB \fI TARGET \fP \fP
let's observe first how the enumeration structures and evolves on usage
.TP
\fB \fI WINDOW \fP \fP
MAIN_WINDOW || DIALOG_WINDOW || MODAL_WINDOW || TEXT_WINDOW
.br
.TP
\fB \fI TOPBAR \fP \fP
LEFT || CENTER || RIGHT\& .
.TP
\fB \fI PAGE \fP \fP
SYNTH_PAGE || STATE_PAGE || RULES_PAGE || MEASURES_PAGE || RESULTS_PAGE
.br
RULES_PAGE == USER TREE versus SELECTED (vertical separation)
2024-10-19 16:05:49 +02:00
.SH "Function Documentation"
.PP
2024-10-20 01:05:12 +02:00
.SS "void fsm_add_data (\fBfsm_struct_list_data\fP d, int * p_data, int * p_target)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI *p_data\fP
.br
\fI *p_target\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_add_displayable (char * displayable_name)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI displayable_name\fP
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_add_log (int severity, int source, const char * file_source, const char * function_source, const char * string_value)"
.PP
It is mandatory for any event to call this function to be published in the journal\& . Before publication, a filter can be applied here (and only here) to select only some events of interest (during debugging, for example)
.PP
If there are too many events, a filter can be applied here to select a few interesting events for publication in the log\& .
.PP
This filter can operate on any the following five parameters: severity, source, *file_source, *function_source, *string_value\& .
.PP
\fB See also\fP
.RS 4
below (params)
.RE
.PP
Simple filters (on a single parameter) can be combined using the logical operators 'and' and 'or' and parentheses\& .
.PP
Use: $ grep -r 'fsm_add_log' to confirm the callergraph calls\& .
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/journal\& .c/fsm_journal_push_front()
.PP
src/main/main()
.PP
src/widget/topbar/modal\& .c
.PP
src/widget/topbar/right\& .c
.PP
src/widget/topbar/dialog\& .c
.PP
src/widget/topbar/left\& .c
.PP
src/widget/topbar/dispatch\& .c * 3
.PP
src/widget/one_rule/dispatch\& .c
.PP
src/widget/one_rule/algebra/conditions\& .c * 2
.PP
src/widget/measure/dispatch\& .c
.PP
src/widget/dispatch\& .c * 3
.PP
src/widget/all_rules/dispatch\& .c
.PP
\fB src/fsm/preferences/manager\& .c\fP * 8
.PP
\fB src/fsm/measures/manager\& .c\fP * 2
.PP
\fB src/fsm/measures/tools_list\& .c\fP * 4
.PP
\fB src/fsm/dispatch\& .c\fP * 10
.PP
\fB src/fsm/results/manager\& .c\fP
.PP
\fB src/util/tree\& .c\fP
.PP
\fB src/signal\& .c\fP * 38
.RE
.PP
\fB Parameters\fP
.RS 4
\fI severity\fP <>
.RE
.PP
\fB See also\fP
.RS 4
enum fsm_enum_journal_severity in \fB include/fsm\& .h\fP 'severity' is a pre-defined value that must be associated to each event\& . It ranges from zero to six : CRITICAL \fB ERROR\fP WARNING \fB INFO\fP \fB INFO\fP \fB DEBUG\fP \fB TRACE\fP 0 1 2 3 4 5 6
.RE
.PP
\fB Parameters\fP
.RS 4
\fI source\fP <>
.RE
.PP
\fB See also\fP
.RS 4
enum fsm_enum_journal_source in \fB include/fsm\& .h\fP 'source' is a pre-defined value that can be associated to each event\& . It is not mandatory\& . It can be set to 'NULL'\& .
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *file_source\fP <> the name of the file that emits the event\& .
.br
\fI *function_source\fP <> the function that emits the event\& .
.br
\fI *string_value\fP <> any value that can qualify the event and provides useful information when reading the log\& .
.RE
.PP
.SS "void fsm_add_log_event (\fBfsm_log_struct\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
.PP
add an event
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_add_measure (char * measure_name)"
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB See also\fP
.RS 4
src/widget/measure/dispatch/widget_measure_event_occurences_nb()
.PP
src/widget/measure/dispatch/widget_measure_event_occurences_dates()
.PP
src/widget/measure/dispatch/widget_measure_event_occurences_situations()
.PP
src/widget/measure/dispatch/widget_measure_time_elapsed_between_two_events()
.PP
src/widget/measure/dispatch/widget_measure_third_event_occurences_in_between()
.PP
2024-10-27 04:18:58 +01:00
src/fsm/dispatch/fsm_add_log()
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *measure_name\fP
.RE
.PP
2024-10-26 08:15:20 +02:00
.SS "void fsm_add_result (char * result_name)"
.PP
\fB See also\fP
.RS 4
\fB util_concat()\fP
.PP
\fB fsm_init()\fP
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_clear_log (\fBfsm_log_struct\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
.PP
usefulness ? (systematic ^c)
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
.PP
2024-10-20 01:05:12 +02:00
.SS "int fsm_get_data (\fBfsm_struct_list_data\fP d, int from, int to)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI from\fP
.br
\fI to\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "int fsm_get_exec_edit ()"
.PP
some client pages (in particular 'state' and 'rules') will be displayed and behave differently depending on whether the fsm is in edit or run state\& . Any function which modifies the appearance or behavior of these pages must use this getter to access the choice_EXEC_EDIT value\& .
.PP
see include/fsm enum fsm_enum_exec_edit { EXEC, EDIT } The current int may be replaced by a boolean \& . TODO
.PP
\fB Since\fP
.RS 4
2024-06
.RE
.PP
\fB See also\fP
.RS 4
src/widget/one_rule/dispatch
.PP
src/widget/state/dispatch * 2
.PP
src/signal
.PP
choice_EXEC_EDIT and
.PP
2024-10-20 01:05:12 +02:00
include/fsm/enum \fB fsm_enum_exec_edit\fP {}
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Returns\fP
.RS 4
choice_EXEC_EDIT
.RE
.PP
.SS "bool fsm_get_preferences_state ()"
.PP
getter for the static boolean: 'preferences_have_been_modified'
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
TODO A function must obtain this boolean when it stores the current state of the fsm (including \fB preferences\fP ) before closing the current session\& .
.RE
.PP
\fB Returns\fP
.RS 4
preferences_have_been_modified
.RE
.PP
.SS "int fsm_get_state_rules_data ()"
.PP
The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data\& . To each value is associated a different page and different possible behaviors\& . Any function that modifies the client window must get this value\& .
.PP
see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA }
.PP
\fB Since\fP
.RS 4
2024-06
.RE
.PP
\fB See also\fP
.RS 4
src/widget/topbar/left
.PP
src/signal
.RE
.PP
\fB Returns\fP
.RS 4
choice_STATE_RULES_DATA
.RE
.PP
2024-10-20 23:03:17 +02:00
.SS "void fsm_init (char * initial_INFO_from_main)"
2024-10-19 16:05:49 +02:00
.PP
fsm init is the first function called by \fB main\& .c\fP It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'\& . The items selected in these lists define the current state of the fsm\& .
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/main/main()
.PP
2024-10-27 04:18:58 +01:00
src/journal/fsm_init_log()
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
src/fsm/dispatch/fsm_add_log()
2024-10-19 16:05:49 +02:00
.PP
src/fsm/measures/manager/fsm_list_init_measures()
.PP
src/fsm/results/manager/fsm_list_init_results()
.PP
src/fsm/preferences/manager/fsm_list_init_displayables()
.PP
src/fsm/preferences/manager/fsm_list_init_preferences()
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 23:03:17 +02:00
\fI *initial_INFO_from_main\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_init_log (\fBfsm_log_struct\fP * jj)"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
init the journal
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-27 04:18:58 +01:00
.SS "int fsm_length_log (\fBfsm_log_struct\fP jj)"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
get journal_length
2024-10-19 16:05:49 +02:00
.PP
\fB Since\fP
.RS 4
2024-10-27 04:18:58 +01:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-27 04:18:58 +01:00
\fI *jj\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB Returns\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
journal length
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_list_init_displayables ()"
.PP
\fB Date\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB Author\fP
2024-10-19 16:05:49 +02:00
.RS 4
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB See also\fP
2024-10-19 16:05:49 +02:00
.RS 4
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_list_init_measures ()"
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB See also\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
src/fsm/dispatch/fsm_init()
2024-10-20 01:05:12 +02:00
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-27 04:18:58 +01:00
.SS "void fsm_list_init_preferences ()"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB Date\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
2024-10-19 16:05:49 +02:00
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB Author\fP
2024-10-19 16:05:49 +02:00
.RS 4
.RE
.PP
2024-10-27 04:18:58 +01:00
\fB See also\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
.PP
2024-10-20 01:05:12 +02:00
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-27 04:18:58 +01:00
.SS "void fsm_list_init_results ()"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB See also\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-27 04:18:58 +01:00
\fB fsm_init()\fP
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB fsm_add_result()\fP
.PP
\fB fsm_add_log()\fP
2024-10-20 01:05:12 +02:00
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-27 04:18:58 +01:00
.SS "void fsm_log_publication_request ()"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
This request is called only once, by \fB main()\fP , just after closing the app and before ending the program\& . This is to guarantee the chronological order of the events\& .
2024-10-19 16:05:49 +02:00
.PP
The log is modified for each event but events can be send asynchronously\& . This is why the journal is only published once, before the end of 'main()', Its chronological order is therefore guaranteed\& .
.PP
2024-10-27 04:18:58 +01:00
src/journal\& .c/fsm_publish_log() (called here) is the last function of the program to be executed\& .
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
The fsm_struct_journal (gg_logs) is a static instance in this file\& . Therefore, all the functions that read or write it are in this file\& . This is to avoid uncontrolled operations on it\& .
2024-10-19 16:05:49 +02:00
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
2024-10-27 04:18:58 +01:00
\fB main()\fP
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
\fB fsm_publish_log()\fP
2024-10-20 01:05:12 +02:00
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
.SS "long fsm_pop_back_log (\fBfsm_log_struct\fP * jj, const char * file_source, const char * function_source, const char * string_value)"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
remove an event
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
2024-10-27 04:18:58 +01:00
.SS "void fsm_publish_log (\fBfsm_log_struct\fP jj)"
2024-10-19 16:05:49 +02:00
.PP
2024-10-27 04:18:58 +01:00
publish all the logs today just print in the console TODO > in a file
2024-10-19 16:05:49 +02:00
.PP
2024-10-20 01:05:12 +02:00
\fB Since\fP
2024-10-19 16:05:49 +02:00
.RS 4
2024-10-20 01:05:12 +02:00
2024-09
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
2024-10-20 01:05:12 +02:00
\fI *jj\fP
2024-10-26 08:15:20 +02:00
.RE
.PP
2024-10-20 01:05:12 +02:00
.SS "void fsm_remove_data (\fBfsm_struct_list_data\fP d, int * p_data)"
.PP
phantom documentation
.PP
\fB Parameters\fP
.RS 4
\fI d\fP
.br
\fI *p_data\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_reset_all_situations_values (int value)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI value\fP
.RE
.PP
.SS "void fsm_rule_trig_measure (int rule_id, int object_id, int measure_id)"
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB Parameters\fP
.RS 4
\fI rule_id\fP
.br
\fI object_id\fP
.br
\fI measure_id\fP
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_seek_log (\fBfsm_log_struct\fP jj, long usec, const char * file_source, const char * function_source, const char * string_value)"
.PP
seek for an event
.PP
\fB Since\fP
.RS 4
2024-09
.RE
.PP
\fB Parameters\fP
.RS 4
\fI *jj\fP
.br
\fI usec\fP
.br
\fI *file_source\fP
.br
\fI *function_source\fP
.br
\fI *string_value\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SS "void fsm_set_exec_edit (int choice)"
.PP
setter for the static value: 'choice_STATE_RULES_DATA' (in this file) see include/fsm enum fsm_enum_exec_edit { EXEC, EDIT }
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/signal * 2
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP < a boolean value which can be 'EXEC' or 'EDIT'
.RE
.PP
.SS "void fsm_set_preferences_modified (bool value)"
.PP
setter for the static boolean: 'preferences_have_been_modified'
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
TODO To be used by any function that modifies the current user \fB preferences\fP
.PP
2024-10-27 04:18:58 +01:00
\fB fsm_add_log()\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Parameters\fP
.RS 4
\fI value\fP = TRUE if preferences_have_been_modified\& .
.RE
.PP
.SS "void fsm_set_state_rules_data (int choice)"
.PP
setter for the static value: 'choice_STATE_RULES_DATA' (in this file) see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA } Today (2024-10) the initial page is set to 'SYNTH'\& .
.PP
\fB See also\fP
.RS 4
line 292 choice_STATE_RULES_DATA = SYNTH; NB This choice can be temporarily modified for debugging purpose:
.PP
2024-10-20 23:03:17 +02:00
end of the function: \fB fsm/dispatch\& .c\fP \fB window_design_topbar_left()\fP
2024-10-19 16:05:49 +02:00
.RE
.PP
\fB Since\fP
.RS 4
2024-08
.RE
.PP
\fB See also\fP
.RS 4
src/signal * 4
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP
.RE
.PP
.SS "void fsm_set_store_restore_reset (int choice, int value)"
.PP
\fB Date\fP
.RS 4
.RE
.PP
\fB Author\fP
.RS 4
.RE
.PP
\fB See also\fP
.RS 4
.PP
.RE
.PP
\fB Parameters\fP
.RS 4
\fI choice\fP
.br
\fI value\fP
.RE
.PP
2024-10-27 04:18:58 +01:00
.SS "void fsm_tools_list_clear (\fBfsm_struct_list_tool\fP ** ml)"
.PP
\fB Parameters\fP
.RS 4
\fI **ml\fP
.RE
.PP
\fB See also\fP
.RS 4
\fB fsm_tools_list_test()\fP
.RE
.PP
.SS "void fsm_tools_list_insert (\fBfsm_struct_list_tool\fP ** ml, int value)"
.PP
\fB Parameters\fP
.RS 4
\fI **ml\fP
.br
\fI value\fP
.RE
.PP
\fB See also\fP
.RS 4
\fB fsm_tools_list_test()\fP
.RE
.PP
.SS "int fsm_tools_list_length (\fBfsm_struct_list_tool\fP * ml)"
.PP
\fB Parameters\fP
.RS 4
\fI **ml\fP
.RE
.PP
\fB See also\fP
.RS 4
\fB fsm_tools_list_test()\fP
.RE
.PP
.SS "int fsm_tools_list_pop (\fBfsm_struct_list_tool\fP ** ml)"
.PP
\fB Parameters\fP
.RS 4
\fI **ml\fP
.RE
.PP
\fB See also\fP
.RS 4
\fB fsm_tools_list_test()\fP
.RE
.PP
.SS "void fsm_tools_list_test ()"
.PP
\fB See also\fP
.RS 4
\fB fsm_list_init_measures()\fP ()
.PP
\fB fsm_add_log()\fP
.PP
\fB fsm_tools_list_insert()\fP
.PP
\fB fsm_tools_list_pop()\fP
.PP
\fB fsm_tools_list_view()\fP
.PP
\fB fsm_tools_list_clear()\fP
.RE
.PP
.SS "void fsm_tools_list_view (\fBfsm_struct_list_tool\fP * ml)"
.PP
\fB Parameters\fP
.RS 4
\fI **ml\fP
.RE
.PP
\fB See also\fP
.RS 4
\fB fsm_tools_list_test()\fP
.RE
.PP
2024-10-19 16:05:49 +02:00
.SH "Author"
.PP
Generated automatically by Doxygen for Gem-graph from the source code\& .