Merge remote-tracking branch 'origin/development' into feature/ecs-1209

This commit is contained in:
Neil Dorin
2020-01-16 19:21:29 -07:00
9 changed files with 116 additions and 75 deletions

View File

@@ -38,7 +38,13 @@ namespace PepperDash.Essentials
else if (typeName == "dmdge200c") else if (typeName == "dmdge200c")
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem); dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
var dgeController = new DgeController(config.Key, config.Name, dgeDevice, config, props); if (dgeDevice == null)
{
Debug.Console(1, "Unable to create DGE device");
return null;
}
var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props);
DeviceManager.AddDevice(dgeController); DeviceManager.AddDevice(dgeController);

View File

@@ -226,63 +226,25 @@ namespace PepperDash.Essentials
void Initialize() void Initialize()
{ {
if (DefaultAudioDevice is IBasicVolumeControls) try
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
else if (DefaultAudioDevice is IHasVolumeDevice)
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
CurrentVolumeControls = DefaultVolumeControls;
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
{ {
// Link power, warming, cooling to display if (DefaultAudioDevice is IBasicVolumeControls)
disp.PowerIsOnFeedback.OutputChange += (o, a) => DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
{ else if (DefaultAudioDevice is IHasVolumeDevice)
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
{ CurrentVolumeControls = DefaultVolumeControls;
if (!disp.PowerIsOnFeedback.BoolValue)
CurrentSourceInfo = null;
OnFeedback.FireUpdate();
}
if (disp.PowerIsOnFeedback.BoolValue)
{
SetDefaultLevels();
}
};
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
{
IsWarmingUpFeedback.FireUpdate();
if (!IsWarmingUpFeedback.BoolValue)
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
};
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
{
IsCoolingDownFeedback.FireUpdate();
};
}
// Get Microphone Privacy object, if any // Combines call feedback from both codecs if available
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); InCallFeedback = new BoolFeedback(() =>
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
// Get emergency object, if any
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
Debug.Console(2, this, "Emergency Config evaluated.");
// Combines call feedback from both codecs if available
InCallFeedback = new BoolFeedback(() =>
{ {
bool inAudioCall = false; bool inAudioCall = false;
bool inVideoCall = false; bool inVideoCall = false;
if(AudioCodec != null) if (AudioCodec != null)
inAudioCall = AudioCodec.IsInCall; inAudioCall = AudioCodec.IsInCall;
if(VideoCodec != null) if (VideoCodec != null)
inVideoCall = VideoCodec.IsInCall; inVideoCall = VideoCodec.IsInCall;
if (inAudioCall || inVideoCall) if (inAudioCall || inVideoCall)
@@ -291,22 +253,71 @@ namespace PepperDash.Essentials
return false; return false;
}); });
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); var disp = DefaultDisplay as DisplayBase;
if (disp != null)
{
// Link power, warming, cooling to display
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
{
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
{
if (!disp.PowerIsOnFeedback.BoolValue)
CurrentSourceInfo = null;
OnFeedback.FireUpdate();
}
if (disp.PowerIsOnFeedback.BoolValue)
{
SetDefaultLevels();
}
};
if (AudioCodec != null) disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); {
IsWarmingUpFeedback.FireUpdate();
if (!IsWarmingUpFeedback.BoolValue)
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
};
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
{
IsCoolingDownFeedback.FireUpdate();
};
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue); }
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
// link privacy to VC (for now?)
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
CallTypeFeedback = new IntFeedback(() => 0);
// Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
SourceListKey = "default"; this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
EnablePowerOnToLastSource = true;
Debug.Console(2, this, "Microphone Privacy Config evaluated.");
// Get emergency object, if any
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
Debug.Console(2, this, "Emergency Config evaluated.");
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
if (AudioCodec != null)
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
// link privacy to VC (for now?)
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
CallTypeFeedback = new IntFeedback(() => 0);
SourceListKey = "default";
EnablePowerOnToLastSource = true;
}
catch (Exception e)
{
Debug.Console(0, this, "Error Initializing Room: {0}", e);
}
} }
protected override void CustomSetConfig(DeviceConfig config) protected override void CustomSetConfig(DeviceConfig config)

View File

