Пример #1
0
        void Init()
        {
            PortGather = new CommunicationGather(Communication, '\x0d');
            PortGather.LineReceived += this.Port_LineReceived;
            CommunicationMonitor     = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "\x02QPW\x03");         // Query Power

            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this));

            InputPorts.Add(new RoutingInputPort(RoutingPortNames.DviIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Dvi, new Action(InputDvi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Composite, new Action(InputVideo1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Vga, new Action(InputVga), this));


            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevel); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);

            //    new BoolCueActionPair(CommonBoolCue.Menu, b => { if(b) Send(MenuIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Up, b => { if(b) Send(UpIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Down, b => { if(b) Send(DownIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Left, b => { if(b) Send(LeftIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Right, b => { if(b) Send(RightIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Select, b => { if(b) Send(SelectIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Exit, b => { if(b) Send(ExitIrCmd); }),
            //};
        }
Пример #2
0
        public TVOneCorio(string key, string name, IBasicCommunication comm, TVOneCorioPropertiesConfig props) :
            base(key, name)
        {
            this.userName = props.userName;
            this.password = props.password;
            CommandQueue  = new CrestronQueue(100);


            Communication = comm;

            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
                // This instance uses RS-232 control
            }
            PortGather = new CommunicationGather(Communication, "\x0a");
            PortGather.LineReceived += this.Port_LineReceived;
            if (props.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
            }
            else
            {
                //#warning Need to deal with this poll string
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000, "System.Status\x0A\x0D");
            }
        }
Пример #3
0
        /// <summary>
        /// Intial logic to set up instance
        /// </summary>
        void Init()
        {
            // Will gather to the specified delimiter
            PortGather = new CommunicationGather(Communication, '\x03');
            PortGather.LineReceived += this.Port_LineReceived;

            // Constuct the CommunicationMonitor
            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "\x02QPW\x03\x02QMI\x03"); // Query Power

            // Define the input ports
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.DviIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Dvi, new Action(InputDvi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Vga, new Action(InputVga), this));

            // Define the feedback Funcs
            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevel); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);
            InputNumberFeedback = new IntFeedback(() => { Debug.Console(2, this, "CHange Input number {0}", InputNumber); return(InputNumber); });

            // Set the warmup time
            WarmupTime = 17000;
        }
Пример #4
0
        public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
            base(key, name)
        {
            // Default to all capabilties
            Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;

            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
                // This instance uses RS-232 control
            }
            PortGather = new CommunicationGather(Communication, "\xFF");


            Communication.BytesReceived += new EventHandler <GenericCommMethodReceiveBytesArgs>(Communication_BytesReceived);
            PowerIsOnFeedback            = new BoolFeedback(() => { return(PowerIsOn); });

            if (props.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
            }
            else
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "\x81\x09\x04\x00\xFF");
            }
            DeviceManager.AddDevice(CommunicationMonitor);
        }
Пример #5
0
        public QscDsp(string key, string name, IBasicCommunication comm, QscDspPropertiesConfig props) :
            base(key, name)
        {
            CommandQueue = new CrestronQueue(100);

            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
                // This instance uses RS-232 control
            }
            PortGather = new CommunicationGather(Communication, "\x0a");
            PortGather.LineReceived += this.Port_LineReceived;

            LevelControlPoints = new Dictionary <string, QscDspLevelControl>();
            Dialers            = new Dictionary <string, QscDspDialer>();

            if (props.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
            }
            else
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "cgp 1\x0D\x0A");
            }


            foreach (KeyValuePair <string, QscDspLevelControlBlockConfig> block in props.LevelControlBlocks)
            {
                this.LevelControlPoints.Add(block.Key, new QscDspLevelControl(block.Key, block.Value, this));
                Debug.Console(2, this, "Added LevelControlPoint {0}", block.Key);
            }
            foreach (KeyValuePair <string, QscDspPresets> preset in props.presets)
            {
                this.addPreset(preset.Value);
                Debug.Console(2, this, "Added Preset {0} {1}", preset.Value.label, preset.Value.preset);
            }
            foreach (KeyValuePair <string, QscDialerConfig> dialerConfig in props.dialerControlBlocks)
            {
                Debug.Console(2, this, "Added Dialer {0}\n {1}", dialerConfig.Key, dialerConfig.Value);
                this.Dialers.Add(dialerConfig.Key, new QscDspDialer(dialerConfig.Value, this));
            }
        }
