Debugging on privacy buttons

This commit is contained in:
Heath Volmer
2018-01-19 15:44:14 -07:00
parent bc25c31860
commit 6f028c06ae
8 changed files with 100 additions and 88 deletions

View File

@@ -30,17 +30,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
base(key)
{
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
InputPort = inputPort;
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
}
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
{
Debug.Console(1, this, "Versiport change: {0}", args.Event);
InputStateFeedback.FireUpdate();
}
}

View File

@@ -119,41 +119,41 @@ namespace PepperDash.Essentials.Devices.Common
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props);
}
else if (typeName == "versiportinput")
{
var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
//else if (typeName == "versiportinput")
//{
// var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
IIOPorts portDevice;
// IIOPorts portDevice;
if (props.PortDeviceKey == "processor")
portDevice = Global.ControlSystem as IIOPorts;
else
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IIOPorts;
// if (props.PortDeviceKey == "processor")
// portDevice = Global.ControlSystem as IIOPorts;
// else
// portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IIOPorts;
if(portDevice == null)
Debug.Console(0, "Unable to add versiport device with key '{0}'. Port Device does not support versiports", key);
else
{
var cs = (portDevice as CrestronControlSystem);
// if(portDevice == null)
// Debug.Console(0, "Unable to add versiport device with key '{0}'. Port Device does not support versiports", key);
// else
// {
// var cs = (portDevice as CrestronControlSystem);
if (cs != null)
if (cs.SupportsVersiport && props.PortNumber <= cs.NumberOfVersiPorts)
{
Versiport versiport = cs.VersiPorts[props.PortNumber];
// if (cs != null)
// if (cs.SupportsVersiport && props.PortNumber <= cs.NumberOfVersiPorts)
// {
// Versiport versiport = cs.VersiPorts[props.PortNumber];
if(!versiport.Registered)
{
if (versiport.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
return new GenericVersiportInputDevice(key, versiport);
else
Debug.Console(0, "Attempt to register versiport {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
}
}
// if(!versiport.Registered)
// {
// if (versiport.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
// return new GenericVersiportInputDevice(key, versiport);
// else
// Debug.Console(0, "Attempt to register versiport {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
// }
// }
// 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
}
}
// }
//}
else if (typeName == "digitalinput")
{
@@ -210,14 +210,15 @@ namespace PepperDash.Essentials.Devices.Common
if (!vp.Registered)
{
if (vp.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
var regSuccess = vp.Register();
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
{
return new GenericVersiportInputDevice(key, vp);
}
else
{
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed.",
props.PortNumber, props.PortDeviceKey);
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
props.PortNumber, props.PortDeviceKey, regSuccess);
return null;
}
}

View File

@@ -103,6 +103,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)
{
Debug.Console(1, this, "Privacy mode change: {0}", sender as BoolFeedback);
CheckPrivacyMode();
}
@@ -160,7 +161,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
/// <summary>
/// Toggles the state of the privacy mute
/// </summary>
void TogglePrivacyMute()
public void TogglePrivacyMute()
{
PrivacyDevice.PrivacyModeToggle();
}

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.0.23.*")]
[assembly: AssemblyVersion("1.0.27.*")]

View File

@@ -101,59 +101,69 @@ namespace PepperDash.Essentials.Room.Config
return null;
}
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
{
var microphonePrivacy = props.MicrophonePrivacy;
if (microphonePrivacy != null)
{
// Get the MicrophonePrivacy device from the device manager
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController);
// Set this room as the IPrivacy device
if (mP != null)
{
mP.SetPrivacyDevice(room);
/// <summary>
///
/// </summary>
/// <param name="props"></param>
/// <param name="room"></param>
/// <returns></returns>
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
{
var microphonePrivacy = props.MicrophonePrivacy;
if (microphonePrivacy == null)
{
Debug.Console(0, "ERROR: Cannot create microphone privacy with null properties");
return null;
}
// Get the MicrophonePrivacy device from the device manager
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController);
// Set this room as the IPrivacy device
if (mP == null)
{
Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
return null;
}
mP.SetPrivacyDevice(room);
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
if (behaviour != null)
{
if (behaviour == "trackroomstate")
{
// Tie LED enable to room power state
room.OnFeedback.OutputChange += (o, a) =>
{
if (room.OnFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
if (behaviour == null)
{
Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
return null;
}
if (behaviour == "trackroomstate")
{
// Tie LED enable to room power state
room.OnFeedback.OutputChange += (o, a) =>
{
if (room.OnFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = room.OnFeedback.BoolValue;
}
else if (behaviour == "trackcallstate")
{
// Tie LED enable to room power state
room.InCallFeedback.OutputChange += (o, a) =>
{
if (room.InCallFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = room.InCallFeedback.BoolValue;
}
}
else
Debug.Console(0, "No behaviour defined for MicrophonePrivacyController");
return mP;
}
}
return null;
}
mP.EnableLeds = room.OnFeedback.BoolValue;
}
else if (behaviour == "trackcallstate")
{
// Tie LED enable to room power state
room.InCallFeedback.OutputChange += (o, a) =>
{
if (room.InCallFeedback.BoolValue)
mP.EnableLeds = true;
else
mP.EnableLeds = false;
};
mP.EnableLeds = room.InCallFeedback.BoolValue;
}
return mP;
}
}
/// <summary>

View File

@@ -202,8 +202,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
else // If only one value present, just show the phone number
roomNumberSipUri = Codec.CodecInfo.SipPhoneNumber;
if(string.IsNullOrEmpty(roomNumberSipUri))
roomNumberSipUri = string.Format("{0} | {1}", GetFormattedPhoneNumber(Codec.CodecInfo.E164Alias), Codec.CodecInfo.H323Id);
if (string.IsNullOrEmpty(roomNumberSipUri))
{
var phone = Codec.CodecInfo.E164Alias.Length < 7 ? Codec.CodecInfo.E164Alias : GetFormattedPhoneNumber(Codec.CodecInfo.E164Alias);
roomNumberSipUri = string.Format("{0} | {1}", phone, Codec.CodecInfo.H323Id);
}
TriList.SetString(UIStringJoin.RoomPhoneText, roomNumberSipUri);