Merge remote-tracking branch 'origin/bugfix/ecs-541' into bugfix/ecs-535

This commit is contained in:
Heath Volmer
2017-10-18 08:22:09 -06:00
11 changed files with 1809 additions and 1714 deletions

View File

@@ -18,6 +18,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public interface IHasScheduleAwareness public interface IHasScheduleAwareness
{ {
CodecScheduleAwareness CodecSchedule { get; } CodecScheduleAwareness CodecSchedule { get; }
void GetSchedule();
} }
public class CodecScheduleAwareness public class CodecScheduleAwareness

View File

@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration }; enum eCommandType { SessionStart, SessionEnd, Command, GetStatus, GetConfiguration };
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory, public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfview IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfview, ICommunicationMonitor
{ {
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned; public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
@@ -762,11 +762,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
} }
private void GetCallHistory() public void GetCallHistory()
{ {
SendText("xCommand CallHistory Recents Limit: 20 Order: OccurrenceTime"); SendText("xCommand CallHistory Recents Limit: 20 Order: OccurrenceTime");
} }
/// <summary>
/// Required for IHasScheduleAwareness
/// </summary>
public void GetSchedule()
{
GetBookings(null);
}
/// <summary> /// <summary>
/// Gets the bookings for today /// Gets the bookings for today
/// </summary> /// </summary>
@@ -953,7 +961,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
else else
sendingMode = "LocalOnly"; sendingMode = "LocalOnly";
SendText(string.Format("xCommand Presentation Start PresentationSource: {0}", PresentationSource)); SendText(string.Format("xCommand Presentation Start PresentationSource: {0} SendingMode: {1}", PresentationSource, sendingMode));
} }
public override void StopSharing() public override void StopSharing()

View File

@@ -339,6 +339,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
#region IHasScheduleAwareness Members #region IHasScheduleAwareness Members
public void GetSchedule()
{
}
public CodecScheduleAwareness CodecSchedule public CodecScheduleAwareness CodecSchedule
{ {
get { get {

View File

@@ -189,7 +189,7 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(room); DeviceManager.AddDevice(room);
Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion"); Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController((EssentialsHuddleSpaceRoom)room, 0xf1)); DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
var cotija = DeviceManager.GetDeviceForKey("cotijaServer") as CotijaSystemController; var cotija = DeviceManager.GetDeviceForKey("cotijaServer") as CotijaSystemController;

View File

@@ -18,12 +18,13 @@ using PepperDash.Core;
using PepperDash.Essentials; using PepperDash.Essentials;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.Occupancy;
namespace PepperDash.Essentials.Fusion namespace PepperDash.Essentials.Fusion
{ {
public class EssentialsHuddleSpaceFusionSystemController : Device public class EssentialsHuddleSpaceFusionSystemControllerBase : Device, IOccupancyStatusProvider
{ {
public event EventHandler<ScheduleChangeEventArgs> ScheduleChange; public event EventHandler<ScheduleChangeEventArgs> ScheduleChange;
//public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning; //public event EventHandler<MeetingChangeEventArgs> MeetingEndWarning;
@@ -34,8 +35,6 @@ namespace PepperDash.Essentials.Fusion
Dictionary<Device, BoolInputSig> SourceToFeedbackSigs = Dictionary<Device, BoolInputSig> SourceToFeedbackSigs =
new Dictionary<Device, BoolInputSig>(); new Dictionary<Device, BoolInputSig>();
//BooleanSigData OccupancyStatusSig;
StatusMonitorCollection ErrorMessageRollUp; StatusMonitorCollection ErrorMessageRollUp;
StringSigData CurrentRoomSourceNameSig; StringSigData CurrentRoomSourceNameSig;
@@ -105,11 +104,25 @@ namespace PepperDash.Essentials.Fusion
Dictionary<int, FusionAsset> FusionStaticAssets; Dictionary<int, FusionAsset> FusionStaticAssets;
// For use with local occ sensor devices which will relay to Fusion the current occupancy status
FusionRemoteOccupancySensor FusionRemoteOccSensor;
// For use with occ sensor attached to a scheduling panel in Fusion
FusionOccupancySensorAsset FusionOccSensor; FusionOccupancySensorAsset FusionOccSensor;
public BoolFeedback RoomIsOccupiedFeedback { get; private set; }
protected Func<bool> RoomIsOccupiedFeedbackFunc
{
get
{
return () => FusionRemoteOccSensor.RoomOccupied.OutputSig.BoolValue;
}
}
//ScheduleResponseEvent NextMeeting; //ScheduleResponseEvent NextMeeting;
public EssentialsHuddleSpaceFusionSystemController(EssentialsHuddleSpaceRoom room, uint ipId) public EssentialsHuddleSpaceFusionSystemControllerBase(EssentialsHuddleSpaceRoom room, uint ipId)
: base(room.Key + "-fusion") : base(room.Key + "-fusion")
{ {
@@ -143,7 +156,16 @@ namespace PepperDash.Essentials.Fusion
SetUpCommunitcationMonitors(); SetUpCommunitcationMonitors();
SetUpDisplay(); SetUpDisplay();
SetUpError(); SetUpError();
//SetUpOccupancy();
if(Room.RoomOccupancy != null)
{
if(Room.OccupancyStatusProviderIsRemote)
SetUpRemoteOccupancy();
else
{
SetUpLocalOccupancy();
}
}
// Make it so! // Make it so!
FusionRVI.GenerateFileForAllFusionDevices(); FusionRVI.GenerateFileForAllFusionDevices();
@@ -1176,7 +1198,25 @@ namespace PepperDash.Essentials.Fusion
} }
void SetUpOccupancy() /// <summary>
/// Sets up a local occupancy sensor, such as one attached to a Fusion Scheduling panel. The occupancy status of the room will be read from Fusion
/// </summary>
void SetUpLocalOccupancy()
{
RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);
// Build Occupancy Asset?
// Link sigs?
Room.SetRoomOccupancy(this);
}
/// <summary>
/// Sets up remote occupancy that will relay the occupancy status determined by local system devices to Fusion
/// </summary>
void SetUpRemoteOccupancy()
{ {
// Need to have the room occupancy object first and somehow determine the slot number of the Occupancy asset but will not be able to use the UID from config likely. // Need to have the room occupancy object first and somehow determine the slot number of the Occupancy asset but will not be able to use the UID from config likely.
@@ -1203,7 +1243,7 @@ namespace PepperDash.Essentials.Fusion
//occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b)); //occSensorShutdownMinutes.OutputSig.UserObject(new Action(ushort)(b => Room.OccupancyObj.SetShutdownMinutes(b));
// use Room.OccObject.RoomOccupiedFeedback.LinkInputSig(occSensorAsset.InputSig); Room.RoomOccupancy.RoomIsOccupiedFeedback.LinkInputSig(occSensorAsset.RoomOccupied.InputSig);
//} //}
} }

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.Occupancy;
namespace PepperDash.Essentials.Fusion
{
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
{
public EssentialsHuddleVtc1FusionController(EssentialsHuddleSpaceRoom room, uint ipId)
: base(room, ipId)
{
}
}
}

View File

@@ -134,11 +134,12 @@
<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="OTHER\Fusion\EssentialsHuddleVtc1FusionController.cs" />
<Compile Include="OTHER\Fusion\FusionEventHandlers.cs" /> <Compile Include="OTHER\Fusion\FusionEventHandlers.cs" />
<Compile Include="OTHER\Fusion\FusionProcessorQueries.cs" /> <Compile Include="OTHER\Fusion\FusionProcessorQueries.cs" />
<Compile Include="OTHER\Fusion\FusionRviDataClasses.cs" /> <Compile Include="OTHER\Fusion\FusionRviDataClasses.cs" />
<Compile Include="REMOVE EssentialsApp.cs" /> <Compile Include="REMOVE EssentialsApp.cs" />
<Compile Include="OTHER\Fusion\EssentialsHuddleSpaceFusionSystemController.cs" /> <Compile Include="OTHER\Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.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" />

View File

@@ -65,7 +65,9 @@ namespace PepperDash.Essentials.Room.Config
var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, codec, codec, props); var rm = new EssentialsHuddleVtc1Room(Key, Name, disp, codec, codec, props);
// Add Occupancy object from config // Add Occupancy object from config
#warning Add in occupancy object from config if found and link up device to occupancy feedback
if (props.Occupancy != null)
rm.SetRoomOccupancy(DeviceManager.GetDeviceForKey(props.Occupancy.DeviceKey) as PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider);
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

@@ -32,6 +32,8 @@ namespace PepperDash.Essentials
public IOccupancyStatusProvider RoomOccupancy { get; private set; } public IOccupancyStatusProvider RoomOccupancy { get; private set; }
public bool OccupancyStatusProviderIsRemote { get; private set; }
protected abstract Func<bool> IsWarmingFeedbackFunc { get; } protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
protected abstract Func<bool> IsCoolingFeedbackFunc { get; } protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
@@ -179,6 +181,10 @@ namespace PepperDash.Essentials
/// <param name="statusProvider"></param> /// <param name="statusProvider"></param>
public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider) public void SetRoomOccupancy(IOccupancyStatusProvider statusProvider)
{ {
// If status provider is fusion, set flag to remote
if (statusProvider is PepperDash.Essentials.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase)
OccupancyStatusProviderIsRemote = true;
RoomOccupancy = statusProvider; RoomOccupancy = statusProvider;
RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += new EventHandler<EventArgs>(RoomIsOccupiedFeedback_OutputChange); RoomOccupancy.RoomIsOccupiedFeedback.OutputChange += new EventHandler<EventArgs>(RoomIsOccupiedFeedback_OutputChange);

View File

@@ -1023,6 +1023,9 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
void RefreshMeetingsList() void RefreshMeetingsList()
{ {
// See if this is helpful or if the callback response in the codec class maybe doesn't come it time?
CurrentRoom.ScheduleSource.GetSchedule();
TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar"); TriList.SetString(UIStringJoin.MeetingsOrContactMethodListIcon, "Calendar");
TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings"); TriList.SetString(UIStringJoin.MeetingsOrContactMethodListTitleText, "Today's Meetings");

View File

@@ -680,10 +680,14 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary> /// </summary>
void SetupSelfViewControls() void SetupSelfViewControls()
{ {
TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout); TriList.SetSigFalseAction(UIBoolJoin.VCStagingSelfViewLayoutPress, this.ShowSelfViewLayout);
var svc = Codec as IHasCodecSelfview; var svc = Codec as IHasCodecSelfview;
if (svc != null) if (svc != null)
{ {
// Default Selfview to off
svc.SelfviewModeOff();
TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle); TriList.SetSigFalseAction(UIBoolJoin.VCSelfViewTogglePress, svc.SelfviewModeToggle);
svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]); svc.SelfviewIsOnFeedback.LinkInputSig(TriList.BooleanInput[UIBoolJoin.VCSelfViewTogglePress]);