From ec25870bfd6c30a113ce7c5b2ff10143062d7d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 1 Dec 2015 10:57:27 +0100 Subject: [PATCH] fix documentation --- .../osdomotics/devicepluginosdomotics.cpp | 4 +-- server/rule.cpp | 2 +- server/ruleengine.cpp | 27 ++++++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/plugins/deviceplugins/osdomotics/devicepluginosdomotics.cpp b/plugins/deviceplugins/osdomotics/devicepluginosdomotics.cpp index a7a72775..60e0a69d 100644 --- a/plugins/deviceplugins/osdomotics/devicepluginosdomotics.cpp +++ b/plugins/deviceplugins/osdomotics/devicepluginosdomotics.cpp @@ -26,10 +26,10 @@ \ingroup network This plugin allows you to connect guh to a 6LoWPAN network by adding a Mercury Board from OSDomotics - as a RPL router to your devices \l{OSDomotics Tutorial}{http://osdwiki.open-entry.com/doku.php/de:tutorials:contiki:merkur_board_rpl_usb_router}. + as a RPL router to your devices \l{http://osdwiki.open-entry.com/doku.php/de:tutorials:contiki:merkur_board_rpl_usb_router}{OSDomotics Tutorial- RPL Router}. All nodes in the 6LoWPAN network of the added RPL router will appear automatically in the system. - \note Currently the plugin recognizes only one node. That node has to be flashed like the Node in this \l{OSDomotics tutorial}{http://osdwiki.open-entry.com/doku.php/de:tutorials:contiki:use_example_firmware}. + \note Currently the plugin recognizes only one node. That node has to be flashed like the Node in this \l{http://osdwiki.open-entry.com/doku.php/de:tutorials:contiki:use_example_firmware}{OSDomotics Tutorial - Firmware}. \chapter Plugin properties Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses} diff --git a/server/rule.cpp b/server/rule.cpp index 8bdaddf6..8ea01684 100644 --- a/server/rule.cpp +++ b/server/rule.cpp @@ -129,7 +129,7 @@ bool Rule::enabled() const { } /*! Set the \a enabled flag of this rule. In order to actually enable/disable the rule you still need to - * update the \l{RulesEngine} */ + * update the \l{RuleEngine} */ void Rule::setEnabled(bool enabled) { m_enabled = enabled; diff --git a/server/ruleengine.cpp b/server/ruleengine.cpp index 440d042b..2b94a8ad 100644 --- a/server/ruleengine.cpp +++ b/server/ruleengine.cpp @@ -56,6 +56,8 @@ Couldn't find a \l{Device} with the given id. \value RuleErrorEventTypeNotFound Couldn't find a \l{EventType} with the given id. + \value RuleErrorStateTypeNotFound + Couldn't find a \l{StateType} with the given id. \value RuleErrorActionTypeNotFound Couldn't find a \l{ActionType} with the given id. \value RuleErrorInvalidParameter @@ -66,8 +68,17 @@ One of the given \l{Param}{Params} is missing. \value RuleErrorInvalidRuleActionParameter One of the given \l{RuleActionParam}{RuleActionParams} is not valid. + \value RuleErrorInvalidStateEvaluatorValue + One of the given \l{StateEvaluator}{StateEvaluators} has an invalid \l{State} value. \value RuleErrorTypesNotMatching The types of the \l{RuleActionParam} and the corresponding \l{Event} \l{Param} do not match. + \value RuleErrorNotExecutable + This rule is not executable. + \value RuleErrorContainsEventBasesAction + This rule contains an \l{Action} which depends on an \l{Event} value. This \l{Rule} cannot execute + the \l{Action}{Actions} without the \l{Event} value. + \value RuleErrorNoExitActions + This rule does not have any ExitActions which means they cannot be executed. */ /*! \enum guhserver::RuleEngine::RemovePolicy @@ -263,8 +274,8 @@ RuleEngine::RuleError RuleEngine::addRule(const RuleId &ruleId, const QString &n return addRule(ruleId, name, eventDescriptorList, StateEvaluator(), actions, QList(), enabled); } -/*! Add a new \l{Rule} with the given \a ruleId, \a name, \a eventDescriptorList, \a stateEvaluator, the list of \a actions the list of \a exitActions and the \a enabled value to the engine. - If \a fromEdit is true, the notification Rules.RuleAdded will not be emitted. +/*! Add a new \l{Rule} with the given \a ruleId, \a name, \a eventDescriptorList, \a stateEvaluator, the list of \a actions, the list of \a exitActions, the \a enabled and the \a executable value to the engine. + If \a fromEdit is true, the notification Rules. RuleAdded will not be emitted. */ RuleEngine::RuleError RuleEngine::addRule(const RuleId &ruleId, const QString &name, const QList &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList &actions, const QList &exitActions, bool enabled, bool executable, bool fromEdit) { @@ -366,7 +377,7 @@ RuleEngine::RuleError RuleEngine::addRule(const RuleId &ruleId, const QString &n } /*! Edit a \l{Rule} with the given \a ruleId, \a name, \a eventDescriptorList, \a stateEvaluator, - the list of \a actions the list of \a exitActions and the \a enabled in the engine. + the list of \a actions, the list of \a exitActions, the \a enabled and the \a executable in the engine. */ RuleEngine::RuleError RuleEngine::editRule(const RuleId &ruleId, const QString &name, const QList &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList &actions, const QList &exitActions, bool enabled, bool executable) { @@ -483,6 +494,11 @@ RuleEngine::RuleError RuleEngine::disableRule(const RuleId &ruleId) return RuleErrorNoError; } +/*! Executes the list of \l{Action}{Actions} of the rule with the given \a ruleId. + Returns the corresponding RuleEngine::RuleError to inform about the result. + + \sa executeExitActions() +*/ RuleEngine::RuleError RuleEngine::executeActions(const RuleId &ruleId) { // check if rule exits @@ -512,6 +528,11 @@ RuleEngine::RuleError RuleEngine::executeActions(const RuleId &ruleId) return RuleErrorNoError; } +/*! Executes the list of \l{Action}{ExitActions} of the rule with the given \a ruleId. + Returns the corresponding RuleEngine::RuleError to inform about the result. + + \sa executeActions() +*/ RuleEngine::RuleError RuleEngine::executeExitActions(const RuleId &ruleId) { // check if rule exits