Esempio n. 1
0
 protected LicenseManager()
 {
     CrestronConsole.AddNewConsoleCommand(
         s => CrestronConsole.ConsoleCommandResponse(GetStatusString()),
         "licensestatus", "shows license and related data",
         ConsoleAccessLevelEnum.AccessOperator);
 }
        private void Start()
        {
            _HDMIInput.Aspect_Ratio_Changed          += (state) => { CrestronConsole.PrintLine("{2} Aspcet Ratio State: {0}, {1}", state, _HDMIInput.Aspect_Ratio_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Audio_Channels_Changed        += (value) => { CrestronConsole.PrintLine("{2} Audio Channels Value: {0}, {1}", value, _HDMIInput.Audio_Channels_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Audio_Format_Changed          += (format) => { CrestronConsole.PrintLine("{2} Audio Format: {0}, {1}", format.ToString(), _HDMIInput.Audio_Format_fb.ToString(), _HDMIInput.HDMIInputPort); };
            _HDMIInput.Audio_Gain_Changed            += (value) => { CrestronConsole.PrintLine("{2} Audio Gain Value: {0}, {1}", (double)value / 10, (double)_HDMIInput.Audio_Gain_fb / 10, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Audio_Source_Detected_Changed += (state) => { CrestronConsole.PrintLine("{2} Audo Source Detected State: {0}, {1}", state, _HDMIInput.Audio_Source_Detected_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.CEC_Err_Changed               += (state) => { CrestronConsole.PrintLine("{2} CEC Err Changed State: {0}, {1}", state, _HDMIInput.CEC_Err_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.HDCP_Active_Changed           += (state) => { CrestronConsole.PrintLine("{2} HDCP Active State: {0}, {1}", state, _HDMIInput.HDCP_Active_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.HDCP_Support_Off_Changed      += (state) => { CrestronConsole.PrintLine("{2} HDCP Support Off State: {0}, {1}", state, _HDMIInput.HDCP_Support_Off_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.HDCP_Support_On_Changed       += (state) => { CrestronConsole.PrintLine("{2} HDCP Support On State: {0}, {1}", state, _HDMIInput.HDCP_Support_On_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Horizontal_Resolution_Changed += (value) => { CrestronConsole.PrintLine("{2} Horizontal Resolution Value: {0}, {1}", value, _HDMIInput.Horizontal_Resolution_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Interlaced_Detected_Changed   += (state) => { CrestronConsole.PrintLine("{2} Interlaced Detected State: {0}, {1}", state, _HDMIInput.Interlaced_Detected_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Receive_CEC_Message_Changed   += (message) => { CrestronConsole.PrintLine("{2} Receive CEC Message: {0}, {1}", message, _HDMIInput.Receive_CEC_Message_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Refresh_Rate_Changed          += (value) => { CrestronConsole.PrintLine("{2} Refresh Rate Value: {0}, {1}", value, _HDMIInput.Refresh_Rate_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Status_3D_Changed             += (status) => { CrestronConsole.PrintLine("{2} Status 3D State: {0}, {1}", status.ToString(), _HDMIInput.Status_3D_fb.ToString(), _HDMIInput.HDMIInputPort); };
            _HDMIInput.Sync_Detected_Changed         += (state) => { CrestronConsole.PrintLine("{2} Sync Detected State: {0}, {1}", state, _HDMIInput.Sync_Detected_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Vertical_Resolution_Changed   += (value) => { CrestronConsole.PrintLine("{2} Vertical Resolution Value: {0}, {1}", value, _HDMIInput.Vertical_Resolution_fb, _HDMIInput.HDMIInputPort); };
            _HDMIInput.Video_Source_Detected_Changed += (state) => { CrestronConsole.PrintLine("{2} Video Source Detected State: {0}, {1}", state, _HDMIInput.Video_Source_Detected_fb, _HDMIInput.HDMIInputPort); };


            CrestronConsole.AddNewConsoleCommand(HDCPChangeSupport, "THDCPSupport" + _HDMIInput.HDMIInputPort, "Sets/Resets HDCP Support for " + _HDMIInput.HDMIInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(AudioGain, "TAudioGain" + _HDMIInput.HDMIInputPort, "Changes Audio Gain for" + _HDMIInput.HDMIInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(SendCECMessage, "TCECMessage" + _HDMIInput.HDMIInputPort, "Sends CEC Message" + _HDMIInput.HDMIInputPort, ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 3
0
        /// <summary>
        /// Create an instance of a QsysCore
        /// </summary>
        /// <param name="deviceAddresses">The hostnames or ip addresses of the core(s)</param>
        /// <param name="port">Override the default TCP port of 1710</param>
        /// <param name="name"></param>
        public QsysCore(IList <string> deviceAddresses, string name, int port)
        {
            _name = name;
            try
            {
                _socket = new QsysSocket(deviceAddresses, port, name);
                _socket.StatusChanged += (client, status) =>
                {
                    _initialized        = status != SocketStatus.SOCKET_STATUS_CONNECTED;
                    DeviceCommunicating = status == SocketStatus.SOCKET_STATUS_CONNECTED;
                };

                _socket.RequestReceived  += SocketOnRequestReceived;
                _socket.ResponseReceived += SocketOnResponseReceived;
                CloudLog.Debug("{0} instance created with address(es) \"{1}\" port {2}", GetType().Name,
                               String.Join(",", deviceAddresses.ToArray()), port);
                CrestronConsole.AddNewConsoleCommand(parameters => DefaultChangeGroup.Invalidate(), "QSysUpdateAll",
                                                     "Invalidate the default change group in the core",
                                                     ConsoleAccessLevelEnum.AccessOperator);
            }
            catch (Exception e)
            {
                CloudLog.Error("Error in {0}.ctor(), {1}", GetType().Name, e.Message);
            }
        }
Esempio n. 4
0
 public static void Initialize(CrestronControlSystem cs)
 {
     CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
                                          ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
                                          ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(ListDevices, "devlist", "Lists current managed devices",
                                          ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(DeviceJsonApi.DoDeviceActionWithJson, "devjson", "",
                                          ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(s =>
     {
         CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetProperties(s));
     }, "devprops", "", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(s =>
     {
         CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetMethods(s));
     }, "devmethods", "", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(s =>
     {
         CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s));
     }, "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
                                          "Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
 }
Esempio n. 5
0
 public SecureServer()
 {
     CrestronConsole.AddNewConsoleCommand(Listen, "listen", "usage: listen [<cert_file> <key_file>] <port>", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(Disconnect, "disconnect", "usage: disconnect [<client_index>]", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(ShowStatus, "showstatus", "usage: showstatus [<client_index>]", ConsoleAccessLevelEnum.AccessOperator);
     server = null;
 }
        public TestSingleRelay(SingleRelay Relay)
        {
            _Relay = Relay;
            _Relay.RelayStateChanged += (rly, value) => { CrestronConsole.PrintLine("Port {2}: Relay Changed: {0}, {1}", value, _Relay.RelayState, _Relay.Number); };

            CrestronConsole.AddNewConsoleCommand(SetRelay, "TSetRelay" + _Relay.Name, "Set/Reset A Relay", ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 7
0
 public CalendarMeetings(PolycomGroupSeriesCodec codec)
 {
     _codec = codec;
     _codec.ReceivedFeedback += (c, data) => OnReceive(data);
     if (_testRegistered)
     {
         return;
     }
     _testRegistered = true;
     CrestronConsole.AddNewConsoleCommand(parameters =>
     {
         var now      = DateTime.Now;
         var time     = new DateTime(now.Year, now.Month, now.Day, now.Hour, 0, 0, DateTimeKind.Local);
         var meetings = new Dictionary <string, CalendarMeeting>();
         for (var m = 0; m < 3; m++)
         {
             var meeting = new CalendarMeeting(_codec, "id" + m, time, time + TimeSpan.FromHours(1),
                                               "Test Meeting " + (m + 1));
             time = time + TimeSpan.FromMinutes(90);
             meetings["id" + m] = meeting;
             meeting.Organizer  = "John Smith";
             meeting.CanDial    = true;
             meeting.IsPublic   = true;
             meeting.AddDiallingNumber(new MeetingDiallingNumber(parameters, DiallingNumberType.Video));
             Debug.WriteInfo("Created test meeting", "{0} {1} {2}", meeting.Id, meeting.Name, meeting.TimeDetailsString);
         }
         _meetings.Clear();
         foreach (var meeting in meetings)
         {
             _meetings[meeting.Key] = meeting.Value;
         }
         OnMeetingsUpdated(this, CurrentMeeting, NextMeeting);
     }, "TestGsMeetings", "Setup some test meetings", ConsoleAccessLevelEnum.AccessOperator);
 }
Esempio n. 8
0
        /// <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 = 80;

                //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.AddNewConsoleCommand(PrintReceivingOutputList, "PrintROutputList", "This will Print the Receiving Output List", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(PrintSendingOutputList, "PrintSOutputList", "This will Print the Sending Output List", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(UpdateOutputList, "UpdateOutputList", "This will Update the Output List", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(PrintRoomList, "PrintRoomList", "This will print the List", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(PrintRoomOutputs, "PrintRoomOutputs", "This will print the Outputs", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(PrintReceivingInputs, "PrintReceivingInputs", "This will print the Outputs", ConsoleAccessLevelEnum.AccessOperator);
                CrestronConsole.AddNewConsoleCommand(PrintRoomStatus, "PrintRoomStatus", "Prints the rooms status", ConsoleAccessLevelEnum.AccessOperator);
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in the constructor: {0}", e.Message);
            }
        }
Esempio n. 9
0
        private FileControls mFC; //Accessing the new class we made
        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.AddNewConsoleCommand(StringToUpper, "toUpper", "converts string to upper case", ConsoleAccessLevelEnum.AccessOperator);
                #region Keypad Static
                //Define Keypad Statically
                if (this.SupportsCresnet)
                {
                    myKeypad = new C2nCbdP(0x25, this);
                    myKeypad.ButtonStateChange += new ButtonEventHandler(myKeypad_ButtonStateChange);
                    if (myKeypad.Register() != eDeviceRegistrationUnRegistrationResponse.Success)
                    {
                        ErrorLog.Error("Error Registering Keypad: {0}", myKeypad.RegistrationFailureReason);
                    }
                }
                #endregion

                mFC = new FileControls(); // Instanciate the Class for File Reading
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in the constructor: {0}", e.Message);
            }
        }
Esempio n. 10
0
        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);

                // Console Commands
                CrestronConsole.AddNewConsoleCommand(SendToDataStore, "setField", "Stores String to DS",
                                                     ConsoleAccessLevelEnum.AccessAdministrator);
                CrestronConsole.AddNewConsoleCommand(RetrieveFromDataStore, "getField", "Gets String from DS",
                                                     ConsoleAccessLevelEnum.AccessAdministrator);
                CrestronConsole.AddNewConsoleCommand(SetupDataStore, "setDataStore", "Gets in Setup",
                                                     ConsoleAccessLevelEnum.AccessAdministrator);
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in the constructor: {0}", e.Message);
            }
        }
Esempio n. 11
0
        /// <summary>
        /// Git 'er goin'
        /// </summary>
        public override void InitializeSystem()
        {
            CrestronConsole.AddNewConsoleCommand(s =>
            {
                foreach (var tl in TieLineCollection.Default)
                {
                    CrestronConsole.ConsoleCommandResponse("  {0}\r", tl);
                }
            },
                                                 "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);

            CrestronConsole.AddNewConsoleCommand(s =>
            {
                CrestronConsole.ConsoleCommandResponse
                    ("Current running configuration. This is the merged system and template configuration");
                CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
                                                           (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
            }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);

            CrestronConsole.AddNewConsoleCommand(s =>
            {
                CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
                                                       "System URL:   {0}\r" +
                                                       "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
            }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);

            GoWithLoad();
        }
        private void Start()
        {
            _VGAInput.Analog_Audio_Gain_Changed += (value) => { CrestronConsole.PrintLine("{2} Analog Audio Gain Value: {0}, {1}", (double)value / 10, (double)_VGAInput.Analog_Audio_Gain_fb / 10, _VGAInput.VgaInputPort); };
            _VGAInput.Aspect_Ratio_Changed      += (state) => { CrestronConsole.PrintLine("{2} Aspcet Ratio State: {0}, {1}", state, _VGAInput.Aspect_Ratio_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Auto_Calibrate_Changed    += (state) => { CrestronConsole.PrintLine("{2} Auto Calibrate State: {0}, {1}", state, _VGAInput.Auto_Calibrate_fb.ToString(), _VGAInput.VgaInputPort); };
            _VGAInput.Blue_Changed                  += (value) => { CrestronConsole.PrintLine("{2} Blue Gain Value: {0}, {1}", value, _VGAInput.Blue_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Brightness_Changed            += (value) => { CrestronConsole.PrintLine("{2} Brightness Gain Value: {0}, {1}", value, _VGAInput.Brightness_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Contrast_Changed              += (value) => { CrestronConsole.PrintLine("{2} Contrast Gain Value: {0}, {1}", value, _VGAInput.Contrast_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Green_Changed                 += (value) => { CrestronConsole.PrintLine("{2} Green Gain Value: {0}, {1}", value, _VGAInput.Green_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Horizontal_Resolution_Changed += (value) => { CrestronConsole.PrintLine("{2} Horizontal Resolution Value: {0}, {1}", value, _VGAInput.Horizontal_Resolution_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Hue_Changed                   += (value) => { CrestronConsole.PrintLine("{2} Hue Gain Value: {0}, {1}", value, _VGAInput.Hue_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Red_Changed                   += (value) => { CrestronConsole.PrintLine("{2} Red Gain Value: {0}, {1}", value, _VGAInput.Red_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Refresh_Rate_Changed          += (value) => { CrestronConsole.PrintLine("{2} Refresh Rate Value: {0}, {1}", value, _VGAInput.Refresh_Rate_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Saturation_Changed            += (value) => { CrestronConsole.PrintLine("{2} Saturation Gain Value: {0}, {1}", value, _VGAInput.Saturation_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Sync_Detected_Changed         += (state) => { CrestronConsole.PrintLine("{2} Sync Detected State: {0}, {1}", state, _VGAInput.Sync_Detected_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Type_Control_Changed          += (type) => { CrestronConsole.PrintLine("{2} Audo Source Detected Type: {0}, {1}", type.ToString(), _VGAInput.Type_Control_fb.ToString(), _VGAInput.VgaInputPort); };
            _VGAInput.Vertical_Resolution_Changed   += (value) => { CrestronConsole.PrintLine("{2} Vertical Resolution Value: {0}, {1}", value, _VGAInput.Vertical_Resolution_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Video_Source_Detected_Changed += (state) => { CrestronConsole.PrintLine("{2} Video Source Detected State: {0}, {1}", state, _VGAInput.Video_Source_Detected_fb, _VGAInput.VgaInputPort); };
            _VGAInput.X_Position_Changed            += (value) => { CrestronConsole.PrintLine("{2} X_Position Gain Value: {0}, {1}", value, _VGAInput.X_Position_fb, _VGAInput.VgaInputPort); };
            _VGAInput.Y_Position_Changed            += (value) => { CrestronConsole.PrintLine("{2} Y_Position Gain Value: {0}, {1}", value, _VGAInput.Y_Position_fb, _VGAInput.VgaInputPort); };


            CrestronConsole.AddNewConsoleCommand(AutoCalibrate, "TAutoCalibrate" + _VGAInput.VgaInputPort, "Sets/Resets HDCP Support for " + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Brightness, "TBrightness" + _VGAInput.VgaInputPort, "Changes Brightness Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Contrast, "TContrast" + _VGAInput.VgaInputPort, "Changes Contrast Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Saturation, "TSaturation" + _VGAInput.VgaInputPort, "Changes Saturation Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Hue, "THue" + _VGAInput.VgaInputPort, "Changes Hue Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Red, "TRed" + _VGAInput.VgaInputPort, "Changes Red Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Green, "TGreen" + _VGAInput.VgaInputPort, "Changes Green Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(Blue, "TBlue" + _VGAInput.VgaInputPort, "Changes Blue Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(TypeControl, "TTypeControl" + _VGAInput.VgaInputPort, "Changes TypeControl for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(AudioGain, "TAudioGain" + _VGAInput.VgaInputPort, "Changes Audio Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(XPosition, "TXPosition" + _VGAInput.VgaInputPort, "Changes XPosition Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(YPosition, "TYPosition" + _VGAInput.VgaInputPort, "Changes YPosition Gain for" + _VGAInput.VgaInputPort, ConsoleAccessLevelEnum.AccessOperator);
        }
        /// <summary>
        /// CCDDisplay Plugin device constructor for ISerialComport transport
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="config"></param>
        /// <param name="display">Loaded and initialized instance of CCD Display driver instance</param>
        public ClearOneDSPDevice(string key, string name, ClearOneDSPConfig config, IBasicCommunication comm)
            : base(key, name)
        {
            Debug.Console(0, this, "Constructing new {0} instance", name);

            _config                 = config;
            _commandQueue           = new CrestronQueue(100);
            _responseQueue          = new CrestronQueue <string>();
            _responseParseThread    = new Thread(parseResponse, null, Thread.eThreadStartOptions.Running);
            _commandInProgressTimer = new CTimer((o) => { _commandInProgress = null; }, Timeout.Infinite);

            _devices = new Dictionary <string, ClearOneDSPDeviceInfo>();

            Communication             = comm;
            _portGather               = new CommunicationGather(Communication, "\x0D\x0A");
            _portGather.LineReceived += this.lineReceived;

            if (config.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, config.CommunicationMonitorProperties);
            }
            else
            {
                //#warning Need to deal with this poll string
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 30000, 60000, new Action(() =>
                {
                    if (_devices.Count == 0)
                    {
                        _commandQueue.Enqueue("** VER");
                    }
                    //sendLine("** VER");

                    foreach (var controlPoint in LevelControlPoints.Values)
                    {
                        controlPoint.Poll();
                    }
                }));
            }

            LevelControlPoints = new Dictionary <string, ClearOneDSPVolumeControl>();
            foreach (KeyValuePair <string, ClearOneLevelControlBlockConfig> kvp in _config.LevelControlBlocks)
            {
                this.LevelControlPoints.Add(kvp.Key, new ClearOneDSPVolumeControl(kvp.Key, kvp.Value, this));
            }

            CrestronConsole.AddNewConsoleCommand((s) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("Devices:");
                foreach (var kvp in _devices)
                {
                    sb.AppendFormat("\tDevice: {0}\r\n", kvp.Key);
                    sb.AppendFormat("\t\tModel:     {0}\r\n", kvp.Value.DeviceType.ToString());
                    sb.AppendFormat("\t\tId:        {0}\r\n", kvp.Value.DeviceId);
                    sb.AppendFormat("\t\tFirmware:  {0}\r\n", kvp.Value.Version);
                }
                CrestronConsole.ConsoleCommandResponse("{0}", sb.ToString());
            },
                                                 Key + "INFO", "Print Driver Info", ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 14
0
        public override bool CustomActivate()
        {
            /*
             * Communication.Connect();
             * CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
             * CommunicationMonitor.Start();
             */

            OnlineFeedback       = new BoolFeedback(() => { return(OnlineStatus); });
            CircuitStatus        = new Dictionary <uint, DigitalLoggerCircuit>();
            CircuitNameFeedbacks = new Dictionary <uint, StringFeedback>();
            CircuitIsCritical    = new Dictionary <uint, BoolFeedback>();
            CircuitState         = new Dictionary <uint, BoolFeedback>();
            for (uint i = 0; i < CircuitCount; i++)
            {
                uint circuit = i;
                CircuitStatus[circuit]        = new DigitalLoggerCircuit();
                CircuitNameFeedbacks[circuit] = new StringFeedback(() => {
                    if (CircuitStatus[circuit].name != null)
                    {
                        return(CircuitStatus[circuit].name);
                    }
                    else
                    {
                        return("");
                    }
                });
                CircuitIsCritical[circuit] = new BoolFeedback(() =>
                {
                    if (CircuitStatus.ContainsKey(circuit))
                    {
                        return(CircuitStatus[circuit].critical);
                    }
                    else
                    {
                        return(false);
                    }
                });
                CircuitState[circuit] = new BoolFeedback(() =>
                {
                    if (CircuitStatus.ContainsKey(circuit))
                    {
                        return(CircuitStatus[circuit].state);
                    }
                    else
                    {
                        return(false);
                    }
                });
                PollCircuit(circuit);
            }

            CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator);



            return(true);
        }
        static public void Start(Relays2Card Relays2Card)
        {
            _Relays2Card = Relays2Card;
            _Relays2Card.A1_F_Changed += value => CrestronConsole.PrintLine("Relay 1 Changed  :{0}, {1}", value, _Relays2Card.A1_F);
            _Relays2Card.A2_F_Changed += value => CrestronConsole.PrintLine("Relay 2 Changed  :{0}, {1}", value, _Relays2Card.A2_F);

            CrestronConsole.AddNewConsoleCommand(SetRelay, "TSetRelay", "Changes Relay # ON|OFF", ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 16
0
 public ControlSystem()
     : base()
 {
     Thread.MaxNumberOfUserThreads = 20;
     CrestronConsole.AddNewConsoleCommand(TestEventCmd, "testevent", "testevent", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(TestCSCmd, "TestCS", "TestCS", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(TestCMCmd, "TestCM", "TestCM", ConsoleAccessLevelEnum.AccessOperator);
 }
Esempio n. 17
0
        /// <summary>
        /// Device Constructor.  Called by BuildDevice
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="config"></param>
        public MockOccupancyDetectorDevice(string key, string name, MockOccupancyDetectorPropertiesConfig config)
            : base(key, name)
        {
            RoomIsOccupiedFeedback = new BoolFeedback(() => IsOccupied);

            CrestronConsole.AddNewConsoleCommand((s) => SetOccupiedStatus(s), "setoccupiedstate",
                                                 "Sets the state of the mock occupancy detector [true/false]", ConsoleAccessLevelEnum.AccessOperator);
        }
 public SecureClient()
 {
     CrestronConsole.AddNewConsoleCommand(this.Connect, "connect", "usage: connect [<cert_file> <key_file>] <hostname> <port>", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(this.SendMessage, "send", "send <msg>", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(this.Disconnect, "disconnect", "disconnect from server if currently connected", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(this.ShowStatus, "showstatus", "show the client socket's current status", ConsoleAccessLevelEnum.AccessOperator);
     client = null;
 }
Esempio n. 19
0
 /// <summary>
 /// Sets up the backing class. Adds console commands for S#Pro programs
 /// </summary>
 static CommStatic()
 {
     if (CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SimplSharpPro)
     {
         CrestronConsole.AddNewConsoleCommand(SocketCommand, "socket", "socket commands: list, send, connect, disco",
                                              ConsoleAccessLevelEnum.AccessOperator);
     }
 }
Esempio n. 20
0
        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.AddNewConsoleCommand(StringToUpper, "toUpper", "converts string to upper case", ConsoleAccessLevelEnum.AccessOperator);
                #region Keypad Static
                //Define Keypad Statically
                //if (this.SupportsCresnet)
                //{
                //    myKeypad = new C2nCbdP(0x25, this);
                //    myKeypad.ButtonStateChange += new ButtonEventHandler(myKeypad_ButtonStateChange);
                //    if (myKeypad.Register() != eDeviceRegistrationUnRegistrationResponse.Success)
                //        ErrorLog.Error("Error Registering Keypad: {0}", myKeypad.RegistrationFailureReason);
                //}
                #endregion
                #region KeypadWithQuery
                //Define Keypad with Device Query
                if (this.SupportsCresnet)
                {
                    var QueryResponse = CrestronCresnetHelper.Query();
                    if (QueryResponse == CrestronCresnetHelper.eCresnetDiscoveryReturnValues.Success)
                    {
                        foreach (CrestronCresnetHelper.DiscoveredDeviceElement Item in CrestronCresnetHelper.DiscoveredElementsList)
                        {
                            if (Item.DeviceModel.ToUpper().Contains("C2N-CBD"))
                            {
                                if (myKeypad == null)
                                {
                                    myKeypad = new C2nCbdP(Item.CresnetId, this);
                                    myKeypad.ButtonStateChange += new ButtonEventHandler(myKeypad_ButtonStateChange);
                                    if (myKeypad.Register() != eDeviceRegistrationUnRegistrationResponse.Success)
                                    {
                                        ErrorLog.Error("Error Registering Keypad: {0}", myKeypad.RegistrationFailureReason);
                                        myKeypad = null;
                                    }
                                }
                            }
                        }
                    }
                }
                #endregion
                mFC = new FileControl();
                // Instanciate the Class for File Reading
                CrestronConsole.PrintLine("DefaultConstructor Complete");
            }
            catch (Exception e)
            {
                ErrorLog.Error("Error in the constructor: {0}", e.Message);
            }
        }
Esempio n. 21
0
        /// <summary>
        /// Create an instance of a server controlled video distribution system
        /// </summary>
        /// <param name="address">The IP Address or Hostname to connect using telnet</param>
        public ZeeVeeServer(string address)
        {
            _socket = new ZeeVeeServerSocket(address, 23);
            _socket.ReceivedData += SocketOnReceivedData;
            Devices = new ZeeVeeDeviceCollection(this);

            CrestronConsole.AddNewConsoleCommand(ConsoleRoute, "ZVRoute", "Route an encoder to a decoder",
                                                 ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 22
0
        /// <summary>
        /// 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()
        {
            Debug.Console(0, this, "Final activation. Setting up actions and feedbacks");
            SetupFunctions();
            SetupFeedbacks();

            var atcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);

            AtcMessenger = new Ddvc01AtcMessenger(atcKey, EISC, "/device/audioCodec");
            AtcMessenger.RegisterWithAppServer(Parent);

            var vtcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key);

            VtcMessenger = new Ddvc01VtcMessenger(vtcKey, EISC, "/device/videoCodec");
            VtcMessenger.RegisterWithAppServer(Parent);

            EISC.SigChange          += EISC_SigChange;
            EISC.OnlineStatusChange += (o, a) =>
            {
                Debug.Console(1, this, "DDVC EISC online={0}. Config is ready={1}", a.DeviceOnLine, EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue);
                if (a.DeviceOnLine && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue)
                {
                    LoadConfigValues();
                }
            };
            // load config if it's already there
            if (EISC.IsOnline && EISC.BooleanOutput[BoolJoin.ConfigIsReady].BoolValue)             // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
            {
                LoadConfigValues();
            }


            CrestronConsole.AddNewConsoleCommand(s =>
            {
                for (uint i = 1; i < 1000; i++)
                {
                    if (s.ToLower().Equals("b"))
                    {
                        CrestronConsole.ConsoleCommandResponse("D{0,6} {1} - ", i, EISC.BooleanOutput[i].BoolValue);
                    }
                    else if (s.ToLower().Equals("u"))
                    {
                        CrestronConsole.ConsoleCommandResponse("U{0,6} {1,8} - ", i, EISC.UShortOutput[i].UShortValue);
                    }
                    else if (s.ToLower().Equals("s"))
                    {
                        var val = EISC.StringOutput[i].StringValue;
                        if (!string.IsNullOrEmpty(val))
                        {
                            CrestronConsole.ConsoleCommandResponse("S{0,6} {1}\r", i, EISC.StringOutput[i].StringValue);
                        }
                    }
                }
            }, "mobilebridgedump", "Dumps DDVC01 bridge EISC data b,u,s", ConsoleAccessLevelEnum.AccessOperator);

            return(base.CustomActivate());
        }
Esempio n. 23
0
        public LightwareMatrix(string ipAddress)
        {
            _socket = new LightwareSocket(ipAddress);
            _socket.StatusChanged += SocketOnStatusChanged;
            _socket.ReceivedData  += SocketOnReceivedData;

            CrestronConsole.AddNewConsoleCommand(Send, "LwSend",
                                                 "Send a command to the lightware matrix", ConsoleAccessLevelEnum.AccessOperator);
        }
Esempio n. 24
0
        public override bool CustomActivate()
        {
            Communication.Connect();
            CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
            CommunicationMonitor.Start();

            CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
            return(true);
        }
Esempio n. 25
0
        public override void InitializeSystem()
        {
            try
            {
                Charger                       = new Chg4N();
                Charger.Errors               += new EventHandler <SscErrorEventArgs>(Errors);
                Charger.BaysHandler.Events   += new EventHandler <Chg4NBaysEventArgs>(ChargerBaysHandler_Events);
                Charger.DeviceHandler.Events += new EventHandler <Chg4NDeviceEventArgs>(ChargerDeviceHandler_Events);
                //Charger.Debug = true;

                Receiver         = new Sldw();
                Receiver.Errors += new EventHandler <SscErrorEventArgs>(Errors);
                Receiver.DeviceHandler.Events += new EventHandler <SldwDeviceEventArgs>(ReceiverDeviceHandler_Events);
                Receiver.RxHandler.Events     += new EventHandler <SldwRxEventArgs>(ReceiverRxHandler_Events);
                Receiver.TxHandler.Events     += new EventHandler <SldwTxEventArgs>(ReceiverTxHandler_Events);
                Receiver.AudioHandler.Events  += new EventHandler <SldwAudioEventArgs>(ReceiverAudioHandler_Events);
                Receiver.RxHandler.EnableRfQualityFeedback();
                //Receiver.Debug = true;

                Tcc         = new Tcc2();
                Tcc.Errors += new EventHandler <SscErrorEventArgs>(Errors);
                Tcc.DeviceHandler.Events += new EventHandler <Tcc2DeviceEventArgs>(TccDeviceHandler_Events);
                Tcc.MeterHandler.Events  += new EventHandler <Tcc2MeterEventArgs>(TccMeterHandler_Events);
                Tcc.AudioHandler.Events  += new EventHandler <Tcc2AudioEventArgs>(TccAudioHandler_Events);
                Tcc.MeterHandler.EnableAzimuthFeedback();
                Tcc.MeterHandler.EnableElevationFeedback();
                Tcc.MeterHandler.EnableInputPeakLevelFeedback();

                _xpanel = new Xpanel(0x03);

                Charger.Connect("192.168.10.135");
                Receiver.Connect("192.168.10.136");
                Tcc.Connect("192.168.10.133");

                CrestronConsole.AddNewConsoleCommand(cmd =>
                {
                    if (cmd.ToLower() == "on")
                    {
                        Charger.Debug  = true;
                        Receiver.Debug = true;
                        Tcc.Debug      = true;
                    }
                    else if (cmd.ToLower() == "off")
                    {
                        Charger.Debug  = false;
                        Receiver.Debug = false;
                        Tcc.Debug      = false;
                    }
                }, "sennheiserdebug", "usage: sennheiserdebug <on/off>", ConsoleAccessLevelEnum.AccessOperator);
            }
            catch (Exception ex)
            {
                ErrorLog.Exception("Exception in InitializeSystem: {0}", ex);
            }
        }
Esempio n. 26
0
 static public void AddCustomConsoleCommands()
 {
     CrestronConsole.AddNewConsoleCommand(UpPress, "UpPress", "Presses the UP Button", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(UpRelease, "UpRelease", "Releases the UP Button", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(DnPress, "DnPress", "Presses the DN Button", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(DnRelease, "DnRelease", "Releases the DN Button", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(PrintCN, "PrintCN", "Prints Cresnet Devices", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(PrintIRDeviceFunctions, "PrintIR", "Prints IR Device Functions", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(SwampPZ, "SwampPZ", "Prints Zones for Swamp", ConsoleAccessLevelEnum.AccessOperator);
     CrestronConsole.AddNewConsoleCommand(SwampCZS, "SwampCZS", "Changes source for Swamp Zone", ConsoleAccessLevelEnum.AccessOperator);
 }
Esempio n. 27
0
        /// <summary>
        /// The default Constructor.
        /// </summary>
        internal CallHistory(CiscoTelePresenceCodec codec)
        {
            _codec = codec;

#if DEBUG
            CrestronConsole.AddNewConsoleCommand(parameters => Get(Filter.All, 0, 50),
                                                 "CHTest", "Test Call History", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(parameters => GetLastDialed(),
                                                 "CHTestLast", "Test Call History", ConsoleAccessLevelEnum.AccessOperator);
#endif
        }
Esempio n. 28
0
 /// <summary>
 /// InitializeSystem - this method gets called after the constructor
 /// has finished.
 ///
 /// Use InitializeSystem to:
 /// * Start threads
 /// * Configure ports, such as serial and verisports
 /// * Start and initialize socket connections
 /// Send initial device configurations
 ///
 /// Please be aware that InitializeSystem needs to exit quickly also;
 /// if it doesn't exit in time, the SIMPL#Pro program will exit.
 /// </summary>
 public override void InitializeSystem()
 {
     try
     {
         CrestronConsole.AddNewConsoleCommand(SendToCardframeComport, "SendToCardframeComport", "Send a string to a comport on a connected cardframe.", ConsoleAccessLevelEnum.AccessOperator);
     }
     catch (Exception e)
     {
         ErrorLog.Error("Error in InitializeSystem: {0}", e.Message);
     }
 }
Esempio n. 29
0
        /// <summary>
        /// Attempts to add the command to the console.
        /// <para>This must be done in the Control System Constructor.</para>
        /// </summary>
        /// <returns>True if it succeeds, false if it fails for any reason.</returns>
        public bool AddToConsole()
        {
            ConsoleAccessLevelEnum level = (ConsoleAccessLevelEnum)CommandAccess;

            if (CrestronConsole.AddNewConsoleCommand(ExecuteCommand, Name, Help, level))
            {
                return(Manager.RegisterCrestronConsoleCommand(this));
            }

            return(false);
        }
Esempio n. 30
0
        void StartIRTest()
        {
            string AcerIRFileName = string.Format("{0}\\IRFiles\\ACER WIL-8458MA.ir", Directory.GetApplicationDirectory());

            AcerIRFileId = LoadIRDiver(AcerIRFileName);
            string AdcomIRFileName = string.Format("{0}\\IRFiles\\adcom_gdd_1.ir", Directory.GetApplicationDirectory());

            AdcomIRFileId = LoadIRDiver(AdcomIRFileName);

            CrestronConsole.AddNewConsoleCommand(SendAcerCommand, "TSendAcerIRDMTX", "Sends Acer Left Click Command ", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(SendAdcomCommand, "TSendAdcomIRDMTX", "Sends Acer Left Click Command ", ConsoleAccessLevelEnum.AccessOperator);
        }