Commit c84cb53a authored by Pierre Paleo's avatar Pierre Paleo
Browse files

Allow enable_halftomo=auto in nabu config

parent 1e1c6de7
...@@ -283,9 +283,9 @@ nabu_config = { ...@@ -283,9 +283,9 @@ nabu_config = {
"type": "optional", # put "advanced" with default value "edges" ? "type": "optional", # put "advanced" with default value "edges" ?
}, },
"enable_halftomo": { "enable_halftomo": {
"default": "0", "default": "auto",
"help": "Whether to enable half-acquisition", "help": "Whether to enable half-acquisition. Default is auto. You can enable/disable it manually by setting 1 or 0.",
"validator": boolean_validator, "validator": boolean_or_auto_validator,
"type": "optional", "type": "optional",
}, },
"start_x": { "start_x": {
......
...@@ -212,6 +212,14 @@ def boolean_validator(val): ...@@ -212,6 +212,14 @@ def boolean_validator(val):
assert error is None, "Invalid boolean value" assert error is None, "Invalid boolean value"
return res return res
@validator
def boolean_or_auto_validator(val):
res, error = convert_to_bool(val)
if error is not None:
assert val.lower() == "auto", "Valid values are 0, 1 and auto"
return val
return res
@validator @validator
def float_validator(val): def float_validator(val):
val_float, error = convert_to_float(val) val_float, error = convert_to_float(val)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment