using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Core.Logging;
namespace PepperDash.Essentials.Touchpanel
{
///
/// Partial class containing app control functionality for managing applications on the touchpanel.
///
public partial class MobileControlTouchpanelController
{
///
/// Sets the application URL for mobile control access.
///
/// The URL to set for the mobile control application.
public void SetAppUrl(string url)
{
_appUrl = GetUrlWithCorrectIp(url);
AppUrlFeedback.FireUpdate();
}
///
/// Hides the currently open application on the touchpanel.
///
public void HideOpenApp()
{
if (Panel is TswX70Base x70Panel)
{
x70Panel.ExtenderApplicationControlReservedSigs.HideOpenedApplication();
return;
}
if (Panel is TswX60BaseClass x60Panel)
{
x60Panel.ExtenderApplicationControlReservedSigs.HideOpenApplication();
return;
}
}
///
/// Opens an application on the touchpanel.
///
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;
}
}
///
/// Closes the currently open application on the touchpanel.
///
public void CloseOpenApp()
{
if (Panel is TswX70Base x70Panel)
{
x70Panel.ExtenderApplicationControlReservedSigs.CloseOpenedApplication();
return;
}
if (Panel is TswX60WithZoomRoomAppReservedSigs x60Panel)
{
x60Panel.ExtenderApplicationControlReservedSigs.CloseOpenedApplication();
return;
}
}
}
}