1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Resetting a compress record to empty it |
From: | "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Érico Nogueira Rolim <erico.rolim at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Tue, 10 Dec 2024 18:26:40 +0000 |
Hi Érico, I don’t know the compress record internals terribly well, but it sounds like the reset behavior you’re seeing isn’t ideal. Changing record functionality to make it more sensible is something that we can do, although we try to be careful
to not break IOCs that might rely on the existing behavior so any changes must be documented. The compressRecord.c file only ever posts monitors on NUSE and VAL. In older versions of the IOC, CA didn’t handle zero-length arrays very well and that might have been why the RES field didn’t trigger a monitor event on VAL, although I
don’t see why it couldn’t have posted them on the NUSE field. If you want to try fixing this, you could add a call to
monitor(prec) to the special() routine immediately after the call to
reset(prec) — the
reset() routine has other callers so it can’t call
db_post_events() itself, but calling
monitor(prec) after that looks like it might do the right thing. I don’t know if that’s the best fix, others here may know better and disagree — please take a look and speak up if you’ve worked on the compress record recently! If that change does what you need and there are no dissenters here, we would consider merging a pull request with that change, but please run the unit tests to see if they might need changes to match — this record type has unit tests! HTH, - Andrew -- Complexity comes for free, Simplicity you have to work for. |