/// <summary> /// ControlSystem Constructor. Starting point for the SIMPL#Pro program. /// Use the constructor to: /// * Initialize the maximum number of threads (max = 400) /// * Register devices /// * Register event handlers /// * Add Console Commands /// /// Please be aware that the constructor needs to exit quickly; if it doesn't /// exit in time, the SIMPL#Pro program will exit. /// /// You cannot send / receive data in the constructor /// </summary> public ControlSystem() : base() { try { Thread.MaxNumberOfUserThreads = 20; //Subscribe to the controller events (System, Program, and Ethernet) CrestronEnvironment.SystemEventHandler += new SystemEventHandler(ControlSystem_ControllerSystemEventHandler); CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(ControlSystem_ControllerProgramEventHandler); CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(ControlSystem_ControllerEthernetEventHandler); CrestronConsole.PrintLine(String.Format("Info: {0}", SwitcherOutputs[Convert.ToUInt16(eDmps34K250COutputs.Dm1)].CardInputOutputType)); if (SwitcherOutputs[Convert.ToUInt16(eDmps34K250COutputs.Dm1)].CardInputOutputType == eCardInputOutputType.Dmps3DmOutputBackend) { myDmRmc4k100C = new DmRmc4k100C(0x03, (Card.Dmps3DmOutputBackend)SwitcherOutputs[Convert.ToUInt16(eDmps34K250COutputs.Dm1)]); } myTSW760 = new Tsw760(0x04, this); myTSW760.ExtenderSystemReservedSigs.Use(); } catch (Exception e) { ErrorLog.Error("Error in the constructor: {0}\n", e.Message); } }
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(); }