//Init ------------------------------------------------------- public void Initialize(ushort _panel, ushort _outputNumber) { myPanel = ElkCore.AddOrGetCoreObject(_panel); if (myPanel == null) { return; } if (myPanel.Outputs.ContainsKey((int)_outputNumber)) { myOutput = myPanel.Outputs[(int)_outputNumber]; myOutput.ElkOutputEvent += new EventHandler <ElkOutputEventArgs>(myOutput_ElkOutputEvent); } }
//Initialize public void Initialize(int _panelId) { if (this.initRun) { return; } panelId = _panelId; this.SendDebug(string.Format("Added and initialized Panel ", _panelId)); for (int i = 1; i <= 8; i++) { if (!Areas.ContainsKey(i)) { ElkArea a = new ElkArea(); a.Initialize(this, i); Areas.Add(i, a); } } for (int i = 1; i <= 208; i++) { if (!Zones.ContainsKey(i)) { ElkZone z = new ElkZone(); z.Initialize(this, i); Zones.Add(i, z); } } for (int i = 1; i <= 208; i++) { if (!Outputs.ContainsKey(i)) { ElkOutput o = new ElkOutput(); o.Initialize(this, i); Outputs.Add(i, o); } } commandQueue = new CrestronQueue <string>(); responseQueue = new CrestronQueue <string>(); this.panelId = _panelId; this.initRun = true; }