Commit before merging in Heath's branch

This commit is contained in:
Neil Dorin
2017-10-17 21:10:23 -06:00
parent b9fceb830f
commit f5626fcd8b
9 changed files with 214 additions and 148 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

@@ -767,6 +767,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
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>

View File

@@ -340,6 +340,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

@@ -12,7 +12,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec namespace PepperDash.Essentials.Devices.Common.VideoCodec
{ {
public abstract class VideoCodecBase : Device, IRoutingInputsOutputs, public abstract class VideoCodecBase : Device, IRoutingInputsOutputs,
IUsageTracking, IHasDialer, IHasSharing, ICodecAudio, iCodecInfo IUsageTracking, IHasDialer, IHasSharing, ICodecAudio, iCodecInfo //, ICommunicationMonitor
{ {
/// <summary> /// <summary>
/// Fires when the status of any active, dialing, or incoming call changes or is new /// Fires when the status of any active, dialing, or incoming call changes or is new

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

@@ -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

@@ -1017,6 +1017,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");