diff --git a/Essentials/PepperDashEssentials/ControlSystem.cs b/Essentials/PepperDashEssentials/ControlSystem.cs index 039cb771..b6880d2c 100644 --- a/Essentials/PepperDashEssentials/ControlSystem.cs +++ b/Essentials/PepperDashEssentials/ControlSystem.cs @@ -245,9 +245,10 @@ namespace PepperDash.Essentials Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion"); DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1)); - Debug.Console(0, "******* RE-ENABLE COTIJA PROPERLY *******"); - //var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom); - //AddBridgePostActivationHelper(bridge); + // Cotija bridge + var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom); + AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present + DeviceManager.AddDevice(bridge); } else if (room is EssentialsHuddleVtc1Room) { diff --git a/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs b/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs index 9b1216cd..c903d5f1 100644 --- a/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/Essentials/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")] -[assembly: AssemblyVersion("1.0.36.*")] +[assembly: AssemblyVersion("1.0.37.*")] diff --git a/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs b/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs index 2f5269a0..267dec9d 100644 --- a/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs +++ b/Essentials/PepperDashEssentials/Room/Cotija/CotijaSystemController.cs @@ -111,10 +111,12 @@ namespace PepperDash.Essentials var b = bridge as IDelayedConfiguration; if (b != null) { + Debug.Console(0, this, "Adding room bridge with delayed configuration"); b.ConfigurationIsReady += new EventHandler(bridge_ConfigurationIsReady); } else { + Debug.Console(0, this, "Adding room bridge and sending configuration"); RegisterSystemToServer(); } } @@ -200,9 +202,9 @@ namespace PepperDash.Essentials } else { - Client = new HttpClient(); - Client.Verbose = true; - Client.KeepAlive = true; + var regClient = new HttpClient(); + regClient.Verbose = true; + regClient.KeepAlive = true; string url = string.Format("http://{0}/api/system/join/{1}", Config.ServerUrl, SystemUuid); Debug.Console(1, this, "Joining server at {0}", url); @@ -213,7 +215,7 @@ namespace PepperDash.Essentials request.Header.SetHeaderValue("Content-Type", "application/json"); request.ContentString = postBody; - var err = Client.DispatchAsync(request, PostConnectionCallback); + var err = regClient.DispatchAsync(request, PostConnectionCallback); } } diff --git a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaBridgeBase.cs b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaBridgeBase.cs index 0dee40de..3946d944 100644 --- a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaBridgeBase.cs +++ b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaBridgeBase.cs @@ -22,10 +22,11 @@ namespace PepperDash.Essentials } /// - /// + /// Set the parent. Does nothing else. Override to add functionality such + /// as adding actions to parent /// /// - public void AddParent(CotijaSystemController parent) + public virtual void AddParent(CotijaSystemController parent) { Parent = parent; } diff --git a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs index a8e6338e..37068183 100644 --- a/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs +++ b/Essentials/PepperDashEssentials/Room/Cotija/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs @@ -23,31 +23,40 @@ namespace PepperDash.Essentials public CotijaEssentialsHuddleSpaceRoomBridge(EssentialsHuddleSpaceRoom room): base("cotijaController", "Cotija Controller") { - Room = room; + Room = room; + } + + /// + /// Override of base: calls base to add parent and then registers actions and events. + /// + /// + public override void AddParent(CotijaSystemController parent) + { + base.AddParent(parent); // we add actions to the messaging system with a path, and a related action. Custom action // content objects can be handled in the controller's LineReceived method - and perhaps other // sub-controller parsing could be attached to these classes, so that the systemController // doesn't need to know about everything. - // Source Changes and room off - Parent.AddAction(string.Format(@"/room/{0}/status",Room.Key), new Action(() => Room_RoomFullStatus(Room))); - Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action(c => room.RunRouteAction(c.SourceListItem))); + // Source Changes and room off + Parent.AddAction(string.Format(@"/room/{0}/status", Room.Key), new Action(() => Room_RoomFullStatus(Room))); + Parent.AddAction(string.Format(@"/room/{0}/source", Room.Key), new Action(c => Room.RunRouteAction(c.SourceListItem))); Parent.AddAction(string.Format(@"/room/{0}/defaultsource", Room.Key), new Action(Room.RunDefaultRoute)); Parent.AddAction(string.Format(@"/room/{0}/masterVolumeLevel", Room.Key), new Action(u => - (room.CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(u))); - Parent.AddAction(string.Format(@"/room/{0}/masterVolumeMuteToggle", Room.Key), new Action(() => room.CurrentVolumeControls.MuteToggle())); + (Room.CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(u))); + Parent.AddAction(string.Format(@"/room/{0}/masterVolumeMuteToggle", Room.Key), new Action(() => Room.CurrentVolumeControls.MuteToggle())); - Parent.AddAction(string.Format(@"/room/{0}/shutdownStart", Room.Key), new Action(() => room.StartShutdown(eShutdownType.Manual))); - Parent.AddAction(string.Format(@"/room/{0}/shutdownEnd", Room.Key), new Action(() => room.ShutdownPromptTimer.Finish())); - Parent.AddAction(string.Format(@"/room/{0}/shutdownCancel", Room.Key), new Action(() => room.ShutdownPromptTimer.Cancel())); + Parent.AddAction(string.Format(@"/room/{0}/shutdownStart", Room.Key), new Action(() => Room.StartShutdown(eShutdownType.Manual))); + Parent.AddAction(string.Format(@"/room/{0}/shutdownEnd", Room.Key), new Action(() => Room.ShutdownPromptTimer.Finish())); + Parent.AddAction(string.Format(@"/room/{0}/shutdownCancel", Room.Key), new Action(() => Room.ShutdownPromptTimer.Cancel())); - Room.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange); + Room.CurrentSingleSourceChange += new SourceInfoChangeHandler(Room_CurrentSingleSourceChange); - Room.CurrentVolumeDeviceChange += new EventHandler(Room_CurrentVolumeDeviceChange); + Room.CurrentVolumeDeviceChange += new EventHandler(Room_CurrentVolumeDeviceChange); - Room.OnFeedback.OutputChange += new EventHandler(OnFeedback_OutputChange); + Room.OnFeedback.OutputChange += new EventHandler(OnFeedback_OutputChange); Room.IsCoolingDownFeedback.OutputChange += new EventHandler(IsCoolingDownFeedback_OutputChange); Room.IsWarmingUpFeedback.OutputChange += new EventHandler(IsWarmingUpFeedback_OutputChange); @@ -55,21 +64,20 @@ namespace PepperDash.Essentials Room.ShutdownPromptTimer.HasFinished += new EventHandler(ShutdownPromptTimer_HasFinished); Room.ShutdownPromptTimer.WasCancelled += new EventHandler(ShutdownPromptTimer_WasCancelled); - // Registers for initial volume events, if possible - var currentVolumeDevice = Room.CurrentVolumeControls; + // Registers for initial volume events, if possible + var currentVolumeDevice = Room.CurrentVolumeControls; - if (currentVolumeDevice != null) - { - if (currentVolumeDevice is IBasicVolumeWithFeedback) - { - var newDev = currentVolumeDevice as IBasicVolumeWithFeedback; + if (currentVolumeDevice != null) + { + if (currentVolumeDevice is IBasicVolumeWithFeedback) + { + var newDev = currentVolumeDevice as IBasicVolumeWithFeedback; - newDev.MuteFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); - newDev.VolumeLevelFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); - } - } - - } + newDev.MuteFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); + newDev.VolumeLevelFeedback.OutputChange += new EventHandler(VolumeLevelFeedback_OutputChange); + } + } + } /// /// Handler for cancelled shutdown diff --git a/Release Package/PepperDashEssentials.cpz b/Release Package/PepperDashEssentials.cpz index 58e948ac..4a6a3a82 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 facd5505..1e6e3b15 100644 Binary files a/Release Package/PepperDashEssentials.dll and b/Release Package/PepperDashEssentials.dll differ