Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

[BUG]-CameraBase.LinkCameraToApi method incorrectly sets the max number of presets in for loop on line 234

Open jtalborough opened this issue 4 years ago • 2 comments

for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
                {
                    int tempNum = i;

                    trilist.SetSigTrueAction((ushort) (joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
                    {
                        presetsCamera.PresetSelect(tempNum);
                    });
                    trilist.SetSigTrueAction((ushort) (joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
                    {
                        var label = trilist.GetString((ushort) (joinMap.PresetLabelStart.JoinNumber + tempNum));

                        presetsCamera.PresetStore(tempNum, label);
                    });
                }

The joinMap.NumberOfPrests.JoinNumber will be a fixed number depending on the joinStart. When joinStart is 51 the number would be 61 yielding 61 presets.

The join map defines the NumberOfPresets value as "Tells Essentials the number of defined presets" which means it should be more like

for (int i = 0; i < trilist.UShortInput[joinMap.NumberOfPresets.JoinNumber].UShortValue; i++)

or better yet first checking for a value first and defaulting.

Personally I think it should be fixed at 20 and developer can override as needed. In any case currently when using more than one camera on a bridge it adversely affects the preset recall and storage.

jtalborough avatar Oct 12 '21 16:10 jtalborough

If I'm understanding correctly, this is what the JoinSpan poperty on the join map is for. It can be set to 10 by default but that allows it to be overridden by config if more/less presets are desired.

The value of JoinSpan for joinMap.PresetRecallStart should be used to determine the number of iterations of this for loop.

ndorin avatar Oct 12 '21 17:10 ndorin

@jtalborough check if this is fixed.

jtalborough avatar Feb 23 '23 18:02 jtalborough