Пример #6
0
        public etc(string key, string name, IBasicCommunication comm, DeviceConfig dc)
            : base(key, name)
        {
            _Dc = dc;


            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }

            var config = JsonConvert.DeserializeObject <EtcConfigObject>(dc.Properties.ToString());


            PortGather = new CommunicationGather(Communication, "\x0D");
            PortGather.LineReceived += this.Port_LineReceived;

            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "?ETHERNET, 0\x0D");
            CommunicationMonitor.Start();

            TestTxFeedback          = new StringFeedback(() => TestTx);
            CommandPassThruFeedback = new StringFeedback(() => DeviceRx);
            ActivePresetFeedback    = new StringFeedback(() => ActivePreset);

            CommandQueue = new CrestronQueue(100);
            cmdTimer     = new CommandTimer();


            Scenes = new Dictionary <string, EtcScene>();

            if (config.scenes != null)
            {
                Debug.Console(2, this, "Zone List Exists");
                foreach (KeyValuePair <string, EtcSceneConfig> scene in config.scenes)
                {
                    string itemkey = scene.Key;
                    var    value   = scene.Value;
                    Debug.Console(2, this, "Adding: Key: {0} Value Label: {1} Enabled: {2}", itemkey, value.sceneName, value.enabled);
                    EtcScene thisScene = new EtcScene(value, this);
                    Scenes.Add(itemkey, thisScene);
                }
            }

            Initialize();
        }
Пример #7
0
        void Init()
        {
            WarmupTime   = 10000;
            CooldownTime = 8000;

            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, StatusGet);
            DeviceManager.AddDevice(CommunicationMonitor);

            VolumeIncrementer = new ActionIncrementer(655, 0, 65535, 800, 80,
                                                      v => SetVolume((ushort)v),
                                                      () => _LastVolumeSent);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this), 0x21);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn1PC, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1PC), this), 0x22);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this), 0x23);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn2PC, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2PC), this), 0x24);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi3), this), 0x32);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.DisplayPortIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.DisplayPort, new Action(InputDisplayPort1), this), 0x25);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.DviIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Dvi, new Action(InputDvi1), this), 0x18);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Composite, new Action(InputVideo1), this), 0x08);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.RgbIn1, eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Vga, new Action(InputRgb1), this), 0x14);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.RgbIn2, eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Rgb, new Action(new Action(InputRgb2)), this), 0x1E);

            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevelForSig); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);

            StatusGet();
        }
        /// <summary>
        /// Plugin device constructor for devices that need IBasicCommunication
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="config"></param>
        /// <param name="comms"></param>
        public EssentialsPluginTemplateDevice(string key, string name, EssentialsPluginConfigObjectTemplate config, IBasicCommunication comms)
            : base(key, name)
        {
            Debug.Console(0, this, "Constructing new {0} instance", name);

            // TODO [ ] Update the constructor as needed for the plugin device being developed

            _config = config;

            ConnectFeedback = new BoolFeedback(() => Connect);
            OnlineFeedback  = new BoolFeedback(() => _commsMonitor.IsOnline);
            StatusFeedback  = new IntFeedback(() => (int)_commsMonitor.Status);

            _comms        = comms;
            _commsMonitor = new GenericCommunicationMonitor(this, _comms, _config.PollTimeMs, _config.WarningTimeoutMs, _config.ErrorTimeoutMs, Poll);

            var socket = _comms as ISocketStatus;

            if (socket != null)
            {
                // device comms is IP **ELSE** device comms is RS232
                socket.ConnectionChange += socket_ConnectionChange;
                Connect = true;
            }

            #region Communication data event handlers.  Comment out any that don't apply to the API type

            // Only one of the below handlers should be necessary.

            // _comms gather for any API that has a defined delimiter
            // TODO [ ] If not using an ASCII based API, remove the line below
            _commsGather = new CommunicationGather(_comms, CommsDelimiter);
            _commsGather.LineReceived += Handle_LineRecieved;

            // _comms byte buffer for HEX/byte based API's with no delimiter
            // TODO [ ] If not using an HEX/byte based API, remove the line below
            _comms.BytesReceived += Handle_BytesReceived;

            // _comms byte buffer for HEX/byte based API's with no delimiter
            // TODO [ ] If not using an HEX/byte based API, remove the line below
            _comms.TextReceived += Handle_TextReceived;

            #endregion
        }
