Tech PIN from config

This commit is contained in:
Heath Volmer
2017-10-06 10:19:01 -06:00
parent f9d320e2b2
commit 0196997a4e
12 changed files with 945 additions and 974 deletions

View File

@@ -102,7 +102,6 @@ namespace PepperDash.Essentials.Core
eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable) eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable)
{ {
cycle++; cycle++;
Debug.Console(2, destination, "*#* SelectInput-cycle {1}. Finding {2} route back to {0}", source.Key, cycle, signalType);
var destDevInputTies = TieLineCollection.Default.Where(t => var destDevInputTies = TieLineCollection.Default.Where(t =>
t.DestinationPort.ParentDevice == destination && (t.Type == signalType || t.Type == eRoutingSignalType.AudioVideo)); t.DestinationPort.ParentDevice == destination && (t.Type == signalType || t.Type == eRoutingSignalType.AudioVideo));
@@ -115,7 +114,6 @@ namespace PepperDash.Essentials.Core
RoutingInputPort goodInputPort = null; RoutingInputPort goodInputPort = null;
if (directTie != null) // Found a tie directly to the source if (directTie != null) // Found a tie directly to the source
{ {
Debug.Console(2, destination, "*#* Found direct tie to {0}**", source.Key);
goodInputPort = directTie.DestinationPort; goodInputPort = directTie.DestinationPort;
} }
else // no direct-connect. Walk back devices. else // no direct-connect. Walk back devices.

View File

@@ -182,7 +182,6 @@ namespace PepperDash.Essentials.Devices.Displays
// Good length, grab the message // Good length, grab the message
var message = newBytes.Skip(4).Take(msgLen).ToArray(); var message = newBytes.Skip(4).Take(msgLen).ToArray();
Debug.Console(2, this, "*#* Parsing input: {0}", ComTextHelper.GetEscapedText(message));
// At this point, the ack/nak is the first byte // At this point, the ack/nak is the first byte
if (message[0] == 0x41) if (message[0] == 0x41)
@@ -254,7 +253,6 @@ namespace PepperDash.Essentials.Devices.Displays
IsInStandby = true; IsInStandby = true;
if (powerByte == 0x00 && IsInStandby) // Ignore power off if coming from standby - glitch if (powerByte == 0x00 && IsInStandby) // Ignore power off if coming from standby - glitch
{ {
Debug.Console(2, this, "*#* STANDBY GLITCH - IGNORING");
IsInStandby = false; IsInStandby = false;
return; return;
} }
@@ -319,7 +317,7 @@ namespace PepperDash.Essentials.Devices.Displays
checksum = checksum & 0x000000FF; // mask off MSBs checksum = checksum & 0x000000FF; // mask off MSBs
b[b.Length - 1] = (byte)checksum; b[b.Length - 1] = (byte)checksum;
if(Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1 if(Debug.Level == 2) // This check is here to prevent following string format from building unnecessarily on level 0 or 1
Debug.Console(2, this, "*#* Sending:{0}", ComTextHelper.GetEscapedText(b)); Debug.Console(2, this, "Sending:{0}", ComTextHelper.GetEscapedText(b));
Communication.SendBytes(b); Communication.SendBytes(b);
} }
@@ -372,7 +370,6 @@ namespace PepperDash.Essentials.Devices.Displays
// Fake cool-down cycle // Fake cool-down cycle
CooldownTimer = new CTimer(o => CooldownTimer = new CTimer(o =>
{ {
Debug.Console(2, this, "*#* Cooldown timer ending");
_IsCoolingDown = false; _IsCoolingDown = false;
IsCoolingDownFeedback.FireUpdate(); IsCoolingDownFeedback.FireUpdate();
}, CooldownTime); }, CooldownTime);

View File

@@ -110,6 +110,7 @@ namespace PepperDash.Essentials.Room.Config
public EssentialsRoomAddressPropertiesConfig Addresses { get; set; } public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
public EssentialsRoomOccSensorConfig OccupancySensors { get; set; } public EssentialsRoomOccSensorConfig OccupancySensors { get; set; }
public EssentialsLogoPropertiesConfig Logo { get; set; } public EssentialsLogoPropertiesConfig Logo { get; set; }
public EssentialsRoomTechConfig Tech { get; set; }
public EssentialsRoomVolumesConfig Volumes { get; set; } public EssentialsRoomVolumesConfig Volumes { get; set; }
} }
@@ -176,4 +177,9 @@ namespace PepperDash.Essentials.Room.Config
public List<string> Types { get; set; } public List<string> Types { get; set; }
} }
public class EssentialsRoomTechConfig
{
public string Password { get; set; }
}
} }

View File

@@ -338,7 +338,6 @@ namespace PepperDash.Essentials
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
} }
} }
} }

