Compare commits

...

17 Commits

Author SHA1 Message Date
Joshua_Gutenplan
e37c675da1 Merge remote-tracking branch 'origin/feature-2.0.0/room-combiner-updates' into feature-2.0.0/video-codec-interface-uiextensions 2024-05-06 12:55:16 -07:00
Neil Dorin
3ee8cb7ea3 feat: updates IHasInput to remove requirement for SetInputs method (unnecessary) 2024-05-03 13:34:22 -06:00
Neil Dorin
2b6f79b68f feat: updates to Room combiner for use with mobile control 2024-05-02 17:27:34 -06:00
Neil Dorin
65369606a4 feat: updates to room combiner interfaces 2024-05-02 15:00:17 -06:00
Joshua_Gutenplan
e9954b3081 fix: add GetRoomMessenger to IMobileControl 2024-05-02 12:07:00 -07:00
Neil Dorin
bc67a4382b Merge pull request #1185 from PepperDash/feature-2.0.0/tech-password-interface
Feature 2.0.0/tech password interface
2024-05-02 09:55:41 -06:00
Joshua_Gutenplan
e1b50649fd fix: UiWebViewDisplayActionArgs add target 2024-04-30 21:41:53 -07:00
Joshua_Gutenplan
5e69ea1947 Merge remote-tracking branch 'origin/feature-2.0.0/tech-password-interface' into feature-2.0.0/video-codec-interface-uiextensions 2024-04-30 10:24:50 -07:00
Neil Dorin
80b8cc6385 feat: Adds SecondsRemainingFeedback to SecondsCountdownTimer 2024-04-26 13:15:15 -06:00
Neil Dorin
82f78bf068 feat: adds StarShutdown method to IShutdownPromptTimer 2024-04-26 12:08:26 -06:00
Neil Dorin
d8d27949c3 fix: updates to IMobileControlTouchpanelController 2024-04-26 09:31:27 -06:00
Joshua_Gutenplan
fd1b92a6c0 Merge remote-tracking branch 'origin/feature-2.0.0/tech-password-interface' into feature-2.0.0/video-codec-interface-uiextensions 2024-04-25 19:13:46 -07:00
Neil Dorin
fa9b493431 feat: Adds IMobileControlTouchpanelController 2024-04-25 16:31:54 -06:00
Joshua_Gutenplan
06d806687d feat: IMobileControlTouchpanelController 2024-04-25 15:29:44 -07:00
Joshua_Gutenplan
d8e2f8cd51 feat: IVideoCodecUiExtensions 2024-04-25 10:03:38 -07:00
Neil Dorin
e5d5c90aa9 feat: Adds ITechPassword 2024-04-24 16:54:51 -06:00
Neil Dorin
5fad706cd8 Merge pull request #1179 from PepperDash/feature-2.0.0/soft-codec-routing
Update interfaces for Generic Soft Codec device
2024-04-12 10:31:03 -06:00
14 changed files with 239 additions and 43 deletions

View File

@@ -15,10 +15,8 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
/// <example>
/// See MockDisplay for example implemntation
/// </example>
public interface IHasInputs<TKey, TSelector>: IKeyName
public interface IHasInputs<T, TSelector>: IKeyName
{
ISelectableItems<TKey> Inputs { get; }
void SetInput(TSelector selector);
ISelectableItems<T> Inputs { get; }
}
}

View File

@@ -44,7 +44,10 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
void AddDeviceMessenger(IMobileControlMessenger messenger);
bool CheckForDeviceMessenger(string key);
}
IMobileControlRoomMessenger GetRoomMessenger(string key);
}
/// <summary>
/// Describes a mobile control messenger
@@ -106,4 +109,11 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
Action<string,string, JToken> Action { get; }
}
public interface IMobileControlTouchpanelController : IKeyed
{
string DefaultRoomKey { get; }
void SetAppUrl(string url);
bool UseDirectServer { get; }
bool ZoomRoomController { get; }
}
}

View File

@@ -17,6 +17,6 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
Dictionary<TKey, ISelectableItem> Items { get; set; }
[JsonProperty("currentItem")]
string CurrentItem { get; set; }
TKey CurrentItem { get; set; }
}
}

View File

@@ -19,7 +19,29 @@ namespace PepperDash.Essentials.Core
private bool isInAutoMode;
private bool partitionPresent;
private bool _partitionPresent;
public bool PartitionPresent
{
get
{
return _partitionPresent;
}
set
{
if (_partitionPresent == value)
{
return;
}
_partitionPresent = value;
if (PartitionPresentFeedback != null)
{
PartitionPresentFeedback.FireUpdate();
}
}
}
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
{
@@ -42,7 +64,7 @@ namespace PepperDash.Essentials.Core
SetManualMode();
}
}
else
else
{
SetManualMode();
}
@@ -85,11 +107,11 @@ namespace PepperDash.Essentials.Core
isInAutoMode = false;
if (PartitionPresentFeedback != null)
{
PartitionPresentFeedback.SetValueFunc(() => partitionPresent);
PartitionPresentFeedback.SetValueFunc(() => _partitionPresent);
}
else
{
PartitionPresentFeedback = new BoolFeedback(() => partitionPresent);
PartitionPresentFeedback = new BoolFeedback(() => _partitionPresent);
}
if (_partitionSensor != null)
@@ -103,7 +125,7 @@ namespace PepperDash.Essentials.Core
{
if (!isInAutoMode)
{
partitionPresent = true;
PartitionPresent = true;
PartitionPresentFeedback.FireUpdate();
}
}
@@ -112,7 +134,7 @@ namespace PepperDash.Essentials.Core
{
if (!isInAutoMode)
{
partitionPresent = false;
PartitionPresent = false;
PartitionPresentFeedback.FireUpdate();
}
}
@@ -121,7 +143,7 @@ namespace PepperDash.Essentials.Core
{
if (!isInAutoMode)
{
partitionPresent = !partitionPresent;
PartitionPresent = !PartitionPresent;
PartitionPresentFeedback.FireUpdate();
}
}

View File

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using System.Collections.Generic;
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
@@ -13,7 +9,11 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IPartitionStateProvider : IKeyName
{
[JsonIgnore]
BoolFeedback PartitionPresentFeedback { get; }
[JsonProperty("partitionPresent")]
bool PartitionPresent { get; }
}
/// <summary>
@@ -21,6 +21,7 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IPartitionController : IPartitionStateProvider
{
[JsonProperty("adjacentRoomKeys")]
List<string> AdjacentRoomKeys { get; }
void SetPartitionStatePresent();

View File

@@ -1,11 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using Serilog.Events;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Core
{
@@ -17,7 +17,33 @@ namespace PepperDash.Essentials.Core
private List<IEssentialsRoom> _rooms;
private bool isInAutoMode;
public List<IKeyName> Rooms
{
get
{
return _rooms.Cast<IKeyName>().ToList();
}
}
private bool _isInAutoMode;
public bool IsInAutoMode
{
get
{
return _isInAutoMode;
}
set
{
if(value == _isInAutoMode)
{
return;
}
_isInAutoMode = value;
IsInAutoModeFeedback.FireUpdate();
}
}
private CTimer _scenarioChangeDebounceTimer;
@@ -36,14 +62,14 @@ namespace PepperDash.Essentials.Core
_scenarioChangeDebounceTimeSeconds = _propertiesConfig.ScenarioChangeDebounceTimeSeconds;
}
IsInAutoModeFeedback = new BoolFeedback(() => isInAutoMode);
IsInAutoModeFeedback = new BoolFeedback(() => _isInAutoMode);
// default to auto mode
isInAutoMode = true;
IsInAutoMode = true;
if (_propertiesConfig.defaultToManualMode)
{
isInAutoMode = false;
IsInAutoMode = false;
}
IsInAutoModeFeedback.FireUpdate();
@@ -56,7 +82,7 @@ namespace PepperDash.Essentials.Core
SetRooms();
if (isInAutoMode)
if (IsInAutoMode)
{
DetermineRoomCombinationScenario();
}
@@ -201,20 +227,17 @@ namespace PepperDash.Essentials.Core
public void SetAutoMode()
{
isInAutoMode = true;
IsInAutoModeFeedback.FireUpdate();
IsInAutoMode = true;
}
public void SetManualMode()
{
isInAutoMode = false;
IsInAutoModeFeedback.FireUpdate();
IsInAutoMode = false;
}
public void ToggleMode()
{
isInAutoMode = !isInAutoMode;
IsInAutoModeFeedback.FireUpdate();
IsInAutoMode = !IsInAutoMode;
}
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }
@@ -233,7 +256,7 @@ namespace PepperDash.Essentials.Core
public void SetRoomCombinationScenario(string scenarioKey)
{
if (isInAutoMode)
if (IsInAutoMode)
{
Debug.LogMessage(LogEventLevel.Information, this, "Cannot set room combination scenario when in auto mode. Set to auto mode first.");
return;

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
@@ -21,13 +18,21 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The current room combination scenario
/// </summary>
[JsonProperty("currentScenario")]
IRoomCombinationScenario CurrentScenario { get; }
/// <summary>
/// When true, indicates the current mode is auto mode
/// </summary>
[JsonIgnore]
BoolFeedback IsInAutoModeFeedback {get;}
[JsonProperty("isInAutoMode")]
bool IsInAutoMode { get; }
[JsonProperty("rooms")]
List<IKeyName> Rooms { get; }
/// <summary>
/// Sets auto mode
/// </summary>
@@ -46,11 +51,13 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The available room combinatino scenarios
/// </summary>
[JsonProperty("roomCombinationScenarios")]
List<IRoomCombinationScenario> RoomCombinationScenarios { get; }
/// <summary>
/// The partition
/// </summary>
[JsonProperty("partitions")]
List<IPartitionController> Partitions { get; }
/// <summary>
@@ -71,8 +78,12 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// When true, indicates that this room combination scenario is active
/// </summary>
[JsonIgnore]
BoolFeedback IsActiveFeedback { get; }
[JsonProperty("isActive")]
bool IsActive { get; }
/// <summary>
/// Activates this room combination scenario
/// </summary>
@@ -86,11 +97,13 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The state of the partitions that would activate this scenario
/// </summary>
[JsonProperty("partitionStates")]
List<PartitionState> PartitionStates { get; }
/// <summary>
/// The mapping of UIs by key to rooms by key
/// </summary>
[JsonProperty("uiMap")]
Dictionary<string, string> UiMap { get; set; }
}

View File

@@ -16,20 +16,41 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Represents a room combination scenario
/// </summary>
public class RoomCombinationScenario: IRoomCombinationScenario
public class RoomCombinationScenario: IRoomCombinationScenario, IKeyName
{
private RoomCombinationScenarioConfig _config;
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("partitionStates")]
public List<PartitionState> PartitionStates { get; private set; }
[JsonProperty("uiMap")]
public Dictionary<string, string> UiMap { get; set; }
private bool _isActive;
[JsonProperty("isActive")]
public bool IsActive
{
get { return _isActive; }
set
{
if(value == _isActive)
{
return;
}
_isActive = value;
IsActiveFeedback.FireUpdate();
}
}
[JsonIgnore]
public BoolFeedback IsActiveFeedback { get; private set; }
private List<DeviceActionWrapper> activationActions;
@@ -67,8 +88,7 @@ namespace PepperDash.Essentials.Core
}
}
_isActive = true;
IsActiveFeedback.FireUpdate();
IsActive = true;
}
public void Deactivate()
@@ -83,8 +103,7 @@ namespace PepperDash.Essentials.Core
}
}
_isActive = false;
IsActiveFeedback.FireUpdate();
IsActive = false;
}
}

