mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 12:44:58 +00:00
Finished merge with 307
This commit is contained in:
@@ -13,7 +13,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A bridge class to cover the basic features of GenericBase hardware
|
/// A bridge class to cover the basic features of GenericBase hardware
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor
|
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
|
||||||
{
|
{
|
||||||
public virtual GenericBase Hardware { get; protected set; }
|
public virtual GenericBase Hardware { get; protected set; }
|
||||||
|
|
||||||
@@ -88,6 +88,12 @@ namespace PepperDash.Essentials.Core
|
|||||||
|
|
||||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
//***********************************************************************************
|
//***********************************************************************************
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ using System.Text;
|
|||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharpPro.Fusion;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core
|
namespace PepperDash.Essentials.Core
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -43,4 +45,24 @@ namespace PepperDash.Essentials.Core
|
|||||||
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
public static class IFusionPowerExtensions
|
||||||
|
{
|
||||||
|
public static void LinkAttributes(this IPower dev, FusionRoom room)
|
||||||
|
{
|
||||||
|
dev.PowerIsOnFeedback.LinkInputSig(room.DisplayPowerOn.InputSig);
|
||||||
|
|
||||||
|
room.DisplayPowerOn.OutputSig.SetSigFalseAction(dev.PowerOn);
|
||||||
|
room.DisplayPowerOff.OutputSig.SetSigFalseAction(dev.PowerOff);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UnlinkAttributes(this IPower dev, FusionRoom room)
|
||||||
|
{
|
||||||
|
dev.PowerIsOnFeedback.UnlinkInputSig(room.DisplayPowerOn.InputSig);
|
||||||
|
|
||||||
|
room.DisplayPowerOn.OutputSig.SetSigFalseAction(null);
|
||||||
|
room.DisplayPowerOff.OutputSig.SetSigFalseAction(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,135 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasFeedback : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method shall return a list of all Output objects on a device,
|
||||||
|
/// including all "aggregate" devices.
|
||||||
|
/// </summary>
|
||||||
|
List<Feedback> Feedbacks { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class IHasFeedbackExtensions
|
||||||
|
{
|
||||||
|
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
|
||||||
|
{
|
||||||
|
CType t = source.GetType();
|
||||||
|
// get the properties and set them into a new collection of NameType wrappers
|
||||||
|
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||||
|
if (feedbacks != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||||
|
foreach (var f in feedbacks)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
string type = "";
|
||||||
|
if (getCurrentStates)
|
||||||
|
{
|
||||||
|
if (f is BoolFeedback)
|
||||||
|
{
|
||||||
|
val = f.BoolValue.ToString();
|
||||||
|
type = "boolean";
|
||||||
|
}
|
||||||
|
else if (f is IntFeedback)
|
||||||
|
{
|
||||||
|
val = f.IntValue.ToString();
|
||||||
|
type = "integer";
|
||||||
|
}
|
||||||
|
else if (f is StringFeedback)
|
||||||
|
{
|
||||||
|
val = f.StringValue;
|
||||||
|
type = "string";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
|
||||||
|
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, source, "No available outputs:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
=======
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasFeedback : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method shall return a list of all Output objects on a device,
|
||||||
|
/// including all "aggregate" devices.
|
||||||
|
/// </summary>
|
||||||
|
List<Feedback> Feedbacks { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class IHasFeedbackExtensions
|
||||||
|
{
|
||||||
|
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
|
||||||
|
{
|
||||||
|
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||||
|
if (feedbacks != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||||
|
foreach (var f in feedbacks)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
if (getCurrentStates)
|
||||||
|
{
|
||||||
|
if (f is BoolFeedback)
|
||||||
|
val = " = " + f.BoolValue;
|
||||||
|
else if(f is IntFeedback)
|
||||||
|
val = " = " + f.IntValue;
|
||||||
|
else if(f is StringFeedback)
|
||||||
|
val = " = " + f.StringValue;
|
||||||
|
|
||||||
|
//switch (f.Type)
|
||||||
|
//{
|
||||||
|
// case eCueType.Bool:
|
||||||
|
// val = " = " + f.BoolValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.Int:
|
||||||
|
// val = " = " + f.IntValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.String:
|
||||||
|
// val = " = " + f.StringValue;
|
||||||
|
// break;
|
||||||
|
// //case eOutputType.Other:
|
||||||
|
// // break;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
|
||||||
|
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, source, "No available outputs:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class IHasFeedbackFusionExtensions
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
>>>>>>> origin/feature/ecs-307
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasFeedback : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method shall return a list of all Output objects on a device,
|
||||||
|
/// including all "aggregate" devices.
|
||||||
|
/// </summary>
|
||||||
|
List<Feedback> Feedbacks { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class IHasFeedbackExtensions
|
||||||
|
{
|
||||||
|
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
|
||||||
|
{
|
||||||
|
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||||
|
if (feedbacks != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||||
|
foreach (var f in feedbacks)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
if (getCurrentStates)
|
||||||
|
{
|
||||||
|
if (f is BoolFeedback)
|
||||||
|
val = " = " + f.BoolValue;
|
||||||
|
else if(f is IntFeedback)
|
||||||
|
val = " = " + f.IntValue;
|
||||||
|
else if(f is StringFeedback)
|
||||||
|
val = " = " + f.StringValue;
|
||||||
|
|
||||||
|
//switch (f.Type)
|
||||||
|
//{
|
||||||
|
// case eCueType.Bool:
|
||||||
|
// val = " = " + f.BoolValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.Int:
|
||||||
|
// val = " = " + f.IntValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.String:
|
||||||
|
// val = " = " + f.StringValue;
|
||||||
|
// break;
|
||||||
|
// //case eOutputType.Other:
|
||||||
|
// // break;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
|
||||||
|
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, source, "No available outputs:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasFeedback : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method shall return a list of all Output objects on a device,
|
||||||
|
/// including all "aggregate" devices.
|
||||||
|
/// </summary>
|
||||||
|
List<Feedback> Feedbacks { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class IHasFeedbackExtensions
|
||||||
|
{
|
||||||
|
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
|
||||||
|
{
|
||||||
|
CType t = source.GetType();
|
||||||
|
// get the properties and set them into a new collection of NameType wrappers
|
||||||
|
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||||
|
if (feedbacks != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||||
|
foreach (var f in feedbacks)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
string type = "";
|
||||||
|
if (getCurrentStates)
|
||||||
|
{
|
||||||
|
if (f is BoolFeedback)
|
||||||
|
{
|
||||||
|
val = f.BoolValue.ToString();
|
||||||
|
type = "boolean";
|
||||||
|
}
|
||||||
|
else if (f is IntFeedback)
|
||||||
|
{
|
||||||
|
val = f.IntValue.ToString();
|
||||||
|
type = "integer";
|
||||||
|
}
|
||||||
|
else if (f is StringFeedback)
|
||||||
|
{
|
||||||
|
val = f.StringValue;
|
||||||
|
type = "string";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
|
||||||
|
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, source, "No available outputs:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IHasFeedback : IKeyed
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// This method shall return a list of all Output objects on a device,
|
||||||
|
/// including all "aggregate" devices.
|
||||||
|
/// </summary>
|
||||||
|
List<Feedback> Feedbacks { get; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class IHasFeedbackExtensions
|
||||||
|
{
|
||||||
|
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
|
||||||
|
{
|
||||||
|
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
|
||||||
|
if (feedbacks != null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, source, "\n\nAvailable feedbacks:");
|
||||||
|
foreach (var f in feedbacks)
|
||||||
|
{
|
||||||
|
string val = "";
|
||||||
|
if (getCurrentStates)
|
||||||
|
{
|
||||||
|
if (f is BoolFeedback)
|
||||||
|
val = " = " + f.BoolValue;
|
||||||
|
else if(f is IntFeedback)
|
||||||
|
val = " = " + f.IntValue;
|
||||||
|
else if(f is StringFeedback)
|
||||||
|
val = " = " + f.StringValue;
|
||||||
|
|
||||||
|
//switch (f.Type)
|
||||||
|
//{
|
||||||
|
// case eCueType.Bool:
|
||||||
|
// val = " = " + f.BoolValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.Int:
|
||||||
|
// val = " = " + f.IntValue;
|
||||||
|
// break;
|
||||||
|
// case eCueType.String:
|
||||||
|
// val = " = " + f.StringValue;
|
||||||
|
// break;
|
||||||
|
// //case eOutputType.Other:
|
||||||
|
// // break;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
|
||||||
|
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Debug.Console(0, source, "No available outputs:");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class IHasFeedbackFusionExtensions
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core
|
||||||
|
{
|
||||||
|
public interface IUsageTracking
|
||||||
|
{
|
||||||
|
UsageTracking UsageTracker { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//public static class IUsageTrackingExtensions
|
||||||
|
//{
|
||||||
|
// public static void EnableUsageTracker(this IUsageTracking device)
|
||||||
|
// {
|
||||||
|
// device.UsageTracker = new UsageTracking();
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
public class UsageTracking
|
||||||
|
{
|
||||||
|
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
|
||||||
|
|
||||||
|
public InUseTracking InUseTracker { get; protected set; }
|
||||||
|
|
||||||
|
public bool UsageIsTracked { get; set; }
|
||||||
|
public DateTime UsageStartTime { get; protected set; }
|
||||||
|
public DateTime UsageEndTime { get; protected set; }
|
||||||
|
|
||||||
|
public UsageTracking()
|
||||||
|
{
|
||||||
|
InUseTracker = new InUseTracking();
|
||||||
|
|
||||||
|
InUseTracker.InUseFeedback.OutputChange +=new EventHandler<EventArgs>(InUseFeedback_OutputChange);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InUseFeedback_OutputChange(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if(InUseTracker.InUseFeedback.BoolValue)
|
||||||
|
{
|
||||||
|
StartDeviceUsage();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EndDeviceUsage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stores the usage start time
|
||||||
|
/// </summary>
|
||||||
|
public void StartDeviceUsage()
|
||||||
|
{
|
||||||
|
UsageStartTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
|
||||||
|
/// </summary>
|
||||||
|
public void EndDeviceUsage()
|
||||||
|
{
|
||||||
|
UsageEndTime = DateTime.Now;
|
||||||
|
|
||||||
|
var timeUsed = UsageEndTime - UsageStartTime;
|
||||||
|
|
||||||
|
var handler = DeviceUsageEnded;
|
||||||
|
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class DeviceUsageEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public DateTime UsageEndTime { get; set; }
|
||||||
|
public int MinutesUsed { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,12 +16,14 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling
|
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
|
||||||
{
|
{
|
||||||
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
public BoolFeedback PowerIsOnFeedback { get; protected set; }
|
||||||
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
|
||||||
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
public BoolFeedback IsWarmingUpFeedback { get; private set; }
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
public uint WarmupTime { get; set; }
|
public uint WarmupTime { get; set; }
|
||||||
public uint CooldownTime { get; set; }
|
public uint CooldownTime { get; set; }
|
||||||
|
|
||||||
@@ -77,7 +79,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TwoWayDisplayBase : DisplayBase
|
public abstract class TwoWayDisplayBase : DisplayBase
|
||||||
{
|
{
|
||||||
public StringFeedback CurrentInputFeedback { get; private set; }
|
public StringFeedback CurrentInputFeedback { get; private set; }
|
||||||
|
|
||||||
@@ -104,6 +106,8 @@ namespace PepperDash.Essentials.Core
|
|||||||
CooldownTime = 15000;
|
CooldownTime = 15000;
|
||||||
|
|
||||||
Feedbacks.Add(CurrentInputFeedback);
|
Feedbacks.Add(CurrentInputFeedback);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,10 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||||
@@ -112,6 +116,7 @@
|
|||||||
<Compile Include="Config\DeviceConfig.cs" />
|
<Compile Include="Config\DeviceConfig.cs" />
|
||||||
<Compile Include="Constants\CommonCues.cs" />
|
<Compile Include="Constants\CommonCues.cs" />
|
||||||
<Compile Include="Devices\DisplayUiConstants.cs" />
|
<Compile Include="Devices\DisplayUiConstants.cs" />
|
||||||
|
<Compile Include="Devices\IUsageTracking.cs" />
|
||||||
<Compile Include="Devices\REMOVE DeviceConfig.cs" />
|
<Compile Include="Devices\REMOVE DeviceConfig.cs" />
|
||||||
<Compile Include="Devices\DeviceJsonApi.cs" />
|
<Compile Include="Devices\DeviceJsonApi.cs" />
|
||||||
<Compile Include="Devices\SourceListItem.cs" />
|
<Compile Include="Devices\SourceListItem.cs" />
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.Routing;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class IRBlurayBase : Device, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs
|
public class IRBlurayBase : Device, IDiscPlayerControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
||||||
@@ -304,5 +304,11 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
|
||||||
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo
|
public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
||||||
{
|
{
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
||||||
public string IconName { get; set; }
|
public string IconName { get; set; }
|
||||||
@@ -51,5 +51,11 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo
|
public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
|
||||||
{
|
{
|
||||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
|
||||||
public string IconName { get; set; }
|
public string IconName { get; set; }
|
||||||
@@ -51,5 +51,11 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ using PepperDash.Essentials.Core.Routing;
|
|||||||
|
|
||||||
namespace PepperDash.Essentials.Devices.Common
|
namespace PepperDash.Essentials.Devices.Common
|
||||||
{
|
{
|
||||||
public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs
|
public class IRSetTopBoxBase : Device, ISetTopBoxControls, IUiDisplayInfo, IRoutingOutputs, IUsageTracking
|
||||||
{
|
{
|
||||||
public IrOutputPortController IrPort { get; private set; }
|
public IrOutputPortController IrPort { get; private set; }
|
||||||
|
|
||||||
@@ -333,5 +333,11 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IUsageTracking Members
|
||||||
|
|
||||||
|
public UsageTracking UsageTracker { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,5 +152,11 @@ namespace PepperDash.Essentials
|
|||||||
return o1;
|
return o1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetGroupForDeviceKey(string key)
|
||||||
|
{
|
||||||
|
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
|
||||||
|
return dev == null ? null : dev.Group;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,8 +29,8 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public override void InitializeSystem()
|
public override void InitializeSystem()
|
||||||
{
|
{
|
||||||
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file",
|
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Reloads configuration file",
|
||||||
// ConsoleAccessLevelEnum.AccessOperator);
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
//CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Reloads configuration file",
|
//CrestronConsole.AddNewConsoleCommand(s => TearDown(), "ungo", "Reloads configuration file",
|
||||||
// ConsoleAccessLevelEnum.AccessOperator);
|
// ConsoleAccessLevelEnum.AccessOperator);
|
||||||
CrestronConsole.AddNewConsoleCommand(s =>
|
CrestronConsole.AddNewConsoleCommand(s =>
|
||||||
@@ -40,7 +40,7 @@ namespace PepperDash.Essentials
|
|||||||
},
|
},
|
||||||
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
GoWithLoad();
|
//GoWithLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -62,11 +62,6 @@ namespace PepperDash.Essentials
|
|||||||
LoadDevices();
|
LoadDevices();
|
||||||
LoadTieLines();
|
LoadTieLines();
|
||||||
LoadRooms();
|
LoadRooms();
|
||||||
// FUSION - should go per room I believe. See CreateSystems in original Configuration.cs
|
|
||||||
// ???
|
|
||||||
|
|
||||||
//Temp Cotija testing
|
|
||||||
//CotijaSystemController CotijaInterface = new CotijaSystemController("WebClient1");
|
|
||||||
|
|
||||||
DeviceManager.ActivateAll();
|
DeviceManager.ActivateAll();
|
||||||
Debug.Console(0, "Essentials load complete\r" +
|
Debug.Console(0, "Essentials load complete\r" +
|
||||||
@@ -192,8 +187,6 @@ namespace PepperDash.Essentials
|
|||||||
DeviceManager.AddDevice(room);
|
DeviceManager.AddDevice(room);
|
||||||
}
|
}
|
||||||
|
|
||||||
#warning Add Fusion connector to room factory?
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Debug.Console(0, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
Debug.Console(0, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
||||||
|
|||||||
399
Essentials/PepperDashEssentials/Fusion/FusionRviDataClasses.cs
Normal file
399
Essentials/PepperDashEssentials/Fusion/FusionRviDataClasses.cs
Normal file
@@ -0,0 +1,399 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Fusion
|
||||||
|
{
|
||||||
|
// Helper Classes for GUIDs
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stores GUIDs to be written to a file in NVRAM
|
||||||
|
/// </summary>
|
||||||
|
public class FusionRoomGuids
|
||||||
|
{
|
||||||
|
public string RoomName { get; set; }
|
||||||
|
public uint IpId { get; set; }
|
||||||
|
public string RoomGuid { get; set; }
|
||||||
|
public List<FusionAsset> StaticAssets { get; set; }
|
||||||
|
|
||||||
|
public FusionRoomGuids()
|
||||||
|
{
|
||||||
|
StaticAssets = new List<FusionAsset>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public FusionRoomGuids(string roomName, uint ipId, string roomGuid, List<FusionAsset> staticAssets)
|
||||||
|
{
|
||||||
|
RoomName = roomName;
|
||||||
|
IpId = ipId;
|
||||||
|
RoomGuid = roomGuid;
|
||||||
|
|
||||||
|
StaticAssets = new List<FusionAsset>(staticAssets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FusionAsset
|
||||||
|
{
|
||||||
|
public uint Number { get; set; }
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
|
public string InstanceID { get; set; }
|
||||||
|
|
||||||
|
public FusionAsset()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public FusionAsset(uint slotNum, string assetName, string type, string instanceID)
|
||||||
|
{
|
||||||
|
Number = slotNum;
|
||||||
|
Name = assetName;
|
||||||
|
Type = type;
|
||||||
|
if (string.IsNullOrEmpty(instanceID))
|
||||||
|
{
|
||||||
|
InstanceID = Guid.NewGuid().ToString();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
InstanceID = instanceID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************************************
|
||||||
|
|
||||||
|
public class RoomSchedule
|
||||||
|
{
|
||||||
|
public List<Event> Meetings { get; set; }
|
||||||
|
|
||||||
|
public RoomSchedule()
|
||||||
|
{
|
||||||
|
Meetings = new List<Event>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//****************************************************************************************************
|
||||||
|
// Helper Classes for XML API
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data needed to request the local time from the Fusion server
|
||||||
|
/// </summary>
|
||||||
|
public class LocalTimeRequest
|
||||||
|
{
|
||||||
|
public string RequestID { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// All the data needed for a full schedule request in a room
|
||||||
|
/// </summary>
|
||||||
|
/// //[XmlRoot(ElementName = "RequestSchedule")]
|
||||||
|
public class RequestSchedule
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "RequestID")]
|
||||||
|
public string RequestID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "RoomID")]
|
||||||
|
public string RoomID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Start")]
|
||||||
|
public DateTime Start { get; set; }
|
||||||
|
//[XmlElement(ElementName = "HourSpan")]
|
||||||
|
public double HourSpan { get; set; }
|
||||||
|
|
||||||
|
public RequestSchedule(string requestID, string roomID)
|
||||||
|
{
|
||||||
|
RequestID = requestID;
|
||||||
|
RoomID = roomID;
|
||||||
|
Start = DateTime.Now;
|
||||||
|
HourSpan = 24;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "RequestAction")]
|
||||||
|
public class RequestAction
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "RequestID")]
|
||||||
|
public string RequestID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "RoomID")]
|
||||||
|
public string RoomID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ActionID")]
|
||||||
|
public string ActionID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Parameters")]
|
||||||
|
public List<Parameter> Parameters { get; set; }
|
||||||
|
|
||||||
|
public RequestAction(string roomID, string actionID, List<Parameter> parameters)
|
||||||
|
{
|
||||||
|
RoomID = roomID;
|
||||||
|
ActionID = actionID;
|
||||||
|
Parameters = parameters;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "ActionResponse")]
|
||||||
|
public class ActionResponse
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "RequestID")]
|
||||||
|
public string RequestID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ActionID")]
|
||||||
|
public string ActionID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Parameters")]
|
||||||
|
public List<Parameter> Parameters { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Parameter")]
|
||||||
|
public class Parameter
|
||||||
|
{
|
||||||
|
//[XmlAttribute(AttributeName = "ID")]
|
||||||
|
public string ID { get; set; }
|
||||||
|
//[XmlAttribute(AttributeName = "Value")]
|
||||||
|
public string Value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
////[XmlRoot(ElementName = "Parameters")]
|
||||||
|
//public class Parameters
|
||||||
|
//{
|
||||||
|
// //[XmlElement(ElementName = "Parameter")]
|
||||||
|
// public List<Parameter> Parameter { get; set; }
|
||||||
|
//}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Data structure for a ScheduleResponse from Fusion
|
||||||
|
/// </summary>
|
||||||
|
/// //[XmlRoot(ElementName = "ScheduleResponse")]
|
||||||
|
public class ScheduleResponse
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "RequestID")]
|
||||||
|
public string RequestID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "RoomID")]
|
||||||
|
public string RoomID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "RoomName")]
|
||||||
|
public string RoomName { get; set; }
|
||||||
|
//[XmlElement("Event")]
|
||||||
|
public List<Event> Events { get; set; }
|
||||||
|
|
||||||
|
public ScheduleResponse()
|
||||||
|
{
|
||||||
|
Events = new List<Event>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Event")]
|
||||||
|
public class Event
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "MeetingID")]
|
||||||
|
public string MeetingID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "RVMeetingID")]
|
||||||
|
public string RVMeetingID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Recurring")]
|
||||||
|
public string Recurring { get; set; }
|
||||||
|
//[XmlElement(ElementName = "InstanceID")]
|
||||||
|
public string InstanceID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "dtStart")]
|
||||||
|
public DateTime dtStart { get; set; }
|
||||||
|
//[XmlElement(ElementName = "dtEnd")]
|
||||||
|
public DateTime dtEnd { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Organizer")]
|
||||||
|
public string Organizer { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Attendees")]
|
||||||
|
public Attendees Attendees { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Resources")]
|
||||||
|
public Resources Resources { get; set; }
|
||||||
|
//[XmlElement(ElementName = "IsEvent")]
|
||||||
|
public string IsEvent { get; set; }
|
||||||
|
//[XmlElement(ElementName = "IsRoomViewMeeting")]
|
||||||
|
public string IsRoomViewMeeting { get; set; }
|
||||||
|
//[XmlElement(ElementName = "IsPrivate")]
|
||||||
|
public string IsPrivate { get; set; }
|
||||||
|
//[XmlElement(ElementName = "IsExchangePrivate")]
|
||||||
|
public string IsExchangePrivate { get; set; }
|
||||||
|
//[XmlElement(ElementName = "MeetingTypes")]
|
||||||
|
public MeetingTypes MeetingTypes { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ParticipantCode")]
|
||||||
|
public string ParticipantCode { get; set; }
|
||||||
|
//[XmlElement(ElementName = "PhoneNo")]
|
||||||
|
public string PhoneNo { get; set; }
|
||||||
|
//[XmlElement(ElementName = "WelcomeMsg")]
|
||||||
|
public string WelcomeMsg { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Subject")]
|
||||||
|
public string Subject { get; set; }
|
||||||
|
//[XmlElement(ElementName = "LiveMeeting")]
|
||||||
|
public LiveMeeting LiveMeeting { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ShareDocPath")]
|
||||||
|
public string ShareDocPath { get; set; }
|
||||||
|
//[XmlElement(ElementName = "HaveAttendees")]
|
||||||
|
public string HaveAttendees { get; set; }
|
||||||
|
//[XmlElement(ElementName = "HaveResources")]
|
||||||
|
public string HaveResources { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the duration of the meeting
|
||||||
|
/// </summary>
|
||||||
|
public string DurationInMinutes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
string duration;
|
||||||
|
|
||||||
|
var timeSpan = dtEnd.Subtract(dtStart);
|
||||||
|
int hours = timeSpan.Hours;
|
||||||
|
double minutes = timeSpan.Minutes;
|
||||||
|
double roundedMinutes = Math.Round(minutes);
|
||||||
|
if (hours > 0)
|
||||||
|
{
|
||||||
|
duration = string.Format("{0} hours {1} minutes", hours, roundedMinutes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
duration = string.Format("{0} minutes", roundedMinutes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the remaining time in the meeting. Returns null if the meeting is not currently in progress.
|
||||||
|
/// </summary>
|
||||||
|
public string RemainingTime
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var now = DateTime.Now;
|
||||||
|
|
||||||
|
string remainingTime;
|
||||||
|
|
||||||
|
if (GetInProgress())
|
||||||
|
{
|
||||||
|
var timeSpan = dtEnd.Subtract(now);
|
||||||
|
int hours = timeSpan.Hours;
|
||||||
|
double minutes = timeSpan.Minutes;
|
||||||
|
double roundedMinutes = Math.Round(minutes);
|
||||||
|
if (hours > 0)
|
||||||
|
{
|
||||||
|
remainingTime = string.Format("{0} hours {1} minutes", hours, roundedMinutes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
remainingTime = string.Format("{0} minutes", roundedMinutes);
|
||||||
|
}
|
||||||
|
|
||||||
|
return remainingTime;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates that the meeting is in progress
|
||||||
|
/// </summary>
|
||||||
|
public bool isInProgress
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return GetInProgress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if the meeting is in progress
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>Returns true if in progress</returns>
|
||||||
|
bool GetInProgress()
|
||||||
|
{
|
||||||
|
var now = DateTime.Now;
|
||||||
|
|
||||||
|
if (now > dtStart && now < dtEnd)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Resources")]
|
||||||
|
public class Resources
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Rooms")]
|
||||||
|
public Rooms Rooms { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Rooms")]
|
||||||
|
public class Rooms
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Room")]
|
||||||
|
public List<Room> Room { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Room")]
|
||||||
|
public class Room
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Name")]
|
||||||
|
public string Name { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ID")]
|
||||||
|
public string ID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "MPType")]
|
||||||
|
public string MPType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Attendees")]
|
||||||
|
public class Attendees
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Required")]
|
||||||
|
public Required Required { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Optional")]
|
||||||
|
public Optional Optional { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Required")]
|
||||||
|
public class Required
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Attendee")]
|
||||||
|
public List<string> Attendee { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "Optional")]
|
||||||
|
public class Optional
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "Attendee")]
|
||||||
|
public List<string> Attendee { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "MeetingType")]
|
||||||
|
public class MeetingType
|
||||||
|
{
|
||||||
|
//[XmlAttribute(AttributeName = "ID")]
|
||||||
|
public string ID { get; set; }
|
||||||
|
//[XmlAttribute(AttributeName = "Value")]
|
||||||
|
public string Value { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "MeetingTypes")]
|
||||||
|
public class MeetingTypes
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "MeetingType")]
|
||||||
|
public List<MeetingType> MeetingType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "LiveMeeting")]
|
||||||
|
public class LiveMeeting
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "URL")]
|
||||||
|
public string URL { get; set; }
|
||||||
|
//[XmlElement(ElementName = "ID")]
|
||||||
|
public string ID { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Key")]
|
||||||
|
public string Key { get; set; }
|
||||||
|
//[XmlElement(ElementName = "Subject")]
|
||||||
|
public string Subject { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
//[XmlRoot(ElementName = "LiveMeetingURL")]
|
||||||
|
public class LiveMeetingURL
|
||||||
|
{
|
||||||
|
//[XmlElement(ElementName = "LiveMeeting")]
|
||||||
|
public LiveMeeting LiveMeeting { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,10 +14,9 @@ using Crestron.SimplSharpPro.Fusion;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
|
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials;
|
using PepperDash.Essentials;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
|
|
||||||
@@ -35,10 +34,27 @@ 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 SourceNameSig;
|
StringSigData SourceNameSig;
|
||||||
|
|
||||||
|
//ProcessorEthernet Info
|
||||||
|
#region
|
||||||
|
StringSigData Ip1;
|
||||||
|
StringSigData Ip2;
|
||||||
|
StringSigData Gateway;
|
||||||
|
StringSigData Hostname;
|
||||||
|
StringSigData Domain;
|
||||||
|
StringSigData Dns1;
|
||||||
|
StringSigData Dns2;
|
||||||
|
StringSigData Mac1;
|
||||||
|
StringSigData Mac2;
|
||||||
|
StringSigData NetMask1;
|
||||||
|
StringSigData NetMask2;
|
||||||
|
#endregion
|
||||||
|
|
||||||
RoomSchedule CurrentSchedule;
|
RoomSchedule CurrentSchedule;
|
||||||
|
|
||||||
Event NextMeeting;
|
Event NextMeeting;
|
||||||
@@ -71,7 +87,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
public long PushNotificationTimeout = 5000;
|
public long PushNotificationTimeout = 5000;
|
||||||
|
|
||||||
List<StaticAsset> StaticAssets;
|
List<FusionAsset> FusionAssets;
|
||||||
|
|
||||||
//ScheduleResponseEvent NextMeeting;
|
//ScheduleResponseEvent NextMeeting;
|
||||||
|
|
||||||
@@ -83,7 +99,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
IpId = ipId;
|
IpId = ipId;
|
||||||
|
|
||||||
StaticAssets = new List<StaticAsset>();
|
FusionAssets = new List<FusionAsset>();
|
||||||
|
|
||||||
GUIDs = new FusionRoomGuids();
|
GUIDs = new FusionRoomGuids();
|
||||||
|
|
||||||
@@ -113,33 +129,34 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
SetUpCommunitcationMonitors();
|
SetUpCommunitcationMonitors();
|
||||||
SetUpDisplay();
|
SetUpDisplay();
|
||||||
SetUpError();
|
SetUpError();
|
||||||
|
SetUpOccupancy();
|
||||||
|
|
||||||
// test assets --- THESE ARE BOTH WIRED TO AssetUsage somewhere internally.
|
// test assets --- THESE ARE BOTH WIRED TO AssetUsage somewhere internally.
|
||||||
var tempAsset1 = new StaticAsset();
|
//var tempAsset1 = new StaticAsset();
|
||||||
var tempAsset2 = new StaticAsset();
|
//var tempAsset2 = new StaticAsset();
|
||||||
|
|
||||||
|
|
||||||
//Check for existing GUID
|
////Check for existing GUID
|
||||||
if (GuidFileExists)
|
//if (GuidFileExists)
|
||||||
{
|
//{
|
||||||
tempAsset1 = StaticAssets.FirstOrDefault(a => a.Number.Equals(1));
|
// tempAsset1 = StaticAssets.FirstOrDefault(a => a.Number.Equals(1));
|
||||||
|
|
||||||
tempAsset2 = StaticAssets.FirstOrDefault(a => a.Number.Equals(2));
|
// tempAsset2 = StaticAssets.FirstOrDefault(a => a.Number.Equals(2));
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
tempAsset1 = new StaticAsset(1, "Test Asset 1", "Test Asset 1", "");
|
// tempAsset1 = new StaticAsset(1, "Test Asset 1", "Test Asset 1", "");
|
||||||
StaticAssets.Add(tempAsset1);
|
// StaticAssets.Add(tempAsset1);
|
||||||
|
|
||||||
tempAsset2 = new StaticAsset(2, "Test Asset 2", "Test Asset 2", "");
|
// tempAsset2 = new StaticAsset(2, "Test Asset 2", "Test Asset 2", "");
|
||||||
StaticAssets.Add(tempAsset2);
|
// StaticAssets.Add(tempAsset2);
|
||||||
}
|
//}
|
||||||
|
|
||||||
var ta1 = FusionRoom.CreateStaticAsset(tempAsset1.Number, tempAsset1.Name, tempAsset1.Type, tempAsset1.InstanceID);
|
//var ta1 = FusionRoom.CreateStaticAsset(tempAsset1.Number, tempAsset1.Name, tempAsset1.Type, tempAsset1.InstanceID);
|
||||||
ta1.AssetError.InputSig.StringValue = "This should be error";
|
//ta1.AssetError.InputSig.StringValue = "This should be error";
|
||||||
|
|
||||||
var ta2 = FusionRoom.CreateStaticAsset(tempAsset2.Number, tempAsset2.Name, tempAsset2.Type, tempAsset2.InstanceID);
|
//var ta2 = FusionRoom.CreateStaticAsset(tempAsset2.Number, tempAsset2.Name, tempAsset2.Type, tempAsset2.InstanceID);
|
||||||
ta2.AssetUsage.InputSig.StringValue = "This should be usage";
|
//ta2.AssetUsage.InputSig.StringValue = "This should be usage";
|
||||||
|
|
||||||
// Make it so!
|
// Make it so!
|
||||||
FusionRVI.GenerateFileForAllFusionDevices();
|
FusionRVI.GenerateFileForAllFusionDevices();
|
||||||
@@ -170,7 +187,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
Debug.Console(1, this, "Writing GUIDs to file");
|
Debug.Console(1, this, "Writing GUIDs to file");
|
||||||
|
|
||||||
GUIDs = new FusionRoomGuids(Room.Name, IpId, RoomGuid, StaticAssets);
|
GUIDs = new FusionRoomGuids(Room.Name, IpId, RoomGuid, FusionAssets);
|
||||||
|
|
||||||
var JSON = JsonConvert.SerializeObject(GUIDs, Newtonsoft.Json.Formatting.Indented);
|
var JSON = JsonConvert.SerializeObject(GUIDs, Newtonsoft.Json.Formatting.Indented);
|
||||||
|
|
||||||
@@ -223,7 +240,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
IpId = GUIDs.IpId;
|
IpId = GUIDs.IpId;
|
||||||
|
|
||||||
StaticAssets = GUIDs.StaticAssets;
|
FusionAssets = GUIDs.StaticAssets;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +248,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
Debug.Console(1, this, "\nRoom Name: {0}\nIPID: {1:x}\n RoomGuid: {2}", Room.Name, IpId, RoomGuid);
|
Debug.Console(1, this, "\nRoom Name: {0}\nIPID: {1:x}\n RoomGuid: {2}", Room.Name, IpId, RoomGuid);
|
||||||
|
|
||||||
foreach (StaticAsset asset in StaticAssets)
|
foreach (FusionAsset asset in FusionAssets)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "\nAsset Name: {0}\nAsset No: {1}\n Guid: {2}", asset.Name, asset.Number, asset.InstanceID);
|
Debug.Console(1, this, "\nAsset Name: {0}\nAsset No: {1}\n Guid: {2}", asset.Name, asset.Number, asset.InstanceID);
|
||||||
}
|
}
|
||||||
@@ -270,7 +287,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
// Room to fusion room
|
// Room to fusion room
|
||||||
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
|
||||||
SourceNameSig = FusionRoom.CreateOffsetStringSig(50, "Source - Name", eSigIoMask.InputSigOnly);
|
SourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Source - Name", eSigIoMask.InputSigOnly);
|
||||||
// Don't think we need to get current status of this as nothing should be alive yet.
|
// Don't think we need to get current status of this as nothing should be alive yet.
|
||||||
Room.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSourceInfoChange);
|
Room.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSourceInfoChange);
|
||||||
|
|
||||||
@@ -281,8 +298,55 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
FusionRoom.ErrorMessage.InputSig.StringValue =
|
FusionRoom.ErrorMessage.InputSig.StringValue =
|
||||||
"3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
"3: 7 Errors: This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;This is a really long error message;";
|
||||||
|
|
||||||
|
// Processor Info
|
||||||
|
|
||||||
}
|
FusionRoom.CreateOffsetStringSig(50, "Info - Processor - System Name", eSigIoMask.InputSigOnly);
|
||||||
|
FusionRoom.CreateOffsetStringSig(51, "Info - Processor - Model", eSigIoMask.InputSigOnly);
|
||||||
|
FusionRoom.CreateOffsetStringSig(52, "Info - Processor - Serial Number", eSigIoMask.InputSigOnly);
|
||||||
|
FusionRoom.CreateOffsetStringSig(53, "Info - Processor - Uptime", eSigIoMask.InputSigOnly);
|
||||||
|
Ip1 = FusionRoom.CreateOffsetStringSig(54, "Info - Processor - IP 1", eSigIoMask.InputSigOnly);
|
||||||
|
Ip2 = FusionRoom.CreateOffsetStringSig(55, "Info - Processor - IP 2", eSigIoMask.InputSigOnly);
|
||||||
|
Gateway = FusionRoom.CreateOffsetStringSig(56, "Info - Processor - Gateway", eSigIoMask.InputSigOnly);
|
||||||
|
Hostname = FusionRoom.CreateOffsetStringSig(57, "Info - Processor - Hostname", eSigIoMask.InputSigOnly);
|
||||||
|
Domain = FusionRoom.CreateOffsetStringSig(58, "Info - Processor - Domain", eSigIoMask.InputSigOnly);
|
||||||
|
Dns1 = FusionRoom.CreateOffsetStringSig(59, "Info - Processor - DNS 1", eSigIoMask.InputSigOnly);
|
||||||
|
Dns2 = FusionRoom.CreateOffsetStringSig(60, "Info - Processor - DNS 2", eSigIoMask.InputSigOnly);
|
||||||
|
Mac1 = FusionRoom.CreateOffsetStringSig(61, "Info - Processor - MAC 1", eSigIoMask.InputSigOnly);
|
||||||
|
Mac2 = FusionRoom.CreateOffsetStringSig(62, "Info - Processor - MAC 2", eSigIoMask.InputSigOnly);
|
||||||
|
NetMask1 = FusionRoom.CreateOffsetStringSig(63, "Info - Processor - Net Mask 1", eSigIoMask.InputSigOnly);
|
||||||
|
NetMask2 = FusionRoom.CreateOffsetStringSig(64, "Info - Processor - Net Mask 2", eSigIoMask.InputSigOnly);
|
||||||
|
|
||||||
|
SetProcessorEthernetValues();
|
||||||
|
|
||||||
|
CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CrestronEnvironment_EthernetEventHandler(EthernetEventArgs ethernetEventArgs)
|
||||||
|
{
|
||||||
|
if (ethernetEventArgs.EthernetEventType == eEthernetEventType.LinkUp)
|
||||||
|
{
|
||||||
|
SetProcessorEthernetValues();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetProcessorEthernetValues()
|
||||||
|
{
|
||||||
|
Ip1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0);
|
||||||
|
Ip2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 1);
|
||||||
|
Gateway.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_ROUTER, 0);
|
||||||
|
Hostname.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_HOSTNAME, 0);
|
||||||
|
Domain.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DOMAIN_NAME, 0);
|
||||||
|
|
||||||
|
var dnsServers = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_DNS_SERVER, 0).Split(',');
|
||||||
|
Dns1.InputSig.StringValue = dnsServers[0];
|
||||||
|
if (dnsServers.Length > 1)
|
||||||
|
Dns2.InputSig.StringValue = dnsServers[1];
|
||||||
|
|
||||||
|
Mac1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 0);
|
||||||
|
Mac2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_MAC_ADDRESS, 1);
|
||||||
|
NetMask1.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 0);
|
||||||
|
NetMask2.InputSig.StringValue = CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_MASK, 1);
|
||||||
|
}
|
||||||
|
|
||||||
void FusionRoom_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
void FusionRoom_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
{
|
{
|
||||||
@@ -306,7 +370,6 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
"<Parameter ID='Field' Value='MeetingID' />\n" +
|
"<Parameter ID='Field' Value='MeetingID' />\n" +
|
||||||
"<Parameter ID='Field' Value='RVMeetingID' />\n" +
|
"<Parameter ID='Field' Value='RVMeetingID' />\n" +
|
||||||
"<Parameter ID='Field' Value='InstanceID' />\n" +
|
"<Parameter ID='Field' Value='InstanceID' />\n" +
|
||||||
//"<Parameter ID='Field' Value='Recurring' />\n" +
|
|
||||||
"<Parameter ID='Field' Value='dtStart' />\n" +
|
"<Parameter ID='Field' Value='dtStart' />\n" +
|
||||||
"<Parameter ID='Field' Value='dtEnd' />\n" +
|
"<Parameter ID='Field' Value='dtEnd' />\n" +
|
||||||
"<Parameter ID='Field' Value='Subject' />\n" +
|
"<Parameter ID='Field' Value='Subject' />\n" +
|
||||||
@@ -324,6 +387,15 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
Debug.Console(2, this, "Sending Fusion ActionRequest: \n{0}", actionRequest);
|
Debug.Console(2, this, "Sending Fusion ActionRequest: \n{0}", actionRequest);
|
||||||
|
|
||||||
FusionRoom.ExtenderFusionRoomDataReservedSigs.ActionQuery.StringValue = actionRequest;
|
FusionRoom.ExtenderFusionRoomDataReservedSigs.ActionQuery.StringValue = actionRequest;
|
||||||
|
|
||||||
|
|
||||||
|
// Request current Fusion Server Time
|
||||||
|
|
||||||
|
string timeRequestID = "TimeRequest";
|
||||||
|
|
||||||
|
string timeRequest = string.Format("<LocalTimeRequest><RequestID>{0}</RequestID></LocalTimeRequest>", timeRequestID);
|
||||||
|
|
||||||
|
FusionRoom.ExtenderFusionRoomDataReservedSigs.LocalDateTimeQuery.StringValue = timeRequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -480,20 +552,6 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//ActionResponse actionResponse = new ActionResponse();
|
|
||||||
|
|
||||||
//TextReader reader = new StringReader(args.Sig.StringValue);
|
|
||||||
|
|
||||||
//actionResponse = CrestronXMLSerialization.DeSerializeObject<ActionResponse>(reader);
|
|
||||||
|
|
||||||
//if (actionResponse != null)
|
|
||||||
//{
|
|
||||||
// if (actionResponse.RequestID == "InitialPushRequest")
|
|
||||||
// {
|
|
||||||
// if (actionResponse.Parameters != null)
|
|
||||||
// {
|
|
||||||
// var tempParam = actionResponse.Parameters.FirstOrDefault(p => p.ID.Equals("Registered"));
|
|
||||||
|
|
||||||
XmlDocument message = new XmlDocument();
|
XmlDocument message = new XmlDocument();
|
||||||
|
|
||||||
message.LoadXml(args.Sig.StringValue);
|
message.LoadXml(args.Sig.StringValue);
|
||||||
@@ -560,6 +618,40 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
Debug.Console(1, this, "Error parsing ActionQueryResponse: {0}", e);
|
Debug.Console(1, this, "Error parsing ActionQueryResponse: {0}", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (args.Sig == FusionRoom.ExtenderFusionRoomDataReservedSigs.LocalDateTimeQueryResponse)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
XmlDocument message = new XmlDocument();
|
||||||
|
|
||||||
|
message.LoadXml(args.Sig.StringValue);
|
||||||
|
|
||||||
|
var localDateTimeResponse = message["LocalTimeResponse"];
|
||||||
|
|
||||||
|
if (localDateTimeResponse != null)
|
||||||
|
{
|
||||||
|
var localDateTime = localDateTimeResponse["LocalDateTime"];
|
||||||
|
|
||||||
|
if (localDateTime != null)
|
||||||
|
{
|
||||||
|
var tempLocalDateTime = localDateTime.InnerText;
|
||||||
|
|
||||||
|
DateTime currentTime = DateTime.Parse(tempLocalDateTime);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "DateTime from Fusion Server: {0}", currentTime);
|
||||||
|
|
||||||
|
// Parse time and date from response and insert values
|
||||||
|
CrestronEnvironment.SetTimeAndDate((ushort)currentTime.Hour, (ushort)currentTime.Minute, (ushort)currentTime.Second, (ushort)currentTime.Month, (ushort)currentTime.Day, (ushort)currentTime.Year);
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Processor time set to {0}", CrestronEnvironment.GetLocalTime());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Error parsing LocalDateTimeQueryResponse: {0}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -727,6 +819,18 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var kvp in dict)
|
||||||
|
{
|
||||||
|
var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
|
||||||
|
|
||||||
|
if (usageDevice != null)
|
||||||
|
{
|
||||||
|
usageDevice.UsageTracker = new UsageTracking();
|
||||||
|
usageDevice.UsageTracker.UsageIsTracked = true;
|
||||||
|
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -735,6 +839,35 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Collects usage data from source and sends to Fusion
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void UsageTracker_DeviceUsageEnded(object sender, DeviceUsageEventArgs e)
|
||||||
|
{
|
||||||
|
var device = sender as Device;
|
||||||
|
|
||||||
|
var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(device.Key));
|
||||||
|
|
||||||
|
string group = ConfigReader.GetGroupForDeviceKey(device.Key);
|
||||||
|
|
||||||
|
string currentMeetingId = "";
|
||||||
|
|
||||||
|
if (CurrentMeeting != null)
|
||||||
|
currentMeetingId = CurrentMeeting.MeetingID;
|
||||||
|
|
||||||
|
//String Format: "USAGE||[Date YYYY-MM-DD]||[Time HH-mm-ss]||TIME||[Asset_Type]||[Asset_Name]||[Minutes_used]||[Asset_ID]||[Meeting_ID]"
|
||||||
|
// [Asset_ID] property does not appear to be used in Crestron SSI examples. They are sending "-" instead so that's what is replicated here
|
||||||
|
string deviceUsage = string.Format("USAGE||{0}||{1}||TIME||{2}||{3}||{4}||{5}||{6})", e.UsageEndTime.ToString("YYYY-MM-DD"), e.UsageEndTime.ToString("HH-mm-ss"),
|
||||||
|
group, device.Name, e.MinutesUsed, "-", currentMeetingId);
|
||||||
|
|
||||||
|
|
||||||
|
FusionRoom.DeviceUsage.InputSig.StringValue = deviceUsage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TryAddRouteActionSigs(string attrName, uint attrNum, string routeKey, Device pSrc)
|
void TryAddRouteActionSigs(string attrName, uint attrNum, string routeKey, Device pSrc)
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}",
|
Debug.Console(2, this, "Creating attribute '{0}' with join {1} for source {2}",
|
||||||
@@ -777,22 +910,35 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
string attrName = null;
|
string attrName = null;
|
||||||
uint attrNum = Convert.ToUInt32(keyNum);
|
uint attrNum = Convert.ToUInt32(keyNum);
|
||||||
|
|
||||||
//if (dev is SmartGraphicsTouchpanelControllerBase)
|
|
||||||
//{
|
|
||||||
// if (attrNum > 10)
|
if (dev is BasicTriListWithSmartObject)
|
||||||
// continue;
|
{
|
||||||
// attrName = "Device Ok - Touch Panel " + attrNum;
|
if (attrNum > 10)
|
||||||
// attrNum += 200;
|
continue;
|
||||||
//}
|
attrName = "Online - Touch Panel " + attrNum;
|
||||||
//// add xpanel here
|
attrNum += 200;
|
||||||
|
#warning should this be 150
|
||||||
|
}
|
||||||
|
// add xpanel here
|
||||||
|
|
||||||
|
if (dev is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||||
|
{
|
||||||
|
if (attrNum > 10)
|
||||||
|
continue;
|
||||||
|
attrName = "Online - Touch Panel " + attrNum;
|
||||||
|
attrNum += 160;
|
||||||
|
#warning should this be 160
|
||||||
|
}
|
||||||
|
|
||||||
//else
|
//else
|
||||||
if (dev is DisplayBase)
|
if (dev is DisplayBase)
|
||||||
{
|
{
|
||||||
if (attrNum > 10)
|
if (attrNum > 10)
|
||||||
continue;
|
continue;
|
||||||
attrName = "Device Ok - Display " + attrNum;
|
attrName = "Online - Display " + attrNum;
|
||||||
attrNum += 240;
|
attrNum += 240;
|
||||||
|
#warning should this be 170
|
||||||
}
|
}
|
||||||
//else if (dev is DvdDeviceBase)
|
//else if (dev is DvdDeviceBase)
|
||||||
//{
|
//{
|
||||||
@@ -822,42 +968,61 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
|
|
||||||
void SetUpDisplay()
|
void SetUpDisplay()
|
||||||
{
|
{
|
||||||
var display = Room.DefaultDisplay as DisplayBase;
|
//Setup Display Usage Monitoring
|
||||||
if (display == null)
|
|
||||||
|
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
|
||||||
|
|
||||||
|
#warning should work for now in single room systems but will grab all devices regardless of room assignment. In multi-room systems, this will need to be handled differently.
|
||||||
|
|
||||||
|
foreach (DisplayBase display in displays)
|
||||||
|
{
|
||||||
|
display.UsageTracker = new UsageTracking();
|
||||||
|
display.UsageTracker.UsageIsTracked = true;
|
||||||
|
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
|
||||||
|
}
|
||||||
|
|
||||||
|
var defaultDisplay = Room.DefaultDisplay as DisplayBase;
|
||||||
|
if (defaultDisplay == null)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Cannot link null display to Fusion");
|
Debug.Console(1, this, "Cannot link null display to Fusion");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dispPowerOnAction = new Action<bool>(b => { if (!b) display.PowerOn(); });
|
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
|
||||||
var dispPowerOffAction = new Action<bool>(b => { if (!b) display.PowerOff(); });
|
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
|
||||||
|
|
||||||
// Display to fusion room sigs
|
// Display to fusion room sigs
|
||||||
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
display.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
|
||||||
if (display is IDisplayUsage)
|
if (defaultDisplay is IDisplayUsage)
|
||||||
(display as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
|
||||||
|
|
||||||
// static assets --------------- testing
|
// static assets --------------- testing
|
||||||
// Make a display asset
|
// Make a display asset
|
||||||
string dispAssetInstanceId;
|
string dispAssetInstanceId;
|
||||||
|
|
||||||
//Check for existing GUID
|
//Check for existing GUID
|
||||||
var tempAsset = StaticAssets.FirstOrDefault(a => a.Number.Equals(3));
|
var tempAsset = FusionAssets.FirstOrDefault(a => a.Name.Equals("Display"));
|
||||||
if(tempAsset != null)
|
if(tempAsset != null)
|
||||||
dispAssetInstanceId = tempAsset.InstanceID;
|
dispAssetInstanceId = tempAsset.InstanceID;
|
||||||
else
|
else
|
||||||
dispAssetInstanceId = "";
|
{
|
||||||
|
var nextSlotNum = FusionAssets.Count + 1;
|
||||||
|
|
||||||
var dispAsset = FusionRoom.CreateStaticAsset(3, display.Name, "Display", dispAssetInstanceId);
|
tempAsset = new FusionAsset((uint)nextSlotNum, defaultDisplay.Name, "Display", "");
|
||||||
|
FusionAssets.Add(tempAsset);
|
||||||
|
dispAssetInstanceId = tempAsset.InstanceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dispAsset = FusionRoom.CreateStaticAsset(3, defaultDisplay.Name, "Display", dispAssetInstanceId);
|
||||||
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
|
||||||
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
|
||||||
display.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
|
||||||
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
|
||||||
// Use extension methods
|
// Use extension methods
|
||||||
dispAsset.TrySetMakeModel(display);
|
dispAsset.TrySetMakeModel(defaultDisplay);
|
||||||
dispAsset.TryLinkAssetErrorToCommunication(display);
|
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetUpError()
|
void SetUpError()
|
||||||
@@ -883,7 +1048,31 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetUpOccupancy()
|
||||||
|
{
|
||||||
|
#warning Add actual object logic check here
|
||||||
|
//if (Room.OccupancyObj != null)
|
||||||
|
//{
|
||||||
|
string occAssetId;
|
||||||
|
|
||||||
|
var tempAsset = FusionAssets.FirstOrDefault(a => a.Type.Equals("Occupancy Sensor"));
|
||||||
|
|
||||||
|
if(tempAsset != null)
|
||||||
|
occAssetId = tempAsset.InstanceID;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var nextAssetNum = FusionAssets.Count + 1;
|
||||||
|
|
||||||
|
tempAsset = new FusionAsset((uint)nextAssetNum, "Occupancy Sensor", "Occupancy Sensor", "");
|
||||||
|
FusionAssets.Add(tempAsset);
|
||||||
|
occAssetId = tempAsset.InstanceID;
|
||||||
|
}
|
||||||
|
|
||||||
|
FusionRoom.AddAsset(eAssetType.OccupancySensor, tempAsset.Number, tempAsset.Name, tempAsset.Type, tempAsset.InstanceID);
|
||||||
|
|
||||||
|
((FusionOccupancySensor)FusionRoom.UserConfigurableAssetDetails[tempAsset.Number].Asset).RoomOccupied.InputSig.BoolValue = OccupancyStatusSig.InputSig.BoolValue;
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Helper to get the number from the end of a device's key string
|
/// Helper to get the number from the end of a device's key string
|
||||||
@@ -1063,386 +1252,5 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper Classes for GUIDs
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stores GUIDs to be written to a file in NVRAM
|
|
||||||
/// </summary>
|
|
||||||
public class FusionRoomGuids
|
|
||||||
{
|
|
||||||
public string RoomName { get; set; }
|
|
||||||
public uint IpId { get; set; }
|
|
||||||
public string RoomGuid { get; set; }
|
|
||||||
public List<StaticAsset> StaticAssets { get; set; }
|
|
||||||
|
|
||||||
public FusionRoomGuids()
|
|
||||||
{
|
|
||||||
StaticAssets = new List<StaticAsset>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public FusionRoomGuids(string roomName, uint ipId, string roomGuid, List<StaticAsset> staticAssets)
|
|
||||||
{
|
|
||||||
RoomName = roomName;
|
|
||||||
IpId = ipId;
|
|
||||||
RoomGuid = roomGuid;
|
|
||||||
|
|
||||||
StaticAssets = new List<StaticAsset>(staticAssets);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class StaticAsset
|
|
||||||
{
|
|
||||||
public uint Number { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public string Type { get; set; }
|
|
||||||
public string InstanceID { get; set; }
|
|
||||||
|
|
||||||
public StaticAsset()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public StaticAsset(uint slotNum, string assetName, string type, string instanceID)
|
|
||||||
{
|
|
||||||
Number = slotNum;
|
|
||||||
Name = assetName;
|
|
||||||
Type = type;
|
|
||||||
if(string.IsNullOrEmpty(instanceID))
|
|
||||||
{
|
|
||||||
InstanceID = Guid.NewGuid().ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
InstanceID = instanceID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//***************************************************************************************************
|
|
||||||
|
|
||||||
public class RoomSchedule
|
|
||||||
{
|
|
||||||
public List<Event> Meetings { get; set; }
|
|
||||||
|
|
||||||
public RoomSchedule()
|
|
||||||
{
|
|
||||||
Meetings = new List<Event>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//****************************************************************************************************
|
|
||||||
// Helper Classes for XML API
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// All the data needed for a full schedule request in a room
|
|
||||||
/// </summary>
|
|
||||||
/// //[XmlRoot(ElementName = "RequestSchedule")]
|
|
||||||
public class RequestSchedule
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "RequestID")]
|
|
||||||
public string RequestID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "RoomID")]
|
|
||||||
public string RoomID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Start")]
|
|
||||||
public DateTime Start { get; set; }
|
|
||||||
//[XmlElement(ElementName = "HourSpan")]
|
|
||||||
public double HourSpan { get; set; }
|
|
||||||
|
|
||||||
public RequestSchedule(string requestID, string roomID)
|
|
||||||
{
|
|
||||||
RequestID = requestID;
|
|
||||||
RoomID = roomID;
|
|
||||||
Start = DateTime.Now;
|
|
||||||
HourSpan = 24;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "RequestAction")]
|
|
||||||
public class RequestAction
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "RequestID")]
|
|
||||||
public string RequestID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "RoomID")]
|
|
||||||
public string RoomID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ActionID")]
|
|
||||||
public string ActionID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Parameters")]
|
|
||||||
public List<Parameter> Parameters { get; set; }
|
|
||||||
|
|
||||||
public RequestAction(string roomID, string actionID, List<Parameter> parameters)
|
|
||||||
{
|
|
||||||
RoomID = roomID;
|
|
||||||
ActionID = actionID;
|
|
||||||
Parameters = parameters;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "ActionResponse")]
|
|
||||||
public class ActionResponse
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "RequestID")]
|
|
||||||
public string RequestID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ActionID")]
|
|
||||||
public string ActionID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Parameters")]
|
|
||||||
public List<Parameter> Parameters { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Parameter")]
|
|
||||||
public class Parameter
|
|
||||||
{
|
|
||||||
//[XmlAttribute(AttributeName = "ID")]
|
|
||||||
public string ID { get; set; }
|
|
||||||
//[XmlAttribute(AttributeName = "Value")]
|
|
||||||
public string Value { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
////[XmlRoot(ElementName = "Parameters")]
|
|
||||||
//public class Parameters
|
|
||||||
//{
|
|
||||||
// //[XmlElement(ElementName = "Parameter")]
|
|
||||||
// public List<Parameter> Parameter { get; set; }
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Data structure for a ScheduleResponse from Fusion
|
|
||||||
/// </summary>
|
|
||||||
/// //[XmlRoot(ElementName = "ScheduleResponse")]
|
|
||||||
public class ScheduleResponse
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "RequestID")]
|
|
||||||
public string RequestID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "RoomID")]
|
|
||||||
public string RoomID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "RoomName")]
|
|
||||||
public string RoomName { get; set; }
|
|
||||||
//[XmlElement("Event")]
|
|
||||||
public List<Event> Events { get; set; }
|
|
||||||
|
|
||||||
public ScheduleResponse()
|
|
||||||
{
|
|
||||||
Events = new List<Event>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Event")]
|
|
||||||
public class Event
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "MeetingID")]
|
|
||||||
public string MeetingID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "RVMeetingID")]
|
|
||||||
public string RVMeetingID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Recurring")]
|
|
||||||
public string Recurring { get; set; }
|
|
||||||
//[XmlElement(ElementName = "InstanceID")]
|
|
||||||
public string InstanceID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "dtStart")]
|
|
||||||
public DateTime dtStart { get; set; }
|
|
||||||
//[XmlElement(ElementName = "dtEnd")]
|
|
||||||
public DateTime dtEnd { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Organizer")]
|
|
||||||
public string Organizer { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Attendees")]
|
|
||||||
public Attendees Attendees { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Resources")]
|
|
||||||
public Resources Resources { get; set; }
|
|
||||||
//[XmlElement(ElementName = "IsEvent")]
|
|
||||||
public string IsEvent { get; set; }
|
|
||||||
//[XmlElement(ElementName = "IsRoomViewMeeting")]
|
|
||||||
public string IsRoomViewMeeting { get; set; }
|
|
||||||
//[XmlElement(ElementName = "IsPrivate")]
|
|
||||||
public string IsPrivate { get; set; }
|
|
||||||
//[XmlElement(ElementName = "IsExchangePrivate")]
|
|
||||||
public string IsExchangePrivate { get; set; }
|
|
||||||
//[XmlElement(ElementName = "MeetingTypes")]
|
|
||||||
public MeetingTypes MeetingTypes { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ParticipantCode")]
|
|
||||||
public string ParticipantCode { get; set; }
|
|
||||||
//[XmlElement(ElementName = "PhoneNo")]
|
|
||||||
public string PhoneNo { get; set; }
|
|
||||||
//[XmlElement(ElementName = "WelcomeMsg")]
|
|
||||||
public string WelcomeMsg { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Subject")]
|
|
||||||
public string Subject { get; set; }
|
|
||||||
//[XmlElement(ElementName = "LiveMeeting")]
|
|
||||||
public LiveMeeting LiveMeeting { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ShareDocPath")]
|
|
||||||
public string ShareDocPath { get; set; }
|
|
||||||
//[XmlElement(ElementName = "HaveAttendees")]
|
|
||||||
public string HaveAttendees { get; set; }
|
|
||||||
//[XmlElement(ElementName = "HaveResources")]
|
|
||||||
public string HaveResources { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the duration of the meeting
|
|
||||||
/// </summary>
|
|
||||||
public string DurationInMinutes
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string duration;
|
|
||||||
|
|
||||||
var timeSpan = dtEnd.Subtract(dtStart);
|
|
||||||
int hours = timeSpan.Hours;
|
|
||||||
double minutes = timeSpan.Minutes;
|
|
||||||
double roundedMinutes = Math.Round(minutes);
|
|
||||||
if(hours > 0)
|
|
||||||
{
|
|
||||||
duration = string.Format("{0} hours {1} minutes", hours, roundedMinutes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
duration = string.Format("{0} minutes", roundedMinutes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return duration;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the remaining time in the meeting. Returns null if the meeting is not currently in progress.
|
|
||||||
/// </summary>
|
|
||||||
public string RemainingTime
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var now = DateTime.Now;
|
|
||||||
|
|
||||||
string remainingTime;
|
|
||||||
|
|
||||||
if (GetInProgress())
|
|
||||||
{
|
|
||||||
var timeSpan = dtEnd.Subtract(now);
|
|
||||||
int hours = timeSpan.Hours;
|
|
||||||
double minutes = timeSpan.Minutes;
|
|
||||||
double roundedMinutes = Math.Round(minutes);
|
|
||||||
if (hours > 0)
|
|
||||||
{
|
|
||||||
remainingTime = string.Format("{0} hours {1} minutes", hours, roundedMinutes);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
remainingTime = string.Format("{0} minutes", roundedMinutes);
|
|
||||||
}
|
|
||||||
|
|
||||||
return remainingTime;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Indicates that the meeting is in progress
|
|
||||||
/// </summary>
|
|
||||||
public bool isInProgress
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return GetInProgress();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Determines if the meeting is in progress
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Returns true if in progress</returns>
|
|
||||||
bool GetInProgress()
|
|
||||||
{
|
|
||||||
var now = DateTime.Now;
|
|
||||||
|
|
||||||
if (now > dtStart && now < dtEnd)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Resources")]
|
|
||||||
public class Resources
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Rooms")]
|
|
||||||
public Rooms Rooms { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Rooms")]
|
|
||||||
public class Rooms
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Room")]
|
|
||||||
public List<Room> Room { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Room")]
|
|
||||||
public class Room
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Name")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ID")]
|
|
||||||
public string ID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "MPType")]
|
|
||||||
public string MPType { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Attendees")]
|
|
||||||
public class Attendees
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Required")]
|
|
||||||
public Required Required { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Optional")]
|
|
||||||
public Optional Optional { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Required")]
|
|
||||||
public class Required
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Attendee")]
|
|
||||||
public List<string> Attendee { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "Optional")]
|
|
||||||
public class Optional
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "Attendee")]
|
|
||||||
public List<string> Attendee { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "MeetingType")]
|
|
||||||
public class MeetingType
|
|
||||||
{
|
|
||||||
//[XmlAttribute(AttributeName = "ID")]
|
|
||||||
public string ID { get; set; }
|
|
||||||
//[XmlAttribute(AttributeName = "Value")]
|
|
||||||
public string Value { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "MeetingTypes")]
|
|
||||||
public class MeetingTypes
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "MeetingType")]
|
|
||||||
public List<MeetingType> MeetingType { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "LiveMeeting")]
|
|
||||||
public class LiveMeeting
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "URL")]
|
|
||||||
public string URL { get; set; }
|
|
||||||
//[XmlElement(ElementName = "ID")]
|
|
||||||
public string ID { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Key")]
|
|
||||||
public string Key { get; set; }
|
|
||||||
//[XmlElement(ElementName = "Subject")]
|
|
||||||
public string Subject { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
//[XmlRoot(ElementName = "LiveMeetingURL")]
|
|
||||||
public class LiveMeetingURL
|
|
||||||
{
|
|
||||||
//[XmlElement(ElementName = "LiveMeeting")]
|
|
||||||
public LiveMeeting LiveMeeting { get; set; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\pepperdash-simplsharp-core\Pepperdash Core\CLZ Builds\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\pepperdash-simplsharp-core\Pepperdash Core\CLZ Builds\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PepperDash_Essentials_Core, Version=1.0.0.12925, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Essentials_Core, Version=1.0.0.18243, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll</HintPath>
|
<HintPath>..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -135,6 +135,7 @@
|
|||||||
<Compile Include="Devices\NUMERIC AppleTV.cs" />
|
<Compile Include="Devices\NUMERIC AppleTV.cs" />
|
||||||
<Compile Include="ControlSystem.cs" />
|
<Compile Include="ControlSystem.cs" />
|
||||||
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
<Compile Include="Fusion\FusionEventHandlers.cs" />
|
||||||
|
<Compile Include="Fusion\FusionRviDataClasses.cs" />
|
||||||
<Compile Include="REMOVE EssentialsApp.cs" />
|
<Compile Include="REMOVE EssentialsApp.cs" />
|
||||||
<Compile Include="Fusion\FusionSystemController.cs" />
|
<Compile Include="Fusion\FusionSystemController.cs" />
|
||||||
<Compile Include="HttpApiHandler.cs" />
|
<Compile Include="HttpApiHandler.cs" />
|
||||||
|
|||||||
Reference in New Issue
Block a user