Merge branch 'feature/ecs-407' of http://code.pepperdash.net/scm/pec/essentials into feature/cisco-spark-2

Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs
This commit is contained in:
Neil Dorin
2017-10-03 15:09:31 -06:00
25 changed files with 818 additions and 223 deletions

View File

@@ -6,15 +6,6 @@ using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public enum eMeetingEventChangeType
{
Unkown = 0,
MeetingStartWarning,
MeetingStart,
MeetingEndWarning,
MeetingEnd
}
public interface IHasScheduleAwareness
{
CodecScheduleAwareness CodecSchedule { get; }
@@ -22,52 +13,11 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public class CodecScheduleAwareness
{
public event EventHandler<MeetingEventArgs> MeetingEventChange;
public event EventHandler<EventArgs> MeetingsListHasChanged;
public List<Meeting> Meetings { get; set; }
private CTimer ScheduleChecker;
public CodecScheduleAwareness()
{
Meetings = new List<Meeting>();
ScheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
}
private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting)
{
var handler = MeetingEventChange;
if (handler != null)
{
handler(this, new MeetingEventArgs() { ChangeType = changeType, Meeting = meeting });
}
}
private void CheckSchedule(object o)
{
// Iterate the meeting list and check if any meeting need to do anythingk
foreach (Meeting m in Meetings)
{
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
if (m.TimeToMeetingStart.TotalMinutes == m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
changeType = eMeetingEventChangeType.MeetingStartWarning;
else if (m.TimeToMeetingStart.TotalMinutes == 0) // Meeting Start
changeType = eMeetingEventChangeType.MeetingStart;
else if (m.TimeToMeetingEnd.TotalMinutes == m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to end
changeType = eMeetingEventChangeType.MeetingEndWarning;
else if (m.TimeToMeetingEnd.TotalMinutes == 0) // Meeting has ended
changeType = eMeetingEventChangeType.MeetingEnd;
if(changeType != eMeetingEventChangeType.Unkown)
OnMeetingChange(changeType, m);
}
}
}
@@ -76,25 +26,10 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// </summary>
public class Meeting
{
public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5);
public string Id { get; set; }
public string Organizer { get; set; }
public string Title { get; set; }
public string Agenda { get; set; }
public TimeSpan TimeToMeetingStart {
get
{
return StartTime - DateTime.Now;
}
}
public TimeSpan TimeToMeetingEnd
{
get
{
return EndTime - DateTime.Now;
}
}
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
public TimeSpan Duration
@@ -109,20 +44,11 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{
get
{
// Meeting is joinable from 5 minutes before start until 5 minutes before end
if (TimeToMeetingStart.TotalMinutes <= MeetingWarningMinutes.TotalMinutes && TimeToMeetingEnd.TotalMinutes >= MeetingWarningMinutes.TotalMinutes)
return true;
else
return false;
return StartTime.AddMinutes(-5) <= DateTime.Now
&& DateTime.Now <= EndTime.AddMinutes(-5);
}
}
public string ConferenceNumberToDial { get; set; }
public string ConferencePassword { get; set; }
}
public class MeetingEventArgs : EventArgs
{
public eMeetingEventChangeType ChangeType { get; set; }
public Meeting Meeting { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Displays
{
public interface IInputHdmi1 { void InputHdmi1(); }
public interface IInputHdmi2 { void InputHdmi2(); }
public interface IInputHdmi3 { void InputHdmi3(); }
public interface IInputHdmi4 { void InputHdmi4(); }
public interface IInputDisplayPort1 { void InputDisplayPort1(); }
public interface IInputDisplayPort2 { void InputDisplayPort2(); }
}

View File

@@ -14,7 +14,8 @@ namespace PepperDash.Essentials.Devices.Displays
/// <summary>
///
/// </summary>
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor, IInputDisplayPort1, IInputDisplayPort2,
IInputHdmi1, IInputHdmi2, IInputHdmi3, IInputHdmi4
{
public IBasicCommunication Communication { get; private set; }

View File

@@ -116,6 +116,7 @@
<Compile Include="Codec\iHasScheduleAwareness.cs" />
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
<Compile Include="Display\ComTcpDisplayBase.cs" />
<Compile Include="Display\InputInterfaces.cs" />
<Compile Include="Display\SamsungMDCDisplay.cs" />
<Compile Include="Display\DeviceFactory.cs" />
<Compile Include="Display\NecPaSeriesProjector.cs" />

View File

@@ -262,13 +262,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource1), this);
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(SelectPresentationSource2), this);
HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null, this);
InputPorts.Add(CodecOsdIn);
InputPorts.Add(HdmiIn1);
InputPorts.Add(HdmiIn2);
OutputPorts.Add(HdmiOut);
HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, null, this);
InputPorts.Add(CodecOsdIn);
InputPorts.Add(HdmiIn1);
InputPorts.Add(HdmiIn2);
OutputPorts.Add(HdmiOut);
string prefix = "xFeedback register ";

View File

@@ -11,7 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
namespace PepperDash.Essentials.Devices.Common.VideoCodec
{
public class MockVC : VideoCodecBase, IRoutingSource
public class MockVC : VideoCodecBase, IRoutingSource, IHasCallHistory, IHasScheduleAwareness
{
public RoutingInputPort CodecOsdIn { get; private set; }
public RoutingInputPort HdmiIn1 { get; private set; }
@@ -43,6 +43,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
InputPorts.Add(HdmiIn2);
OutputPorts.Add(HdmiOut);
CallHistory = new CodecCallHistory();
for (int i = 0; i < 10; i++)
{
var call = new CodecCallHistory.CallHistoryEntry();
call.Name = "Call " + i;
call.Number = i + "@call.com";
CallHistory.RecentCalls.Add(call);
}
// eventually fire history event here
SetIsReady();
}
@@ -302,7 +312,39 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
Debug.Console(1, this, "TestFarEndHangup");
}
}
#region IHasCallHistory Members
public CodecCallHistory CallHistory { get; private set; }
public void RemoveCallHistoryEntry(CodecCallHistory.CallHistoryEntry entry)
{
}
#endregion
#region IHasScheduleAwareness Members
public CodecScheduleAwareness CodecSchedule
{
get {
var sch = new CodecScheduleAwareness();
for(int i = 0; i < 5; i++)
{
var m = new Meeting();
m.StartTime = DateTime.Now.AddMinutes(3).AddHours(i);
m.EndTime = DateTime.Now.AddHours(i).AddMinutes(30);
m.Title = "Meeting " + i;
m.ConferenceNumberToDial = i + "meeting@fake.com";
sch.Meetings.Add(m);
}
return sch;
}
}
#endregion
}
/// <summary>
/// Implementation for the mock VC