Skip to content

33 add calc record logic#39

Merged
kurup merged 8 commits into
mainfrom
33-add-calc-record-logic
Sep 26, 2025
Merged

33 add calc record logic#39
kurup merged 8 commits into
mainfrom
33-add-calc-record-logic

Conversation

@kurup

@kurup kurup commented Sep 26, 2025

Copy link
Copy Markdown
Contributor

This PR adds a calc rule that calculates the value for a PV based on other PVs and a string that defines the calculation. The config reader and pvrecipe have been updated to add support for the calc rule. A method has been added to the server class so that the server object can be used to return the value of a PV either directly using the SharedPV object if it is local to the server or using a Context get if the PV is remote. This also fixes a small bug in the concurrency model where p4p.client.raw.Context in server.Server was not being substituted by the thread or asyncio versions of Context. Support for NTScalarArrays will be added in the future.

@kurup
kurup requested review from Monarda and aqshafei September 26, 2025 10:23
@kurup kurup linked an issue Sep 26, 2025 that may be closed by this pull request
Comment thread p4pillon/pvrecipe.py Outdated
+ f" Config settings are:\n {self.config_settings} \n Initial value:\n {self.initial_value}\n"
)

kws = {}

@aqshafei aqshafei Sep 26, 2025

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.

would changing kws to kwargs be more descriptive variable name?
I know some people in python use both. I think other files uses kws

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, it's best to be consistent. I've renamed kws to kwargs throughout.

@kurup
kurup merged commit 4834cd8 into main Sep 26, 2025
16 checks passed
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.

Add in logic to replicate behaviour of traditional CALC records

2 participants