lots of changes. Getting things working

This commit is contained in:
Andrew Welker
2020-07-21 13:27:15 -06:00
parent 2b06672800
commit 8d0ea82402
13 changed files with 2071 additions and 2155 deletions

View File

@@ -14,27 +14,41 @@ namespace PepperDash.Essentials.Core.Fusion
_room = room;
}
#region Overrides of EssentialsHuddleSpaceFusionSystemControllerBase
#region Overrides of EssentialsHuddleVtc1FusionController
protected override void ExecuteCustomSteps()
{
var leftDisplay = _room.LeftDisplay as DisplayBase;
var rightDisplay = _room.RightDisplay as DisplayBase;
SetUpDisplay(leftDisplay);
SetUpDisplay(rightDisplay);
SetUpDisplays();
base.ExecuteCustomSteps();
}
#endregion
#region Overrides of EssentialsHuddleSpaceFusionSystemControllerBase
protected override void SetUpDisplay()
private void SetUpDisplays()
{
Debug.Console(1, this, "No default Display fo this room");
if (_room == null) return;
var leftDisplay = _room.LeftDisplay as DisplayBase;
var rightDisplay = _room.RightDisplay as DisplayBase;
SetUpDisplay(leftDisplay);
SetUpDisplay(rightDisplay);
}
protected override void SetUpDefaultDisplay()
{
Debug.Console(0, this, "No default display for Dual Display Room");
}
#region Overrides of EssentialsFusionSystemControllerBase
protected override void SetUpDefaultDisplayAsset()
{
Debug.Console(0, this, "No default display for Dual Display Room");
}
#endregion
private void SetUpDisplay(DisplayBase display)
{
FusionAsset tempAsset;
@@ -77,7 +91,5 @@ namespace PepperDash.Essentials.Core.Fusion
{
throw new NotImplementedException();
}
#endregion
}
}

View File

@@ -1,19 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Fusion;
namespace PepperDash_Essentials_Core.Fusion
{
public class EssentialsHuddleSpaceFusionController:EssentialsHuddleSpaceFusionSystemControllerBase
public class EssentialsHuddleSpaceFusionController:EssentialsFusionSystemControllerBase
{
private EssentialsHuddleSpaceRoom _room;
public EssentialsHuddleSpaceFusionController(EssentialsHuddleSpaceRoom room, uint ipId) : base(room, ipId)
{
_room = room;
Initialize();
}
}
}

View File

@@ -6,11 +6,10 @@ using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Fusion
{
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
public class EssentialsHuddleVtc1FusionController : EssentialsFusionSystemControllerBase
{
private BooleanSigData _codecIsInCall;
private readonly EssentialsHuddleVtc1Room _room;
private BooleanSigData _codecIsInCall;
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
: base(room, ipId)
@@ -148,67 +147,6 @@ namespace PepperDash.Essentials.Core.Fusion
}
}
#region Overrides of EssentialsHuddleSpaceFusionSystemControllerBase
protected override void SetUpDisplay()
{
base.SetUpDisplay();
var defaultDisplay = _room.DefaultDisplay as DisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
return;
}
var deviceConfig =
ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
//Check for existing asset in GUIDs collection
FusionAsset tempAsset;
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
tempAsset = FusionStaticAssets[deviceConfig.Uid];
}
else
{
// Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom),
defaultDisplay.Name, "Display", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
var dispPowerOnAction = new Action<bool>(b =>
{
if (!b)
{
defaultDisplay.PowerOn();
}
});
var dispPowerOffAction = new Action<bool>(b =>
{
if (!b)
{
defaultDisplay.PowerOff();
}
});
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display",
tempAsset.InstanceId);
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
// Use extension methods
dispAsset.TrySetMakeModel(defaultDisplay);
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
}
#endregion
private void codec_CallStatusChange(object sender, Devices.Codec.CodecCallStatusItemChangeEventArgs e)
{
var codec = _room.VideoCodec;