Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep Serialization, Behavior Trees, EPICS unentwined in code #46

Open
joshc-slac opened this issue Sep 18, 2024 · 2 comments
Open

Keep Serialization, Behavior Trees, EPICS unentwined in code #46

joshc-slac opened this issue Sep 18, 2024 · 2 comments

Comments

@joshc-slac
Copy link
Collaborator

joshc-slac commented Sep 18, 2024

Current Behavior

Fundamental to where we want to take this library we cannot be limited by only facilitating EPICS level commands. This is relatively well captured but it is easy within the current paradigm to allow EPICS things to creep into a place where they should not be.

Case and point:

proc_type=CAProcess,

ActionWorker should default to spawning a Process and take as argument from its ActionNode parent what type of process this is.:

self.worker = ActionWorker(
proc_name=name,
volatile_status=self.volatile_status,
work_gate=self.work_gate,
work_func=self.work_func,
comp_cond=completion_condition,
stop_func=None
) # TODO: some standard notion of stop function could be valuable

Possible Solution

This may require making an enum that we gets set by the results of the type of node specified in the config json file and parsed by tree_config.py that gets passed the action node, there are other alternatives as well.

@joshc-slac
Copy link
Collaborator Author

Another location, this one I would argue is a more serious infringement of the conceptual distance between BTs / Serialization / EPICS

BEAMS/beams/tree_config.py

Lines 135 to 148 in 3b8b95b

class ConditionItem(BaseItem):
pv: str = ""
value: Any = 1
operator: ConditionOperator = ConditionOperator.equal
def get_tree(self) -> ConditionNode:
cond_func = self.get_condition_function()
return ConditionNode(self.name, cond_func)
def get_condition_function(self) -> Callable[[], bool]:
op = getattr(operator, self.operator.value)
def cond_func():
val = caget(self.pv)

@joshc-slac joshc-slac changed the title Maintain rigor of ActionNodes and ActionWorker being task agnostic Keep Serialization, Behavior Trees, EPICS unentwined in code Sep 25, 2024
@joshc-slac
Copy link
Collaborator Author

This was pretty well addressed by #67; I think theres probably more creep, going to keep this open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant