HOPS
HOPS class reference
Public Member Functions | List of all members
hops_control.config._ConditionBuilder Class Reference

Public Member Functions

def __init__ (self, config)
 
'_ConditionBuilder__enter__ (self)
 
def __exit__ (self, exc_type, exc_val, exc_tb)
 
'_ConditionBuilderAND (self)
 
'_ConditionBuilderbaseline (self, str b)
 
'_ConditionBuilderfgroup (self, str fg)
 
'_ConditionBuilderNOT (self)
 
'_ConditionBuilderOR (self)
 
'_ConditionBuilderscan_after (self, str scan)
 
'_ConditionBuilderscan_before (self, str scan)
 
'_ConditionBuilderscan_between (self, str lo, str hi)
 
'_ConditionBuildersource (self, str s)
 
'_ConditionBuilderstation (self, str s)
 

Detailed Description

Implements the fluent builder pattern for a fourfit control-DSL condition token list.

Returned by ``cfg.IF()``.  Each method appends tokens to an internal list
and returns ``self``, so calls can be chained before the ``with`` statement.

Boolean operators (matching DSL ``and`` / ``or`` / ``not``)::

    .AND()   -- appends "and"
    .OR()    -- appends "or"
    .NOT()   -- appends "not"

Predicate methods (each appends its keyword plus argument tokens)::

    .station(s)              -- "station" s
    .baseline(b)             -- "baseline" b
    .source(s)               -- "source" s
    .fgroup(fg)              -- "f_group" fg
    .scan_before(scan)       -- "scan" "<" scan
    .scan_after(scan)        -- "scan" ">" scan
    .scan_between(lo, hi)    -- "scan" lo "to" hi

The token list is passed verbatim to ``MHO_ControlConditionEvaluator``, so
the full DSL grammar (including ``not`` and parentheses via raw token
injection) is available. Final token consumption is done on the C++ side.

Note! Nested conditional ``with`` blocks are not allowed. This mirrors the
underlying fourfit control domain-specific-language (DSL), which has 
flat conditionals rather than nested ones. To express multiple predicates, 
combine them in a single call chain, e.g.::

    with cfg.IF().station("G").AND().source("3C279"):
        ...

rather than nesting::

    with cfg.IF().station("G"):
        with cfg.IF().source("3C279"):   # not allowed
            ...

Constructor & Destructor Documentation

◆ __init__()

def hops_control.config._ConditionBuilder.__init__ (   self,
  config 
)

Member Function Documentation

◆ __enter__()

'_ConditionBuilder' hops_control.config._ConditionBuilder.__enter__ (   self)

◆ __exit__()

def hops_control.config._ConditionBuilder.__exit__ (   self,
  exc_type,
  exc_val,
  exc_tb 
)

◆ AND()

'_ConditionBuilder' hops_control.config._ConditionBuilder.AND (   self)
Append "and" to the condition token list.

◆ baseline()

'_ConditionBuilder' hops_control.config._ConditionBuilder.baseline (   self,
str  b 
)
Append ``baseline <b>`` tokens.

◆ fgroup()

'_ConditionBuilder' hops_control.config._ConditionBuilder.fgroup (   self,
str  fg 
)
Append ``f_group <fg>`` tokens.

◆ NOT()

'_ConditionBuilder' hops_control.config._ConditionBuilder.NOT (   self)
Append "not" to the condition token list.

◆ OR()

'_ConditionBuilder' hops_control.config._ConditionBuilder.OR (   self)
Append "or" to the condition token list.

◆ scan_after()

'_ConditionBuilder' hops_control.config._ConditionBuilder.scan_after (   self,
str  scan 
)
Append ``scan > <scan>`` tokens.

◆ scan_before()

'_ConditionBuilder' hops_control.config._ConditionBuilder.scan_before (   self,
str  scan 
)
Append ``scan < <scan>`` tokens.

◆ scan_between()

'_ConditionBuilder' hops_control.config._ConditionBuilder.scan_between (   self,
str  lo,
str  hi 
)
Append ``scan <lo> to <hi>`` tokens.

◆ source()

'_ConditionBuilder' hops_control.config._ConditionBuilder.source (   self,
str  s 
)
Append ``source <s>`` tokens.

◆ station()

'_ConditionBuilder' hops_control.config._ConditionBuilder.station (   self,
str  s 
)
Append ``station <s>`` tokens.

The documentation for this class was generated from the following file: