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);
}
else if (typeName == "mockvc")
{
return new PepperDash.Essentials.Devices.Common.VideoCodec
.MockVC(key, name);
}
else if (groupName == "settopbox") //(typeName == "irstbbase")
{
var irCont = IRPortHelper.GetIrOutputPortController(dc);

View File

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

View File

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

View File

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

View File

@@ -13,5 +13,6 @@ namespace PepperDash.Essentials.Room.Config
public string DefaultAudioKey { get; set; }
public string SourceListKey { 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>
(this.Properties.ToString());
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.SourceListKey = props.SourceListKey;
rm.DefaultSourceItem = props.DefaultSourceItem;

View File

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

View File

@@ -154,6 +154,9 @@ namespace PepperDash.Essentials
{
Debug.Console(0, this, "Adding huddle space driver");
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.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
@@ -127,7 +128,7 @@ namespace PepperDash.Essentials
JoinedSigInterlock CallPagesInterlock;
PepperDash.Essentials.UIDrivers.VC.EssentialsCiscoSparkUiDriver VCDriver;
PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver VCDriver;
/// <summary>
/// Constructor
@@ -138,8 +139,6 @@ namespace PepperDash.Essentials
Config = config;
Parent = parent;
VCDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsCiscoSparkUiDriver(Parent.TriList, null);
PopupInterlock = new JoinedSigInterlock(TriList);
StagingBarInterlock = new JoinedSigInterlock(TriList);
CallPagesInterlock = new JoinedSigInterlock(TriList);
@@ -158,6 +157,15 @@ namespace PepperDash.Essentials
//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>

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.
///
/// </summary>
public class EssentialsCiscoSparkUiDriver : PanelDriverBase
public class EssentialsVideoCodecUiDriver : PanelDriverBase
{
/// <summary>
///
/// </summary>
VideoCodecBase Codec;
/// <summary>
@@ -62,7 +65,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
/// <param name="triList"></param>
/// <param name="codec"></param>
public EssentialsCiscoSparkUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec)
public EssentialsVideoCodecUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec)
: base(triList)
{
Codec = codec;
@@ -146,6 +149,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*"));
DialKeypad.Misc2SigName = "#";
DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#"));
TriList.SetSigFalseAction(UIBoolJoin.KeyboardClearPress, DialKeypadBackspacePress);
}
else
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)
{
#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
{
// Header icon
@@ -224,12 +235,16 @@ namespace PepperDash.Essentials.UIDrivers.VC
DialStringBuilder.Length > 0;
}
/// <summary>
///
/// </summary>
void DialKeypadBackspacePress()
{
DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1);
DialStringFeedback.FireUpdate();
TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue =
DialStringBuilder.Length > 0;
TriList.SetBool(UIBoolJoin.VCStagingConnectEnable, DialStringBuilder.Length > 0);
}
}
}