@@ -30,12 +30,17 @@ namespace PepperDash.Essentials
tsw.SigChange += Panel_SigChange; tsw.SigChange += Panel_SigChange;
} }
public EssentialsTouchpanelController(string key, string name, Dge100 panel, string projectName, string sgdPath) public EssentialsTouchpanelController(string key, string name, Dge100 dge, string projectName, string sgdPath)
: base(key, name) : base(key, name)
{ {
Panel = panel; Panel = dge;
panel.LoadSmartObjects(sgdPath);
panel.SigChange += Panel_SigChange; if (!string.IsNullOrEmpty(sgdPath))
dge.LoadSmartObjects(sgdPath);
else
Debug.Console(1, this, "No SGD file path defined");
dge.SigChange += Panel_SigChange;
} }
/// <summary> /// <summary>

View File

@@ -87,7 +87,11 @@ namespace PepperDash.Essentials.Core.Privacy
else else
Debug.Console(0, this, "Unable to add Red LED device"); Debug.Console(0, this, "Unable to add Red LED device");
CheckPrivacyMode(); AddPostActivationAction(() => {
CheckPrivacyMode();
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
});
initialized = true; initialized = true;
@@ -97,8 +101,6 @@ namespace PepperDash.Essentials.Core.Privacy
public void SetPrivacyDevice(IPrivacy privacyDevice) public void SetPrivacyDevice(IPrivacy privacyDevice)
{ {
PrivacyDevice = privacyDevice; PrivacyDevice = privacyDevice;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
} }
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e) void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)

View File

@@ -32,8 +32,8 @@ namespace PepperDash.Essentials.Core
public enum eRoutingSignalType public enum eRoutingSignalType
{ {
Audio = 1, Audio = 1,
Video = 2, Video = 2,
AudioVideo = 4, AudioVideo = 4,
UsbOutput = 8, UsbOutput = 8,
UsbInput = 16 UsbInput = 16
} }

View File

@@ -33,7 +33,7 @@ namespace PepperDash.Essentials.Core
public ushort Count public ushort Count
{ {
get { return SetNumberOfItemsSig.UShortValue; } get { return SetNumberOfItemsSig.UShortValue; }
set { SetNumberOfItemsSig.UShortValue = value; } set { SetNumberOfItemsSig.UShortValue = value; }
} }
public ushort MaxDefinedItems { get; private set; } public ushort MaxDefinedItems { get; private set; }
@@ -100,8 +100,9 @@ namespace PepperDash.Essentials.Core
// Empty the list // Empty the list
Items.Clear(); Items.Clear();
// Clean up the SRL // Clean up the SRL
Count = 0; Count = 1;
ScrollToItemSig.UShortValue = 1;
ScrollToItemSig.UShortValue = 1;
} }
/// <summary> /// <summary>

View File

@@ -747,13 +747,19 @@ namespace PepperDash.Essentials.DM
case DMInputEventIds.UsbRoutedToEventId: case DMInputEventIds.UsbRoutedToEventId:
{ {
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number); Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
UsbInputRoutedToFeebacks[args.Number].FireUpdate(); if(UsbInputRoutedToFeebacks[args.Number] != null)
UsbInputRoutedToFeebacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
break; break;
} }
case DMInputEventIds.HdcpCapabilityFeedbackEventId: case DMInputEventIds.HdcpCapabilityFeedbackEventId:
{ {
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number); Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate(); if (InputCardHdcpCapabilityFeedbacks[args.Number] != null)
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
break; break;
} }
default: default:
@@ -818,6 +824,10 @@ namespace PepperDash.Essentials.DM
{ {
AudioOutputFeedbacks[output].FireUpdate(); AudioOutputFeedbacks[output].FireUpdate();
} }
if (OutputAudioRouteNameFeedbacks.ContainsKey(output))
{
OutputAudioRouteNameFeedbacks[output].FireUpdate();
}
break; break;
} }
case DMOutputEventIds.OutputNameEventId: case DMOutputEventIds.OutputNameEventId:

View File

@@ -28,6 +28,8 @@ namespace PepperDash.Essentials.DM.Endpoints.DGEs
public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props) public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
:base(key, name, device) :base(key, name, device)
{ {
DigitalGraphicsEngine = device;
DeviceConfig = dc; DeviceConfig = dc;
PropertiesConfig = props; PropertiesConfig = props;

View File

@@ -297,6 +297,10 @@ namespace PepperDash.Essentials.Devices.Common
else else
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey); Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
} }
else
{
return new GenericRelayDevice(key, relay);
}
// Future: Check if portDevice is 3-series card or other non control system that supports versiports // Future: Check if portDevice is 3-series card or other non control system that supports versiports
} }