Closed olterion closed 1 month ago
What if the ParameterRefRef is in an other ParameterBlock?
Yes you are absolutely right. Now I have added a search for ParameterRef also in ParameterBlocks above the choose object.
Why so complicated? A recursive method which checks if it is a parameterref and the searching id or if not check all child items
In Pseudo-Code:
if(!IsSearchedParaRefRef(vbase.Dynamic[0], dco.ParameterRefObject)
actions.Add([...]);
bool IsSearchedParaRefRef(DynItem item, ParameterRef paraRef) {
if(item is DynParameter dynPara) {
if(dynPara.ParameterRefObject == paraRef) return true;
}
if(dynPara.Items != null) {
foreach(DynItem child in dynPara.Items) {
if(IsSearchedParaRefRef(child, paraRef)) return true;
}
}
return false;
}
Yes its complicated.
With your solution it is not necessary where the ParameterRef Id is written in dynamic section. But here is a example which shows, that only one same RefId as choose RefId is not sufficient.
`
`
Block 1:
Block 2:
With your solution, the ParamRefId of both choose is found in Block 1 and no error will be shown.
The correct solution has be recognize, that the ParameterRef in the Block of the choose is missing. mit_und_ohne_choose_parameter.zip
Did you import your knxprod and tested it?
The ETS doesnt care in which ParameterBlock the ParameterRef and in which the choose is. They can also be in different Channels. As long there is an ParameterRef or an Assign. I get listet both ComObjects as i would expect the ETS do it.
Yes, I think we can refuse this pull request. I had a big mistake in my mind to understand how the "choose" is displayed in the ETS. Only the parameters are displayed and never the choose. The choose is only in XML to get into the branches if there is a change at the parameter value. In some original knxprod there are many choose without appropriate parameter. In that case we have many errors in the check helper.
You can activate an parameterRef in many ways. The simplest is with an parameterRefRef. But you can also use an assign.
I will close this. If you have any other questitons for chooses feel free to open it again or just comment.
Add check for ParameterRefRef with same RefId as choose block in dynamic section.