From 5a04a23e8c8997521518e623cad316cf9d924464 Mon Sep 17 00:00:00 2001 From: Neil Dorin Date: Thu, 27 Apr 2017 23:11:09 -0600 Subject: [PATCH] Fusion working again for Huddle room types --- .../PepperDash_Essentials_Core.projectinfo | Bin 1280 -> 1281 bytes .../Essentials_DM/Essentials_DM.projectinfo | Bin 1142 -> 1142 bytes .../DSP/BiampTesira/BiampTesiraForteDsp.cs | 40 +- .../BiampTesira/BiampTesiraForteDspLevel.cs | 624 +++++++++--------- .../BiampTesira/TesiraForteControlPoint.cs | 206 +++--- .../Essentials Devices Common.projectinfo | Bin 1162 -> 1163 bytes .../PepperDashEssentials/ControlSystem.cs | 20 +- .../Fusion/FusionSystemController.cs | 6 +- .../PepperDashEssentials.csproj | 1 + .../PepperDashEssentials.projectinfo | Bin 1871 -> 1865 bytes .../UI/CotijaInterfaceController.cs | 36 + 11 files changed, 492 insertions(+), 441 deletions(-) create mode 100644 Essentials/PepperDashEssentials/UI/CotijaInterfaceController.cs diff --git a/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo b/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.projectinfo index d106e6019c534445a9f0146af1fcbcbb4dc99d49..f1ca8e713eca08bf721f136af25f99052303583e 100644 GIT binary patch delta 1111 zcmV-d1gQIf3V{lcxqoMWd+))Uy}d{GcOLCM9N#;5aIkxSe|zWCM>{*zZcgn^9{s+* z?{};EZLz#apB8mKZL7M-o8R~Mb^ZOmzwhfG|9yYo+;;l={=N=@6bSf@-B(YthQ65; zOaJRG?&ImI`~jg-SgO3NtDhz;&X(uZv!cwG*&_cTpt%9Vm46^q5JH6LSwr2o*JkQo zUpH;Ocp*q`oFW?6MV&3qW^b~KTee-~wM^*oY*w^IwaiM8MLs*J7AvC9?91gXXWP8+ zL!|00C;xOY$!D*tbv@0G>*>6>%q=&ZRIBSZ)w8Oc<#qGXBO^$AAN`WiM_&}nVzFL4 zE9%8nR_8xSEq{nc5VP^l&O`eD-a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mrcd{w9l)1Xqh?MX*H-CIyO|$ZcGEF!0rI7JyzRH)g zd^x4AKYH{%GaL8A**K|by6b8=eqAh9rNAP4k`E zeV_Ilpam0f3z)Z@fDJwVzj+q+hGyYaet%vf?5>t)%Qmk;k8nEjd*|l|`D`-D4)&+h z*@NBt_a_e@9_;6zKG;7vm;`S0ZNLWeatq+^Jukyu|G#;H?hQ@Q>z{c3?YyL32Il8{ zXL^6<{%n>{X9wAXgL||6$%FfQyAST~>`o_>2Ltmn2sN0VTflzr=^5<#|9!L5`A@*k zRVPv4#`ZL8v+*oz-RvCf?My!1o$en@53;=}4fbH~;r$1BJ|lL&_u#<~Bg&7U_e;M2 cOMVIGFN$;Zdug2OvXx=~Kdhi|jz<*$0Az-T=l}o! diff --git a/Essentials DM/Essentials_DM/Essentials_DM.projectinfo b/Essentials DM/Essentials_DM/Essentials_DM.projectinfo index 0de19ca21674ca3f21c02c9c44ca379659026b56..b1abb6224dff3bc04e6dc70a6da55adfeaeb3938 100644 GIT binary patch delta 821 zcmV-51IqmN2=)k&u7B)r?>%_4xA*A&&ZBz|#t$BR`sw|L54U$deYCSf?dH_(Js(5LCJpCWJ5QY;iVwlU)pdy~t~sg5%k&Xp3r@l^CLYc2X@?G}hUd%UjNm zdEsZ5Lc`N_x|rm%*VVe7=EwDPUR>sO{!XgZ^_%KhRnGFd`RI{h^gmie<4_ zFP;_k;wr22pMRtlLQxLh9g)Y+0P=P3y3`N1y8S zI=H`obm(7X#qyZGSWL=m2VkGR@g`#s$gC`>WiW91@7}|EyAM9<(Wgt8ZxcNF?9)$o z4`zG$bdu+jo%;{+$-(a4G~1otzqdDeILXebrA*B&Mw2W8q<@IrAMWn%9ZYs-x0xCP zGMJBB0REu)FrEItYZ4xWli&^Qq^k3f^gBDV-O0n*!Gj0)?ms-Zf4+Y{$@izT`}e1N zll%K@gJL?y0~8Sa7T|70@OW4M?;`WTZA?L*;`_Th2Rpm>&(CM~i7R(!``Nt*pJw+a z_ddP9|LIOPy?@WmBDZEWyL+&co^b*}a`v zmd|Fh^Mi-?r}sY1rjzq*n(xf+`!lcsT0r|-z`PahH}v=aE~@YD43Yg+eqO@Eu9j!Z zHm^Z|kpB6-^YepzHko7x`_t*{!S4P0lZOuv_VZ64?0+8|Oae=M8?eDd+yeM}PQ-A> z|1X=7-JuzI{S(i>otK2gz=WLdOz-d9pUv{=>>zt^aBsFhd2oMk_rd+0-RWfVU|>Q9 zp$7AD3)t^DAA|k=zhXK%AK1y+8=9P_S(}Y#S?i|bU~gyg>F#v@V0w^|!#~Xr_8yY^ zpU;S)?54<6my9q%7}y0>@#V0-7&M>{*zZcgn^9{s+* z?{};EZLz#apB8mKZL7M-o8R~MeVMOTdHpnN=D+Xn`})U!-`_X4UH-nmuj@X2`i1}J z?~gwx#j^9+c)BWoKphr#gfHvrr>U>A<$3k2DD!2u$bWW_34ifeNw)=cOX!?6)Jc17 zi2eGyY4gPkL8VJ!LinQ27H6|J*~ReJi@cU8IG)Xlwy2g_i6P2oC)Hv_W1W4uyyg6u z7k+jrG(26Wi%C9vU9IbBeq2xI#bs{i@1$B?zp0*8+<9<*aR1=o{^Y@@2Yb^`sijQKEt4t&rGN6t!Nc9%y@Sc_>^4(l zKnC-13&0;VAEwj)cTK{BK^=8c)p$o?unFX3TV%d=&h z*C0Sh|NP$h`9VILOtORh>2&sB_x}CK!-og^`KJ%|4}T6OfhE2T*kB@V0sK8DVz}e~ zm(9rT(2TtPiRa(WOTuDcLe6)l_jm5kX8Ck>kUcoKH`|{)xWBji;Qr3;bTWA`Fd>6b zgZa1x?Dw3H!G8Z=F&&)`?BwhXP0rJ-&Bn8=b<=UMw=?;4ce;NtJ;?T^G`@qqhxZ@k y`HUF)-YJ6zx3CZ&dW)KA$ - /// Used for to identify level subscription values - /// - public string LevelCustomName { get; private set; } - - /// - /// Used for to identify mute subscription values - /// - public string MuteCustomName { get; private set; } - - /// - /// Minimum fader level - /// - double MinLevel; - - /// - /// Maximum fader level - /// - double MaxLevel; - - /// - /// Checks if a valid subscription string has been recieved for all subscriptions - /// - public bool IsSubsribed - { - get - { - bool isSubscribed = false; - - if (HasMute && MuteIsSubscribed) - isSubscribed = true; - - if (HasLevel && LevelIsSubscribed) - isSubscribed = true; - - return isSubscribed; - } - } - - public bool AutomaticUnmuteOnVolumeUp { get; private set; } - - public bool HasMute { get; private set; } - - public bool HasLevel { get; private set; } - - bool MuteIsSubscribed; - - bool LevelIsSubscribed; - - //public TesiraForteLevelControl(string label, string id, int index1, int index2, bool hasMute, bool hasLevel, BiampTesiraForteDsp parent) - // : base(id, index1, index2, parent) - //{ - // Initialize(label, hasMute, hasLevel); - //} - - public TesiraForteLevelControl(string key, BiampTesiraForteLevelControlBlockConfig config, BiampTesiraForteDsp parent) - : base(config.InstanceTag, config.Index1, config.Index2, parent) - { - Initialize(key, config.Label, config.HasMute, config.HasLevel); - } - - - /// - /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue. - /// - public void Initialize(string key, string label, bool hasMute, bool hasLevel) - { - Key = string.Format("{0}--{1}", Parent.Key, key); - - DeviceManager.AddDevice(this); - - Debug.Console(2, this, "Adding LevelControl '{0}'", Key); - - this.IsSubscribed = false; - - MuteFeedback = new BoolFeedback(() => _IsMuted); - - VolumeLevelFeedback = new IntFeedback(() => _VolumeLevel); - - HasMute = hasMute; - HasLevel = hasLevel; - } - - public void Subscribe() - { - // Do subscriptions and blah blah - - // Subscribe to mute - if (this.HasMute) - { - MuteCustomName = string.Format("{0}~mute{1}", this.InstanceTag, this.Index1); - - SendSubscriptionCommand(MuteCustomName, "mute", 500); - } - - // Subscribe to level - if (this.HasLevel) - { - LevelCustomName = string.Format("{0}~level{1}", this.InstanceTag, this.Index1); - - SendSubscriptionCommand(LevelCustomName, "level", 250); - - SendFullCommand("get", "minLevel", null); - - SendFullCommand("get", "maxLevel", null); - } - } - - - /// - /// Parses the response from the DspBase - /// - /// - /// - public void ParseSubscriptionMessage(string customName, string value) - { - - // Check for valid subscription response - - if (this.HasMute && customName == MuteCustomName) - { - //if (value.IndexOf("+OK") > -1) - //{ - // int pointer = value.IndexOf(" +OK"); - - // MuteIsSubscribed = true; - - // // Removes the +OK - // value = value.Substring(0, value.Length - (value.Length - (pointer - 1))); - //} - - if (value.IndexOf("true") > -1) - { - _IsMuted = true; - MuteIsSubscribed = true; - - } - else if (value.IndexOf("false") > -1) - { - _IsMuted = false; - MuteIsSubscribed = true; - } - - MuteFeedback.FireUpdate(); - } - else if (this.HasLevel && customName == LevelCustomName) - { - //if (value.IndexOf("+OK") > -1) - //{ - // int pointer = value.IndexOf(" +OK"); - - // LevelIsSubscribed = true; - - //} - - var _value = Double.Parse(value); - - _VolumeLevel = (ushort)Scale(_value, MinLevel, MaxLevel, 0, 65535); - - LevelIsSubscribed = true; - - VolumeLevelFeedback.FireUpdate(); - } - - } - - /// - /// Parses a non subscription response - /// - /// The attribute code of the command +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using PepperDash.Core; +using PepperDash.Essentials.Core; +using System.Text.RegularExpressions; + + +namespace PepperDash.Essentials.Devices.Common.DSP +{ + + // QUESTIONS: + // + // When subscribing, just use the Instance ID for Custom Name? + + // Verbose on subscriptions? + + // ! "publishToken":"name" "value":-77.0 + // ! "myLevelName" -77 + +#warning Working here when set aside for config editor work + + public class TesiraForteLevelControl : TesiraForteControlPoint, IDspLevelControl, IKeyed + { + bool _IsMuted; + ushort _VolumeLevel; + + public BoolFeedback MuteFeedback { get; private set; } + + public IntFeedback VolumeLevelFeedback { get; private set; } + + + public bool Enabled { get; set; } + public string ControlPointTag { get { return base.InstanceTag; } } + + /// + /// Used for to identify level subscription values + /// + public string LevelCustomName { get; private set; } + + /// + /// Used for to identify mute subscription values + /// + public string MuteCustomName { get; private set; } + + /// + /// Minimum fader level + /// + double MinLevel; + + /// + /// Maximum fader level + /// + double MaxLevel; + + /// + /// Checks if a valid subscription string has been recieved for all subscriptions + /// + public bool IsSubsribed + { + get + { + bool isSubscribed = false; + + if (HasMute && MuteIsSubscribed) + isSubscribed = true; + + if (HasLevel && LevelIsSubscribed) + isSubscribed = true; + + return isSubscribed; + } + } + + public bool AutomaticUnmuteOnVolumeUp { get; private set; } + + public bool HasMute { get; private set; } + + public bool HasLevel { get; private set; } + + bool MuteIsSubscribed; + + bool LevelIsSubscribed; + + //public TesiraForteLevelControl(string label, string id, int index1, int index2, bool hasMute, bool hasLevel, BiampTesiraForteDsp parent) + // : base(id, index1, index2, parent) + //{ + // Initialize(label, hasMute, hasLevel); + //} + + public TesiraForteLevelControl(string key, BiampTesiraForteLevelControlBlockConfig config, BiampTesiraForteDsp parent) + : base(config.InstanceTag, config.Index1, config.Index2, parent) + { + Initialize(key, config.Label, config.HasMute, config.HasLevel); + } + + + /// + /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue. + /// + public void Initialize(string key, string label, bool hasMute, bool hasLevel) + { + Key = string.Format("{0}--{1}", Parent.Key, key); + + DeviceManager.AddDevice(this); + + Debug.Console(2, this, "Adding LevelControl '{0}'", Key); + + this.IsSubscribed = false; + + MuteFeedback = new BoolFeedback(() => _IsMuted); + + VolumeLevelFeedback = new IntFeedback(() => _VolumeLevel); + + HasMute = hasMute; + HasLevel = hasLevel; + } + + public void Subscribe() + { + // Do subscriptions and blah blah + + // Subscribe to mute + if (this.HasMute) + { + MuteCustomName = string.Format("{0}~mute{1}", this.InstanceTag, this.Index1); + + SendSubscriptionCommand(MuteCustomName, "mute", 500); + } + + // Subscribe to level + if (this.HasLevel) + { + LevelCustomName = string.Format("{0}~level{1}", this.InstanceTag, this.Index1); + + SendSubscriptionCommand(LevelCustomName, "level", 250); + + SendFullCommand("get", "minLevel", null); + + SendFullCommand("get", "maxLevel", null); + } + } + + + /// + /// Parses the response from the DspBase + /// + /// + /// + public void ParseSubscriptionMessage(string customName, string value) + { + + // Check for valid subscription response + + if (this.HasMute && customName == MuteCustomName) + { + //if (value.IndexOf("+OK") > -1) + //{ + // int pointer = value.IndexOf(" +OK"); + + // MuteIsSubscribed = true; + + // // Removes the +OK + // value = value.Substring(0, value.Length - (value.Length - (pointer - 1))); + //} + + if (value.IndexOf("true") > -1) + { + _IsMuted = true; + MuteIsSubscribed = true; + + } + else if (value.IndexOf("false") > -1) + { + _IsMuted = false; + MuteIsSubscribed = true; + } + + MuteFeedback.FireUpdate(); + } + else if (this.HasLevel && customName == LevelCustomName) + { + //if (value.IndexOf("+OK") > -1) + //{ + // int pointer = value.IndexOf(" +OK"); + + // LevelIsSubscribed = true; + + //} + + var _value = Double.Parse(value); + + _VolumeLevel = (ushort)Scale(_value, MinLevel, MaxLevel, 0, 65535); + + LevelIsSubscribed = true; + + VolumeLevelFeedback.FireUpdate(); + } + + } + + /// + /// Parses a non subscription response + /// + /// The attribute code of the command /// The message to parse public override void ParseGetMessage(string attributeCode, string message) { @@ -257,122 +257,122 @@ namespace PepperDash.Essentials.Devices.Common.DSP Debug.Console(2, "Unable to parse message: '{0}'\n{1}", message, e); } - } - - /// - /// Turns the mute off - /// - public void MuteOff() - { - SendFullCommand("set", "mute", "false"); - } - - /// - /// Turns the mute on - /// - public void MuteOn() - { - SendFullCommand("set", "mute", "true"); - } - - /// - /// Sets the volume to a specified level - /// - /// - public void SetVolume(ushort level) + } + + /// + /// Turns the mute off + /// + public void MuteOff() { - Debug.Console(1, this, "volume: {0}", level); - // Unmute volume if new level is higher than existing - if (level > _VolumeLevel && AutomaticUnmuteOnVolumeUp) - if(!_IsMuted) - MuteOff(); - + SendFullCommand("set", "mute", "false"); + } + + /// + /// Turns the mute on + /// + public void MuteOn() + { + SendFullCommand("set", "mute", "true"); + } + + /// + /// Sets the volume to a specified level + /// + /// + public void SetVolume(ushort level) + { + Debug.Console(1, this, "volume: {0}", level); + // Unmute volume if new level is higher than existing + if (level > _VolumeLevel && AutomaticUnmuteOnVolumeUp) + if(!_IsMuted) + MuteOff(); + double volumeLevel = Scale(level, 0, 65535, MinLevel, MaxLevel); - SendFullCommand("set", "level", string.Format("{0:0.000000}", volumeLevel)); - } - - /// - /// Toggles mute status - /// - public void MuteToggle() - { - SendFullCommand("toggle", "mute", ""); - } - - /// - /// Decrements volume level - /// - /// - public void VolumeDown(bool pressRelease) - { - SendFullCommand("decrement", "level", ""); - } - - /// - /// Increments volume level - /// - /// - public void VolumeUp(bool pressRelease) - { - SendFullCommand("increment", "level", ""); - - if (AutomaticUnmuteOnVolumeUp) - if (!_IsMuted) - MuteOff(); - } - - ///// - ///// Scales the input from the input range to the output range - ///// - ///// - ///// - ///// - ///// - ///// - ///// - //int Scale(int input, int inMin, int inMax, int outMin, int outMax) + SendFullCommand("set", "level", string.Format("{0:0.000000}", volumeLevel)); + } + + /// + /// Toggles mute status + /// + public void MuteToggle() + { + SendFullCommand("toggle", "mute", ""); + } + + /// + /// Decrements volume level + /// + /// + public void VolumeDown(bool pressRelease) + { + SendFullCommand("decrement", "level", ""); + } + + /// + /// Increments volume level + /// + /// + public void VolumeUp(bool pressRelease) + { + SendFullCommand("increment", "level", ""); + + if (AutomaticUnmuteOnVolumeUp) + if (!_IsMuted) + MuteOff(); + } + + ///// + ///// Scales the input from the input range to the output range + ///// + ///// + ///// + ///// + ///// + ///// + ///// + //int Scale(int input, int inMin, int inMax, int outMin, int outMax) //{ - // Debug.Console(1, this, "Scaling (int) input '{0}' with min '{1}'/max '{2}' to output range min '{3}'/max '{4}'", input, inMin, inMax, outMin, outMax); - - // int inputRange = inMax - inMin; - - // int outputRange = outMax - outMin; - + // Debug.Console(1, this, "Scaling (int) input '{0}' with min '{1}'/max '{2}' to output range min '{3}'/max '{4}'", input, inMin, inMax, outMin, outMax); + + // int inputRange = inMax - inMin; + + // int outputRange = outMax - outMin; + // var output = (((input-inMin) * outputRange) / inputRange ) - outMin; - // Debug.Console(1, this, "Scaled output '{0}'", output); - - // return output; - //} - - /// - /// Scales the input from the input range to the output range - /// - /// - /// - /// - /// - /// - /// - double Scale(double input, double inMin, double inMax, double outMin, double outMax) - { - Debug.Console(1, this, "Scaling (double) input '{0}' with min '{1}'/max '{2}' to output range min '{3}'/max '{4}'",input ,inMin ,inMax ,outMin, outMax); - + // Debug.Console(1, this, "Scaled output '{0}'", output); + + // return output; + //} + + /// + /// Scales the input from the input range to the output range + /// + /// + /// + /// + /// + /// + /// + double Scale(double input, double inMin, double inMax, double outMin, double outMax) + { + Debug.Console(1, this, "Scaling (double) input '{0}' with min '{1}'/max '{2}' to output range min '{3}'/max '{4}'",input ,inMin ,inMax ,outMin, outMax); + double inputRange = inMax - inMin; if (inputRange <= 0) { throw new ArithmeticException(string.Format("Invalid Input Range '{0}' for Scaling. Min '{1}' Max '{2}'.", inputRange, inMin, inMax)); - } - - double outputRange = outMax - outMin; - + } + + double outputRange = outMax - outMin; + var output = (((input - inMin) * outputRange) / inputRange) + outMin; - Debug.Console(1, this, "Scaled output '{0}'", output); - - return output; - } - } + Debug.Console(1, this, "Scaled output '{0}'", output); + + return output; + } + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/DSP/BiampTesira/TesiraForteControlPoint.cs b/Essentials Devices Common/Essentials Devices Common/DSP/BiampTesira/TesiraForteControlPoint.cs index d75dffe2..151eb2ad 100644 --- a/Essentials Devices Common/Essentials Devices Common/DSP/BiampTesira/TesiraForteControlPoint.cs +++ b/Essentials Devices Common/Essentials Devices Common/DSP/BiampTesira/TesiraForteControlPoint.cs @@ -1,75 +1,75 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; - -namespace PepperDash.Essentials.Devices.Common.DSP -{ - public abstract class TesiraForteControlPoint : DspControlPoint - { - public string Key { get; protected set; } - - public string InstanceTag { get; set; } - public int Index1 { get; private set; } - public int Index2 { get; private set; } - public BiampTesiraForteDsp Parent { get; private set; } - - public bool IsSubscribed { get; protected set; } - - protected TesiraForteControlPoint(string id, int index1, int index2, BiampTesiraForteDsp parent) - { - InstanceTag = id; - Index1 = index1; - Index2 = index2; - Parent = parent; - } - - virtual public void Initialize() - { - } - - /// - /// Sends a command to the DSP - /// - /// command - /// attribute code - /// value (use "" if not applicable) - public virtual void SendFullCommand(string command, string attributeCode, string value) - { - // Command Format: InstanceTag get/set/toggle/increment/decrement/subscribe/unsubscribe attributeCode [index] [value] - // Ex: "RoomLevel set level 1.00" - - string cmd; - - if (attributeCode == "level" || attributeCode == "mute" || attributeCode == "minLevel" || attributeCode == "maxLevel" || attributeCode == "label" || attributeCode == "rampInterval" || attributeCode == "rampStep") - { - //Command requires Index - - if (String.IsNullOrEmpty(value)) - { - // format command without value - cmd = string.Format("{0} {1} {2} {3}", InstanceTag, command, attributeCode, Index1); - } - else - { - // format commadn with value - cmd = string.Format("{0} {1} {2} {3} {4}", InstanceTag, command, attributeCode, Index1, value); - } - - } - else - { - //Command does not require Index - - if (String.IsNullOrEmpty(value)) - { - cmd = string.Format("{0} {1} {2} {3}", InstanceTag, command, attributeCode, value); - } - else - { - cmd = string.Format("{0} {1} {2}", InstanceTag, command, attributeCode); - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +namespace PepperDash.Essentials.Devices.Common.DSP +{ + public abstract class TesiraForteControlPoint : DspControlPoint + { + public string Key { get; protected set; } + + public string InstanceTag { get; set; } + public int Index1 { get; private set; } + public int Index2 { get; private set; } + public BiampTesiraForteDsp Parent { get; private set; } + + public bool IsSubscribed { get; protected set; } + + protected TesiraForteControlPoint(string id, int index1, int index2, BiampTesiraForteDsp parent) + { + InstanceTag = id; + Index1 = index1; + Index2 = index2; + Parent = parent; + } + + virtual public void Initialize() + { + } + + /// + /// Sends a command to the DSP + /// + /// command + /// attribute code + /// value (use "" if not applicable) + public virtual void SendFullCommand(string command, string attributeCode, string value) + { + // Command Format: InstanceTag get/set/toggle/increment/decrement/subscribe/unsubscribe attributeCode [index] [value] + // Ex: "RoomLevel set level 1.00" + + string cmd; + + if (attributeCode == "level" || attributeCode == "mute" || attributeCode == "minLevel" || attributeCode == "maxLevel" || attributeCode == "label" || attributeCode == "rampInterval" || attributeCode == "rampStep") + { + //Command requires Index + + if (String.IsNullOrEmpty(value)) + { + // format command without value + cmd = string.Format("{0} {1} {2} {3}", InstanceTag, command, attributeCode, Index1); + } + else + { + // format commadn with value + cmd = string.Format("{0} {1} {2} {3} {4}", InstanceTag, command, attributeCode, Index1, value); + } + + } + else + { + //Command does not require Index + + if (String.IsNullOrEmpty(value)) + { + cmd = string.Format("{0} {1} {2} {3}", InstanceTag, command, attributeCode, value); + } + else + { + cmd = string.Format("{0} {1} {2}", InstanceTag, command, attributeCode); + } } if (command == "get") @@ -81,35 +81,35 @@ namespace PepperDash.Essentials.Devices.Common.DSP { // This command will generate a simple "+OK" response and doesn't need to be queued Parent.SendLine(cmd); - } - - } - - virtual public void ParseGetMessage(string attributeCode, string message) - { - } - - - - public virtual void SendSubscriptionCommand(string customName, string attributeCode, int responseRate) - { - // Subscription string format: InstanceTag subscribe attributeCode Index1 customName responseRate - // Ex: "RoomLevel subscribe level 1 MyRoomLevel 500" - - string cmd; - - if (responseRate > 0) - { - cmd = string.Format("{0} subscribe {1} {2} {3} {4}", InstanceTag, attributeCode, Index1, customName, responseRate); - } - else - { - cmd = string.Format("{0} subscribe {1} {2} {3}", InstanceTag, attributeCode, Index1, customName); - } - - Parent.SendLine(cmd); - } - - - } + } + + } + + virtual public void ParseGetMessage(string attributeCode, string message) + { + } + + + + public virtual void SendSubscriptionCommand(string customName, string attributeCode, int responseRate) + { + // Subscription string format: InstanceTag subscribe attributeCode Index1 customName responseRate + // Ex: "RoomLevel subscribe level 1 MyRoomLevel 500" + + string cmd; + + if (responseRate > 0) + { + cmd = string.Format("{0} subscribe {1} {2} {3} {4}", InstanceTag, attributeCode, Index1, customName, responseRate); + } + else + { + cmd = string.Format("{0} subscribe {1} {2} {3}", InstanceTag, attributeCode, Index1, customName); + } + + Parent.SendLine(cmd); + } + + + } } \ No newline at end of file diff --git a/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo b/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.projectinfo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4ECzjyy(mYsjP z`*7#}!}Faizqh~t;NIkXw&xT2J)p}wx9{UtQ}pOP5cs*9%l>42fArC-ykUy)pTA^e zrti~RO@H6#S({&F*G)Kc5BB!=^1a=?EW3BGe{XN^AiF<%xSLNt{q$h(;rT&!i<#>H z4kqmu;6G^6I(`3tW4<1Q^X2gQ{ZFbo59eoRXSO?eI6HXo;NJa*2lvnS&nNl*bawy# zbZ>HhpADp)pE#gkK5hZ-cJmSM>;D_{KNzIH>ytYJRRfTzzmt>$$}aaFJP54NW@_G+ n>K&p+kozUy|0TbKW3}SEm}Zb38s)ldWzhc*qX2udOcDS9vh + diff --git a/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo b/Essentials/PepperDashEssentials/PepperDashEssentials.projectinfo index 537afda37a17b9bd36954bafd22dd120159e91b7..51aeea255bbefd6ecd9ccc23cf4868c12d9d46d7 100644 GIT binary patch delta 1656 zcmV-;28a324#^IXvw!~f-h(%Ldynq#JlelE-rIX{@BYL6?VV2_?d(vyIkh`^^!xt4 z->vGm#quJ3TGaWpt?D9ge&65M_4NDxzOR4$_x*iy+u!f|`?|jUcK)Z6Vj2HxJYD^O zx-RUOPQ6;gHYOTXz{$7X64W36l~%#p?}oVe3dU}`Ep8qee~#ihSc{% zQlHc`iFLIczb+Q5^7TBcS0sDmr}SOfA9XoEIa>n_u-oa#dcAJ?oAcN_+1>mnc9j3qk z_szkBTg|~~JJ0K7-jZ!ute3?!gOxHOsN}o%Y5wV__x2w?*nN0^cYi0(KRw@_?B|o| z{d?#4^X$Pb=4E3y!Cc*QJqAmU0od=Wr7PAt<4JPFl(7)!Sgq{As za87n_H78%4h10QfK)&!^wv+J#Hh<&(&d&Y(;K9zPd*`1XkO}_u0eP^qPqT;9?B2ua zr#t>6+ypY1gj)c^OxkpXXWebM|y8D0O3=D?mzduIM(SJZYv)#$V z*}((kT@LP_@1IZd{psxf{psH1{{BwD{Bb~`-nkjv?dk3J^8Z3IcfxWHZwEC(@%`PM zgPq;`=jX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wfpLo7e-=FVHvHCg7r?Z2M!q?gUF#ksER(8$(hD+B$10QOdA I!H6RO0E?5ysQ>@~ diff --git a/Essentials/PepperDashEssentials/UI/CotijaInterfaceController.cs b/Essentials/PepperDashEssentials/UI/CotijaInterfaceController.cs new file mode 100644 index 00000000..c105d873 --- /dev/null +++ b/Essentials/PepperDashEssentials/UI/CotijaInterfaceController.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharp.CrestronIO; +using Crestron.SimplSharpPro; +using Crestron.SimplSharp.Net.Http; +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Core.PageManagers; + +namespace PepperDash.Essentials +{ + public class CotijaInterfaceController : Device + { + public CotijaInterfaceController(string key) : base(key) + { + CrestronConsole.AddNewConsoleCommand(InitializeClient, "InitializeHttpClient", "Initializes a new HTTP client connection to a specified URL", ConsoleAccessLevelEnum.AccessOperator); + } + + public void InitializeClient(string url) + { + HttpClient webClient = new HttpClient(); + webClient.Verbose = true; + HttpClientRequest request = new HttpClientRequest(); + request.Url.Parse(url); + request.Header.AddHeader(new HttpHeader("accept", "text/event-stream")); + request.Header.SetHeaderValue("Expect", ""); + webClient.DispatchAsync(request, (resp, err) => + { + CrestronConsole.PrintLine(resp.ContentString); + }); + } + } +} \ No newline at end of file