refactor(force-patch): move MC touch panel class to use partial classes

This commit is contained in:
Andrew Welker
2025-09-19 13:13:09 -05:00
parent f84ae4d82f
commit 3261c01bfa
5 changed files with 430 additions and 332 deletions

View File

@@ -0,0 +1,76 @@
using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Core.Logging;
namespace PepperDash.Essentials.Touchpanel
{
/// <summary>
/// Partial class containing app control functionality for managing applications on the touchpanel.
/// </summary>
public partial class MobileControlTouchpanelController
{
/// <summary>
/// Sets the application URL for mobile control access.
/// </summary>
/// <param name="url">The URL to set for the mobile control application.</param>
public void SetAppUrl(string url)
{
_appUrl = GetUrlWithCorrectIp(url);
AppUrlFeedback.FireUpdate();
}
/// <summary>
/// Hides the currently open application on the touchpanel.
/// </summary>
public void HideOpenApp()
{
if (Panel is TswX70Base x70Panel)
{
x70Panel.ExtenderApplicationControlReservedSigs.HideOpenedApplication();
return;
}
if (Panel is TswX60BaseClass x60Panel)
{
x60Panel.ExtenderApplicationControlReservedSigs.HideOpenApplication();
return;
}
}
/// <summary>
/// Opens an application on the touchpanel.
/// </summary>
public void OpenApp()
{
if (Panel is TswX70Base x70Panel)
{
x70Panel.ExtenderApplicationControlReservedSigs.OpenApplication();
return;
}
if (Panel is TswX60WithZoomRoomAppReservedSigs)
{
Debug.LogMessage(Serilog.Events.LogEventLevel.Information, this, $"X60 panel does not support zoom app");
return;
}
}
/// <summary>
/// Closes the currently open application on the touchpanel.
/// </summary>
public void CloseOpenApp()
{
if (Panel is TswX70Base x70Panel)
{
x70Panel.ExtenderApplicationControlReservedSigs.CloseOpenedApplication();
return;
}
if (Panel is TswX60WithZoomRoomAppReservedSigs x60Panel)
{
x60Panel.ExtenderApplicationControlReservedSigs.CloseOpenedApplication();
return;
}
}
}
}