med-material / ArduinoLogger

Source code for an Arduino Logger (Windows/Mac) used for the advanced human computer interaction (AMMI) course at AAU (Unity 2018.3.2f1)
MIT License
3 stars 2 forks source link

LogToDisk.Log function called from the editor should be called internally #47

Open Vincent-SD opened 2 years ago

Vincent-SD commented 2 years ago

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.

image

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.

image


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.

image

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).