Seems to work except dynamic graphics for logos and QR code

This commit is contained in:
Neil Dorin
2020-08-06 19:46:12 -06:00
parent edd01785d5
commit 66c481e3dc
5 changed files with 58 additions and 5 deletions

View File

@@ -342,6 +342,7 @@ namespace PepperDash.Essentials
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight(); this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark(); this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
this.SourceListKey = PropertiesConfig.SourceListKey; this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem; this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100); this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);

View File

@@ -162,9 +162,9 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint RoomMcUrl = 3908; public const uint RoomMcUrl = 3908;
/// <summary> /// <summary>
/// 3908 - The url for the mobile control QR Code image /// 3909 - The url for the mobile control QR Code image
/// </summary> /// </summary>
public const uint RoomMcWQrCodeUrl = 3909; public const uint RoomMcQrCodeUrl = 3909;
/// <summary> /// <summary>
/// 3911 /// 3911
/// </summary> /// </summary>

View File

@@ -212,6 +212,7 @@ namespace PepperDash.Essentials
"Tap Share to begin"; "Tap Share to begin";
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@@ -835,12 +836,22 @@ namespace PepperDash.Essentials
if (_CurrentRoom == room) return; if (_CurrentRoom == room) return;
// Disconnect current (probably never called) // Disconnect current (probably never called)
if (_CurrentRoom != null)
_CurrentRoom.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged -= room_ConfigChanged; room.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged += room_ConfigChanged; room.ConfigChanged += room_ConfigChanged;
if (room.IsMobileControlEnabled) if (room.IsMobileControlEnabled)
{ {
StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible; StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible;
UpdateMCJoins(room);
if (_CurrentRoom != null)
_CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged;
} }
else else
{ {
@@ -850,6 +861,18 @@ namespace PepperDash.Essentials
RefreshCurrentRoom(room); RefreshCurrentRoom(room);
} }
void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e)
{
UpdateMCJoins(_CurrentRoom);
}
void UpdateMCJoins(EssentialsHuddleSpaceRoom room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode);
}
/// <summary> /// <summary>
/// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI /// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI
/// </summary> /// </summary>

View File

@@ -969,12 +969,22 @@ namespace PepperDash.Essentials
if (_CurrentRoom == room) return; if (_CurrentRoom == room) return;
// Disconnect current (probably never called) // Disconnect current (probably never called)
if(_CurrentRoom != null)
_CurrentRoom.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged -= room_ConfigChanged; room.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged += room_ConfigChanged; room.ConfigChanged += room_ConfigChanged;
if (room.IsMobileControlEnabled) if (room.IsMobileControlEnabled)
{ {
StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible; StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible;
UpdateMCJoins(room);
if (_CurrentRoom != null)
_CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged;
} }
else else
{ {
@@ -984,6 +994,18 @@ namespace PepperDash.Essentials
RefreshCurrentRoom(room); RefreshCurrentRoom(room);
} }
void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e)
{
UpdateMCJoins(_CurrentRoom);
}
void UpdateMCJoins(EssentialsHuddleVtc1Room room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode);
}
/// <summary> /// <summary>
/// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI /// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI
/// </summary> /// </summary>

View File

@@ -138,11 +138,16 @@ namespace PepperDash.Essentials.Core
{ {
if (RoomOccupancy != null) if (RoomOccupancy != null)
OnRoomOccupancyIsSet(); OnRoomOccupancyIsSet();
SetUpMobileControl();
}); });
} }
public override bool CustomActivate()
{
SetUpMobileControl();
return base.CustomActivate();
}
/// <summary> /// <summary>
/// If mobile control is enabled, sets the appropriate properties /// If mobile control is enabled, sets the appropriate properties
/// </summary> /// </summary>
@@ -152,12 +157,14 @@ namespace PepperDash.Essentials.Core
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey); var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey);
if (mcBridge == null) if (mcBridge == null)
{ {
Debug.Console(1, this, "Mobile Control Bridge Not found for this room."); Debug.Console(1, this, "*********************Mobile Control Bridge Not found for this room.");
IsMobileControlEnabled = false;
return; return;
} }
else else
{ {
MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge; MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge;
Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room");
IsMobileControlEnabled = true; IsMobileControlEnabled = true;
} }
} }