Fixing header list icons

This commit is contained in:
Heath Volmer
2017-10-20 11:24:44 -06:00
parent a16ea3f034
commit 897d568032
9 changed files with 183 additions and 102 deletions

View File

@@ -366,7 +366,26 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint VolumeDefaultPress = 3891; public const uint VolumeDefaultPress = 3891;
/// <summary>
/// 3991
/// </summary>
public const uint HeaderIcon1Press = 3991;
/// <summary>
/// 3992
/// </summary>
public const uint HeaderIcon2Press = 3992;
/// <summary>
/// 3993
/// </summary>
public const uint HeaderIcon3Press = 3993;
/// <summary>
/// 3994
/// </summary>
public const uint HeaderIcon4Press = 3994;
/// <summary>
/// 3995
/// </summary>
public const uint HeaderIcon5Press = 3995;
/// <summary> /// <summary>
/// 3999 /// 3999
/// </summary> /// </summary>
@@ -451,10 +470,6 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint ActivityFooterVisible = 15022; public const uint ActivityFooterVisible = 15022;
/// <summary> /// <summary>
/// 15023
/// </summary>
public const uint HeaderLightsButtonVisible = 15023;
/// <summary>
/// 15024 /// 15024
/// </summary> /// </summary>
public const uint HeaderCallStatusLeftPositionVisible = 15024; public const uint HeaderCallStatusLeftPositionVisible = 15024;
@@ -463,17 +478,9 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint HeaderCallStatusRightPositionVisible = 15025; public const uint HeaderCallStatusRightPositionVisible = 15025;
/// <summary> /// <summary>
/// 15026
/// </summary>
public const uint HeaderLightsButtonPress = 15026;
/// <summary>[-
/// 15027
/// </summary>
public const uint HeaderCallStatusButtonPress = 15027;
/// <summary>
/// 15028 The gear button in header /// 15028 The gear button in header
/// </summary> /// </summary>
public const uint HeaderGearButtonPress = 15028; public const uint FIXFIX_HeaderGearButtonPress_FIXFIX = 15028;
/// <summary> /// <summary>
/// 15029 the room button in header /// 15029 the room button in header
/// </summary> /// </summary>

View File

@@ -228,6 +228,27 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint NextMeetingFollowingMeetingText = 3972; public const uint NextMeetingFollowingMeetingText = 3972;
/// <summary>
/// 3991
/// </summary>
public const uint HeaderButtonIcon1 = 3991;
/// <summary>
/// 3992
/// </summary>
public const uint HeaderButtonIcon2 = 3992;
/// <summary>
/// 3993
/// </summary>
public const uint HeaderButtonIcon3 = 3993;
/// <summary>
/// 3994
/// </summary>
public const uint HeaderButtonIcon4 = 3994;
/// <summary>
/// 3995
/// </summary>
public const uint HeaderButtonIcon5 = 3995;
/// <summary> /// <summary>
/// 3996 /// 3996
/// </summary> /// </summary>

View File

@@ -1,58 +1,58 @@
using System; //using System;
using System.Collections.Generic; //using System.Collections.Generic;
using System.Linq; //using System.Linq;
using System.Text; //using System.Text;
using Crestron.SimplSharp; //using Crestron.SimplSharp;
using Crestron.SimplSharpPro; //using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; //using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core; //using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects; //using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials //namespace PepperDash.Essentials
{ //{
public class SmartObjectHeaderButtonList : SmartObjectHelperBase // public class SmartObjectHeaderButtonList : SmartObjectHelperBase
{ // {
public SmartObjectHeaderButtonList(SmartObject so) // public SmartObjectHeaderButtonList(SmartObject so)
: base(so, true) // : base(so, true)
{ // {
} // }
} // }
public class HeaderListButton // public class HeaderListButton
{ // {
public BoolInputSig SelectedSig { get; private set; } // public BoolInputSig SelectedSig { get; private set; }
public BoolInputSig VisibleSig { get; private set; } // public BoolInputSig VisibleSig { get; private set; }
public BoolOutputSig OutputSig { get; private set; } // public BoolOutputSig OutputSig { get; private set; }
StringInputSig IconSig; // StringInputSig IconSig;
public HeaderListButton(SmartObjectHeaderButtonList list, uint index) // public HeaderListButton(SmartObjectHeaderButtonList list, uint index)
{ // {
var so = list.SmartObject; // var so = list.SmartObject;
OutputSig = so.BooleanOutput["Item " + index + " Pressed"]; // OutputSig = so.BooleanOutput["Item " + index + " Pressed"];
SelectedSig = so.BooleanInput["Item " + index + " Selected"]; // SelectedSig = so.BooleanInput["Item " + index + " Selected"];
VisibleSig = so.BooleanInput["Item " + index + " Visible"]; // VisibleSig = so.BooleanInput["Item " + index + " Visible"];
IconSig = so.StringInput["Set Item " + index + " Icon Serial"]; // IconSig = so.StringInput["Set Item " + index + " Icon Serial"];
} // }
public void SetIcon(string i) // public void SetIcon(string i)
{ // {
IconSig.StringValue = i; // IconSig.StringValue = i;
} // }
public void ClearIcon() // public void ClearIcon()
{ // {
IconSig.StringValue = "Blank"; // IconSig.StringValue = "Blank";
} // }
public static string Calendar = "Calendar"; // public static string Calendar = "Calendar";
public static string Camera = "Camera"; // public static string Camera = "Camera";
public static string Gear = "Gear"; // public static string Gear = "Gear";
public static string Lights = "Lights"; // public static string Lights = "Lights";
public static string Help = "Help"; // public static string Help = "Help";
public static string OnHook = "DND"; // public static string OnHook = "DND";
public static string Phone = "Phone"; // public static string Phone = "Phone";
} // }
} //}

