//factory to prevent duplicate instansiations. public static DMPS4K150C_VGA_Input GetVGAInput(ControlSystem ControlSystem, ControlSystem.eDmps34K150CInputs Input) { if (TestInputRange(Input)) { switch (Input) { case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga1: return(VGAInput1 ?? (VGAInput1 = new DMPS4K150C_VGA_Input(ControlSystem, Input))); case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga2: return(VGAInput2 ?? (VGAInput2 = new DMPS4K150C_VGA_Input(ControlSystem, Input))); case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga3: return(VGAInput3 ?? (VGAInput3 = new DMPS4K150C_VGA_Input(ControlSystem, Input))); case Crestron.SimplSharpPro.CrestronControlSystem.eDmps34K150CInputs.Vga4: return(VGAInput4 ?? (VGAInput4 = new DMPS4K150C_VGA_Input(ControlSystem, Input))); default: return(null); } } else { throw new IndexOutOfRangeException(); } }
public ControlSystem() : base() { TestControlSystemType.isDMPS4K150C(this, "This program is for a DMPS4K150 Control System"); try { Thread.MaxNumberOfUserThreads = 20; #region Assigning SIMPL like classes //This clases are created to mimic the modules find in SIMPL //Slot-01 Com01 = new DMPS3TwoWaySerialDriver(this.ComPorts[1]); //Slot-02 IRIn1 = this.IROutputPorts[1]; //Slot-03 Digtal_Inputs = DigitalInputs2Card.GetSlot2DigitalInputs(this.DigitalInputPorts); //Slot-04 Relays = Relays2Card.GetRelay2Card(this.RelayPorts); //Slot-07.Slot01 Ethernet_Information = AdapterInformation.GetAdapterInformation(); //Slot-08.Slot-01 DeviceControl = DMPS4K150C_DeviceControl.GetDMPS4K150C_DeviceControl(this); //Slot-08.Slot-02 AVControl = DMPS4K150C_AVControl.GetDMPS4K150C_AVControl(this); //Slot-08.Slot-02.Slot-01.Slot-01 Mic1 = DMPS4K150C_Mic1.GetDMPS4K150C_Mic(this); //Slot-08.Slot-02.Slot-02.Slot-01 VGA1 = DMPS4K150C_VGA_Input.GetVGAInput(this, eDmps34K150CInputs.Vga1); //Slot-08.Slot-02.Slot-02.Slot-02 VGA2 = DMPS4K150C_VGA_Input.GetVGAInput(this, eDmps34K150CInputs.Vga2); //Slot-08.Slot-02.Slot-02.Slot-03 VGA3 = DMPS4K150C_VGA_Input.GetVGAInput(this, eDmps34K150CInputs.Vga3); //Slot-08.Slot-02.Slot-02.Slot-04 VGA4 = DMPS4K150C_VGA_Input.GetVGAInput(this, eDmps34K150CInputs.Vga4); //Slot-08.Slot-02.Slot-02.Slot-05 HDMI1 = DMPS4K150C_HDMI_Input.GetHDMIInput(this, eDmps34K150CInputs.Hdmi1); //Slot-08.Slot-02.Slot-02.Slot-06 HDMI2 = DMPS4K150C_HDMI_Input.GetHDMIInput(this, eDmps34K150CInputs.Hdmi2); //Slot-08.Slot-02.Slot-02.Slot-07 HDMI3 = DMPS4K150C_HDMI_Input.GetHDMIInput(this, eDmps34K150CInputs.Hdmi3); //Slot-08.Slot-02.Slot-02.Slot-08 HDMI4 = DMPS4K150C_HDMI_Input.GetHDMIInput(this, eDmps34K150CInputs.Hdmi4); //Slot-08.Slot-02.Slot-02.Slot-09 DM1 = DMPS4K150C_DM_Input.GetDMInput(this, eDmps34K150CInputs.Dm1); //Slot-08.Slot-02.Slot-02.Slot-10 DM2 = DMPS4K150C_DM_Input.GetDMInput(this, eDmps34K150CInputs.Dm2); //Slot-08.Slot-02.Slot-03.Slot-01 AnalogAudioOutput = DMPS4K150C_AnalogAudioOutput.GetDMPS4K150C_Mic(this); //Slot-08.Slot-02.Slot-03.Slot-02 DM1Out = DMPS4K150C_DM_Output.GetDMOutput(this, eDmps34K150COutputs.DmHdmiAnalogOutput); //Slot-09.Slot-01 TT_1XX = new ConnectItDevice(new Tt1xx(this, 1)); //Slot-11.Slot-01 C2I_USB_HID1 = new USBPort(this.UsbHids[1]); //Slot-11.Slot-02 C2I_USB_HID2 = new USBPort(this.UsbHids[2]); //Slot-11.Slot-03 C2I_USB_HID3 = new USBPort(this.UsbHids[3]); //Slot-11.Slot-04 C2I_USB_HID4 = new USBPort(this.UsbHids[4]); //Slot-12 System_Monitor = System_Monitor.GetSystemMonitor(); //Slot-12.Slot-01 System_Control = System_Control.GetSystemControl(); //Slot-12.Slot-02 SystemInformation = System_Information.GetSystemInformation(); #endregion #region Enpoints var DMTransmitter1 = this.SwitcherInputs[(uint)eDmps34K150CInputs.Dm1] as DMInput; Transmitter1 = new DM_TX_4K_100_C_1G(DMTransmitter1); var DMReciver = this.SwitcherOutputs[(uint)eDmps34K150COutputs.DmHdmiAnalogOutput] as DMOutput; Receiver1 = new DM_RMC_4K_100_C_1G(DMReciver); #endregion } catch (Exception e) { ErrorLog.Error("Error in the constructor: {0}", e.Message); } }