Hello,
I’m trying to replicate the behavior of the Merge and Addition components in one component. The goal is to start with two input variables, which can never be deleted. Once both variables are fed with a value, a new (third) input slot should be created. Once a value is provided to the third slot a new (forth) input slot should be created and so on. If the user does not want to provide a fourth value, he/she should be able to delete this input slot. I think I have understood most of the concepts related to the VariableParameterComponent interface but there are certain behaviors I have not managed to implement:
When the first and second variables are fed with a value, the third slot is NOT generated, even though I have implemented the RegisterInputParam function in VariableParameterMaintenance. Obviously the same applies when three variables are fed with a value and so on. Rather, the user has to manually click on the “+” sign.
When the new input slot (e.g. third one) is manually introduced, the summation of the previous varaibles (e.g. first and second) fails.
I cannot manage to delete the 3rd input slot if the first and second variables have been fed with a value.
The VariableParameterMaintenance is only used to renumber everything.
For the second issue I guess the problem comes from double.NaN that makes the addition fail. I’ve changed it to 0, as well as looping through all inputs.
I’ve added the Optional = true option so inputs can stay empty.
If you really want the user to use the first two inputs before adding a third input, you may want to check the SourceCount property of inputs.