Пример #9
0
        void Init()
        {
            WarmupTime   = 10000;
            CooldownTime = 8000;

            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, StatusGet);
            DeviceManager.AddDevice(CommunicationMonitor);

            VolumeIncrementer = new ActionIncrementer(655, 0, 65535, 800, 80,
                                                      v => SetVolume((ushort)v),
                                                      () => _LastVolumeSent);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this), InputHdmi1Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this), InputHdmi2Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi3), this), InputHdmi3Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn4, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi4), this), InputHdmi4Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.HdmiIn5, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Hdmi, new Action(InputHdmi5), this), InputHdmi5Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.DisplayPortIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.DisplayPort, new Action(InputDisplayPort1), this), InputDisplayPort1Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Dvi, new Action(InputVga1), this), InputVga1Value);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.IpcOps, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Composite, new Action(InputIpcOps), this), InputIpcOpsValue);

            AddRoutingInputPort(new RoutingInputPort(RoutingPortNames.MediaPlayer, eRoutingSignalType.Video,
                                                     eRoutingPortConnectionType.Vga, new Action(InputMediaPlayer), this), InputMediaPlayerValue);

            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevelForSig); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);
        }
Пример #10
0
        public etc(string key, string name, IBasicCommunication comm, DeviceConfig dc)
            : base(key, name)
        {
            Debug.Console(2, this, "Constructor - etc");
            _Dc = dc;


            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }

            PortGather = new CommunicationGather(Communication, "\x0D\x0A");
            PortGather.LineReceived += this.Port_LineReceived;
            CommunicationMonitor     = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "?ETHERNET, 0\x0D");
            CommunicationMonitor.Start();

            Initialize(_Dc);
        }
Пример #11
0
        public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm, BiampTesiraFortePropertiesConfig props) :
            base(key, name)
        {
            CommandQueue = new CrestronQueue(100);

            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control

                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
                // This instance uses RS-232 control
            }
            PortGather = new CommunicationGather(Communication, "\x0d\x0a");
            PortGather.LineReceived += this.Port_LineReceived;
            if (props.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
            }
            else
            {
//#warning Need to deal with this poll string
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000, "SESSION get aliases\x0d\x0a");
            }

            LevelControlPoints = new Dictionary <string, TesiraForteLevelControl>();

            foreach (KeyValuePair <string, BiampTesiraForteLevelControlBlockConfig> block in props.LevelControlBlocks)
            {
                this.LevelControlPoints.Add(block.Key, new TesiraForteLevelControl(block.Key, block.Value, this));
            }
        }
