Merge branch 'main' into feature/add-fusion-joinmaps

This commit is contained in:
Neil Dorin
2021-01-20 14:39:37 -07:00
13 changed files with 2400 additions and 2303 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -28,6 +28,33 @@ namespace PepperDash.Essentials
private Dictionary<string, string> _currentPresets; private Dictionary<string, string> _currentPresets;
private ScheduledEventGroup _roomScheduledEventGroup; private ScheduledEventGroup _roomScheduledEventGroup;
/// <summary>
///
/// </summary>
protected override Func<bool> IsWarmingFeedbackFunc
{
get
{
return () =>
{
return _displays.All(kv => kv.Value.IsWarmingUpFeedback.BoolValue);
};
}
}
/// <summary>
///
/// </summary>
protected override Func<bool> IsCoolingFeedbackFunc
{
get
{
return () =>
{
return _displays.All(kv => kv.Value.IsCoolingDownFeedback.BoolValue);
};
}
}
public EssentialsTechRoom(DeviceConfig config) : base(config) public EssentialsTechRoom(DeviceConfig config) : base(config)
{ {
_config = config.Properties.ToObject<EssentialsTechRoomConfig>(); _config = config.Properties.ToObject<EssentialsTechRoomConfig>();
@@ -111,7 +138,12 @@ namespace PepperDash.Essentials
foreach (var display in _displays) foreach (var display in _displays)
{ {
display.Value.PowerIsOnFeedback.OutputChange += display.Value.PowerIsOnFeedback.OutputChange +=
(sender, args) => RoomPowerIsOnFeedback.InvokeFireUpdate(); (sender, args) =>
{
RoomPowerIsOnFeedback.InvokeFireUpdate();
IsWarmingUpFeedback.InvokeFireUpdate();
IsCoolingDownFeedback.InvokeFireUpdate();
};
} }
} }
@@ -229,8 +261,16 @@ namespace PepperDash.Essentials
CrestronInvoke.BeginInvoke((o) => CrestronInvoke.BeginInvoke((o) =>
{ {
Debug.Console(2, this, "There are {0} actions to execute for this event.", eventConfig.Actions.Count);
foreach (var a in eventConfig.Actions) foreach (var a in eventConfig.Actions)
{ {
Debug.Console(2, this,
@"Attempting to run action:
DeviceKey: {0}
MethodName: {1}
Params: {2}"
, a.DeviceKey, a.MethodName, a.Params);
DeviceJsonApi.DoDeviceAction(a); DeviceJsonApi.DoDeviceAction(a);
} }
}); });
@@ -239,6 +279,8 @@ namespace PepperDash.Essentials
public void RoomPowerOn() public void RoomPowerOn()
{ {
Debug.Console(2, this, "Room Powering On");
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs; var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
if (dummySource == null) if (dummySource == null)
@@ -255,6 +297,8 @@ namespace PepperDash.Essentials
public void RoomPowerOff() public void RoomPowerOff()
{ {
Debug.Console(2, this, "Room Powering Off");
foreach (var display in _displays) foreach (var display in _displays)
{ {
display.Value.PowerOff(); display.Value.PowerOff();
@@ -281,16 +325,6 @@ namespace PepperDash.Essentials
#region Overrides of EssentialsRoomBase #region Overrides of EssentialsRoomBase
protected override Func<bool> IsWarmingFeedbackFunc
{
get { return () => false; }
}
protected override Func<bool> IsCoolingFeedbackFunc
{
get { return () => false; }
}
protected override Func<bool> OnFeedbackFunc protected override Func<bool> OnFeedbackFunc
{ {
get { return () => RoomPowerIsOn; } get { return () => RoomPowerIsOn; }
@@ -358,6 +392,8 @@ namespace PepperDash.Essentials
feedback.Value.FireUpdate(); feedback.Value.FireUpdate();
} }
}; };
return;
} }
i = 0; i = 0;
@@ -366,6 +402,8 @@ namespace PepperDash.Essentials
var tuner = setTopBox; var tuner = setTopBox;
trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value)); trilist.SetStringSigAction(joinMap.CurrentPreset.JoinNumber + i, s => _tunerPresets.Dial(s, tuner.Value));
i++;
} }
} }

