diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index adf18e16..f7a4fab5 100644 --- a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -127,10 +127,7 @@ - - - - + diff --git a/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs new file mode 100644 index 00000000..d8f11150 --- /dev/null +++ b/Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core; + +namespace PepperDash.Essentials.Devices.Common.VideoCodec +{ + public class MockVC : VideoCodecBase + { + public MockVC(string key, string name) + : base(key, name) + { + + } + + protected override Func InCallFeedbackFunc + { + get { return () => _InCall; } + } + bool _InCall; + + protected override Func IncomingCallFeedbackFunc + { + get { return () => _IncomingCall; } + } + bool _IncomingCall; + + protected override Func TransmitMuteFeedbackFunc + { + get { return () => _TransmitMute; } + } + bool _TransmitMute; + + protected override Func ReceiveMuteFeedbackFunc + { + get { return () => _ReceiveMute; } + } + bool _ReceiveMute; + + protected override Func PrivacyModeFeedbackFunc + { + get { return () => _PrivacyModeIsOn; } + } + bool _PrivacyModeIsOn; + + /// + /// Dials, yo! + /// + public override void Dial(string s) + { + + _InCall = true; + InCallFeedback.FireUpdate(); + } + + /// + /// Makes horrible tones go out on the wire! + /// + /// + public void SendDTMF(string s) + { + + } + + + public override void EndCall() + { + _InCall = false; + InCallFeedback.FireUpdate(); + } + + /// + /// For a call from the test methods below + /// + public override void AcceptCall() + { + + } + + /// + /// For a call from the test methods below + /// + public override void RejectCall() + { + + } + + + + public override void ExecuteSwitch(object selector) + { + + } + + public override void ReceiveMuteOff() + { + if (!_ReceiveMute) + return; + _ReceiveMute = false; + ReceiveMuteIsOnFeedback.FireUpdate(); + } + + public override void ReceiveMuteOn() + { + if (_ReceiveMute) + return; + ReceiveMuteIsOnFeedback.FireUpdate(); + } + + public override void ReceiveMuteToggle() + { + _ReceiveMute = !_ReceiveMute; + ReceiveMuteIsOnFeedback.FireUpdate(); + } + + public override void SetReceiveVolume(ushort level) + { + + } + + public override void TransmitMuteOff() + { + if (!_TransmitMute) + return; + _TransmitMute = false; + TransmitMuteIsOnFeedback.FireUpdate(); + } + + public override void TransmitMuteOn() + { + if (_TransmitMute) + return; + TransmitMuteIsOnFeedback.FireUpdate(); + } + + public override void TransmitMuteToggle() + { + _TransmitMute = !_TransmitMute; + TransmitMuteIsOnFeedback.FireUpdate(); + } + + public override void SetTransmitVolume(ushort level) + { + + } + + public override void PrivacyModeOn() + { + if (_PrivacyModeIsOn) + return; + _PrivacyModeIsOn = true; + PrivacyModeIsOnFeedback.FireUpdate(); + + } + + public override void PrivacyModeOff() + { + if (!_PrivacyModeIsOn) + return; + _PrivacyModeIsOn = false; + PrivacyModeIsOnFeedback.FireUpdate(); + } + + public override void PrivacyModeToggle() + { + _PrivacyModeIsOn = !_PrivacyModeIsOn; + PrivacyModeIsOnFeedback.FireUpdate(); + } + + //******************************************************** + // SIMULATION METHODS + + public void TestIncomingCall(string url) + { + _IncomingCall = true; + IncomingCallFeedback.FireUpdate(); + } + + public void TestFarEndHangup() + { + + } + + + + } +} \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs index c0eddc21..c844cfbb 100644 --- a/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs +++ b/Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs @@ -7,9 +7,9 @@ using Crestron.SimplSharp; using PepperDash.Core; using PepperDash.Essentials.Core; -namespace PepperDash.Essentials.Devices.VideoCodec +namespace PepperDash.Essentials.Devices.Common.VideoCodec { - public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer //, ICodecAudio + public abstract class VideoCodecBase : Device, IRoutingSinkWithSwitching, IUsageTracking, IHasDialer, ICodecAudio { #region IUsageTracking Members @@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Devices.VideoCodec } } - public abstract void Dial(); + public abstract void Dial(string s); public abstract void EndCall(); public abstract void AcceptCall(); public abstract void RejectCall(); diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 16451812..9e995b5e 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -59,12 +59,12 @@ namespace PepperDash.Essentials // CODEC TESTING - GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); + //GenericSshClient TestCodecClient = new GenericSshClient("TestCodec-1--SshClient", "10.11.50.135", 22, "crestron", "2H3Zu&OvgXp6"); - PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec TestCodec = - new PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); + //PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec TestCodec = + // new PepperDash.Essentials.Devices.VideoCodec.Cisco.CiscoCodec("TestCodec-1", "Cisco Spark Room Kit", TestCodecClient, 8080); - TestCodec.CustomActivate(); + //TestCodec.CustomActivate(); // CODEC TESTING diff --git a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs.orig b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs.orig index b90a99d5..f783b3c7 100644 --- a/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs.orig +++ b/Essentials/PepperDashEssentials/Fusion/FusionSystemController.cs.orig @@ -25,9 +25,9 @@ namespace PepperDash.Essentials.Fusion { public class EssentialsHuddleSpaceFusionSystemController : Device { - //public event EventHandler ScheduleChange; - //public event EventHandler MeetingEndWarning; - //public event EventHandler NextMeetingBeginWarning; + public event EventHandler ScheduleChange; + public event EventHandler MeetingEndWarning; + public event EventHandler NextMeetingBeginWarning; FusionRoom FusionRoom; EssentialsHuddleSpaceRoom Room; @@ -41,10 +41,10 @@ namespace PepperDash.Essentials.Fusion StringSigData CurrentRoomSourceNameSig; #region System Info Sigs - StringSigData SystemName; - StringSigData Model; - StringSigData SerialNumber; - StringSigData Uptime; + //StringSigData SystemName; + //StringSigData Model; + //StringSigData SerialNumber; + //StringSigData Uptime; #endregion @@ -788,6 +788,15 @@ namespace PepperDash.Essentials.Fusion if (!IsRegisteredForSchedulePushNotifications) PollTimer.Reset(SchedulePollInterval, SchedulePollInterval); + + // Fire Schedule Change Event + var handler = ScheduleChange; + + if (handler != null) + { + handler(this, new ScheduleChangeEventArgs() { Schedule = CurrentSchedule }); + } + } } @@ -806,20 +815,26 @@ namespace PepperDash.Essentials.Fusion } + /// + /// Prints today's schedule to console for debugging + /// void PrintTodaysSchedule() { - if (CurrentSchedule.Meetings.Count > 0) + if (Debug.Level > 1) { - Debug.Console(1, this, "Today's Schedule for '{0}'\n", Room.Name); - - foreach (Event e in CurrentSchedule.Meetings) + if (CurrentSchedule.Meetings.Count > 0) { - Debug.Console(1, this, "Subject: {0}", e.Subject); - Debug.Console(1, this, "Organizer: {0}", e.Organizer); - Debug.Console(1, this, "MeetingID: {0}", e.MeetingID); - Debug.Console(1, this, "Start Time: {0}", e.dtStart); - Debug.Console(1, this, "End Time: {0}", e.dtEnd); - Debug.Console(1, this, "Duration: {0}\n", e.DurationInMinutes); + Debug.Console(1, this, "Today's Schedule for '{0}'\n", Room.Name); + + foreach (Event e in CurrentSchedule.Meetings) + { + Debug.Console(1, this, "Subject: {0}", e.Subject); + Debug.Console(1, this, "Organizer: {0}", e.Organizer); + Debug.Console(1, this, "MeetingID: {0}", e.MeetingID); + Debug.Console(1, this, "Start Time: {0}", e.dtStart); + Debug.Console(1, this, "End Time: {0}", e.dtEnd); + Debug.Console(1, this, "Duration: {0}\n", e.DurationInMinutes); + } } } } @@ -888,13 +903,8 @@ namespace PepperDash.Essentials.Fusion /// /// void UsageTracker_DeviceUsageEnded(object sender, DeviceUsageEventArgs e) -<<<<<<< HEAD - { - var device = sender as Device; -======= { var deviceTracker = sender as UsageTracking; ->>>>>>> origin/feature/fusion-nyu var configDevice = ConfigReader.ConfigObject.Devices.Where(d => d.Key.Equals(deviceTracker.Parent)); @@ -960,6 +970,7 @@ namespace PepperDash.Essentials.Fusion string attrName = null; uint attrNum = Convert.ToUInt32(keyNum); +<<<<<<< HEAD if (dev is BasicTriListWithSmartObject) @@ -971,13 +982,32 @@ namespace PepperDash.Essentials.Fusion } // add xpanel here - if (dev is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics) + //if (dev is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics) + //{ + // if (attrNum > 10) + // continue; + // attrName = "Online - XPanel " + attrNum; + // attrNum += 160; + //} +======= + if (dev is EssentialsTouchpanelController) { - if (attrNum > 10) - continue; - attrName = "Online - XPanel " + attrNum; - attrNum += 160; - } + if ((dev as EssentialsTouchpanelController).Panel is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button) + { + if (attrNum > 10) + continue; + attrName = "Online - Touch Panel " + attrNum; + attrNum += 150; + } + else if ((dev as EssentialsTouchpanelController).Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics) + { + if (attrNum > 10) + continue; + attrName = "Online - XPanel " + attrNum; + attrNum += 160; + } + } +>>>>>>> origin/feature/cisco-spark //else if (dev is DisplayBase) diff --git a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs index 80d5d79e..b61f39f6 100644 --- a/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs +++ b/Essentials/PepperDashEssentials/UIDrivers/VC/EssentialsCiscoSparkUiDriver.cs @@ -9,6 +9,7 @@ using PepperDash.Core; using PepperDash.Essentials; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.SmartObjects; +using PepperDash.Essentials.Devices.Common.VideoCodec; namespace PepperDash.Essentials.UIDrivers.VC { @@ -20,7 +21,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// public class EssentialsCiscoSparkUiDriver : PanelDriverBase { - object Codec; + VideoCodecBase Codec; /// /// @@ -51,12 +52,17 @@ namespace PepperDash.Essentials.UIDrivers.VC SmartObjectNumeric DialKeypad; + // These are likely temp until we get a keyboard built + StringFeedback DialStringFeedback; + StringBuilder DialStringBuilder = new StringBuilder(); + BoolFeedback DialStringBackspaceVisibleFeedback; + /// /// /// /// /// - public EssentialsCiscoSparkUiDriver(BasicTriListWithSmartObject triList, object codec) + public EssentialsCiscoSparkUiDriver(BasicTriListWithSmartObject triList, VideoCodecBase codec) : base(triList) { Codec = codec; @@ -76,6 +82,15 @@ namespace PepperDash.Essentials.UIDrivers.VC StagingButtonFeedbackInterlock = new JoinedSigInterlock(triList); StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCRecentsVisible); + + DialStringFeedback = new StringFeedback(() => DialStringBuilder.ToString()); + DialStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.KeyboardText]); + + DialStringBackspaceVisibleFeedback = new BoolFeedback(() => DialStringBuilder.Length > 0); + DialStringBackspaceVisibleFeedback + .LinkInputSig(TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible]); + + Codec.InCallFeedback.OutputChange += new EventHandler(InCallFeedback_OutputChange); } /// @@ -104,7 +119,7 @@ namespace PepperDash.Essentials.UIDrivers.VC void SetupCallStagingPopover() { TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory); - TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, () => { }); + TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress); TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad); TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents); } @@ -117,20 +132,20 @@ namespace PepperDash.Essentials.UIDrivers.VC if(TriList.SmartObjects.Contains(UISmartObjectJoin.VCDialKeypad)) { DialKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.VCDialKeypad], true); - DialKeypad.Digit0.SetSigFalseAction(() => ___DialPlaceholder___(0)); - DialKeypad.Digit1.SetSigFalseAction(() => ___DialPlaceholder___(1)); - DialKeypad.Digit2.SetSigFalseAction(() => ___DialPlaceholder___(2)); - DialKeypad.Digit3.SetSigFalseAction(() => ___DialPlaceholder___(3)); - DialKeypad.Digit4.SetSigFalseAction(() => ___DialPlaceholder___(4)); - DialKeypad.Digit5.SetSigFalseAction(() => ___DialPlaceholder___(5)); - DialKeypad.Digit6.SetSigFalseAction(() => ___DialPlaceholder___(6)); - DialKeypad.Digit7.SetSigFalseAction(() => ___DialPlaceholder___(7)); - DialKeypad.Digit8.SetSigFalseAction(() => ___DialPlaceholder___(8)); - DialKeypad.Digit9.SetSigFalseAction(() => ___DialPlaceholder___(9)); + DialKeypad.Digit0.SetSigFalseAction(() => DialKeypadPress("0")); + DialKeypad.Digit1.SetSigFalseAction(() => DialKeypadPress("1")); + DialKeypad.Digit2.SetSigFalseAction(() => DialKeypadPress("2")); + DialKeypad.Digit3.SetSigFalseAction(() => DialKeypadPress("3")); + DialKeypad.Digit4.SetSigFalseAction(() => DialKeypadPress("4")); + DialKeypad.Digit5.SetSigFalseAction(() => DialKeypadPress("5")); + DialKeypad.Digit6.SetSigFalseAction(() => DialKeypadPress("6")); + DialKeypad.Digit7.SetSigFalseAction(() => DialKeypadPress("7")); + DialKeypad.Digit8.SetSigFalseAction(() => DialKeypadPress("8")); + DialKeypad.Digit9.SetSigFalseAction(() => DialKeypadPress("9")); DialKeypad.Misc1SigName = "*"; - DialKeypad.Misc1.SetSigFalseAction(() => { }); + DialKeypad.Misc1.SetSigFalseAction(() => DialKeypadPress("*")); DialKeypad.Misc2SigName = "#"; - DialKeypad.Misc2.SetSigFalseAction(() => { }); + DialKeypad.Misc2.SetSigFalseAction(() => DialKeypadPress("#")); } else Debug.Console(0, "Trilist {0:x2}, VC dial keypad object {1} not found. Check SGD file or VTP", @@ -166,24 +181,55 @@ namespace PepperDash.Essentials.UIDrivers.VC StagingButtonFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingRecentsPress); } - void CallHasStarted() + /// + /// + /// + void ConnectPress() { - - // Header icon - // Add end call button to stage - // Volume bar needs to have mic mute + if (Codec.InCallFeedback.BoolValue) + Codec.EndCall(); + else + Codec.Dial(DialStringBuilder.ToString()); } - void CallHasEnded() + /// + /// + /// + + void InCallFeedback_OutputChange(object sender, EventArgs e) { - // Header icon - // Remove end call - // Volume bar no mic mute (or hidden if no source?) + if (Codec.InCallFeedback.BoolValue) // Call is starting + { + // Header icon + // Add end call button to stage + // Volume bar needs to have mic mute + } + else // ending + { + // Header icon + // Remove end call + // Volume bar no mic mute (or hidden if no source?) + } } - void ___DialPlaceholder___(int i) + /// + /// + /// + /// + void DialKeypadPress(string i) { - throw new NotImplementedException(); + DialStringBuilder.Append(i); + DialStringFeedback.FireUpdate(); + TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = + DialStringBuilder.Length > 0; + } + + void DialKeypadBackspacePress() + { + DialStringBuilder.Remove(DialStringBuilder.Length - 1, 1); + DialStringFeedback.FireUpdate(); + TriList.BooleanInput[UIBoolJoin.KeyboardClearVisible].BoolValue = + DialStringBuilder.Length > 0; } } } \ No newline at end of file diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 8044f6e7..7451c8ca 100644 Binary files a/Release Package/PepperDashEssentials.cpz and b/Release Package/PepperDashEssentials.cpz differ diff --git a/Release Package/PepperDashEssentials.dll b/Release Package/PepperDashEssentials.dll index deaab97e..679cdf05 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