mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-14 20:24:57 +00:00
Debugging on privacy buttons
This commit is contained in:
@@ -30,17 +30,14 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
base(key)
|
base(key)
|
||||||
{
|
{
|
||||||
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
|
||||||
|
|
||||||
InputPort = inputPort;
|
InputPort = inputPort;
|
||||||
|
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
||||||
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
|
|
||||||
|
|
||||||
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
|
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Versiport change: {0}", args.Event);
|
||||||
InputStateFeedback.FireUpdate();
|
InputStateFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,41 +119,41 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props);
|
return new PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec(key, name, comm, props);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (typeName == "versiportinput")
|
//else if (typeName == "versiportinput")
|
||||||
{
|
//{
|
||||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
|
// var props = JsonConvert.DeserializeObject<IOPortConfig>(properties.ToString());
|
||||||
|
|
||||||
IIOPorts portDevice;
|
// IIOPorts portDevice;
|
||||||
|
|
||||||
if (props.PortDeviceKey == "processor")
|
// if (props.PortDeviceKey == "processor")
|
||||||
portDevice = Global.ControlSystem as IIOPorts;
|
// portDevice = Global.ControlSystem as IIOPorts;
|
||||||
else
|
// else
|
||||||
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IIOPorts;
|
// portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IIOPorts;
|
||||||
|
|
||||||
if(portDevice == null)
|
// if(portDevice == null)
|
||||||
Debug.Console(0, "Unable to add versiport device with key '{0}'. Port Device does not support versiports", key);
|
// Debug.Console(0, "Unable to add versiport device with key '{0}'. Port Device does not support versiports", key);
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
var cs = (portDevice as CrestronControlSystem);
|
// var cs = (portDevice as CrestronControlSystem);
|
||||||
|
|
||||||
if (cs != null)
|
// if (cs != null)
|
||||||
if (cs.SupportsVersiport && props.PortNumber <= cs.NumberOfVersiPorts)
|
// if (cs.SupportsVersiport && props.PortNumber <= cs.NumberOfVersiPorts)
|
||||||
{
|
// {
|
||||||
Versiport versiport = cs.VersiPorts[props.PortNumber];
|
// Versiport versiport = cs.VersiPorts[props.PortNumber];
|
||||||
|
|
||||||
if(!versiport.Registered)
|
// if(!versiport.Registered)
|
||||||
{
|
// {
|
||||||
if (versiport.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
// if (versiport.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
return new GenericVersiportInputDevice(key, versiport);
|
// return new GenericVersiportInputDevice(key, versiport);
|
||||||
else
|
// else
|
||||||
Debug.Console(0, "Attempt to register versiport {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
|
// 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")
|
else if (typeName == "digitalinput")
|
||||||
{
|
{
|
||||||
@@ -210,14 +210,15 @@ namespace PepperDash.Essentials.Devices.Common
|
|||||||
|
|
||||||
if (!vp.Registered)
|
if (!vp.Registered)
|
||||||
{
|
{
|
||||||
if (vp.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
var regSuccess = vp.Register();
|
||||||
|
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||||
{
|
{
|
||||||
return new GenericVersiportInputDevice(key, vp);
|
return new GenericVersiportInputDevice(key, vp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed.",
|
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
|
||||||
props.PortNumber, props.PortDeviceKey);
|
props.PortNumber, props.PortDeviceKey, regSuccess);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||||||
|
|
||||||
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)
|
void PrivacyModeIsOnFeedback_OutputChange(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
Debug.Console(1, this, "Privacy mode change: {0}", sender as BoolFeedback);
|
||||||
CheckPrivacyMode();
|
CheckPrivacyMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +161,7 @@ namespace PepperDash.Essentials.Devices.Common.Microphones
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Toggles the state of the privacy mute
|
/// Toggles the state of the privacy mute
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void TogglePrivacyMute()
|
public void TogglePrivacyMute()
|
||||||
{
|
{
|
||||||
PrivacyDevice.PrivacyModeToggle();
|
PrivacyDevice.PrivacyModeToggle();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,5 +4,5 @@
|
|||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
|
||||||
[assembly: AssemblyVersion("1.0.23.*")]
|
[assembly: AssemblyVersion("1.0.27.*")]
|
||||||
|
|
||||||
|
|||||||
@@ -101,59 +101,69 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
/// <summary>
|
||||||
{
|
///
|
||||||
var microphonePrivacy = props.MicrophonePrivacy;
|
/// </summary>
|
||||||
if (microphonePrivacy != null)
|
/// <param name="props"></param>
|
||||||
{
|
/// <param name="room"></param>
|
||||||
// Get the MicrophonePrivacy device from the device manager
|
/// <returns></returns>
|
||||||
var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController);
|
PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController GetMicrophonePrivacy(
|
||||||
// Set this room as the IPrivacy device
|
EssentialsRoomPropertiesConfig props, EssentialsHuddleVtc1Room room)
|
||||||
if (mP != null)
|
{
|
||||||
{
|
var microphonePrivacy = props.MicrophonePrivacy;
|
||||||
mP.SetPrivacyDevice(room);
|
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 == null)
|
||||||
{
|
{
|
||||||
if (behaviour == "trackroomstate")
|
Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
|
||||||
{
|
return null;
|
||||||
// Tie LED enable to room power state
|
}
|
||||||
room.OnFeedback.OutputChange += (o, a) =>
|
if (behaviour == "trackroomstate")
|
||||||
{
|
{
|
||||||
if (room.OnFeedback.BoolValue)
|
// Tie LED enable to room power state
|
||||||
mP.EnableLeds = true;
|
room.OnFeedback.OutputChange += (o, a) =>
|
||||||
else
|
{
|
||||||
mP.EnableLeds = false;
|
if (room.OnFeedback.BoolValue)
|
||||||
};
|
mP.EnableLeds = true;
|
||||||
|
else
|
||||||
|
mP.EnableLeds = false;
|
||||||
|
};
|
||||||
|
|
||||||
mP.EnableLeds = room.OnFeedback.BoolValue;
|
mP.EnableLeds = room.OnFeedback.BoolValue;
|
||||||
}
|
}
|
||||||
else if (behaviour == "trackcallstate")
|
else if (behaviour == "trackcallstate")
|
||||||
{
|
{
|
||||||
// Tie LED enable to room power state
|
// Tie LED enable to room power state
|
||||||
room.InCallFeedback.OutputChange += (o, a) =>
|
room.InCallFeedback.OutputChange += (o, a) =>
|
||||||
{
|
{
|
||||||
if (room.InCallFeedback.BoolValue)
|
if (room.InCallFeedback.BoolValue)
|
||||||
mP.EnableLeds = true;
|
mP.EnableLeds = true;
|
||||||
else
|
else
|
||||||
mP.EnableLeds = false;
|
mP.EnableLeds = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
mP.EnableLeds = room.InCallFeedback.BoolValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Debug.Console(0, "No behaviour defined for MicrophonePrivacyController");
|
|
||||||
|
|
||||||
return mP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
mP.EnableLeds = room.InCallFeedback.BoolValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mP;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -202,8 +202,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
|||||||
else // If only one value present, just show the phone number
|
else // If only one value present, just show the phone number
|
||||||
roomNumberSipUri = Codec.CodecInfo.SipPhoneNumber;
|
roomNumberSipUri = Codec.CodecInfo.SipPhoneNumber;
|
||||||
|
|
||||||
if(string.IsNullOrEmpty(roomNumberSipUri))
|
if (string.IsNullOrEmpty(roomNumberSipUri))
|
||||||
roomNumberSipUri = string.Format("{0} | {1}", GetFormattedPhoneNumber(Codec.CodecInfo.E164Alias), Codec.CodecInfo.H323Id);
|
{
|
||||||
|
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);
|
TriList.SetString(UIStringJoin.RoomPhoneText, roomNumberSipUri);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user