fix(Devices.Common.Cameras.CameraVisca): add and fire the event OnPresetsListHasChanged() after LinkToApi so that the camera presets populate to the bridge correctly

This commit is contained in:
Jason Alborough
2021-08-11 13:00:51 -04:00
parent 3aab807631
commit 71881addab

View File

@@ -170,6 +170,8 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkCameraToApi(this, trilist, joinStart, joinMapKey, bridge);
OnPresetsListHasChanged();
}
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
@@ -525,6 +527,15 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
public event EventHandler<EventArgs> PresetsListHasChanged;
protected void OnPresetsListHasChanged()
{
var handler = PresetsListHasChanged;
if (handler == null)
return;
handler.Invoke(this, EventArgs.Empty);
}
public List<CameraPreset> Presets { get; private set; }
public void PresetSelect(int preset)
@@ -537,6 +548,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
SavePreset(preset);
}
#endregion
#region IHasCameraFocusControl Members