Skip to content
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

AttributeEditor: Flag attributes with invalid values #2141

Merged
merged 6 commits into from
Aug 21, 2023

Conversation

cbentejac
Copy link
Contributor

Description

This PR introduces two new parameters in the description of Int, Float and String attributes:

  • validValue, which is true if the value of the attribute is not erroneous (i.e. valid for the type of the attribute but invalid in the
    context of that specific attribute) and false otherwise. This holds a different significance than the "validateValue()" method, which only checks if the attribute's value is correct with respect to its type. For example, we could want an IntParam that flags any value that is not even: an odd integer value would successfully go through the "validateValue()" method, but would then be flagged as an invalid value at the attribute's level.
  • errorMessage, an attribute-specific string that contains a message explaining why the attribute's validValue parameter might be set to false.

With these new parameters, attributes that have an invalid value will be flagged directly in the Attribute Editor as follows:

  1. An icon indicating an error will be added next to the attribute's name.
  2. The color of the label's background will change to red to clearly indicate that the current value is wrong.
  3. If the attribute's error message has been filled, it will be displayed in its tooltip, right before its regular description.

Finally, this PR sets validValue and errorMessage in the HDR fusion nodes (LdrToHdrSampling, LdrToHdrCalibration and LdrToHdrMerge) for the userNbBrackets attribute so that any user-set bracket value that is not a multiple of the number of input images is flagged down.

For example, if the user manually sets userNbBrackets to 3 when there are 28 input images, the attribute will immediately appear as invalid:

Features list

  • Add new validValue and errorMessage parameters to the description of Int, Float and String attributes;
  • Highlight attributes with invalid values in the Attribute Editor;
  • Display an attribute's error message along with its description in its tooltip if its value is invalid;
  • Flag the userNbBrackets attribute in the HDR Fusion nodes when its value is not a multiple of the number of input images.

@cbentejac cbentejac added the UI label Aug 3, 2023
@cbentejac cbentejac added this to the Meshroom 2023.3.0 milestone Aug 3, 2023
@cbentejac cbentejac self-assigned this Aug 3, 2023
cbentejac and others added 6 commits August 21, 2023 16:30
This commit adds two new description parameters:

- `validValue`, which is true if the value of the attribute is not
erroneous (i.e. valid for the type of the attribute but invalid in the
context of that specific attribute) and false otherwise. This holds a
different significance than the "validateValue" method, which only checks
if the parameter's value is expected with respect to the attribute's type.
For example, we could want an IntParam that flags any value that is not
even: an odd integer value would successfully go through the
"validateValue" method, but would then be flagged as an invalid value
at the attribute's level.

- `errorMessage`, an attribute-specific string that contains a message
explaining why the attribute's `validValue` parameter might be set to
false.

By default, all the attributes' values are valid, and they have no error
message.
If an attribute's `validValue` is false, and it has a non-empty
`errorMessage`, the following will happen:
- An icon indicating an error will be added next to the attribute's name;
- The color of the label's background will change to red to clearly
indicate that something is wrong with the current value;
- The error message that has been set for this attribute will be displayed
in its tooltip, before its regular description.
…ltiple of the number of inputs

Add an error message for `userNbBrackets` and set `validValue` to false
if the set number of brackets is not a multiple of the number of input
images.
@mugulmd mugulmd merged commit e873dbf into develop Aug 21, 2023
1 of 2 checks passed
@mugulmd mugulmd deleted the dev/wrongBracketsMessage branch August 21, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants