Mock testing: Connect/End UI behavior start

This commit is contained in:
Heath Volmer
2017-09-13 11:39:22 -06:00
parent fd14eeb9a7
commit d65ff7add0
19 changed files with 2087 additions and 1998 deletions

View File

@@ -100,6 +100,12 @@ namespace PepperDash.Essentials.Devices.Common
return new Laptop(key, name); return new Laptop(key, name);
} }
else if (typeName == "mockvc")
{
return new PepperDash.Essentials.Devices.Common.VideoCodec
.MockVC(key, name);
}
else if (groupName == "settopbox") //(typeName == "irstbbase") else if (groupName == "settopbox") //(typeName == "irstbbase")
{ {
var irCont = IRPortHelper.GetIrOutputPortController(dc); var irCont = IRPortHelper.GetIrOutputPortController(dc);

View File

@@ -52,6 +52,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
public override void Dial(string s) public override void Dial(string s)
{ {
Debug.Console(1, this, "Dial: {0}", s);
_InCall = true; _InCall = true;
InCallFeedback.FireUpdate(); InCallFeedback.FireUpdate();
@@ -63,12 +64,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// <param name="s"></param> /// <param name="s"></param>
public void SendDTMF(string s) public void SendDTMF(string s)
{ {
Debug.Console(1, this, "SendDTMF: {0}", s);
} }
/// <summary>
///
/// </summary>
public override void EndCall() public override void EndCall()
{ {
Debug.Console(1, this, "EndCall");
_InCall = false; _InCall = false;
InCallFeedback.FireUpdate(); InCallFeedback.FireUpdate();
} }
@@ -78,7 +82,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
public override void AcceptCall() public override void AcceptCall()
{ {
Debug.Console(1, this, "AcceptCall");
} }
/// <summary> /// <summary>
@@ -86,52 +90,84 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
/// </summary> /// </summary>
public override void RejectCall() public override void RejectCall()
{ {
Debug.Console(1, this, "RejectCall");
} }
/// <summary>
/// Called by routing to make it happen
/// </summary>
/// <param name="selector"></param>
public override void ExecuteSwitch(object selector) public override void ExecuteSwitch(object selector)
{ {
Debug.Console(1, this, "ExecuteSwitch");
} }
/// <summary>
///
/// </summary>
public override void ReceiveMuteOff() public override void ReceiveMuteOff()
{ {
Debug.Console(1, this, "ReceiveMuteOff");
if (!_ReceiveMute) if (!_ReceiveMute)
return; return;
_ReceiveMute = false; _ReceiveMute = false;
ReceiveMuteIsOnFeedback.FireUpdate(); ReceiveMuteIsOnFeedback.FireUpdate();
} }
/// <summary>
///
/// </summary>
public override void ReceiveMuteOn() public override void ReceiveMuteOn()
{ {
Debug.Console(1, this, "ReceiveMuteOn");
if (_ReceiveMute) if (_ReceiveMute)
return; return;
ReceiveMuteIsOnFeedback.FireUpdate(); ReceiveMuteIsOnFeedback.FireUpdate();
} }
/// <summary>
///
/// </summary>
public override void ReceiveMuteToggle() public override void ReceiveMuteToggle()
{ {
Debug.Console(1, this, "ReceiveMuteToggle");
_ReceiveMute = !_ReceiveMute; _ReceiveMute = !_ReceiveMute;
ReceiveMuteIsOnFeedback.FireUpdate(); ReceiveMuteIsOnFeedback.FireUpdate();
} }
/// <summary>
///
/// </summary>
/// <param name="level"></param>
public override void SetReceiveVolume(ushort level) public override void SetReceiveVolume(ushort level)
{ {
Debug.Console(1, this, "SetReceiveVolume: {0}", level);
} }
/// <summary>
///
/// </summary>
public override void TransmitMuteOff() public override void TransmitMuteOff()
{ {
Debug.Console(1, this, "TransmitMuteOff");
if (!_TransmitMute) if (!_TransmitMute)
return; return;
_TransmitMute = false; _TransmitMute = false;
TransmitMuteIsOnFeedback.FireUpdate(); TransmitMuteIsOnFeedback.FireUpdate();
} }
/// <summary>
///
/// </summary>
public override void TransmitMuteOn() public override void TransmitMuteOn()
{ {
Debug.Console(1, this, "TransmitMuteOn");
if (_TransmitMute) if (_TransmitMute)
return; return;
TransmitMuteIsOnFeedback.FireUpdate(); TransmitMuteIsOnFeedback.FireUpdate();
@@ -140,16 +176,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void TransmitMuteToggle() public override void TransmitMuteToggle()
{ {
_TransmitMute = !_TransmitMute; _TransmitMute = !_TransmitMute;
Debug.Console(1, this, "TransmitMuteToggle: {0}", _TransmitMute);
TransmitMuteIsOnFeedback.FireUpdate(); TransmitMuteIsOnFeedback.FireUpdate();
} }
public override void SetTransmitVolume(ushort level) public override void SetTransmitVolume(ushort level)
{ {
Debug.Console(1, this, "SetTransmitVolume: {0}", level);
} }
public override void PrivacyModeOn() public override void PrivacyModeOn()
{ {
Debug.Console(1, this, "PrivacyMuteOn");
if (_PrivacyModeIsOn) if (_PrivacyModeIsOn)
return; return;
_PrivacyModeIsOn = true; _PrivacyModeIsOn = true;
@@ -159,6 +197,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void PrivacyModeOff() public override void PrivacyModeOff()
{ {
Debug.Console(1, this, "PrivacyMuteOff");
if (!_PrivacyModeIsOn) if (!_PrivacyModeIsOn)
return; return;
_PrivacyModeIsOn = false; _PrivacyModeIsOn = false;
@@ -168,7 +207,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public override void PrivacyModeToggle() public override void PrivacyModeToggle()
{ {
_PrivacyModeIsOn = !_PrivacyModeIsOn; _PrivacyModeIsOn = !_PrivacyModeIsOn;
PrivacyModeIsOnFeedback.FireUpdate(); Debug.Console(1, this, "PrivacyMuteToggle: {0}", _PrivacyModeIsOn);
PrivacyModeIsOnFeedback.FireUpdate();
} }
//******************************************************** //********************************************************
@@ -176,16 +216,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
public void TestIncomingCall(string url) public void TestIncomingCall(string url)
{ {
Debug.Console(1, this, "TestIncomingCall");
_IncomingCall = true; _IncomingCall = true;
IncomingCallFeedback.FireUpdate(); IncomingCallFeedback.FireUpdate();
} }
public void TestFarEndHangup() public void TestFarEndHangup()
{ {
Debug.Console(1, this, "TestFarEndHangup");
} }
} }
} }

View File

@@ -35,6 +35,7 @@ namespace PepperDash.Essentials
properties.ToString()); properties.ToString());
return new EssentialsTouchpanelController(key, name, typeName, props, comm.IpIdInt); return new EssentialsTouchpanelController(key, name, typeName, props, comm.IpIdInt);
} }
else if (typeName == "mockdisplay") else if (typeName == "mockdisplay")
{ {
return new MockDisplay(key, name); return new MockDisplay(key, name);

View File

@@ -134,11 +134,11 @@
<Compile Include="Devices\DiscPlayer\OppoExtendedBdp.cs" /> <Compile Include="Devices\DiscPlayer\OppoExtendedBdp.cs" />
<Compile Include="Devices\NUMERIC AppleTV.cs" /> <Compile Include="Devices\NUMERIC AppleTV.cs" />
<Compile Include="ControlSystem.cs" /> <Compile Include="ControlSystem.cs" />
<Compile Include="Fusion\FusionEventHandlers.cs" /> <Compile Include="OTHER\Fusion\FusionEventHandlers.cs" />
<Compile Include="Fusion\FusionProcessorQueries.cs" /> <Compile Include="OTHER\Fusion\FusionProcessorQueries.cs" />
<Compile Include="Fusion\FusionRviDataClasses.cs" /> <Compile Include="OTHER\Fusion\FusionRviDataClasses.cs" />
<Compile Include="REMOVE EssentialsApp.cs" /> <Compile Include="REMOVE EssentialsApp.cs" />
<Compile Include="Fusion\FusionSystemController.cs" /> <Compile Include="OTHER\Fusion\FusionSystemController.cs" />
<Compile Include="HttpApiHandler.cs" /> <Compile Include="HttpApiHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
@@ -165,7 +165,7 @@
<Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" />
<Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" /> <Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" />
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" /> <Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
<Compile Include="UIDrivers\VC\EssentialsCiscoSparkUiDriver.cs" /> <Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" /> <Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\HuddleVTCPanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\HuddleVTCPanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" /> <Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" />
@@ -193,9 +193,6 @@
<None Include="app.config" /> <None Include="app.config" />
<None Include="Properties\ControlSystem.cfg" /> <None Include="Properties\ControlSystem.cfg" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="OTHER\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>

View File

@@ -13,5 +13,6 @@ namespace PepperDash.Essentials.Room.Config
public string DefaultAudioKey { get; set; } public string DefaultAudioKey { get; set; }
public string SourceListKey { get; set; } public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; } public string DefaultSourceItem { get; set; }
public string VideoCodecKey { get; set; }
} }
} }