View File

@@ -227,19 +227,9 @@ namespace PepperDash.Essentials
/// 2904 /// 2904
/// </summary> /// </summary>
public const uint KeyboardButton2Press = 2904; public const uint KeyboardButton2Press = 2904;
/// <summary>
/// 2910
/// </summary>
//public const uint KeyboardClearPress = 2910;
/// <summary>
/// 2911
/// </summary>
//public const uint KeyboardClearVisible = 2911;
// Letter joins start at 2921; // Letter joins start at 2921;
/// <summary> /// <summary>
/// 3101 /// 3101
/// </summary> /// </summary>
@@ -273,8 +263,6 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint TechSchedulerVisible = 3112; public const uint TechSchedulerVisible = 3112;
//****************************************************** //******************************************************
/// <summary> /// <summary>
/// 3811 /// 3811

View File

@@ -537,11 +537,9 @@ namespace PepperDash.Essentials
/// <param name="e"></param> /// <param name="e"></param>
void ShutdownPromptTimer_HasFinished(object sender, EventArgs e) void ShutdownPromptTimer_HasFinished(object sender, EventArgs e)
{ {
//Debug.Console(2, "*#*UI shutdown prompt finished");
EndMeetingButtonSig.BoolValue = false; EndMeetingButtonSig.BoolValue = false;
CurrentRoom.ShutdownPromptTimer.TimeRemainingFeedback.OutputChange -= ShutdownPromptTimer_TimeRemainingFeedback_OutputChange; CurrentRoom.ShutdownPromptTimer.TimeRemainingFeedback.OutputChange -= ShutdownPromptTimer_TimeRemainingFeedback_OutputChange;
CurrentRoom.ShutdownPromptTimer.PercentFeedback.OutputChange -= ShutdownPromptTimer_PercentFeedback_OutputChange; CurrentRoom.ShutdownPromptTimer.PercentFeedback.OutputChange -= ShutdownPromptTimer_PercentFeedback_OutputChange;
} }
/// <summary> /// <summary>
@@ -551,7 +549,6 @@ namespace PepperDash.Essentials
/// <param name="e"></param> /// <param name="e"></param>
void ShutdownPromptTimer_WasCancelled(object sender, EventArgs e) void ShutdownPromptTimer_WasCancelled(object sender, EventArgs e)
{ {
//Debug.Console(2, "*#*UI shutdown prompt cancelled");
if (PowerDownModal != null) if (PowerDownModal != null)
PowerDownModal.HideDialog(); PowerDownModal.HideDialog();
EndMeetingButtonSig.BoolValue = false; EndMeetingButtonSig.BoolValue = false;

View File

@@ -12,6 +12,7 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects; using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards; using PepperDash.Essentials.Core.Touchpanels.Keyboards;
using PepperDash.Essentials.Devices.Displays; using PepperDash.Essentials.Devices.Displays;
using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials.UIDrivers namespace PepperDash.Essentials.UIDrivers
{ {
@@ -49,7 +50,7 @@ namespace PepperDash.Essentials.UIDrivers
CTimer PinAuthorizedTimer; CTimer PinAuthorizedTimer;
string Pin; EssentialsRoomTechConfig Config;
StringBuilder PinEntryBuilder = new StringBuilder(4); StringBuilder PinEntryBuilder = new StringBuilder(4);
@@ -57,18 +58,16 @@ namespace PepperDash.Essentials.UIDrivers
SmartObjectNumeric PinKeypad; SmartObjectNumeric PinKeypad;
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="trilist"></param> /// <param name="trilist"></param>
/// <param name="parent"></param> /// <param name="parent"></param>
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, IAVDriver parent, string pin) public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, IAVDriver parent, EssentialsRoomTechConfig config)
: base(trilist) : base(trilist)
{ {
Parent = parent; Parent = parent;
Pin = pin; Config = config;
PagesInterlock = new JoinedSigInterlock(trilist); PagesInterlock = new JoinedSigInterlock(trilist);
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible); PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
@@ -176,7 +175,7 @@ namespace PepperDash.Essentials.UIDrivers
// check it! // check it!
if (len == 4) if (len == 4)
{ {
if (Pin == PinEntryBuilder.ToString()) if (Config.Password == PinEntryBuilder.ToString())
{ {
IsAuthorized = true; IsAuthorized = true;
SetPinDotsFeedback(0); SetPinDotsFeedback(0);
@@ -257,10 +256,8 @@ namespace PepperDash.Essentials.UIDrivers
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase) d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase)) || d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
.Select(dd => dd.Key); .Select(dd => dd.Key);
Debug.Console(1, "#################### Config has {0} displays", devKeys.Count());
var disps = DeviceManager.AllDevices.Where(d => var disps = DeviceManager.AllDevices.Where(d =>
devKeys.Contains(d.Key)); devKeys.Contains(d.Key));
Debug.Console(1, "#################### Devices has {0} displays", disps.Count());
ushort i = 0; ushort i = 0;
foreach (var disp in disps) foreach (var disp in disps)
{ {

View File

@@ -153,8 +153,7 @@ namespace PepperDash.Essentials
get get
{ {
if (_TechDriver == null) if (_TechDriver == null)
#warning HLV-Make PIN come from config! _TechDriver = new PepperDash.Essentials.UIDrivers.EssentialsHuddleTechPageDriver(TriList, this, CurrentRoom.Config.Tech);
_TechDriver = new PepperDash.Essentials.UIDrivers.EssentialsHuddleTechPageDriver(TriList, this, "1234");
return _TechDriver; return _TechDriver;
} }
} }
@@ -390,7 +389,6 @@ namespace PepperDash.Essentials
var ss = CurrentRoom.ScheduleSource; var ss = CurrentRoom.ScheduleSource;
if (ss != null) if (ss != null)
{ {
#warning HLV-Add some sort of every-minute "cron" thing to run these.
NextMeetingTimer = new CTimer(o => NextMeetingTimer = new CTimer(o =>
{ {
if (CurrentRoom.OnFeedback.BoolValue) if (CurrentRoom.OnFeedback.BoolValue)
@@ -578,7 +576,6 @@ namespace PepperDash.Essentials
} }
else // room is on show what's active or select a source if nothing is yet active else // room is on show what's active or select a source if nothing is yet active
{ {
Debug.Console(0, "*#*#*#*# ActivitySharPressed: CurrentSourceInfoKey={0}", CurrentRoom.CurrentSourceInfoKey);
if(CurrentRoom.CurrentSourceInfo == null || CurrentRoom.CurrentSourceInfoKey == CurrentRoom.DefaultCodecRouteString) if(CurrentRoom.CurrentSourceInfo == null || CurrentRoom.CurrentSourceInfoKey == CurrentRoom.DefaultCodecRouteString)
TriList.SetBool(UIBoolJoin.SelectASourceVisible, true); TriList.SetBool(UIBoolJoin.SelectASourceVisible, true);
else if (CurrentSourcePageManager != null) else if (CurrentSourcePageManager != null)

View File

@@ -16,9 +16,6 @@ using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials.UIDrivers.VC namespace PepperDash.Essentials.UIDrivers.VC
{ {
#warning HLV - FOR SPARK - (GFX also) we need a staging bar for in call state where there is no camera button
/// <summary> /// <summary>
/// This fella will likely need to interact with the room's source, although that is routed via the spark... /// This fella will likely need to interact with the room's source, although that is routed via the spark...
/// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate. /// Probably needs event or FB to feed AV driver - to show two-mute volume when appropriate.
@@ -154,12 +151,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e) void Codec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
{ {
var call = e.CallItem; var call = e.CallItem;
Debug.Console(1, "*#* UI: Codec status {0}: {1} --> {2}", call.Name, e.PreviousStatus, e.NewStatus);
switch (e.NewStatus) switch (e.NewStatus)
{ {
case eCodecCallStatus.Connected: case eCodecCallStatus.Connected:
// fire at SRL item // fire at SRL item
Debug.Console(1, "*#* UI: Call Connected {0}", call.Name);
KeypadMode = eKeypadMode.DTMF; KeypadMode = eKeypadMode.DTMF;
DialStringBuilder.Remove(0, DialStringBuilder.Length); DialStringBuilder.Remove(0, DialStringBuilder.Length);
DialStringFeedback.FireUpdate(); DialStringFeedback.FireUpdate();
@@ -170,15 +165,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
break; break;
case eCodecCallStatus.Connecting: case eCodecCallStatus.Connecting:
// fire at SRL item // fire at SRL item
Debug.Console(1, "*#* UI: Call Connecting {0}", call.Name);
Parent.ShowNotificationRibbon("Connecting", 0); Parent.ShowNotificationRibbon("Connecting", 0);
break; break;
case eCodecCallStatus.Dialing: case eCodecCallStatus.Dialing:
Debug.Console(1, "*#* UI: Call Dialing {0}", call.Name);
Parent.ShowNotificationRibbon("Dialing", 0); Parent.ShowNotificationRibbon("Dialing", 0);
break; break;
case eCodecCallStatus.Disconnected: case eCodecCallStatus.Disconnected:
Debug.Console(1, "*#* UI: Call Disconnecting {0}", call.Name);
if (!Codec.IsInCall) if (!Codec.IsInCall)
{ {
KeypadMode = eKeypadMode.Dial; KeypadMode = eKeypadMode.Dial;