View File

@@ -78,7 +78,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// <summary> /// <summary>
/// Bridge API using EISC /// Bridge API using EISC
/// </summary> /// </summary>
public class EiscApiAdvanced : BridgeApi public class EiscApiAdvanced : BridgeApi, ICommunicationMonitor
{ {
public EiscApiPropertiesConfig PropertiesConfig { get; private set; } public EiscApiPropertiesConfig PropertiesConfig { get; private set; }
@@ -98,8 +98,23 @@ namespace PepperDash.Essentials.Core.Bridges
Eisc.SigChange += Eisc_SigChange; Eisc.SigChange += Eisc_SigChange;
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Eisc, 120000, 300000);
AddPostActivationAction(LinkDevices); AddPostActivationAction(LinkDevices);
AddPostActivationAction(LinkRooms); AddPostActivationAction(LinkRooms);
AddPostActivationAction(RegisterEisc);
}
public override bool CustomActivate()
{
CommunicationMonitor.Start();
return base.CustomActivate();
}
public override bool Deactivate()
{
CommunicationMonitor.Stop();
return base.Deactivate();
} }
private void LinkDevices() private void LinkDevices()
@@ -137,8 +152,6 @@ namespace PepperDash.Essentials.Core.Bridges
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this); bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
} }
} }
RegisterEisc();
} }
private void RegisterEisc() private void RegisterEisc()
@@ -182,8 +195,6 @@ namespace PepperDash.Essentials.Core.Bridges
rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this); rm.LinkToApi(Eisc, room.JoinStart, room.JoinMapKey, this);
} }
RegisterEisc();
} }
/// <summary> /// <summary>
@@ -324,6 +335,12 @@ namespace PepperDash.Essentials.Core.Bridges
Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e); Debug.Console(2, this, "Error in Eisc_SigChange handler: {0}", e);
} }
} }
#region Implementation of ICommunicationMonitor
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion
} }
public class EiscApiPropertiesConfig public class EiscApiPropertiesConfig

View File

@@ -505,17 +505,23 @@ namespace PepperDash.Essentials.Core.Monitoring
ProgramInfo.RegistrationState = Program.RegistrationState; ProgramInfo.RegistrationState = Program.RegistrationState;
ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start); ProgramStartedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Start);
ProgramStartedFeedback.FireUpdate();
ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop); ProgramStoppedFeedback = new BoolFeedback(() => Program.OperatingState == eProgramOperatingState.Stop);
ProgramStoppedFeedback.FireUpdate();
ProgramRegisteredFeedback = ProgramRegisteredFeedback =
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register); new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Register);
ProgramRegisteredFeedback.FireUpdate();
ProgramUnregisteredFeedback = ProgramUnregisteredFeedback =
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister); new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
ProgramUnregisteredFeedback.FireUpdate();
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile); ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime); ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb); CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment); EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo)); AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
GetProgramInfo(); GetProgramInfo();

View File

