Client side doc : nav

This commit is contained in:
l_samenv
2024-08-21 15:10:05 +02:00
parent 3178359c1c
commit 8534187ab8

View File

@ -1,15 +1,19 @@
The way the main page is served (where you can select the instrument you want to interact with) has not been decided yet, even if its code is in this repository.
### Initialization
### Initialization/navigation
For a selected instrument, there is a single HTML file that holds the application : the `SEAWebClient.html` file, which is served as the main route. It includes all the JS files needed, meaning all the JS files located in the `client/jsFiles` folder excepted `SeaWebClientStart.js`, plus the external librairies (`client/externalFiles/`) and the components (`client/components/`).
The entry point is the `SEAWebClientMain.js`, which has a `window.onload` function and which initiates all the content of the page, plus the responsitivity.
The entry point is the `SEAWebClientMain.js`, which has a `window.onload` function. First, the grid that holds the different parts (graphics, console...) is computed depending on the screen size. Then, the connexion with the server is initiated with the `buildUpdateConnection` function, located in `SeaWebClientCommunication.js`.
This function calls the /update route, which will initiate the SSE connexion, retrieving an id, the name of the instrument and the device currently running to the client. The id will be used for all the API calls. When all this information is received, the `loadFirstBlocks()` function is called (`SeaWebClientMain.js`) to populate an array of routes to call, so we can get the content of each block sequentially. Its content is defined by the global variables defined in `SeaWebClientMain.js`, more precisely in the calling cascade of the `treat()` method on the `Settings` function (still in the same file).
The calling cascade is initiated with the `nextInitCommand()` function (`SeaWebClientMain.js`), called just after the `loadFirstBlocks()` function. Every response of each command will be treated in the switch statement of the `successHandler()` function (in `SeaWebClientCommunication.js`). Specifically, the content of each block is dynamically created in JS when the response of the different init commands are received.
### About updating graphics
- When the server is pushing data, the newly received data is appened to the current curves (on livemode).
- When zooming in the x direction, when the zoom is complete (for e.g. meaning that there are no longer enough mouse wheel step in a certain range of time), then the resolution is computed, the client asks for the data within the new viewing window with the given resolution, and then sets (overwrites) the data for the curves.
- When zooming in the x direction, when the zoom is complete (for e.g. meaning that there are no longer enough mouse wheel step in a certain range of time), then the resolution is computed, the client asks for the data within the new viewing window with the given resolution, and then sets (overwrites) the data for the curves. This process is done only when zooming out, and we have zoomed in by at least 50% of the previous viewing window
### About livemode