Пример #12
0
        /// <summary>
        /// Consturctor for base Tesira DSP Device
        /// </summary>
        /// <param name="key">Tesira DSP Device Key</param>
        /// <param name="name">Tesira DSP Device Friendly Name</param>
        /// <param name="comm">Device Communication Object</param>
        /// <param name="dc">Full device configuration object</param>
        public TesiraDsp(string key, string name, IBasicCommunication comm, DeviceConfig dc)
            : base(key, name)
        {
            _dc = dc;

            Debug.Console(0, this, "Made it to device constructor");

            _commandQueue = new CrestronQueue(100);
            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
                _isSerialComm            = false;
            }
            else
            {
                // This instance uses RS-232 control
                _isSerialComm = true;
            }
            PortGather = new CommunicationGather(Communication, "\x0D\x0A");
            PortGather.LineReceived += Port_LineReceived;

            CommandPassthruFeedback = new StringFeedback(() => DeviceRx);

            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, () => SendLine("SESSION set verbose false"));

            // Custom monitoring, will check the heartbeat tracker count every 20s and reset. Heartbeat sbould be coming in every 20s if subscriptions are valid
            DeviceManager.AddDevice(CommunicationMonitor);

            ControlPointList = new List <ISubscribedComponent>();

            //Initialize Dictionaries
            Feedbacks        = new FeedbackCollection <Feedback>();
            Faders           = new Dictionary <string, TesiraDspFaderControl>();
            Presets          = new Dictionary <string, TesiraDspPresets>();
            Dialers          = new Dictionary <string, TesiraDspDialer>();
            Switchers        = new Dictionary <string, TesiraDspSwitcher>();
            States           = new Dictionary <string, TesiraDspStateControl>();
            Meters           = new Dictionary <string, TesiraDspMeter>();
            CrosspointStates = new Dictionary <string, TesiraDspCrosspointState>();
            RoomCombiners    = new Dictionary <string, TesiraDspRoomCombiner>();


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

            Feedbacks.Add(CommunicationMonitor.IsOnlineFeedback);
            Feedbacks.Add(CommandPassthruFeedback);

            //Start CommnicationMonitor in PostActivation phase
            AddPostActivationAction(() =>
            {
                Communication.Connect();
                if (_isSerialComm)
                {
                    CommunicationMonitor.Start();
                }
            });

            CreateDspObjects();
        }
