Merged in bugfix/ecs-1192 (pull request #38)

Bugfix/ecs 1192

Approved-by: Neil Dorin <ndorin@pepperdash.com>
This commit is contained in:
Neil Dorin
2019-11-27 17:41:37 +00:00
10 changed files with 151 additions and 117 deletions

View File

@@ -137,15 +137,15 @@ namespace PepperDash.Essentials.Bridges {
} }
if (dmChassis.RxDictionary.ContainsKey(ioSlot)) { if (dmChassis.RxDictionary.ContainsKey(ioSlot)) {
Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot); Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
var rxKey = dmChassis.RxDictionary[ioSlot]; //var rxKey = dmChassis.RxDictionary[ioSlot];
var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase; //var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase; //var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
if (dmChassis.Chassis is DmMd128x128 || dmChassis.Chassis is DmMd64x64) { //if (hdBaseTDevice != null) {
dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]); dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
} //}
else if (rxDevice != null) { //else if (rxDevice != null) {
rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]); // rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
} //}
} }
// Feedback // Feedback

View File

@@ -17,6 +17,8 @@ using PepperDash.Essentials.Fusion;
using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Room.Cotija; using PepperDash.Essentials.Room.Cotija;
using Newtonsoft.Json;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public class ControlSystem : CrestronControlSystem public class ControlSystem : CrestronControlSystem
@@ -359,21 +361,7 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
// Check if the processor is a DMPS model
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
{
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, new DM.Config.DmpsRoutingPropertiesConfig());
DeviceManager.AddDevice(dmpsRoutingController);
}
else
{
Debug.Console(2, "************Processor is not DMPS type***************");
}
// Add global System Monitor device // Add global System Monitor device
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor")); DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
@@ -392,6 +380,25 @@ namespace PepperDash.Essentials
"WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available", "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper()); devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
// Check if the processor is a DMPS model
if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
{
Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
var propertiesConfig = JsonConvert.DeserializeObject<DM.Config.DmpsRoutingPropertiesConfig>(devConf.Properties.ToString());
if(propertiesConfig == null)
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
DeviceManager.AddDevice(dmpsRoutingController);
}
else
{
Debug.Console(2, "************Processor is not DMPS type***************");
}
continue; continue;
} }

View File

@@ -230,6 +230,8 @@ namespace PepperDash.Essentials
} }
void Initialize() void Initialize()
{
try
{ {
if (DefaultAudioDevice is IBasicVolumeControls) if (DefaultAudioDevice is IBasicVolumeControls)
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls; DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
@@ -238,6 +240,24 @@ namespace PepperDash.Essentials
CurrentVolumeControls = DefaultVolumeControls; CurrentVolumeControls = DefaultVolumeControls;
// Combines call feedback from both codecs if available
InCallFeedback = new BoolFeedback(() =>
{
bool inAudioCall = false;
bool inVideoCall = false;
if (AudioCodec != null)
inAudioCall = AudioCodec.IsInCall;
if (VideoCodec != null)
inVideoCall = VideoCodec.IsInCall;
if (inAudioCall || inVideoCall)
return true;
else
return false;
});
var disp = DefaultDisplay as DisplayBase; var disp = DefaultDisplay as DisplayBase;
if (disp != null) if (disp != null)
{ {
@@ -267,7 +287,11 @@ namespace PepperDash.Essentials
IsCoolingDownFeedback.FireUpdate(); IsCoolingDownFeedback.FireUpdate();
}; };
// Get Microphone Privacy object, if any }
// Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
Debug.Console(2, this, "Microphone Privacy Config evaluated."); Debug.Console(2, this, "Microphone Privacy Config evaluated.");
@@ -276,27 +300,8 @@ namespace PepperDash.Essentials
this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this); this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
Debug.Console(2, this, "Emergency Config evaluated."); Debug.Console(2, this, "Emergency Config evaluated.");
}
// Combines call feedback from both codecs if available
InCallFeedback = new BoolFeedback(() =>
{
bool inAudioCall = false;
bool inVideoCall = false;
if(AudioCodec != null)
inAudioCall = AudioCodec.IsInCall;
if(VideoCodec != null)
inVideoCall = VideoCodec.IsInCall;
if (inAudioCall || inVideoCall)
return true;
else
return false;
});
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
if (AudioCodec != null) if (AudioCodec != null)
@@ -314,6 +319,11 @@ namespace PepperDash.Essentials
SourceListKey = "default"; SourceListKey = "default";
EnablePowerOnToLastSource = true; 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

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

View File

@@ -100,7 +100,8 @@ 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;
} }

View File

