API
indiCompRules.hpp File Reference

The rules for the MagAO-X stateRuleEngine. More...

#include <variant>
#include <mx/mxException.hpp>
#include "../../libMagAOX/libMagAOX.hpp"
Include dependency graph for indiCompRules.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  indiCompRule
 Virtual base-class for all rules. More...
 
struct  onePropRule
 A rule base class for testing an element in one property. More...
 
struct  twoPropRule
 A rule base class for testing elements in two properties. More...
 
struct  numValRule
 Compare the value of a number element to a target. More...
 
struct  txtValRule
 Compare the value of a text element to a target value. More...
 
struct  swValRule
 Compare the value of a switch to a target value. More...
 
struct  elCompNumRule
 Compare two elements based on their numeric values. More...
 
struct  elCompTxtRule
 Compare two elements based on their text values. More...
 
struct  elCompSwRule
 Compare two elements based on their switch values. More...
 
struct  ruleCompRule
 A rule to compare two rules. More...
 

Enumerations

enum class  ruleComparison {
  Eq , Neq , Lt , Gt ,
  LtEq , GtEq , And , Nand ,
  Or , Nor , Xor = Neq , Xnor = Eq
}
 Logical comparisons for the INDI rules. More...
 
enum class  rulePriority {
  none , info , caution , warning ,
  alert
}
 Reporting priorities for rules. More...
 

Functions

ruleComparison string2comp (const std::string &cstr)
 Get the ruleComparison member from a string representation. More...
 
rulePriority string2priority (const std::string &pstr)
 Get the rulePriority member from a string representation. More...
 

Detailed Description

The rules for the MagAO-X stateRuleEngine.

Definition in file indiCompRules.hpp.

Enumeration Type Documentation

◆ ruleComparison

enum ruleComparison
strong

Logical comparisons for the INDI rules.

Enumerator
Eq 

Equal.

Neq 

Not equal.

Lt 

Less than.

Gt 

Greater than.

LtEq 

Less than or equal to.

GtEq 

Greater than or equal to.

And 

boolean and

Nand 

boolean nand

Or 

boolean or

Nor 

boolean nor

Xor 

boolean xor, equivalent to not equal

Xnor 

boolean xnor, equivalent to equal

Definition at line 17 of file indiCompRules.hpp.

◆ rulePriority

enum rulePriority
strong

Reporting priorities for rules.

Enumerator
none 

Don't publish.

info 

For information only.

caution 

Caution – make sure you know what you're doing.

warning 

Warning – something is probably wrong, you should check.

alert 

Alert – something is definitely wrong, you should take action.

Definition at line 93 of file indiCompRules.hpp.

Function Documentation

◆ string2comp()

ruleComparison string2comp ( const std::string &  cstr)

Get the ruleComparison member from a string representation.

Needed for processing configuration files

Definition at line 36 of file indiCompRules.hpp.

Referenced by loadRuleConfig().

◆ string2priority()

rulePriority string2priority ( const std::string &  pstr)

Get the rulePriority member from a string representation.

Needed for processing configuration files

Definition at line 105 of file indiCompRules.hpp.

Referenced by loadRuleConfig().