In the ArduinoLogger when we stop logging, we have two buttons.
The "Save" button
This button can be used to save logs to a CSV file.
A click on this button calls the Arduino.changefinishstate() function.
The "Publish" button
This button can be used to send the logs to the database.
A click on this button calls the Arduino.publishlogs() function.
On the other hand, we currently have a LogToDisk class.
This class is both used to call the loggingManager to save the logs to a file and to interact with the UI.
The call to this class is done in the Arduino GameObject using the Unity inspector.
It may be a good idea to use this class only to interact with the UI and put the code that is in the LogToDisk.Log function directly into the Arduino.changefinishstate() function.
Maybe we could also rename some of the functions and UnityEvents in a better way.
(for instance the "On Logging Finished" UnityEvent is currently called when the "Save" button is clicked, not when the logging process is finished).
In the ArduinoLogger when we stop logging, we have two buttons.
The "Save" button
This button can be used to save logs to a CSV file. A click on this button calls the Arduino.changefinishstate() function.
The "Publish" button
This button can be used to send the logs to the database. A click on this button calls the Arduino.publishlogs() function.
On the other hand, we currently have a LogToDisk class. This class is both used to call the loggingManager to save the logs to a file and to interact with the UI.
The call to this class is done in the Arduino GameObject using the Unity inspector.
It may be a good idea to use this class only to interact with the UI and put the code that is in the LogToDisk.Log function directly into the Arduino.changefinishstate() function.
Maybe we could also rename some of the functions and UnityEvents in a better way. (for instance the "On Logging Finished" UnityEvent is currently called when the "Save" button is clicked, not when the logging process is finished).