@@ -177,7 +177,9 @@ namespace PepperDash.Essentials.DM {
}); });
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
CrestronConsole.PrintLine("GotHere 5"); //if (Chassis.Outputs[tempX].Endpoint != null)
// return Chassis.Outputs[tempX].Endpoint.IsOnline;
//else
return Chassis.Outputs[tempX].EndpointOnlineFeedback; return Chassis.Outputs[tempX].EndpointOnlineFeedback;
}); });
} }
@@ -456,9 +458,8 @@ namespace PepperDash.Essentials.DM {
} }
/// ///
/// </summary> /// </summary>
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args) { void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
{
//This should be a switch case JTA 2018-07-02
var output = args.Number; var output = args.Number;
switch (args.EventId) { switch (args.EventId) {
@@ -469,7 +470,10 @@ namespace PepperDash.Essentials.DM {
break; break;
} }
case DMOutputEventIds.EndpointOnlineEventId: { case DMOutputEventIds.EndpointOnlineEventId: {
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback); Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}", args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
if(Chassis.Outputs[output].Endpoint != null)
Debug.Console(2, this, "Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}", args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
OutputEndpointOnlineFeedbacks[output].FireUpdate(); OutputEndpointOnlineFeedbacks[output].FireUpdate();
break; break;
} }

View File

@@ -767,8 +767,6 @@ namespace PepperDash.Essentials.DM
/// </summary> /// </summary>
void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args) void Chassis_DMOutputChange(Switch device, DMOutputEventArgs args)
{ {
//This should be a switch case JTA 2018-07-02
var output = args.Number; var output = args.Number;
switch (args.EventId) switch (args.EventId)

View File

@@ -116,15 +116,25 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Set input and output names from config // Set input and output names from config
if (InputNames != null) if (InputNames != null)
{
foreach (var kvp in InputNames) foreach (var kvp in InputNames)
(Dmps.SwitcherInputs[kvp.Key] as DMInput).Name.StringValue = kvp.Value; {
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if (input != null)
input.Name.StringValue = kvp.Value;
}
}
if (OutputNames != null) if (OutputNames != null)
{
foreach (var kvp in OutputNames) foreach (var kvp in OutputNames)
(Dmps.SwitcherOutputs[kvp.Key] as Card.Dmps3OutputBase).Name.StringValue = kvp.Value; {
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if (output != null)
output.Name.StringValue = kvp.Value;
}
}
// Subscribe to events // Subscribe to events
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange); Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
@@ -629,41 +639,41 @@ namespace PepperDash.Essentials.DM
} }
DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput; DMInput inCard = input == 0 ? null : Dmps.SwitcherInputs[input] as DMInput;
Card.Dmps3OutputBase outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as Card.Dmps3OutputBase; DMOutput outCard = output == 0 ? null : Dmps.SwitcherOutputs[output] as DMOutput;
if (inCard != null) //if (inCard != null)
{ //{
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES // NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video) if ((sigType | eRoutingSignalType.Video) == eRoutingSignalType.Video)
{ {
//SystemControl.VideoEnter.BoolValue = true; //SystemControl.VideoEnter.BoolValue = true;
if (outCard != null && outCard.VideoOut != null) if (outCard != null)
outCard.VideoOut = inCard; outCard.VideoOut = inCard;
} }
if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio) if ((sigType | eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
{ {
if (outCard != null && outCard.AudioOut != null) if (outCard != null)
outCard.AudioOut = inCard; outCard.AudioOut = inCard;
} }
if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput) if ((sigType | eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
{ {
if (outCard != null && outCard.USBRoutedTo != null) if (outCard != null)
outCard.USBRoutedTo = inCard; outCard.USBRoutedTo = inCard;
} }
if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput) if ((sigType | eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
{ {
if (inCard != null && inCard.USBRoutedTo != null) if (inCard != null)
inCard.USBRoutedTo = outCard; inCard.USBRoutedTo = outCard;
} }
} //}
else //else
{ //{
Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector); // Debug.Console(1, this, "Unable to execute route from input {0} to output {1}. Input card not available", inputSelector, outputSelector);
} //}
} }
else else

View File

@@ -87,7 +87,11 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
else else
Debug.Console(0, this, "Unable to add Red LED device"); Debug.Console(0, this, "Unable to add Red LED device");
AddPostActivationAction(() => {
CheckPrivacyMode(); CheckPrivacyMode();
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
PrivacyDevice.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
});
initialized = true; initialized = true;
@@ -97,8 +101,6 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
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

@@ -30,6 +30,8 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor) public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
: base(key, name, sensor) : base(key, name, sensor)
{ {
OccSensor = sensor;
AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue); AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);
OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue); OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);