@@ -14,7 +14,7 @@
<tags>crestron 3series 4series</tags> <tags>crestron 3series 4series</tags>
<repository type="git" url="https://github.com/PepperDash/Essentials"/> <repository type="git" url="https://github.com/PepperDash/Essentials"/>
<dependencies> <dependencies>
<dependency id="PepperDashCore" version="[1.0.43, 1.1.0)"/> <dependency id="PepperDashCore" version="[1.0.44, 1.1.0)"/>
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@@ -266,14 +266,13 @@ namespace PepperDash.Essentials.Core.Presets
try try
{ {
_fileOps.Enter(); _fileOps.Enter();
var json = JsonConvert.SerializeObject(PresetsList); var pl = new PresetsList {Channels = PresetsList, Name = Name};
var json = JsonConvert.SerializeObject(pl, Formatting.Indented);
using (var file = File.Open(_filePath, FileMode.Truncate)) using (var file = File.Open(_filePath, FileMode.Truncate))
{ {
file.Write(json, Encoding.UTF8); file.Write(json, Encoding.UTF8);
} }
} }
finally finally
{ {

View File

@@ -39,12 +39,12 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
{ {
_dge = device; _dge = device;
_dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs; _dgeEthernetInfo = _dge.ExtenderEthernetReservedSigs;
_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo(); //_dgeEthernetInfo.DeviceExtenderSigChange += (extender, args) => UpdateDeviceInfo();
_dgeEthernetInfo.Use(); _dgeEthernetInfo.Use();
DeviceInfo = new DeviceInfo(); DeviceInfo = new DeviceInfo();
_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); }; //_dge.OnlineStatusChange += (currentDevice, args) => { if (args.DeviceOnLine) UpdateDeviceInfo(); };
_dc = dc; _dc = dc;

View File

@@ -259,29 +259,35 @@ namespace PepperDash.Essentials.DM
{ {
case 0: case 0:
{ {
ExecuteSwitch(eVst.Auto, null, eRoutingSignalType.Audio | eRoutingSignalType.Video); ExecuteSwitch(eVst.Auto, null, type);
break; break;
} }
case 1: case 1:
{ {
ExecuteSwitch(HdmiIn1.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video); ExecuteSwitch(HdmiIn1.Selector, null, type);
break; break;
} }
case 2: case 2:
{ {
ExecuteSwitch(HdmiIn2.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video); ExecuteSwitch(HdmiIn2.Selector, null, type);
break; break;
} }
case 3: case 3:
{ {
ExecuteSwitch(DisplayPortIn.Selector, null, eRoutingSignalType.Audio | eRoutingSignalType.Video); ExecuteSwitch(DisplayPortIn.Selector, null, type);
break; break;
} }
case 4: case 4:
{ {
ExecuteSwitch(eVst.AllDisabled, null, eRoutingSignalType.Audio | eRoutingSignalType.Video); ExecuteSwitch(eVst.AllDisabled, null, type);
break; break;
} }
default:
{
Debug.Console(2, this, "Unable to execute numeric switch to input {0}", input);
break;
}
} }
@@ -289,15 +295,23 @@ namespace PepperDash.Essentials.DM
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType) public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{ {
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video) try
Tx.VideoSource = (eVst)inputSelector; {
Debug.Console(2, this, "Attempting to switch InputSelector {0}", ((eVst)inputSelector).ToString());
if ((signalType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
Tx.VideoSource = (eVst)inputSelector;
// NOTE: It's possible that this particular TX model may not like the AudioSource property being set. // NOTE: It's possible that this particular TX model may not like the AudioSource property being set.
// The SIMPL definition only shows a single analog for AudioVideo Source // The SIMPL definition only shows a single analog for AudioVideo Source
if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio) if ((signalType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
//it doesn't //it doesn't
Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key); Debug.Console(2, this, "Unable to execute audio-only switch for tx {0}", Key);
//Tx.AudioSource = (eAst)inputSelector; //Tx.AudioSource = (eAst)inputSelector;
}
catch (Exception e)
{
Debug.Console(2, this, "Exception in ExecuteSwitch: {0}", e);
}
} }
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args) void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)

View File

@@ -54,7 +54,7 @@ namespace PepperDash.Essentials.Devices.Common
KeypadAccessoryButton1Label = "-"; KeypadAccessoryButton1Label = "-";
HasKeypadAccessoryButton2 = true; HasKeypadAccessoryButton2 = true;
KeypadAccessoryButton2Command = "NumericEnter"; KeypadAccessoryButton2Command = "KEYPAD_ENTER";
KeypadAccessoryButton2Label = "Enter"; KeypadAccessoryButton2Label = "Enter";
AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,

View File

@@ -1655,6 +1655,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public override void Dial(Meeting meeting) public override void Dial(Meeting meeting)
{ {
Debug.Console(1, this,"Dialing meeting.Id: {0} Title: {1}", meeting.Id, meeting.Title);
SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id)); SendText(string.Format("zCommand Dial Start meetingNumber: {0}", meeting.Id));
} }

View File

@@ -1,3 +1,3 @@
<packages> <packages>
<package id="PepperDashCore" version="1.0.43" targetFramework="net35" allowedVersions="[1.0,1.1)"/> <package id="PepperDashCore" version="1.0.44" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
</packages> </packages>