Пример #13
0
        /// <summary>
        /// CameraVisca Plugin device constructor using IBasicCommunication
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="config"></param>
        /// <param name="comms"></param>
        public CameraVisca(string key, string name, CameraViscaConfig config, IBasicCommunication comm)
            : base(key, name)
        {
            Debug.Console(0, this, "Constructing new {0} instance", name);

            _config = config;
            Enabled = _config.Enabled;

            _visca = new ViscaProtocolProcessor(comm.SendBytes, new Action <byte, string, object[]>((l, f, o) =>
            {
                Debug.Console(l, this, f, o);
            }));

            _camera             = new ViscaCamera((ViscaCameraId)_config.Id, null, _visca);
            _camera.PollEnabled = Enabled;

            Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;
            ControlMode  = eCameraControlMode.Auto;

            ConnectFeedback       = new BoolFeedback(() => Connect);
            OnlineFeedback        = new BoolFeedback(() => _commsMonitor.IsOnline);
            StatusFeedback        = new IntFeedback(() => (int)_commsMonitor.Status);
            PowerIsOnFeedback     = new BoolFeedback(() => _camera.Power);
            CameraIsOffFeedback   = new BoolFeedback(() => !_camera.Power);
            CameraIsMutedFeedback = new BoolFeedback(() => _camera.Mute);

            _camera.PowerChanged += (o, e) => { PowerIsOnFeedback.FireUpdate(); CameraIsOffFeedback.FireUpdate(); };
            _camera.MuteChanged  += (o, e) => { CameraIsMutedFeedback.FireUpdate(); };

            _cameraPollCommands = new Dictionary <string, Action>()
            {
                { "AE", _camera.AEPoll },
                { "Aperture", _camera.AperturePoll },
                { "BackLight", _camera.BackLightPoll },
                { "BGain", _camera.BGainPoll },
                { "ExpComp", _camera.ExpCompPoll },
                { "FocusAuto", _camera.FocusAutoPoll },
                { "FocusPosition", _camera.FocusPositionPoll },
                { "Gain", _camera.GainPoll },
                { "Iris", _camera.IrisPoll },
                { "Mute", _camera.MutePoll },
                { "PTZPosition", _camera.PanTiltPositionPoll },
                { "Power", _camera.PowerPoll },
                { "RGain", _camera.RGainPoll },
                { "Shutter", _camera.ShutterPoll },
                { "Title", _camera.TitlePoll },
                { "WB", _camera.WBModePoll },
                { "WD", _camera.WideDynamicModePoll },
                { "ZoomPosition", _camera.ZoomPositionPoll },
            };

            _comms = comm;

            // TODO: For VISCA camera current library implementation only
            // serial is supported, so socket code is not needed
            var socket = _comms as ISocketStatus;

            if (socket != null)
            {
                socket.ConnectionChange += socket_ConnectionChange;
                if (Enabled)
                {
                    Connect = true;
                }
            }

            if (_config.CommunicationMonitorProperties != null)
            {
                if (!String.IsNullOrEmpty(_config.CommunicationMonitorProperties.PollString))
                {
                    foreach (var poll in _config.CommunicationMonitorProperties.PollString.Split(','))
                    {
                        if (_cameraPollCommands.ContainsKey(poll.Trim()))
                        {
                            _poll.Add(_cameraPollCommands[poll.Trim()]);
                        }
                    }
                }

                _commsMonitor = new GenericCommunicationMonitor(this, _comms,
                                                                _config.CommunicationMonitorProperties.PollInterval,
                                                                _config.CommunicationMonitorProperties.TimeToWarning,
                                                                _config.CommunicationMonitorProperties.TimeToError,
                                                                () => _poll.ForEach((pollAction) => pollAction())
                                                                );
            }
            else
            {
                // We do not have CommunicationMonitorProperties and therefore
                // no Poll string defined, using ALL poll functions
                _poll.AddRange(_cameraPollCommands.Values);
                _commsMonitor = new GenericCommunicationMonitor(this, _comms, 10000, 20000, 30000, () => _poll.ForEach((pollAction) => pollAction()));
            }

            _commsMonitor.Client.BytesReceived += (s, e) => _visca.ProcessIncomingData(e.Bytes);
            DeviceManager.AddDevice(CommunicationMonitor);

            // Handle Increase PTZ move speed
            #region PTZ Speed Increase

            // if FastSpeedHoldTimeMs defined in config, enable SpeedIncrease behaivor
            if (_config.FastSpeedHoldTimeMs > 0)
            {
                _ptzSpeedIncreaseBehaivor = true;

                if (_config.PanSpeedSlow > 0)
                {
                    _camera.PanSpeed = _config.PanSpeedSlow;
                }

                if (_config.TiltSpeedSlow > 0)
                {
                    _camera.TiltSpeed = _config.TiltSpeedSlow;
                }

                _ptzPanNormalSpeed  = _camera.PanSpeed;
                _ptzTiltNormalSpeed = _camera.TiltSpeed;

                _ptzSpeedIncreaseAction = ptzCommand =>
                {
                    // Kill Speed Increase Timer as we already in fast pace
                    ptzSpeedChangeTimerDispose();
                    // if Fast speeds not defined, use Max values
                    _camera.PanSpeed  = (_config.PanSpeedFast > 0) ? _config.PanSpeedFast : Visca.ViscaDefaults.PanSpeedLimits.High;
                    _camera.TiltSpeed = (_config.TiltSpeedFast > 0) ? _config.PanSpeedFast : Visca.ViscaDefaults.TiltSpeedLimits.High;
                    // we passed current ptz command to action, so we repeat it with increased speed
                    (ptzCommand as Action).Invoke();
                };
            }

            #endregion PTZ Speed Increase
        }