set_values[] is a misused variable that is initialized to -2.0f.
It is used as a flag in certain parts of the code, and is only updated
if a magnet's demand value is set.
This causes issues when not all magnets have been set during the life
cycle of the frontend. It's supposed to transition ZFC to active mode,
once all magnet's demand values are 0. But if some haven't been set,
they aren't seen as having a 0 value and it's not transitioning ZFC
to active mode.
This PR, with as little intrusive changes, as possible solves this issue.
I also wonder why ZFC is configured from inside the magnet driver.
At GPS there is a ZFC program that already takes the strayfield values as input,
I think likewise it should take magnet values as input and handle the mode switching in there.
But doing so would probably trigger a rewrite, which probably is out of scope for current Midas project.
set_values[] is a misused variable that is initialized to -2.0f.
It is used as a flag in certain parts of the code, and is only updated
if a magnet's demand value is set.
This causes issues when not all magnets have been set during the life
cycle of the frontend. It's supposed to transition ZFC to active mode,
once all magnet's demand values are 0. But if some haven't been set,
they aren't seen as having a 0 value and it's not transitioning ZFC
to active mode.
This PR, with as little intrusive changes, as possible solves this issue.
I also wonder why ZFC is configured from inside the magnet driver.
At GPS there is a ZFC program that already takes the strayfield values as input,
I think likewise it should take magnet values as input and handle the mode switching in there.
But doing so would probably trigger a rewrite, which probably is out of scope for current Midas project.
set_values[] is a misused variable that is initized to -2.0f.
It is used as a flag in certain parts of the code, and is only updated
if a magnet's demand value is set.
This causes issues when not all magnets have be set during the life
cycle of the frontend. It's supposed to transition ZFC to active mode,
once all magnet's demand values are 0. But if some haven't been set,
they aren't seen as having a 0 value and it's not transitioning ZFC
to active mode.
soederqvist_a
requested review from mathis_s 2026-11-23 14:22:19 +01:00
soederqvist_a
requested review from wall_e 2026-11-23 14:22:19 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
set_values[] is a misused variable that is initialized to -2.0f.
It is used as a flag in certain parts of the code, and is only updated
if a magnet's demand value is set.
This causes issues when not all magnets have been set during the life
cycle of the frontend. It's supposed to transition ZFC to active mode,
once all magnet's demand values are 0. But if some haven't been set,
they aren't seen as having a 0 value and it's not transitioning ZFC
to active mode.
This PR, with as little intrusive changes, as possible solves this issue.
I also wonder why ZFC is configured from inside the magnet driver.
At GPS there is a ZFC program that already takes the strayfield values as input,
I think likewise it should take magnet values as input and handle the mode switching in there.
But doing so would probably trigger a rewrite, which probably is out of scope for current Midas project.