openfluid
openfluid copied to clipboard
Duplicate generator can be added in Builder
Since generator identity is based on variableName.classUnit, two generators with identical parameters will have shared setting. Forbid identical generator creation in Builder generator creation dialog ?
Reproduced bug:
- Ambigious generator objects can be created: same unit class and same var name (happens even when value produced by generator is different)
- They will make the simulation unable to run, and graph-related aesthetic information will be the same (appears at reload of the project) :
- simulator box color
- position in graphical view
Fundamental principle: a variable for a unit class can be produced by only one ware therefore two generators with same unit class and variable names should not be accepted.
Case correctly handled at simulation level in Builder and CLI:
* Checking consistency... [Error]
OpenFLUID ERROR: var10 variable on unitsA produced by var10.unitsA.genscalar cannot be created
because it is already created
- [ ] Fix: in Builder, add blocking check in generator creation dialog to forbid twin generator situation