commit 7b6b75a3ce9b740dbca019d788798e2959c05652
Author: silhavyj <jakub.sil@seznam.cz>
Date:   Wed Apr 27 11:08:42 2022 +0200

    re #9573 Added a sequence and UML diagram

diff --git a/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio b/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio
new file mode 100644
index 0000000..dc3bd8e
--- /dev/null
+++ b/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio
@@ -0,0 +1 @@
+<mxfile host="Electron" modified="2022-04-27T08:58:36.177Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.5.1 Chrome/96.0.4664.110 Electron/16.0.7 Safari/537.36" etag="pkxSyWU8jUEetNVYmsDH" version="16.5.1" type="device"><diagram id="kgpKYQtTHZ0yAKxKKP6v" name="Page-1">7Vxtd9o4Fv41nDP7AY5fwXwkkHRmNnuaJum0O98UI8BbYxFbNNBfv5Is27IkGwN2QqZlzpxaV7Js3/vovukqPXu63n2IwWb1HzSHYc8y5ruePetZljmyDfIPpew5xfCslLKMgzmnFYSH4AfMBnLqNpjDpDQQIxTiYFMm+iiKoI9LNBDH6KU8bIHC8lM3YAkVwoMPQpX6JZjjVUr1XKOg/w6D5Sp7smnwnjXIBnNCsgJz9CKQ7OuePY0RwunVejeFIeVexpf0vpuK3vzFYhjhJjfY0fbqZheP/f2tsYk+fnm0wIc+n+U7CLf8g3v25I9ogW4g9lcw5q+O9xk/yFds6OV2Hd4GCxgGEWldbWAcrCEm4+1ZyMl3Be2KSAcDQqP9JmuHIdgkwROb1iCUGPrbOAm+w3uYpCBgVLSN5nDOWzkHWQPH6FsuEzrpIgjDKQpRzN7UXrj0P0onDxfo6S+fQegZsh/pUVmb8QnGGO4EEmf1B4jIp8Z7MoT3WhnyOfA93nwpQGQ6bkpbCQByHD4QcOAu86kL2ZILLt4jRG2popaFu0FBhNlz3aueO5MEi2K8QksUgVAU7VEiUhlbi8rG3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HH3WWVNXfV4CLivzzAsZ8lJPY+z1zq/u1FTa1J3LOJx/611S+s2WAKIU1DfNvznSQRmliqfj/Fv2+BaBJZTI2FIql2YXu6rj0mtKFV11KLwQdA1Hkvo5tbRrJO1UOjJMWypfrnpOp+XLqiffkko0BsNRSSNauYZ8I41Yh+0LwawtYdaWvZ/GmJWKoonj3JVGrGOrACvi1MCHfYLfV71XJQCP8IIanOLsrHpLK5zLDDNqcfQuqre0XzDsSsGaJe1ar1uFVHQeUpzuD4xU3Vq3K3wputVrSbfK3mZep/ZKulWt2ZjBp+1ySZYiiVTZ8V419LxgHdteUqhBZHusPrFPrL1t5TipvmanQbBxKep7fCy7JfVta9mtsZWd1eyo/vFDmvRJT8+nSZ8nmDKDnavX53x+hhNeB8/7tYORvnsYJGMNSNo4rq9fkZrDDefZ+JPtdV21/juLhUbSqRbFH258NEuaSCmnbCt+lx0Mr934XS9b1b902SsRqFA3wEggMeJUYQl1tcGi10FRbQvW1nIqfDQxZayrkDXbWNx6J1Zd3Nc7H27S4n+DTk6hjrdxlFsFvQkQVnvzdH5M3SpBx6qWnf7xAe56HbOjoJFWLb6ay3BcVs+6fZ6udqv1Nlw9P5OfyV7UyOuXyW4PFK4UM2nWtfeaJlutmL3PljCxvRQaubLsTa3ehJW+sotUYd4sQJj81MhpQdubkqbQFbboUNGZt685aVfnyHEpNkiFO45TytakB/dfKRWuOQpdtyYuxP2zRs7AUQ/Q53vJzmA0Fn7uab6hORwP3KNm7ji5Y7UeS1QfEnGUQyId7iyeBc3xRUHTlo2Z7Lo0ziRKJUi2PFF7YNP+hUFNYdl5WCs0nmlZJY3njU7UeJLMT8tYZ3xutoX9ZriSAlX31B1rWzrY5DbcsW4LVw02mE7FVbnKxnFP/Rtqx8KqeoPjrdBiynvFslvU+M+HyHmL1rRQj5dmC8OLomz7+v8=</diagram></mxfile>
\ No newline at end of file
diff --git a/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio.pdf b/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio.pdf
new file mode 100644
index 0000000..5128acd
Binary files /dev/null and b/ld_client/doc/sequence_diagram/ASWI_SequenceDiagram.drawio.pdf differ
diff --git a/ld_client/doc/uml/ld_uml.pdf b/ld_client/doc/uml/ld_uml.pdf
new file mode 100644
index 0000000..12dce25
Binary files /dev/null and b/ld_client/doc/uml/ld_uml.pdf differ
diff --git a/ld_client/doc/uml/ld_uml.txt b/ld_client/doc/uml/ld_uml.txt
new file mode 100644
index 0000000..39a6ec0
--- /dev/null
+++ b/ld_client/doc/uml/ld_uml.txt
@@ -0,0 +1,154 @@
+@startuml
+interface IProcessDection {
+  + void RunPeriodicDetection()
+}
+
+class ProcessDetection {
+   ____
+  + ProcessProcessDetection(string processName,
+                            uint detectionPeriodMs,
+                            InfoFetcher infoFetcher,
+                            IApiClient apiClient)
+                            
+  + async void RunPeriodicDetection()
+}
+
+interface IApiClient {
+  + Task SendPayloadAsync(Payload payload)
+  + void Run()
+}
+
+class ApiClient {
+  ____
+  + ApiClient(string url, uint port,
+              string path, uint retryPeriod,
+              uint maxEntries, uint maxRetries,
+              string cacheFilename)
+  
+  + async Task SendPayloadAsync(Payload payload)
+  + async void Run()
+}
+
+class InfoFetcher {
+  ____
+  + string HeadSerialNumber
+  + string BodySerialNumber
+  
+  + InfoFetcher(uint maxAttempts, uint waitPeriodMs,
+                string infoFilePath, string f32RemExecutable,
+                string[] f32RemArguments, int f32SuccessExitCode,
+                int f32WaitTimeoutMs)
+  
+  + async Task<bool> FetchDataAsync()
+}
+
+class DebuggerInfoParser {
+  + {static} static (string headSerialNumber,
+    {static} string bodySerialNumber) Parse(string dataTxt)
+}
+
+abstract class ALogger{
+  + ALogger Current
+
+  - LogVerbosity _verbosity
+  - LogFlow _logFlow
+
+  + void Info(string message)
+  + void Debug(string message)
+  + void Error(string message)
+  + void Error(Exception e)
+  
+  # ALogger()
+  
+  {abstract} # CreateLog(string message)
+}
+
+
+class FileLogger{
+  # CreateLog(string message)
+  - void Rotate(string filePat)
+  
+}
+
+class ConsoleLogger{
+ # CreateLog(string message)
+ 
+}
+
+enum LogVerbosity{
+  None
+  Exceptions
+  Full
+}
+
+enum LogFlow{
+  Console
+  File
+}
+
+
+class Payload{
+  + string UserName
+  + string HostName
+  + string TimeStamp
+  + DebuggerInfo HeadDevice
+  + DebuggerInfo BodyDevice
+  + ConnectionStatus Status
+}
+
+class DebuggerInfo{
+  + string SerialNumber
+}
+
+enum ConnectionStatus{
+  Connected
+  Disconnected
+}
+
+LogVerbosity -[hidden] ALogger
+ALogger -left[hidden] LogFlow
+
+ALogger ---left[hidden] ProcessDetection
+
+Payload -right[hidden] ApiClient
+
+ALogger <|.. FileLogger
+ALogger <|.. ConsoleLogger
+ALogger .. LogVerbosity
+ALogger .. LogFlow
+
+Payload o- DebuggerInfo
+Payload o- ConnectionStatus
+
+IProcessDection <|.. ProcessDetection : implements
+IApiClient <|.. ApiClient : implements
+DebuggerInfoParser <.. InfoFetcher : calls (uses)
+ProcessDetection o-- IApiClient : is held in
+note on link: Uses ApiClient to send\ndatato the server
+ProcessDetection o-- InfoFetcher : is held in
+note on link: Calls FetchDataAsync,\nreads the status\ncode (true/false)
+
+class DebuggerInfoParser
+note left: Parses the content of a .txt file \n(throws an ArgumentException)
+
+class InfoFetcher
+note left: Sends commands to the\ndebugger, periodically attempts\nto parse the .txt file 
+
+class ApiClient
+note left: Sends data (payload) to the server,\nmanages a file-based cache.
+
+class ProcessDetection
+note top: Detects a running\nprocess (t32mtc)
+
+note top of ALogger
+  Wraps up common logging functions.
+  Singleton design pattern
+end note
+
+note bottom of FileLogger
+  Transfers logs into file. Upon reaching
+  specified size starts logging into new file. 
+  Full block of files are zipped.
+end note
+
+@enduml
