mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 20:54:55 +00:00
Rearranged how cotija bridge are brought up in relation to parent; adding ddvd01 bridge
This commit is contained in:
@@ -4,16 +4,28 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public abstract class CotijaBridgeBase
|
||||
public abstract class CotijaBridgeBase: Device
|
||||
{
|
||||
public CotijaSystemController Parent { get; private set; }
|
||||
|
||||
public CotijaBridgeBase(CotijaSystemController parent)
|
||||
public CotijaBridgeBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
public void AddParent(CotijaSystemController parent)
|
||||
{
|
||||
Parent = parent;
|
||||
}
|
||||
|
||||
@@ -118,10 +118,12 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
|
||||
public ThreeSeriesTcpIpEthernetIntersystemCommunications EISC { get; private set; }
|
||||
|
||||
CotijaSystemController Parent;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool ConfigIsLoaded { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -131,7 +133,6 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
public CotijaDdvc01RoomBridge(string key, string name, uint ipId)
|
||||
: base(key, name)
|
||||
{
|
||||
Key = key;
|
||||
try
|
||||
{
|
||||
EISC = new ThreeSeriesTcpIpEthernetIntersystemCommunications(ipId, "127.0.0.2", Global.ControlSystem);
|
||||
@@ -146,24 +147,17 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finish wiring up everything after all devices are created
|
||||
/// Finish wiring up everything after all devices are created. The base class will hunt down the related
|
||||
/// parent controller and link them up.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
|
||||
Parent = DeviceManager.AllDevices.FirstOrDefault(d => d is CotijaSystemController) as CotijaSystemController;
|
||||
if (Parent == null)
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Cannot build CotijaDdvc01RoomBridge. System controller not present");
|
||||
return false;
|
||||
}
|
||||
|
||||
SetupFunctions();
|
||||
SetupFeedbacks();
|
||||
EISC.SigChange += EISC_SigChange;
|
||||
// load config if it's already there
|
||||
if (EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
if (EISC.IsOnline || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
|
||||
LoadConfigValues();
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="room"></param>
|
||||
public CotijaEssentialsHuddleSpaceRoomBridge(CotijaSystemController parent, EssentialsHuddleSpaceRoom room):base(parent)
|
||||
public CotijaEssentialsHuddleSpaceRoomBridge(EssentialsHuddleSpaceRoom room):
|
||||
base("cotijaController", "Cotija Controller")
|
||||
{
|
||||
Room = room;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user