From 7f54ec65cc03c22af0cd7712ee1cc5c0c57201de Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 8 Apr 2020 19:35:16 +0200 Subject: [PATCH] some more doc --- ScStwLibraries/ScStw.hpp | 71 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/ScStwLibraries/ScStw.hpp b/ScStwLibraries/ScStw.hpp index 542b45b..3dab7fd 100644 --- a/ScStwLibraries/ScStw.hpp +++ b/ScStwLibraries/ScStw.hpp @@ -33,7 +33,7 @@ * ScStwLibraries.file = shared-libraries/ScStwLibraries/ScStwLibraries.pro * @endcode * - * And in your MyProject.pro include the .pri file + * And in your MyProject.pro include the .pri file: * @code{.pro} * include($$PWD/../shared-libraries/ScStwLibraries/ScStwLibraries.pri) * @endcode @@ -45,13 +45,18 @@ class ScStw : public QObject { Q_OBJECT public: - /** - * Some global enums - */ + /** + * @brief The RaceState enum contains all states a race can have + */ enum RaceState { IDLE, STARTING, WAITING, RUNNING, STOPPED }; Q_ENUM(RaceState) + /** + * @brief The SignalKey enum contains all signal keys a client can subscribe to + * + * @see ScStw::signalKeyFromInt() + */ enum SignalKey { InvalidSignal = -1, RaceStateChanged = 9000, @@ -61,9 +66,20 @@ public: }; Q_ENUM(SignalKey) + /** + * @brief The NextStartAction enum contains all action that occur before a race is started + */ enum NextStartAction { AtYourMarks, Ready, Start, None }; Q_ENUM(NextStartAction) + /** + * @brief The BaseStationSetting enum contains all settings of the base station that can be changed by a client + * + * @see ScStw::baseStationSettingFromInt() + * @see ScStw::baseStationSettingToString() + * @see ScStw::baseStationSettingFromString() + * @see ScStw::baseStationSettings + */ enum BaseStationSetting { InvalidSetting = -1, ReadySoundEnableSetting, @@ -74,6 +90,9 @@ public: }; Q_ENUM(BaseStationSetting) + /** + * @brief The ErrorCode enum contains all error codes that can occur when sending a command to the basestation + */ enum ErrorCode { Success = 200, @@ -84,17 +103,61 @@ public: }; Q_ENUM(ErrorCode) + /** + * @brief SOCKET_MESSAGE_START_KEY contains the key, a message is supposed to start with + */ static const char* SOCKET_MESSAGE_START_KEY; + + /** + * @brief SOCKET_MESSAGE_END_KEY contains the key, a message is supposed to end with + */ static const char* SOCKET_MESSAGE_END_KEY; + /** + * @brief baseStationSettings contains a string with reference to all BaseStationSetting values + * + * @see ScStw::BaseStationSetting + * @see ScStw::baseStationSettingToString() + * @see ScStw::baseStationSettingFromString() + */ static const QMap baseStationSettings; + /** + * @brief Function to convert an int to a BaseStationSetting + * @param i the int to convert + * @return a BaseStationSetting + * + * @see ScStw::BaseStationSetting + */ static BaseStationSetting baseStationSettingfromInt(int i); + /** + * @brief Function to convert a QString to a BaseStationSetting + * @param s the string to convert + * @return a BaseStationSetting + * + * @see ScStw::BaseStationSetting + * @see ScStw::baseStationSettingToString() + */ static BaseStationSetting baseStationSettingFromString(QString s); + /** + * @brief Function to convert BaseStationSetting to a QString + * @param s the BaseStationSetting to convert + * @return a QString + * + * @see ScStw::BaseStationSetting + * @see ScStw::baseStationSettingFromString() + */ static QString baseStationSettingToString(BaseStationSetting s); + /** + * @brief Function to convert an int to a SignalKey + * @param i the int to convert + * @return a SignalKey + * + * @see ScStw::SignalKey + */ static SignalKey signalKeyFromInt(int i); private: