fix some comments
This commit is contained in:
parent
56ca42e1ca
commit
dbe0b47035
@ -83,7 +83,7 @@ bool StateDescriptor::operator ==(const StateDescriptor &other) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! Compare this StateDescriptor to the \l{State} given by \a state.
|
/*! Compare this StateDescriptor to the \l{State} given by \a state.
|
||||||
* Returns true if the given state matches the definition of the StateDescriptor */
|
* Returns true if the given \a state matches the definition of the StateDescriptor */
|
||||||
bool StateDescriptor::operator ==(const State &state) const
|
bool StateDescriptor::operator ==(const State &state) const
|
||||||
{
|
{
|
||||||
if ((m_stateTypeId != state.stateTypeId()) || (m_deviceId != state.deviceId())) {
|
if ((m_stateTypeId != state.stateTypeId()) || (m_deviceId != state.deviceId())) {
|
||||||
@ -109,7 +109,7 @@ bool StateDescriptor::operator ==(const State &state) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! Compare this StateDescriptor to the \l{State} given by \a state.
|
/*! Compare this StateDescriptor to the \l{State} given by \a state.
|
||||||
* returns true if the given state does not match the definition of the StateDescriptor */
|
* returns true if the given \a state does not match the definition of the StateDescriptor */
|
||||||
bool StateDescriptor::operator !=(const State &state) const
|
bool StateDescriptor::operator !=(const State &state) const
|
||||||
{
|
{
|
||||||
return !(operator==(state));
|
return !(operator==(state));
|
||||||
|
|||||||
@ -255,7 +255,7 @@ Rule GuhCore::findRule(const RuleId &ruleId)
|
|||||||
return m_ruleEngine->findRule(ruleId);
|
return m_ruleEngine->findRule(ruleId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Calls the metheod RuleEngine::addRule(\a id, \a eventDescriptorList, \a actionList).
|
/*! Calls the metheod RuleEngine::addRule(\a id, \a eventDescriptorList, \a stateEvaluator \a actionList, \a enabled).
|
||||||
* \sa RuleEngine, */
|
* \sa RuleEngine, */
|
||||||
RuleEngine::RuleError GuhCore::addRule(const RuleId &id, const QList<EventDescriptor> &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList<Action> &actionList, bool enabled)
|
RuleEngine::RuleError GuhCore::addRule(const RuleId &id, const QList<EventDescriptor> &eventDescriptorList, const StateEvaluator &stateEvaluator, const QList<Action> &actionList, bool enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -158,8 +158,8 @@ RuleEngine::RuleEngine(QObject *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! Ask the Engine to evaluate all the rules for the given \a event.
|
/*! Ask the Engine to evaluate all the rules for the given \a event.
|
||||||
This will search all the \l{Rule}{Rules} triggered by this \l{Event}
|
This will search all the \l{Rule}{Rules} triggered by the given \a event
|
||||||
and evaluate it's states in the system. It will return a
|
and evaluate their states in the system. It will return a
|
||||||
list of all \l{Action}{Actions} that should be executed. */
|
list of all \l{Action}{Actions} that should be executed. */
|
||||||
QList<Action> RuleEngine::evaluateEvent(const Event &event)
|
QList<Action> RuleEngine::evaluateEvent(const Event &event)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,10 +66,8 @@ void StateEvaluator::setOperatorType(Types::StateOperator operatorType)
|
|||||||
|
|
||||||
bool StateEvaluator::evaluate() const
|
bool StateEvaluator::evaluate() const
|
||||||
{
|
{
|
||||||
qDebug() << "evaluating:" ;
|
|
||||||
if (m_stateDescriptor.isValid()) {
|
if (m_stateDescriptor.isValid()) {
|
||||||
Device *device = GuhCore::instance()->findConfiguredDevice(m_stateDescriptor.deviceId());
|
Device *device = GuhCore::instance()->findConfiguredDevice(m_stateDescriptor.deviceId());
|
||||||
qDebug() << "have device";
|
|
||||||
if (!device) {
|
if (!device) {
|
||||||
qWarning() << "Device not existing!";
|
qWarning() << "Device not existing!";
|
||||||
return false;
|
return false;
|
||||||
@ -80,7 +78,6 @@ bool StateEvaluator::evaluate() const
|
|||||||
}
|
}
|
||||||
if (m_stateDescriptor != device->state(m_stateDescriptor.stateTypeId())) {
|
if (m_stateDescriptor != device->state(m_stateDescriptor.stateTypeId())) {
|
||||||
// state not matching
|
// state not matching
|
||||||
qDebug() << "booo" << m_stateDescriptor.stateValue() << device->stateValue(m_stateDescriptor.stateTypeId());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user