View File

@@ -59,7 +59,11 @@ namespace PepperDash.Essentials.Room.Config
var props = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig> var props = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
(this.Properties.ToString()); (this.Properties.ToString());
var disp = DeviceManager.GetDeviceForKey(props.DefaultDisplayKey) as IRoutingSinkWithSwitching; var disp = DeviceManager.GetDeviceForKey(props.DefaultDisplayKey) as IRoutingSinkWithSwitching;
var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, disp, props);
var codec = DeviceManager.GetDeviceForKey(props.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, disp, codec, props);
rm.LogoUrl = props.Logo.GetUrl(); rm.LogoUrl = props.Logo.GetUrl();
rm.SourceListKey = props.SourceListKey; rm.SourceListKey = props.SourceListKey;
rm.DefaultSourceItem = props.DefaultSourceItem; rm.DefaultSourceItem = props.DefaultSourceItem;

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
@@ -71,6 +72,8 @@ namespace PepperDash.Essentials
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; } public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
public IBasicVolumeControls DefaultVolumeControls { get; private set; } public IBasicVolumeControls DefaultVolumeControls { get; private set; }
public VideoCodecBase VideoCodec { get; private set; }
public bool ExcludeFromGlobalFunctions { get; set; } public bool ExcludeFromGlobalFunctions { get; set; }
/// <summary> /// <summary>
@@ -152,11 +155,12 @@ namespace PepperDash.Essentials
/// <param name="key"></param> /// <param name="key"></param>
/// <param name="name"></param> /// <param name="name"></param>
public EssentialsHuddleVtc1Room(string key, string name, IRoutingSinkWithSwitching defaultDisplay, public EssentialsHuddleVtc1Room(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
IRoutingSinkNoSwitching defaultAudio, EssentialsHuddleVtc1PropertiesConfig config) IRoutingSinkNoSwitching defaultAudio, VideoCodecBase vc, EssentialsHuddleVtc1PropertiesConfig config)
: base(key, name) : base(key, name)
{ {
Config = config; Config = config;
DefaultDisplay = defaultDisplay; DefaultDisplay = defaultDisplay;
VideoCodec = vc;
DefaultAudioDevice = defaultAudio; DefaultAudioDevice = defaultAudio;
if (defaultAudio is IBasicVolumeControls) if (defaultAudio is IBasicVolumeControls)
DefaultVolumeControls = defaultAudio as IBasicVolumeControls; DefaultVolumeControls = defaultAudio as IBasicVolumeControls;

View File

@@ -154,6 +154,9 @@ namespace PepperDash.Essentials
{ {
Debug.Console(0, this, "Adding huddle space driver"); Debug.Console(0, this, "Adding huddle space driver");
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props); var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(Panel,
(room as EssentialsHuddleVtc1Room).VideoCodec);
avDriver.SetVideoCodecDriver(codecDriver);
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room; avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
avDriver.DefaultRoomKey = props.DefaultRoomKey; avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver; mainDriver.AvDriver = avDriver;

View File

@@ -143,6 +143,10 @@ namespace PepperDash.Essentials
/// 1235 /// 1235
/// </summary> /// </summary>
public const uint VCStagingCameraPress = 1235; public const uint VCStagingCameraPress = 1235;
/// <summary>
/// 1236
/// </summary>
public const uint VCStagingConnectEnable = 1236;
//****************************************************** //******************************************************
// Keyboard // Keyboard

View File

@@ -5,6 +5,12 @@
/// </summary> /// </summary>
public class UIUshortJoin public class UIUshortJoin
{ {
// Video Codec
/// <summary>
/// 1234 - 0 = Connect, 1 = End
/// </summary>
public const uint VCStagingConnectButtonMode = 1234;
/// <summary> /// <summary>
/// 3812 /// 3812
/// </summary> /// </summary>

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
@@ -127,7 +128,7 @@ namespace PepperDash.Essentials
JoinedSigInterlock CallPagesInterlock; JoinedSigInterlock CallPagesInterlock;
PepperDash.Essentials.UIDrivers.VC.EssentialsCiscoSparkUiDriver VCDriver; PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver VCDriver;
/// <summary> /// <summary>
/// Constructor /// Constructor
@@ -138,8 +139,6 @@ namespace PepperDash.Essentials
Config = config; Config = config;
Parent = parent; Parent = parent;
VCDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsCiscoSparkUiDriver(Parent.TriList, null);
PopupInterlock = new JoinedSigInterlock(TriList); PopupInterlock = new JoinedSigInterlock(TriList);
StagingBarInterlock = new JoinedSigInterlock(TriList); StagingBarInterlock = new JoinedSigInterlock(TriList);
CallPagesInterlock = new JoinedSigInterlock(TriList); CallPagesInterlock = new JoinedSigInterlock(TriList);
@@ -158,6 +157,15 @@ namespace PepperDash.Essentials
//TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below"; //TriList.StringInput[UIStringJoin.StartActivityText].StringValue = "Tap an activity below";
} }
/// <summary>
/// Add a video codec driver to this
/// </summary>
/// <param name="vcd"></param>
public void SetVideoCodecDriver(PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver vcd)
{
VCDriver = vcd;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>

View File

@@ -19,8 +19,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// 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.
/// ///
/// </summary> /// </summary>
public class EssentialsCiscoSparkUiDriver : PanelDriverBase public class EssentialsVideoCodecUiDriver : PanelDriverBase
{ {
/// <summary>
///
/// </summary>
VideoCodecBase Codec; VideoCodecBase Codec;
/// <summary> /// <summary>
@@ -62,7 +65,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary> /// </summary>
/// <param name="triList"></param> /// <param name="triList"></param>
/// <param name="codec"></param> /// <param name="codec"></param>
public EssentialsCiscoSparkUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec) public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec)
: base(triList) : base(triList)
{ {
Codec = codec; Codec = codec;
@@ -146,6 +149,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*")); DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*"));
DialKeypad.Misc2SigName = "#"; DialKeypad.Misc2SigName = "#";
DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#")); DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#"));
TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress);
} }
else else
Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP", Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP",
@@ -198,6 +202,13 @@ namespace PepperDash.Essentials.UIDrivers.VC
void InCallFeedback_OutputChange(object sender, EventArgs e) void InCallFeedback_OutputChange(object sender, EventArgs e)
{ {
#warning mode does not change!
var inCall = Codec.InCallFeedback.BoolValue;
Debug.Console(2, "*#* Codec Driver InCallFeedback change={0}", InCall);
TriList.UShortInput[UIUshortJoin.VCStagingConnectButtonMode].UShortValue = (ushort)(inCall ? 1 : 0);
StagingBarInterlock.ShowInterlocked(
inCall ? UIBoolJoin.VCStagingActivePopoverVisible : UIBoolJoin.VCStagingInactivePopoverVisible);
if (Codec.InCallFeedback.BoolValue) // Call is starting if (Codec.InCallFeedback.BoolValue) // Call is starting
{ {
// Header icon // Header icon
@@ -224,12 +235,16 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBuilder.Length > 0; DialStringBuilder.Length > 0;
} }
/// <summary>
///
/// </summary>
void DialKeypadBackspacePress() void DialKeypadBackspacePress()
{ {
DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1); DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1);
DialStringFeedback.FireUpdate(); DialStringFeedback.FireUpdate();
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
DialStringBuilder.Length > 0; DialStringBuilder.Length > 0;
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0);
} }
} }
} }