View File

@@ -218,7 +218,7 @@ namespace PepperDash.Essentials
// ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); // ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible));
// Setup button // Setup button
TriList.SetSigHeldAction(UIBoolJoin.HeaderGearButtonPress, 2000, TriList.SetSigHeldAction(UIBoolJoin.FIXFIX_HeaderGearButtonPress_FIXFIX, 2000,
() => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.TechPanelSetupVisible));// ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible)); () => PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.TechPanelSetupVisible));// ShowInterlockedModal(UIBoolJoin.TechPanelSetupVisible));
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () => TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
PopupInterlock.HideAndClear()); // HideCurrentInterlockedModal()); PopupInterlock.HideAndClear()); // HideCurrentInterlockedModal());

View File

@@ -232,7 +232,7 @@ namespace PepperDash.Essentials
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible)); ShowInterlockedModal(UIBoolJoin.RoomHeaderPageVisible));
TriList.SetSigFalseAction(UIBoolJoin.HeaderGearButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.FIXFIX_HeaderGearButtonPress_FIXFIX, () =>
ShowInterlockedModal(UIBoolJoin.VolumesPageVisible)); ShowInterlockedModal(UIBoolJoin.VolumesPageVisible));
// power-related functions // power-related functions

View File

@@ -63,8 +63,10 @@ namespace PepperDash.Essentials
BoolInputSig ShareButtonSig; BoolInputSig ShareButtonSig;
BoolInputSig EndMeetingButtonSig; BoolInputSig EndMeetingButtonSig;
HeaderListButton HeaderCallButton; //HeaderListButton HeaderCallButton;
HeaderListButton HeaderGearButton; //HeaderListButton HeaderGearButton;
StringInputSig HeaderCallButtonIconSig;
/// <summary> /// <summary>
@@ -99,7 +101,7 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// The list of buttons on the header. Managed with visibility only /// The list of buttons on the header. Managed with visibility only
/// </summary> /// </summary>
SmartObjectHeaderButtonList HeaderButtonsList; //SmartObjectHeaderButtonList HeaderButtonsList;
/// <summary> /// <summary>
/// The AV page mangagers that have been used, to keep them alive for later /// The AV page mangagers that have been used, to keep them alive for later
@@ -178,6 +180,12 @@ namespace PepperDash.Essentials
CTimer NextMeetingTimer; CTimer NextMeetingTimer;
/// <summary>
/// Tracks whether the user dismissed the meeting popup, while the system was on. Always false when
/// system is off.
/// </summary>
DateTime NextMeetingWarningDismissedTime;
/// <summary> /// <summary>
@@ -204,7 +212,7 @@ namespace PepperDash.Essentials
// buttons are added in SetCurrentRoom // buttons are added in SetCurrentRoom
HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]); //HeaderButtonsList = new SmartObjectHeaderButtonList(TriList.SmartObjects[UISmartObjectJoin.HeaderButtonList]);
SetupActivityFooterWhenRoomOff(); SetupActivityFooterWhenRoomOff();
@@ -306,7 +314,7 @@ namespace PepperDash.Essentials
(CurrentRoom.DefaultDisplay as IPower).PowerToggle(); (CurrentRoom.DefaultDisplay as IPower).PowerToggle();
}); });
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, ShowActiveCallsList ); //TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusButtonPress, ShowActiveCallsList );
SetupNextMeetingTimer(); SetupNextMeetingTimer();
@@ -417,8 +425,14 @@ namespace PepperDash.Essentials
var meetings = ss.CodecSchedule.Meetings; var meetings = ss.CodecSchedule.Meetings;
if (meetings.Count > 0) if (meetings.Count > 0)
{ {
var meeting = meetings.Aggregate((m1, m2) => m1.StartTime < m2.StartTime ? m1 : m2); var meeting = meetings.FirstOrDefault(m => m.Joinable);
if (meeting != null && meeting.Joinable)
//var meeting = meetings.Aggregate((m1, m2) => m1.StartTime < m2.StartTime ? m1 : m2);
#warning PICK UP CALENDAR TIME HERE
if (meeting != null)// && NextMeetingWarningDismissedTime != null
//&& (DateTime.Now - NextMeetingWarningDismissedTime).Minutes > 5) // && meeting.Joinable)
{ {
TriList.SetString(UIStringJoin.NextMeetingRibbonStartText, meeting.StartTime.ToShortTimeString()); TriList.SetString(UIStringJoin.NextMeetingRibbonStartText, meeting.StartTime.ToShortTimeString());
TriList.SetString(UIStringJoin.NextMeetingRibbonEndText, meeting.EndTime.ToShortTimeString()); TriList.SetString(UIStringJoin.NextMeetingRibbonEndText, meeting.EndTime.ToShortTimeString());
@@ -443,7 +457,6 @@ namespace PepperDash.Essentials
} }
ShowNextMeetingPopup(); ShowNextMeetingPopup();
} }
} }
}, null, 0, 60000); }, null, 0, 60000);
@@ -919,10 +932,10 @@ namespace PepperDash.Essentials
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true); TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
var roomConf = CurrentRoom.Config; var roomConf = CurrentRoom.Config;
//
HeaderGearButton = new HeaderListButton(HeaderButtonsList, 5); // Gear
HeaderGearButton.SetIcon(HeaderListButton.Gear); TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear");
HeaderGearButton.OutputSig.SetSigHeldAction(2000, TriList.SetSigHeldAction(UIBoolJoin.HeaderIcon5Press, 2000,
ShowTech, ShowTech,
null, null,
() => () =>
@@ -932,10 +945,23 @@ namespace PepperDash.Essentials
else else
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible); PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
}); });
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () => TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
PopupInterlock.HideAndClear()); PopupInterlock.HideAndClear());
//HeaderGearButton = new HeaderListButton(HeaderButtonsList, 5);
//HeaderGearButton.SetIcon(HeaderListButton.Gear);
//HeaderGearButton.OutputSig.SetSigHeldAction(2000,
// ShowTech,
// null,
// () =>
// {
// if (CurrentRoom.OnFeedback.BoolValue)
// PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible);
// else
// PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
// });
// Help button and popup // Help button and popup
if (CurrentRoom.Config.Help != null) if (CurrentRoom.Config.Help != null)
{ {
@@ -954,9 +980,8 @@ namespace PepperDash.Essentials
TriList.SetString(UIStringJoin.HelpPageCallButtonText, null); TriList.SetString(UIStringJoin.HelpPageCallButtonText, null);
TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress); TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
} }
var helpButton = new HeaderListButton(HeaderButtonsList, 4); TriList.SetString(UIStringJoin.HeaderButtonIcon4, "Help");
helpButton.SetIcon(HeaderListButton.Help); TriList.SetSigFalseAction(UIBoolJoin.HeaderIcon4Press, () =>
helpButton.OutputSig.SetSigFalseAction(() =>
{ {
string message = null; string message = null;
var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey) var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
@@ -968,7 +993,21 @@ namespace PepperDash.Essentials
//TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message; //TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible); PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
}); });
uint nextIndex = 3; //var helpButton = new HeaderListButton(HeaderButtonsList, 4);
//helpButton.SetIcon(HeaderListButton.Help);
//helpButton.OutputSig.SetSigFalseAction(() =>
//{
// string message = null;
// var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
// as EssentialsHuddleSpaceRoom;
// if (room != null)
// message = room.Config.HelpMessage;
// else
// message = "Sorry, no help message available. No room connected.";
// //TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
// PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
//});
uint nextJoin = 3993;
// Lights button // Lights button
//if (WHATEVER MAKES LIGHTS WORK) //if (WHATEVER MAKES LIGHTS WORK)
@@ -980,36 +1019,47 @@ namespace PepperDash.Essentials
// Calendar button // Calendar button
if (_CurrentRoom.ScheduleSource != null) // ******************* Do we need a config option here as well? if (_CurrentRoom.ScheduleSource != null) // ******************* Do we need a config option here as well?
{ {
var calBut = new HeaderListButton(HeaderButtonsList, nextIndex); //var calBut = new HeaderListButton(HeaderButtonsList, nextIndex);
calBut.SetIcon(HeaderListButton.Calendar); //calBut.SetIcon(HeaderListButton.Calendar);
calBut.OutputSig.SetSigFalseAction(CalendarPress); //calBut.OutputSig.SetSigFalseAction(CalendarPress);
nextIndex--;
TriList.SetString(nextJoin, "Calendar");
TriList.SetSigFalseAction(nextJoin, CalendarPress);
nextJoin--;
} }
// Call button // Call button
HeaderCallButton = new HeaderListButton(HeaderButtonsList, nextIndex); //HeaderCallButton = new HeaderListButton(HeaderButtonsList, nextJoin);
HeaderCallButton.SetIcon(HeaderListButton.OnHook); //HeaderCallButton.SetIcon(HeaderListButton.OnHook);
HeaderCallButton.OutputSig.SetSigFalseAction(ShowActiveCallsList); //HeaderCallButton.OutputSig.SetSigFalseAction(ShowActiveCallsList);
nextIndex--; TriList.SetString(nextJoin, "DND");
TriList.SetSigFalseAction(nextJoin, ShowActiveCallsList);
HeaderCallButtonIconSig = TriList.StringInput[nextJoin];
nextJoin--;
// blank any that remain // blank any that remain
for (var i = nextIndex; i > 0; i--) for (var i = nextJoin; i > 3990; i--)
{ {
var blankBut = new HeaderListButton(HeaderButtonsList, i); //var blankBut = new HeaderListButton(HeaderButtonsList, i);
blankBut.ClearIcon(); //blankBut.ClearIcon();
blankBut.OutputSig.SetSigFalseAction(() => { }); //blankBut.OutputSig.SetSigFalseAction(() => { });
TriList.SetString(i, "Blank");
TriList.SetSigFalseAction(i, () => { });
} }
// Set Call Status Subpage Position // Set Call Status Subpage Position
if (nextIndex == 1) if (nextJoin == 1)
{ {
// Set to right position // Set to right position
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false); TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false);
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true); TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true);
} }
else if (nextIndex == 0) else if (nextJoin == 0)
{ {
// Set to left position // Set to left position
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true); TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
@@ -1026,13 +1076,16 @@ namespace PepperDash.Essentials
// Set mode of header button // Set mode of header button
if (!codec.IsInCall) if (!codec.IsInCall)
{ {
HeaderCallButton.SetIcon(HeaderListButton.OnHook); HeaderCallButtonIconSig.StringValue = "DND";
//HeaderCallButton.SetIcon(HeaderListButton.OnHook);
} }
else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video)) else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
HeaderCallButton.SetIcon(HeaderListButton.Camera); HeaderCallButtonIconSig.StringValue = "Camera";
//HeaderCallButton.SetIcon(HeaderListButton.Camera);
//TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2); //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
else else
HeaderCallButton.SetIcon(HeaderListButton.Phone); HeaderCallButtonIconSig.StringValue = "Phone";
//HeaderCallButton.SetIcon(HeaderListButton.Phone);
//TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1); //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
// Set the call status text // Set the call status text

View File

@@ -160,7 +160,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
else else
{ {
Parent.Keyboard.DisableGoButton(); Parent.Keyboard.DisableGoButton();
return "Tap For Search Keyboard"; return "Tap for keyboard";
} }
}); });
SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]);
@@ -1112,7 +1112,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
{ {
if (DialStringBuilder.Length == 0 && !Codec.IsInCall) if (DialStringBuilder.Length == 0 && !Codec.IsInCall)
{ {
return "Dial or Tap to Show Keyboard"; return "Tap for keyboard";
} }
if(Regex.Match(ds, @"^\d{4,7}$").Success) // 456-7890 if(Regex.Match(ds, @"^\d{4,7}$").Success) // 456-7890
return string.Format("{0}-{1}", ds.Substring(0, 3), ds.Substring(3)); return string.Format("{0}-{1}", ds.Substring(0, 3), ds.Substring(3));