-
Notifications
You must be signed in to change notification settings - Fork 3
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
min_value option for time fields is being read incorrectly #48
Comments
The documentation clearly describes this as part of the field type (rather than subtype) here: PandABlocks-server/docs/config.rst Lines 99 to 105 in e5a5dab
PandABlocks-server/server/time.c Lines 108 to 111 in e5a5dab
We can fix the documentation, fix the implementation, or drop the functionality altogether. In order, I'd prefer to drop the functionality or fix the implementation if necessary; this behaviour is part of the user interface (and it can be interrogated via the |
@coretl, do you have a preference here? I'd prefer to drop support for this feature altogether as it doesn't appear to be used. |
There are a couple of cases where the field must be non-zero, but generally we just treat 0 as "the shortest possible time period", so I'm happy to stick with that behaviour and remove this feature |
The code always guards against writing 0 to diff --git a/server/time.c b/server/time.c
@@ -143,7 +135,7 @@ static error__t write_time_value(
{
struct time_class_state *state = class_data;
error__t error =
- TEST_OK_(value == 0 || value > state->min_value, "Value too small");
+ TEST_OK_(value == 0, "Value too small");
if (!error)
WITH_MUTEX(state->mutex)
{ I would push my merge, but PR #55 needs to be approved first. |
Well I'm very confused then, because we explicitly use PULSE.WIDTH = 0 as a flag: And I've just testing writing 0 to PULSE.WIDTH on a live PandA and it works... |
Wait, doesn't this: TEST_OK_(value == 0 || value > state->min_value, "Value too small"); mean that a value of 0, or a value greater than min_value is fine? In which case deleting the |
Oops. It's worse than that: my patch now only accepts 0 as an input. I'd better fix that... |
I do realise now that simply fixing the documentation would have been easier. Oh well, it's not being used, so let's get rid of the feature. |
The server should try to parse a min_value (preceded by a '>' character) of Time fields in the config file. Currently this leads to an unexpected character error. After discussing this with @Araneidae, there is a bug in the server as it is trying to parse the min_value from the registers file instead.
This functionality is not currently used, is it worth implementing correctly or should this be removed. @coretl Are there use cases for this to be implemented correctly?
The text was updated successfully, but these errors were encountered: