<trclass="memdesc:a435d1a5171a7d69662d701234722fee2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The <aclass="el"href="../../d4/d07/fsm_2dispatch_8c.html#a435d1a5171a7d69662d701234722fee2"title="The fsm_journal_publication_request() is called only once, by main(), just after closing the app and ...">fsm_journal_publication_request()</a> is called only once, by <aclass="el"href="../../d0/d09/main_8c.html#a3c04138a5bfe5d72780bb7e82a18e627">main()</a>, just after closing the app and before ending the program. <br/></td></tr>
<trclass="memdesc:a8c67f42f95d48ee2469c9a27d65db3e6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">It is mandatory for any event to call this function to be published in the journal. <br/></td></tr>
<trclass="memdesc:ae4300f13ef7fdb5a9ab0379b7e9d1faf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">fsm init is the first function called by <aclass="el"href="../../d0/d09/main_8c.html"title="Gem-graph-client main file.">main.c</a> It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'. <br/></td></tr>
<trclass="memdesc:a770bcaeb0bd6f81cddcc3cd506468fff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">setter for the static boolean: 'preferences_have_been_modified' <br/></td></tr>
<trclass="memdesc:a0b0231a311d0e85723ef9fcf38be88e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">getter for the static boolean: 'preferences_have_been_modified' <br/></td></tr>
<trclass="memdesc:a9123915ffd10fe1ae18254898b1c0ebf"><tdclass="mdescLeft"> </td><tdclass="mdescRight">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. <br/></td></tr>
<trclass="memdesc:a90ab14081a88752d3721947a4922ee25"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data. <br/></td></tr>
<trclass="memdesc:ae921ecd39af67bb8dc0deb2cdc86125d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">setter for the static value: 'choice_STATE_RULES_DATA' (in this file) <br/></td></tr>
<trclass="memdesc:af5a464b19589ba1972c9b3aa3397945a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">setter for the static value: 'choice_STATE_RULES_DATA' (in this file) <br/></td></tr>
<divclass="textblock"><p>fsm (Finite State Machine) tasks dispatcher </p>
<p>This file is part of Gem-graph.</p>
<p>The Finite State Machine (fsm) describes all the possible states of the Gem-graph client and all the transitions between them. It manages several kinds of exclusive states:</p><ul>
<li>Run the model or edit it.</li>
<li>Select a single view of the model from all those possible. The different views show either the space, or the rule tree, or a single rule of interest, or measurements or results. NB an overview is possible, but it does not provide details.</li>
<li>Apply a selected measurement to the currently running model</li>
<li>Select some results for study or/and presentation.</li>
<li>Choose the user's preferred values for a set of parameters used to modify the appearance or behaviour of gem-graph.</li>
</ul>
<p>Each state of the fsm is a combination of each of these states.</p>
<p>The current state of the fsm must be</p><ul>
<li>saved at the end of a work session and</li>
<li>reread (available to the user) at the start of a new session.</li>
</ul>
<p>No state of the fsm should be defined in another module.</p>
<p>No fsm transition should be executed in another module.</p>
<p>The journal is created, edited and published from here. </p>
<p>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. </p>
<p>Any function which modifies the appearance or behavior of these pages must use this getter to access the choice_EXEC_EDIT value.</p>
<p>see include/fsm enum fsm_enum_exec_edit { EXEC, EDIT } The current int may be replaced by a boolean . TODO</p>
<dlclass="section see"><dt>See also</dt><dd>TODO A function must obtain this boolean when it stores the current state of the fsm (including <aclass="el"href="../../d3/d0f/structpreferences.html">preferences</a>) before closing the current session.</dd></dl>
<p>The value of the static int choice_STATE_RULES_DATA can be one of the enum include/fsm enum fsm_enum_state_rules_data. </p>
<p>To each value is associated a different page and different possible behaviors. Any function that modifies the client window must get this value.</p>
<p>see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA }</p>
<p>fsm init is the first function called by <aclass="el"href="../../d0/d09/main_8c.html"title="Gem-graph-client main file.">main.c</a> It initiates the journal and the four lists: 'measures', 'results', 'displayables results' and 'preferences'. </p>
<p>The items selected in these lists define the current state of the fsm.</p>
<p>If there are too many events, a filter can be applied here to select a few interesting events for publication in the log.</p>
<p>This filter can operate on any the following five parameters: severity, source, *file_source, *function_source, *string_value. </p><dlclass="section see"><dt>See also</dt><dd>below (params)</dd></dl>
<p>Simple filters (on a single parameter) can be combined using the logical operators 'and' and 'or' and parentheses.</p>
<p>Use: $ grep -r "fsm_journal_event" to confirm the callergraph calls.</p>
<dlclass="section see"><dt>See also</dt><dd>enum <aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7"title="Conforms to canonical log levels: FATAL, ERROR, WARN, INFO, DEBUG, TRACE.">fsm_enum_journal_severity</a> in <aclass="el"href="../../dd/d01/fsm_8h.html"title="fsm (Finite State Machine) management header">include/fsm.h</a> 'severity' is a pre-defined value that must be associated to each event. It ranges from zero to six : CRITICAL <aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7a2fd6f336d08340583bd620a7f5694c90"title="a conditions that hinder the execution of a specific operation within an application and is unrecover...">ERROR</a> WARNING <aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7a748005382152808a72b1a9177d9dc806"title="(or MESSAGE) a significant event occurs while the system is operating normally">INFO</a><aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7a748005382152808a72b1a9177d9dc806"title="(or MESSAGE) a significant event occurs while the system is operating normally">INFO</a><aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7a0593585da9181e972974c1274d8f2b4f"title="a description of system states in sufficient detail to give developers clues as to the cause of an er...">DEBUG</a><aclass="el"href="../../dd/d01/fsm_8h.html#ab761a6fdf1ac1e26a44f8f9524aa6da7a7fa27e82c6c4f69434225ed81e5d151e"title="provides a systematic overview of code execution but comes at a cost in terms of performance">TRACE</a> 0 1 2 3 4 5 6</dd></dl>
<dlclass="section see"><dt>See also</dt><dd>enum <aclass="el"href="../../dd/d01/fsm_8h.html#ae17fff59df266673b42b150568f1804c"title="arbitrary values that can help the logging filter work more efficiently">fsm_enum_journal_source</a> in <aclass="el"href="../../dd/d01/fsm_8h.html"title="fsm (Finite State Machine) management header">include/fsm.h</a> 'source' is a pre-defined value that can be associated to each event. It is not mandatory. It can be set to 'NULL'.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">*file_source</td><td><> the name of the file that emits the event. </td></tr>
<tr><tdclass="paramname">*function_source</td><td><> the function that emits the event. </td></tr>
<tr><tdclass="paramname">*string_value</td><td><> any value that can qualify the event and provides useful information when reading the log. </td></tr>
<p>The <aclass="el"href="../../d4/d07/fsm_2dispatch_8c.html#a435d1a5171a7d69662d701234722fee2"title="The fsm_journal_publication_request() is called only once, by main(), just after closing the app and ...">fsm_journal_publication_request()</a> is called only once, by <aclass="el"href="../../d0/d09/main_8c.html#a3c04138a5bfe5d72780bb7e82a18e627">main()</a>, just after closing the app and before ending the program. </p>
<p>This is to guarantee the chronological order of the events in the journal.</p>
<p>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.</p>
<p><aclass="el"href="../../d3/d0c/journal_8c.html"title="journal / log">src/journal.c</a>/fsm_journal_publish() (called here) is the last function of the program to be executed.</p>
<p>The <aclass="el"href="../../d9/d03/structfsm__struct__journal.html"title="required to initialise a double-chained list">fsm_struct_journal</a> (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.</p>
<dlclass="section see"><dt>See also</dt><dd>TODO To be used by any function that modifies the current user <aclass="el"href="../../d3/d0f/structpreferences.html">preferences</a></dd>
<dd>
<aclass="el"href="../../d4/d07/fsm_2dispatch_8c.html#a8c67f42f95d48ee2469c9a27d65db3e6"title="It is mandatory for any event to call this function to be published in the journal.">fsm_journal_event()</a></dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">value</td><td>= TRUE if preferences_have_been_modified. </td></tr>
<p>setter for the static value: 'choice_STATE_RULES_DATA' (in this file) </p>
<p>see include/fsm enum fsm_enum_state_rules_data { SYNTH, STATE, RULES, DATA } Today (2024-10) the initial page is set to 'SYNTH'. </p><dlclass="section see"><dt>See also</dt><dd>line 292 choice_STATE_RULES_DATA = SYNTH; NB This choice can be temporarily modified for debugging purpose: </dd>
end of the function: <aclass="el"href="../../d4/d07/fsm_2dispatch_8c.html"title="fsm (Finite State Machine) tasks dispatcher">fsm/dispatch.c</a><aclass="el"href="../../df/d05/widget_8h.html#a45d8a02844578e1c13d8b86b74e3c8b0"title="The rules page consists of two half-pages in a GtkPaned widget :">window_design_topbar_left()</a></dd></dl>