-
Notifications
You must be signed in to change notification settings - Fork 137
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
Make longout record only write on change #63
Conversation
❌ Build EPICS Base base-7.0-546 failed (commit d0cb53d184 by @) |
Group review 2020-03-25: Needs testing, approve in principle before merging. |
This PR now has conflicts in longoutRecord.c file, probably from 36a8b51. More importantly though the two additional fields and their behavior need to be documented in the longoutRecord.dbd.pod reference text, and it should also have a brief entry in the Release Notes. Maybe at the upcoming codeathon? |
Sounds good! Maybe expand to the remaining records. Looking forward to the codeathon! |
I would prefer to add a separate field to store the "write once" bit, rather than adding an option to the menu. Rationale:
The semantics of this field would be "consider a change in OUT as a value change wrt the OOPT 'on change' value", type could be menuYesNo. |
Fair enough, it also keeps OOPT consistent with the other records that already use it. |
fe8182e
to
19003eb
Compare
❌ Build EPICS Base 7 base-7.0-190 failed (commit aa717ebe4d by @joaopaulosm) |
1387c94
to
f4d94b9
Compare
Ok, I've done some modification on the implementation. So, the default behaviour when OOPT is "On Change" and the OUT link is changed is to write to the output during the next time the record is processed even if VAL is the same. To avoid this behaviour, OOCH must be set to NO. I've also added more test cases in longoutTest.c to validate all cases. The tests are done using a simple longout record that writes to the B field of CALC records. These calc records are configured as counters (CALC = A + 1, with A being the calc record itself). This way, we can measure how many times the longout has written to the output link by checking the value of the calc fields. If the implementation, nomenclature and documentation are OK, I can extend this feature to the remaining output records:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love all the tests, thank-you for writing them!
I'm requesting a few minor changes but I think this looks good otherwise.
…ut, better documentation
Thanks @anjohnson! All your requests were implemented. |
We may have a problem with the "On Change" OOPT mode: the first (initial) processing. Since the What should we do?
|
There would seem to be overlap with the OOCH and OUTPVT field in that problem, could you maybe initialize OUTPVT to |
…e and OOPT is On Change
Done! Added a few tests cases for that scenario. |
✅ Build EPICS Base 7 base-7.0-226 completed (commit c404858b28 by @joaopaulosm) |
Group meeting 7/28 Re-run tests against latest. |
Merged after rebase and some minor edits, at 413f14e. Sorry for the long delay, at least it got in before 2023! |
Thank you Andrew! I should probably find some time to extend this feature to the other output records. In fact, I think I already did it for the stringout. |
This pull request refers to bug 1398215 on Launchpad (https://bugs.launchpad.net/epics-base/+bug/1398215), which is "Make output records only write on change". The first record to have this feature implemented is the longout record.
Two fields were added to the record: OOPT and OVAL. The first one is a menu field with usual options from other records, the second holds the last value written and its used for the comparison during the record process routine.
OOPT can assume the following options:
If the OUT field is changed during runtime and OOPT is "On Change", the record special function will force OOPT to be "Write Once then On Change". This will cause output record write to new destination even if the value is equal the previous one.
The second commit refers to test routines of the feature that was implemented.