mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 11:54:57 +00:00
Compare commits
17 Commits
2.0.0-alph
...
2.0.0-alph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e37c675da1 | ||
|
|
3ee8cb7ea3 | ||
|
|
2b6f79b68f | ||
|
|
65369606a4 | ||
|
|
e9954b3081 | ||
|
|
bc67a4382b | ||
|
|
e1b50649fd | ||
|
|
5e69ea1947 | ||
|
|
80b8cc6385 | ||
|
|
82f78bf068 | ||
|
|
d8d27949c3 | ||
|
|
fd1b92a6c0 | ||
|
|
fa9b493431 | ||
|
|
06d806687d | ||
|
|
d8e2f8cd51 | ||
|
|
e5d5c90aa9 | ||
|
|
5fad706cd8 |
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
{
|
||||
public interface IVideoCodecUiExtensionsHandler : IVideoCodecUiExtensionsWebViewDisplayAction, IVideoCodecUiExtensionsClickedEvent
|
||||
{
|
||||
}
|
||||
|
||||
public interface IVideoCodecUiExtensions
|
||||
{
|
||||
IVideoCodecUiExtensionsHandler VideoCodecUiExtensionsHandler { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user