View File

@@ -77,6 +77,34 @@ namespace PepperDash.Essentials.Core
SecondsCountdownTimer ShutdownPromptTimer { get; }
void SetShutdownPromptSeconds(int seconds);
void StartShutdown(eShutdownType type);
}
/// <summary""'""">
/// Describes a room with a tech password
/// </summary>
public interface ITechPassword
{
event EventHandler<TechPasswordEventArgs> TechPasswordValidateResult;
event EventHandler<EventArgs> TechPasswordChanged;
int TechPasswordLength { get; }
void ValidateTechPassword(string password);
void SetTechPassword(string oldPassword, string newPassword);
}
public class TechPasswordEventArgs : EventArgs
{
public bool IsValid { get; private set; }
public TechPasswordEventArgs(bool isValid)
{
IsValid = isValid;
}
}
/// <summary>

View File

@@ -23,6 +23,8 @@ namespace PepperDash.Essentials.Core
public IntFeedback PercentFeedback { get; private set; }
public StringFeedback TimeRemainingFeedback { get; private set; }
public IntFeedback SecondsRemainingFeedback { get; private set; }
public bool CountsDown { get; set; }
/// <summary>
@@ -64,6 +66,8 @@ namespace PepperDash.Essentials.Core
: String.Format("{0:00}:{1:00}", timeSpan.Minutes, timeSpan.Seconds);
});
SecondsRemainingFeedback = new IntFeedback(() => (int)(FinishTime - DateTime.Now).TotalSeconds);
PercentFeedback =
new IntFeedback(
() =>
@@ -144,6 +148,7 @@ namespace PepperDash.Essentials.Core
PercentFeedback.FireUpdate();
TimeRemainingFeedback.FireUpdate();
SecondsRemainingFeedback.FireUpdate();
}
}
}

View File

@@ -54,8 +54,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
public class MockDisplayInput : ISelectableItem
{
private IHasInputs<string, string> _parent;
private MockDisplay _parent;
private bool _isSelected;

View File

@@ -0,0 +1,12 @@
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IVideoCodecUiExtensionsHandler : IVideoCodecUiExtensionsWebViewDisplayAction, IVideoCodecUiExtensionsClickedEvent
{
}
public interface IVideoCodecUiExtensions
{
IVideoCodecUiExtensionsHandler VideoCodecUiExtensionsHandler { get; set; }
}
}

View File

@@ -0,0 +1,41 @@
using System;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IVideoCodecUiExtensionsWebViewDisplayAction
{
Action<UiWebViewDisplayActionArgs> UiWebViewDisplayAction { get; set; }
}
public class UiWebViewDisplayActionArgs
{
/// <summary>
/// Required <0 - 2000> The URL of the web page.
/// </summary>
public string Url { get; set; }
/// <summary>
/// Fullscreen, Modal Full screen: Display the web page on the entire screen.Modal: Display the web page in a window.
/// </summary>
public string Mode { get; set; }
/// <summary>
/// <0 - 255> The title of the web page.
/// </summary>
public string Title { get; set; }
/// <summary>
/// <0 - 8192> An HTTP header field.You can add up 15 Header parameters in one command, each holding one HTTP header field.
/// </summary>
public string Header { get; set; }
/// <summary>
/// OSD, Controller, PersistentWebApp Controller: Only for Cisco internal use.
/// OSD: Close the web view that is displayed on the screen of the device.PersistentWebApp: Only for Cisco internal use.
/// </summary>
public string Target { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IVideoCodecUiExtensionsClickedEvent
{
event EventHandler<UiExtensionsClickedEventArgs> UiExtensionsClickedEvent;
}
public class UiExtensionsClickedEventArgs : EventArgs
{
public bool Clicked { get; set; }
public string Id { get; set; }
public UiExtensionsClickedEventArgs(bool clicked, string id)
{
Clicked = clicked;
Id = id;
}
public UiExtensionsClickedEventArgs()
{
}
}
}