Compare commits

...

22 Commits

Author SHA1 Message Date
jtalborough
688f6cb659 style: Improve file paths and package output in docker workflow 2024-05-06 15:14:38 -04:00
jtalborough
fcaffd0c88 fix: Fix incorrect file paths for adding CPZ and CPLZ files 2024-04-26 16:49:28 -04:00
jtalborough
c418e1ce93 fix: Update file paths for adding CPZ and CPLZ to NuGet Package 2024-04-26 16:41:38 -04:00
jtalborough
a5b5e451f5 fix: typo 2024-04-26 13:11:09 -04:00
jtalborough
3077399655 feature: adds a nuget pack for the mofdified nupkg 2024-04-26 13:04:09 -04:00
jtalborough
5e6f8cfeb3 fix: update file path for build 2024-04-26 12:52:30 -04:00
jtalborough
64ba5a9f94 refactor: Update file paths for packaging commands 2024-04-26 12:23:06 -04:00
jtalborough
b9382216c1 ci: Install 7-Zip for packaging 2024-04-26 12:16:34 -04:00
jtalborough
d75d355dc7 ci: Add CPZ and CPLZ to NuGet Package 2024-04-26 12:11:42 -04:00
jtalborough
7277ccc687 style: Update NuGet package source and add NonInteractive 2024-04-26 12:06:41 -04:00
jtalborough
2e4601b5f9 style: update nuget add command order 2024-04-26 11:59:36 -04:00
jtalborough
fe1804f9c7 feat: Inject CPZ into NuGet Package 2024-04-26 10:28:27 -04:00
jtalborough
faa07e682f feat: Add PackageOutputPath to msbuild command 2024-04-26 10:06:56 -04:00
jtalborough
a1af0bf943 feature: include build in nuget package output 2024-04-24 12:08:13 -04:00
Neil Dorin
661f7b827a fix: Updates to scheduler to attempt to deal with exceptions modifying existing events. Adds console command to allow deletign event group 2024-04-18 16:12:31 -06:00
Andrew Welker
49c4d2a387 fix: use IRoutingSink instead of IRoutingSinkWithSwitching 2024-04-11 09:15:05 -05:00
Neil Dorin
cf81431f57 feat: updates interfaces on GenericSoftCodec and adds IRoutingSink 2024-04-10 10:59:32 -06:00
Neil Dorin
8a7bcd5297 Merge pull request #1178 from PepperDash/feature-2.0.0/interface-updates
Multiple Updates
2024-04-09 10:36:21 -06:00
Andrew Welker
1fdaa84a62 fix: remove generics from matrix routing interfaces 2024-04-09 08:33:58 -05:00
Neil Dorin
8a374072ae feat: Adds EndpointKeys to IHasMatrixRouting 2024-04-04 16:16:54 -06:00
Neil Dorin
5d608887a1 feat: Adds IEssentialsRoomPropertiesConfig 2024-04-03 14:38:54 -06:00
Andrew Welker
d2d041dbf7 fix: make IRoutingOutputSlot & RoutingOutputSlotBase generic 2024-04-03 10:46:43 -05:00
10 changed files with 152 additions and 126 deletions

View File

@@ -65,7 +65,7 @@ jobs:
run: nuget restore .\$($Env:SOLUTION_FILE).sln
# Build the solutions in the docker image
- name: Build Solution
run: msbuild .\$($Env:SOLUTION_FILE).sln /p:Platform="Any CPU" /p:Configuration="Debug" /p:Version="${{ steps.setVersion.outputs.version }}" -m
run: msbuild .\$($Env:SOLUTION_FILE).sln /p:Platform="Any CPU" /p:Configuration="Debug" /p:Version="${{ steps.setVersion.outputs.version }}" /p:PackageOutputPath=".\output" -m
- name: Create tag for non-rc builds
if: contains(steps.setVersion.outputs.version, 'alpha')
run: |

View File

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

View File

@@ -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);
}
}

View File

@@ -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>
@@ -57,6 +57,8 @@ namespace PepperDash.Essentials.Core
public interface IHasMatrixRouting
{
string MatrixRoutingDeviceKey { get; }
List<string> EndpointKeys { get; }
}
/// <summary>

View File

@@ -2,10 +2,10 @@
namespace PepperDash.Essentials.Core.Routing
{
public interface IMatrixRouting<TInput, TOutput> where TInput : IRoutingInputSlot where TOutput : IRoutingOutputSlot
public interface IMatrixRouting
{
Dictionary<string, TInput> InputSlots { get; }
Dictionary<string, TOutput> OutputSlots { get; }
Dictionary<string, IRoutingInputSlot> InputSlots { get; }
Dictionary<string, IRoutingOutputSlot> OutputSlots { get; }
void Route(string inputSlotKey, string outputSlotKey, eRoutingSignalType type);
}

View File

@@ -1,26 +1,7 @@
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
{
string TxDeviceKey { get; }
}
public abstract class RoutingInputSlotBase : IRoutingInputSlot
{
public abstract string TxDeviceKey { get; }
public abstract int SlotNumber { get; }
public abstract eRoutingSignalType SupportedSignalTypes { get; }
public abstract string Name { get; }
public abstract BoolFeedback IsOnline { get; }
public abstract bool VideoSyncDetected { get; }
public abstract string Key { get; }
public abstract event EventHandler VideoSyncChanged;
}
}

View File

@@ -9,18 +9,6 @@ namespace PepperDash.Essentials.Core.Routing
string RxDeviceKey { get; }
Dictionary<eRoutingSignalType, RoutingInputSlotBase> CurrentRoutes { get; }
}
public abstract class RoutingOutputSlotBase : IRoutingOutputSlot
{
public abstract string RxDeviceKey { get; }
public abstract Dictionary<eRoutingSignalType, RoutingInputSlotBase> CurrentRoutes { get; }
public abstract int SlotNumber { get; }
public abstract eRoutingSignalType SupportedSignalTypes { get; }
public abstract string Name { get; }
public abstract string Key { get; }
public abstract event EventHandler OutputSlotChanged;
}
Dictionary<eRoutingSignalType, IRoutingInputSlot> CurrentRoutes { get; }
}
}

View File

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

View File

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

View File

@@ -23,27 +23,10 @@
<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" />