Ensures that the message parser returns a default "{}" response after handling an event, preventing unintended empty responses.
Also, this change avoids sending empty messages to the client unnecessarily.
Rearranges the order of operations during simulator switching to ensure that the previous simulator is properly stopped and disconnected before the new simulator is started.
- Fix for separate message for each ui change/sim change event by putting Qt::QueuedConnection
- Avoids broadcasting empty JSON objects produced by the change above mentioned
Implements a check to ensure a simulator is active before processing commands.
This prevents errors and unexpected behavior when commands are sent without an active simulator. The check is performed at the beginning of the command parsing, and logs an error if no simulator is active, returning an empty JSON object.