public override void InitializeSystem() { _tp = new Tsw1050(0x03, this); _tp.SigChange += new SigEventHandler(_tp_SigChange); _tp.Register(); _inputs = new List <CardDevice>(); _outputs = new List <DmcOutputSingle>(); _sw = new DmMd8x8(0x10, this); _inputs.Add(new Dmc4kC(1, _sw)); _outputs.Add(new DmcCoHdSingle(1, _sw)); _tx = new DmTx4K100C1G(0x14, _sw.Inputs[1]); _tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(_tx_OnlineStatusChange); _rx = new DmRmc4k100C(0x15, _sw.Outputs[1]); _rx.OnlineStatusChange += new OnlineStatusChangeEventHandler(_rx_OnlineStatusChange); _sw.OnlineStatusChange += new OnlineStatusChangeEventHandler(_sw_OnlineStatusChange); _sw.Register(); }
/// <summary> /// Config constructor /// </summary> public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id) : base(key, name) { Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating touchpanel hardware..."); type = type.ToLower(); try { if (type == "crestronapp") { var app = new CrestronApp(id, Global.ControlSystem); app.ParameterProjectName.Value = props.ProjectName; Panel = app; } else if (type == "tsw550") { Panel = new Tsw550(id, Global.ControlSystem); } else if (type == "tsw552") { Panel = new Tsw552(id, Global.ControlSystem); } else if (type == "tsw560") { Panel = new Tsw560(id, Global.ControlSystem); } else if (type == "tsw750") { Panel = new Tsw750(id, Global.ControlSystem); } else if (type == "tsw752") { Panel = new Tsw752(id, Global.ControlSystem); } else if (type == "tsw760") { Panel = new Tsw760(id, Global.ControlSystem); } else if (type == "tsw1050") { Panel = new Tsw1050(id, Global.ControlSystem); } else if (type == "tsw1052") { Panel = new Tsw1052(id, Global.ControlSystem); } else if (type == "tsw1060") { Panel = new Tsw1060(id, Global.ControlSystem); } else { Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create TSW controller with type '{0}'", type); return; } } catch (Exception e) { Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message); return; } // Reserved sigs if (Panel is TswFt5ButtonSystem) { var tsw = Panel as TswFt5ButtonSystem; tsw.ExtenderSystemReservedSigs.Use(); tsw.ExtenderSystemReservedSigs.DeviceExtenderSigChange += ExtenderSystemReservedSigs_DeviceExtenderSigChange; tsw.ButtonStateChange += new ButtonEventHandler(Tsw_ButtonStateChange); } if (Panel.Register() != eDeviceRegistrationUnRegistrationResponse.Success) { Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Registration failed. Continuing, but panel may not function: {0}", Panel.RegistrationFailureReason); } // Give up cleanly if SGD is not present. var sgdName = Global.FilePathPrefix + "sgd" + Global.DirectorySeparator + props.SgdFile; if (!File.Exists(sgdName)) { Debug.Console(0, this, "Smart object file '{0}' not present in User folder. Looking for embedded file", sgdName); sgdName = Global.ApplicationDirectoryPathPrefix + Global.DirectorySeparator + "SGD" + Global.DirectorySeparator + props.SgdFile; if (!File.Exists(sgdName)) { Debug.Console(0, this, "Unable to find SGD file '{0}' in User sgd or application SGD folder. Exiting touchpanel load.", sgdName); return; } } Panel.LoadSmartObjects(sgdName); Panel.SigChange += Panel_SigChange; }