Skip to content

Added feature to parse logic and add internal vars to fd_server and fep#106

Draft
mgaliar wants to merge 1 commit into
sandialabs:mainfrom
mgaliar:feat/add-fd-internal-vars
Draft

Added feature to parse logic and add internal vars to fd_server and fep#106
mgaliar wants to merge 1 commit into
sandialabs:mainfrom
mgaliar:feat/add-fd-internal-vars

Conversation

@mgaliar

@mgaliar mgaliar commented May 1, 2026

Copy link
Copy Markdown
Collaborator

Added feature to parse logic and add internal vars to fd_server and fep

Description

The SCEPTRE app will now parse logic and for any intermediate variables that are for inputs or outputs, it will create an internal variable and add to the field device config.

Related Issue

NA

Type of Change

Please select the type of change your pull request introduces:

  • Bugfix
  • New feature
  • Documentation update
  • Other (please describe):

Checklist

  • This PR conforms to the process detailed in the Contributing Guide.
  • I have included no proprietary/sensitive information in my code.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have tested my code.

Additional Notes

NA

@mgaliar mgaliar marked this pull request as draft May 1, 2026 00:12
@mgaliar mgaliar requested review from cmulk and glattercj May 1, 2026 00:12
for protocol in fd_config.protocols:
for device in protocol.devices:
for register in device.registers:
input_regs = ['analog-input', 'binary-input', 'input-register', 'discrete-input']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a global and make it a set. Alternatively, could be if not register.regtype.endswith("input"):

for protocol in fd_config.protocols:
for device in protocol.devices:
for register in device.registers:
input_regs = ['analog-input', 'binary-input', 'input-register', 'discrete-input']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as comment above

lhs = parts[0].strip()
mapped_lhs = output_name_to_tag.get(lhs, None)
if mapped_lhs is None:
internal_tags[lhs] = 0.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the default 0.0?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because why not? Some default is needed.

@GhostofGoes

Copy link
Copy Markdown
Contributor

Presumably there's a related PR in bennu? Could you link to that from the description?

@mgaliar

mgaliar commented May 5, 2026

Copy link
Copy Markdown
Collaborator Author

No related PR yet, but why this is draft. Technically no bennu update is needed. Bennu field device is already capable of using internal tags, we just don't leverage them in the sceptre app until now. However, potential bennu update for order of logic execution might be coming.

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

Successfully merging this pull request may close these issues.

2 participants