mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 03:45:01 +00:00
Compare commits
32 Commits
2.0.0-alph
...
2.0.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fe0005ce8 | ||
|
|
3529cdcb58 | ||
|
|
90cb454281 | ||
|
|
688f6cb659 | ||
|
|
fcaffd0c88 | ||
|
|
c418e1ce93 | ||
|
|
a5b5e451f5 | ||
|
|
3077399655 | ||
|
|
5e6f8cfeb3 | ||
|
|
64ba5a9f94 | ||
|
|
b9382216c1 | ||
|
|
d75d355dc7 | ||
|
|
7277ccc687 | ||
|
|
2e4601b5f9 | ||
|
|
fe1804f9c7 | ||
|
|
faa07e682f | ||
|
|
a1af0bf943 | ||
|
|
661f7b827a | ||
|
|
49c4d2a387 | ||
|
|
cf81431f57 | ||
|
|
8a7bcd5297 | ||
|
|
1fdaa84a62 | ||
|
|
8a374072ae | ||
|
|
5d608887a1 | ||
|
|
d2d041dbf7 | ||
|
|
b90e5b2a0d | ||
|
|
d26c5344e4 | ||
|
|
595fb3894e | ||
|
|
a7654aa77d | ||
|
|
5ccf298584 | ||
|
|
a1cc46b992 | ||
|
|
09ac964335 |
@@ -52,5 +52,11 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
[JsonProperty("sinkType")]
|
||||
public eRoutingSignalType SinkType { get; set; }
|
||||
|
||||
[JsonProperty("isCodecContentDestination")]
|
||||
public bool isCodecContentDestination { get; set; }
|
||||
|
||||
[JsonProperty("isProgramAudioDestination")]
|
||||
public bool isProgramAudioDestination { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -22,15 +22,31 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
static Scheduler()
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(DeleteEventGroup, "DeleteEventGroup", "Deletes the event group by key", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(ClearEventsFromGroup, "ClearAllEvents", "Clears all scheduled events for this group", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(ListAllEventGroups, "ListAllEventGroups", "Lists all the event groups by key", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(ListAllEventsForGroup, "ListEventsForGroup",
|
||||
"Lists all events for the given group", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void DeleteEventGroup(string groupName)
|
||||
{
|
||||
if (EventGroups.ContainsKey(groupName))
|
||||
{
|
||||
var group = EventGroups[groupName];
|
||||
|
||||
EventGroups.Remove(groupName);
|
||||
|
||||
group.Dispose();
|
||||
|
||||
group = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears (deletes) all events from a group
|
||||
/// </summary>
|
||||
@@ -40,7 +56,7 @@ namespace PepperDash.Essentials.Core
|
||||
if (!EventGroups.ContainsKey(groupName))
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information,
|
||||
"[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.",
|
||||
"[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", null,
|
||||
groupName);
|
||||
return;
|
||||
}
|
||||
@@ -51,47 +67,47 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
group.ClearAllEvents();
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Information, "[Scheduler]: All events deleted from group '{0}'", groupName);
|
||||
Debug.LogMessage(LogEventLevel.Information, "[Scheduler]: All events deleted from group '{0}'", null, groupName);
|
||||
}
|
||||
else
|
||||
Debug.LogMessage(LogEventLevel.Information,
|
||||
"[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.",
|
||||
"[Scheduler]: Unable to delete events from group '{0}'. Group not found in EventGroups dictionary.", null,
|
||||
groupName);
|
||||
}
|
||||
|
||||
static void ListAllEventGroups(string command)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Event Groups:");
|
||||
CrestronConsole.ConsoleCommandResponse("Event Groups:");
|
||||
foreach (var group in EventGroups)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "{0}", group.Key);
|
||||
CrestronConsole.ConsoleCommandResponse($"{group.Key}");
|
||||
}
|
||||
}
|
||||
|
||||
static void ListAllEventsForGroup(string args)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Getting events for group {0}...", args);
|
||||
Debug.LogMessage(LogEventLevel.Information, "Getting events for group {0}...", null, args);
|
||||
|
||||
ScheduledEventGroup group;
|
||||
|
||||
if (!EventGroups.TryGetValue(args, out group))
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Unabled to get event group for key {0}", args);
|
||||
Debug.LogMessage(LogEventLevel.Information, "Unabled to get event group for key {0}", null, args);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var evt in group.ScheduledEvents)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information,
|
||||
@"
|
||||
****Event key {0}****
|
||||
Event date/time: {1}
|
||||
Persistent: {2}
|
||||
Acknowlegable: {3}
|
||||
Recurrence: {4}
|
||||
Recurrence Days: {5}
|
||||
********************", evt.Key, evt.Value.DateAndTime, evt.Value.Persistent, evt.Value.Acknowledgeable,
|
||||
evt.Value.Recurrence.Recurrence, evt.Value.Recurrence.RecurrenceDays);
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
$@"
|
||||
****Event key {evt.Key}****
|
||||
Event state: {evt.Value.EventState}
|
||||
Event date/time: {evt.Value.DateAndTime}
|
||||
Persistent: {evt.Value.Persistent}
|
||||
Acknowlegable: {evt.Value.Acknowledgeable}
|
||||
Recurrence: {evt.Value.Recurrence.Recurrence}
|
||||
Recurrence Days: {evt.Value.Recurrence.RecurrenceDays}
|
||||
********************");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,10 +154,9 @@ Recurrence Days: {5}
|
||||
|
||||
var dayOfWeek = eventTime.DayOfWeek;
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, "[Scheduler]: eventTime day of week is: {0}", dayOfWeek);
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, "[Scheduler]: eventTime day of week is: {0}",null, dayOfWeek);
|
||||
switch (dayOfWeek)
|
||||
{
|
||||
{
|
||||
case DayOfWeek.Sunday:
|
||||
{
|
||||
if ((recurrence & ScheduledEventCommon.eWeekDays.Sunday) == ScheduledEventCommon.eWeekDays.Sunday)
|
||||
@@ -203,53 +218,64 @@ Recurrence Days: {5}
|
||||
|
||||
public static void CreateEventFromConfig(ScheduledEventConfig config, ScheduledEventGroup group, ScheduledEvent.UserEventCallBack handler)
|
||||
{
|
||||
if (group == null)
|
||||
try
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Unable to create event. Group is null");
|
||||
return;
|
||||
if (group == null)
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Information, "Unable to create event. Group is null", null, null);
|
||||
return;
|
||||
}
|
||||
var scheduledEvent = new ScheduledEvent(config.Key, group)
|
||||
{
|
||||
Acknowledgeable = config.Acknowledgeable,
|
||||
Persistent = config.Persistent
|
||||
};
|
||||
|
||||
scheduledEvent.UserCallBack += handler;
|
||||
|
||||
scheduledEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||
|
||||
var eventTime = DateTime.Parse(config.Time);
|
||||
|
||||
if (DateTime.Now > eventTime)
|
||||
{
|
||||
eventTime = eventTime.AddDays(1);
|
||||
}
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Verbose, "[Scheduler] Current Date day of week: {0} recurrence days: {1}", null, eventTime.DayOfWeek,
|
||||
config.Days);
|
||||
|
||||
var dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, "[Scheduler] eventTime Day: {0}", null, dayOfWeekConverted);
|
||||
|
||||
while (!dayOfWeekConverted.IsFlagSet(config.Days))
|
||||
{
|
||||
eventTime = eventTime.AddDays(1);
|
||||
|
||||
dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||
}
|
||||
|
||||
scheduledEvent.DateAndTime.SetAbsoluteEventTime(eventTime);
|
||||
|
||||
scheduledEvent.Recurrence.Weekly(config.Days);
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Verbose, $"[Scheduler] Event State: {scheduledEvent.EventState}", null, null);
|
||||
|
||||
if (config.Enable && scheduledEvent.EventState != ScheduledEventCommon.eEventState.Enabled)
|
||||
{
|
||||
scheduledEvent.Enable();
|
||||
}
|
||||
else if (!config.Enable && scheduledEvent.EventState != ScheduledEventCommon.eEventState.Disabled)
|
||||
{
|
||||
scheduledEvent.Disable();
|
||||
}
|
||||
|
||||
}
|
||||
var scheduledEvent = new ScheduledEvent(config.Key, group)
|
||||
catch (Exception e)
|
||||
{
|
||||
Acknowledgeable = config.Acknowledgeable,
|
||||
Persistent = config.Persistent
|
||||
};
|
||||
|
||||
scheduledEvent.UserCallBack += handler;
|
||||
|
||||
scheduledEvent.DateAndTime.SetFirstDayOfWeek(ScheduledEventCommon.eFirstDayOfWeek.Sunday);
|
||||
|
||||
var eventTime = DateTime.Parse(config.Time);
|
||||
|
||||
if (DateTime.Now > eventTime)
|
||||
{
|
||||
eventTime = eventTime.AddDays(1);
|
||||
}
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Verbose, "[Scheduler] Current Date day of week: {0} recurrence days: {1}", eventTime.DayOfWeek,
|
||||
config.Days);
|
||||
|
||||
var dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||
|
||||
Debug.LogMessage(LogEventLevel.Debug, "[Scheduler] eventTime Day: {0}", dayOfWeekConverted);
|
||||
|
||||
while (!dayOfWeekConverted.IsFlagSet(config.Days))
|
||||
{
|
||||
eventTime = eventTime.AddDays(1);
|
||||
|
||||
dayOfWeekConverted = ConvertDayOfWeek(eventTime);
|
||||
}
|
||||
|
||||
scheduledEvent.DateAndTime.SetAbsoluteEventTime(eventTime);
|
||||
|
||||
scheduledEvent.Recurrence.Weekly(config.Days);
|
||||
|
||||
if (config.Enable)
|
||||
{
|
||||
scheduledEvent.Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
scheduledEvent.Disable();
|
||||
Debug.LogMessage(LogEventLevel.Error, "Error creating scheduled event: {0}", null, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-400" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-402" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Crestron\CrestronGenericBaseDevice.cs.orig" />
|
||||
|
||||
@@ -210,6 +210,10 @@ namespace PepperDash.Essentials.Room.Config
|
||||
/// </summary>
|
||||
[JsonProperty("userCanChangeShareMode")]
|
||||
public bool UserCanChangeShareMode { get; set; }
|
||||
|
||||
|
||||
[JsonProperty("matrixRoutingKey", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string MatrixRoutingKey { get; set; }
|
||||
}
|
||||
|
||||
public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
|
||||
@@ -218,6 +222,7 @@ namespace PepperDash.Essentials.Room.Config
|
||||
public string VideoCodecKey { get; set; }
|
||||
[JsonProperty("audioCodecKey")]
|
||||
public string AudioCodecKey { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class EssentialsEnvironmentPropertiesConfig
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IHasDefaultDisplay
|
||||
{
|
||||
IRoutingSinkWithSwitching DefaultDisplay { get; }
|
||||
IRoutingSink DefaultDisplay { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public interface IHasMultipleDisplays
|
||||
{
|
||||
Dictionary<eSourceListItemDestinationTypes, IRoutingSinkWithSwitching> Displays { get; }
|
||||
Dictionary<eSourceListItemDestinationTypes, IRoutingSink> Displays { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -50,6 +50,34 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
void RunDirectRoute(string sourceKey, string destinationKey, eRoutingSignalType type = eRoutingSignalType.AudioVideo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with matrix routing
|
||||
/// </summary>
|
||||
public interface IHasMatrixRouting
|
||||
{
|
||||
string MatrixRoutingDeviceKey { get; }
|
||||
|
||||
List<string> EndpointKeys { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with routing endpoints
|
||||
/// </summary>
|
||||
public interface IHasRoutingEndpoints
|
||||
{
|
||||
List<string> EndpointKeys { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a room with a shutdown prompt timer
|
||||
/// </summary>
|
||||
public interface IShutdownPromptTimer
|
||||
{
|
||||
SecondsCountdownTimer ShutdownPromptTimer { get; }
|
||||
|
||||
void SetShutdownPromptSeconds(int seconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For rooms that default presentation only routing
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IRoutingInputSlot: IRoutingSlot, IOnline, IVideoSync
|
||||
{
|
||||
|
||||
@@ -3,12 +3,12 @@ using System.Collections.Generic;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Routing
|
||||
{
|
||||
public interface IRoutingOutputSlot:IRoutingSlot
|
||||
public interface IRoutingOutputSlot : IRoutingSlot
|
||||
{
|
||||
event EventHandler OutputSlotChanged;
|
||||
|
||||
string RxDeviceKey { get; }
|
||||
|
||||
Dictionary<eRoutingSignalType, IRoutingInputSlot> CurrentRoutes { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Verbose, this, "*************************************************** Display Power is {0}", _PowerIsOn ? "on" : "off");
|
||||
return _PowerIsOn;
|
||||
};
|
||||
} }
|
||||
@@ -36,7 +35,6 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Verbose, this, "*************************************************** {0}", _IsCoolingDown ? "Display is cooling down" : "Display has finished cooling down");
|
||||
return _IsCoolingDown;
|
||||
};
|
||||
}
|
||||
@@ -47,7 +45,6 @@ namespace PepperDash.Essentials.Devices.Common.Displays
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
Debug.LogMessage(LogEventLevel.Verbose, this, "*************************************************** {0}", _IsWarmingUp ? "Display is warming up" : "Display has finished warming up");
|
||||
return _IsWarmingUp;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-400" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-402" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,14 @@
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Room
|
||||
{
|
||||
public interface IEssentialsRoomPropertiesConfig
|
||||
{
|
||||
EssentialsRoomPropertiesConfig PropertiesConfig { get; }
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
||||
{
|
||||
public class GenericSoftCodec : EssentialsDevice, IRoutingInputsOutputs
|
||||
public class GenericSoftCodec : EssentialsDevice, IRoutingSource, IRoutingSink
|
||||
{
|
||||
public GenericSoftCodec(string key, string name, GenericSoftCodecProperties props) : base(key, name)
|
||||
{
|
||||
@@ -48,6 +48,32 @@ namespace PepperDash.Essentials.Devices.Common.SoftCodec
|
||||
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
|
||||
|
||||
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
|
||||
public string CurrentSourceInfoKey { get ; set; }
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CurrentSourceInfo;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
}
|
||||
}
|
||||
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
}
|
||||
|
||||
public class GenericSoftCodecProperties
|
||||
|
||||
@@ -23,31 +23,14 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Example Configuration\EssentialsHuddleSpaceRoom\configurationFile-HuddleSpace-2-Source.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Example Configuration\EssentialsHuddleVtc1Room\configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Example Configuration\SIMPLBridging\configurationFile-dmps3300c-avRouting.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Example Configuration\SIMPLBridging\SIMPLBridgeExample_configurationFile.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="SGD\PepperDash Essentials iPad.sgd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="SGD\PepperDash Essentials TSW-560.sgd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="SGD\PepperDash Essentials TSW-760.sgd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<Content Include="output\**\*.cpz">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>content\</PackagePath>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.20.42" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-400" />
|
||||
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-402" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />
|
||||
|
||||
Reference in New Issue
Block a user