Ejemplo n.º 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); }),
            //};
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor for Tesira DSP Dialer
        /// </summary>
        /// <param name="key">Unique Key</param>
        /// <param name="config">Component Config</param>
        /// <param name="parent">Parent Device</param>
        public TesiraDspDialer(string key, TesiraDialerControlBlockConfig config, TesiraDsp parent)
            : base(key, config.DialerInstanceTag, config.ControlStatusInstanceTag, config.Index, config.CallAppearance, parent, config.BridgeIndex)
        {
            Key = string.Format("{0}--Dialer{1}", parent.Key, key);

            Feedbacks = new FeedbackCollection <Feedback>();

            DialStringFeedback     = new StringFeedback(Key + "-DialStringFeedback", () => DialString);
            OffHookFeedback        = new BoolFeedback(Key + "-OffHookFeedback", () => OffHookStatus);
            AutoAnswerFeedback     = new BoolFeedback(Key + "-AutoAnswerFeedback", () => AutoAnswerState);
            DoNotDisturbFeedback   = new BoolFeedback(Key + "-DoNotDisturbFeedback", () => DoNotDisturbState);
            CallerIdNumberFeedback = new StringFeedback(Key + "-CallerIDNumberFeedback", () => CallerIdNumber);
            CallerIdNameFeedback   = new StringFeedback(Key + "-CallerIDNameFeedback", () => CallerIdName);
            IncomingCallFeedback   = new BoolFeedback(Key + "-IncomingCallFeedback", () => IncomingCallState);
            CallStateFeedback      = new IntFeedback(Key + "-CallStateFeedback", () => (int)CallStatusEnum);
            LastDialedFeedback     = new StringFeedback(Key + "-LastDialedFeedback", () => LastDialed);
            NameFeedback           = new StringFeedback(Key + "-NameFeedback", () => Name);
            DisplayNumberFeedback  = new StringFeedback(Key + "-DisplayNumberFeedback", () => DisplayNumber);

            Feedbacks.Add(DialStringFeedback);
            Feedbacks.Add(OffHookFeedback);
            Feedbacks.Add(AutoAnswerFeedback);
            Feedbacks.Add(DoNotDisturbFeedback);
            Feedbacks.Add(CallerIdNumberFeedback);
            Feedbacks.Add(CallerIdNameFeedback);
            Feedbacks.Add(IncomingCallFeedback);
            Feedbacks.Add(CallStateFeedback);
            Feedbacks.Add(LastDialedFeedback);
            Feedbacks.Add(NameFeedback);
            Feedbacks.Add(DisplayNumberFeedback);

            parent.Feedbacks.AddRange(Feedbacks);

            Initialize(key, config);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue.
        /// </summary>
        public void Initialize(string key, QscDspLevelControlBlockConfig config)
        {
            Key     = string.Format("{0}--{1}", Parent.Key, key);
            Enabled = true;
            DeviceManager.AddDevice(this);
            if (config.IsMic)
            {
                Type = ePdtLevelTypes.microphone;
            }
            else
            {
                Type = ePdtLevelTypes.speaker;
            }

            Debug.Console(2, this, "Adding LevelControl '{0}'", Key);

            this.IsSubscribed = false;

            MuteFeedback = new BoolFeedback(() => _IsMuted);

            VolumeLevelFeedback = new IntFeedback(() => _VolumeLevel);

            VolumeUpRepeatTimer   = new CTimer(VolumeUpRepeat, Timeout.Infinite);
            VolumeDownRepeatTimer = new CTimer(VolumeDownRepeat, Timeout.Infinite);
            LevelCustomName       = config.Label;
            HasMute  = config.HasMute;
            HasLevel = config.HasLevel;
        }
Ejemplo n.º 4
0
        public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
        {
            _device = hardware as StatusSign;

            RedLedEnabledFeedback =
                new BoolFeedback(
                    () =>
                    _device.Leds[(uint)StatusSign.Led.eLedColor.Red]
                    .ControlFeedback.BoolValue);
            GreenLedEnabledFeedback =
                new BoolFeedback(
                    () =>
                    _device.Leds[(uint)StatusSign.Led.eLedColor.Green]
                    .ControlFeedback.BoolValue);
            BlueLedEnabledFeedback =
                new BoolFeedback(
                    () =>
                    _device.Leds[(uint)StatusSign.Led.eLedColor.Blue]
                    .ControlFeedback.BoolValue);

            RedLedBrightnessFeedback =
                new IntFeedback(() => (int)_device.Leds[(uint)StatusSign.Led.eLedColor.Red].BrightnessFeedback);
            GreenLedBrightnessFeedback =
                new IntFeedback(() => (int)_device.Leds[(uint)StatusSign.Led.eLedColor.Green].BrightnessFeedback);
            BlueLedBrightnessFeedback =
                new IntFeedback(() => (int)_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].BrightnessFeedback);

            if (_device != null)
            {
                _device.BaseEvent += _device_BaseEvent;
            }
        }
Ejemplo n.º 5
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;
        }
        public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
            : base(key, name, rmc)
        {
            _rmc = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
                                          eRoutingPortConnectionType.Hdmi, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            EdidManufacturerFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());

            InputPorts = new RoutingPortCollection <RoutingInputPort> {
                DmIn, HdmiIn
            };
            OutputPorts = new RoutingPortCollection <RoutingOutputPort> {
                HdmiOut
            };

            _rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
            _rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = _rmc.HdmiOutput;

            AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
        }
Ejemplo n.º 7
0
        /// <summary>
        ///  Make a Crestron RMC and put it in here
        /// </summary>
        public DmRmc4kScalerCDspController(string key, string name, DmRmc4kScalerCDsp rmc)
            : base(key, name, rmc)
        {
            Rmc  = rmc;
            DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                        eRoutingPortConnectionType.DmCat, 0, this);
            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);
            BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
                                                     eRoutingPortConnectionType.LineAudio, null, this);

            MuteFeedback        = new BoolFeedback(() => false);
            VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
                                                  rmc.AudioOutput.VolumeFeedback.UShortValue);

            EdidManufacturerFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
            EdidNameFeedback            = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
            EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
            EdidSerialNumberFeedback    = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);

            VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());

            Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
            Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;

            // Set Ports for CEC
            HdmiOut.Port = Rmc.HdmiOutput;
        }
        public SystemMonitorController(string key)
            : base(key)
        {
            Debug.Console(2, this, "Adding SystemMonitorController.");

            SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;

            //CrestronConsole.AddNewConsoleCommand(RefreshSystemMonitorData, "RefreshSystemMonitor", "Refreshes System Monitor Feedbacks", ConsoleAccessLevelEnum.AccessOperator);

            TimeZoneFeedback     = new IntFeedback(new Func <int>(() => SystemMonitor.TimeZoneInformation.TimeZoneNumber));
            TimeZoneTextFeedback = new StringFeedback(new Func <string>(() => SystemMonitor.TimeZoneInformation.TimeZoneName));

            IOControllerVersionFeedback = new StringFeedback(new Func <string>(() => SystemMonitor.VersionInformation.IOPVersion));
            SnmpVersionFeedback         = new StringFeedback(new Func <string>(() => SystemMonitor.VersionInformation.SNMPVersion));
            BACnetAppVersionFeedback    = new StringFeedback(new Func <string>(() => SystemMonitor.VersionInformation.BACNetVersion));
            ControllerVersionFeedback   = new StringFeedback(new Func <string>(() => SystemMonitor.VersionInformation.ControlSystemVersion));

            //var status = string.Format("System Monitor Status: \r TimeZone: {0}\rTimeZoneText: {1}\rIOControllerVersion: {2}\rSnmpAppVersionFeedback: {3}\rBACnetAppVersionFeedback: {4}\rControllerVersionFeedback: {5}",
            //    SystemMonitor.TimeZoneInformation.TimeZoneNumber, SystemMonitor.TimeZoneInformation.TimeZoneName, SystemMonitor.VersionInformation.IOPVersion, SystemMonitor.VersionInformation.SNMPVersion,
            //    SystemMonitor.VersionInformation.BACNetVersion, SystemMonitor.VersionInformation.ControlSystemVersion);

            //Debug.Console(1, this, status);

            ProgramStatusFeedbackCollection = new Dictionary <uint, ProgramStatusFeedbacks>();

            foreach (var prog in SystemMonitor.ProgramCollection)
            {
                var program = new ProgramStatusFeedbacks(prog);
                ProgramStatusFeedbackCollection.Add(prog.Number, program);
            }

            SystemMonitor.ProgramChange += new ProgramStateChangeEventHandler(SystemMonitor_ProgramChange);
            SystemMonitor.TimeZoneInformation.TimeZoneChange += new TimeZoneChangeEventHandler(TimeZoneInformation_TimeZoneChange);
        }
Ejemplo n.º 9
0
        public TesiraDspMeter(string key, TesiraMeterBlockConfig config, TesiraDsp parent)
            : base(config.MeterInstanceTag, string.Empty, config.Index, 0, parent, string.Format(KeyFormatter, parent.Key, key), config.Label, config.BridgeIndex)
        {
            DeviceManager.AddDevice(this);

            Label   = config.Label;
            Enabled = config.Enabled;

            MeterFeedback      = new IntFeedback(Key + "-MeterFeedback", () => _currentMeter);
            SubscribedFeedback = new BoolFeedback(Key + "-SubscribedFeedback", () => IsSubscribed);

            Feedbacks.Add(MeterFeedback);
            Feedbacks.Add(SubscribedFeedback);
            Feedbacks.Add(NameFeedback);

            parent.Feedbacks.AddRange(Feedbacks);

            if (config.MeterData != null)
            {
                var data = config.MeterData;
                _meterMinimum    = data.MeterMimimum;
                _meterMaximum    = data.MeterMaxiumum;
                _defaultPollTime = data.DefaultPollTime;
            }
            else
            {
                _meterMinimum    = MeterMinimumDefault;
                _meterMaximum    = MeterMaximumDefault;
                _defaultPollTime = DefaultPollTimeDefault;
            }

            /*CrestronConsole.AddNewConsoleCommand(s => Subscribe(), "enablemeters", "", ConsoleAccessLevelEnum.AccessOperator);
             * CrestronConsole.AddNewConsoleCommand(s => UnSubscribe(), "disablemeters", "", ConsoleAccessLevelEnum.AccessOperator);*/
        }
        public GlsOccupancySensorBaseController(string key, string name, GlsOccupancySensorBase sensor)
            : base(key, name, sensor)
        {
            OccSensor = sensor;

            RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);

            PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PirEnabledFeedback.BoolValue);

            LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);

            ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);

            PirSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInVacantStateFeedback.UShortValue);

            PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.PirSensitivityInOccupiedStateFeedback.UShortValue);

            CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);

            LocalTimoutFeedback = new IntFeedback(() => OccSensor.LocalTimeoutFeedback.UShortValue);

            GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);

            RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyFeedback.BoolValue);

            InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);

            ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ExternalPhotoSensorValueFeedback.UShortValue);

            OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);

            OccSensor.GlsOccupancySensorChange += new GlsOccupancySensorChangeEventHandler(OccSensor_GlsOccupancySensorChange);
        }
Ejemplo n.º 11
0
        public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
        {
            _device = hardware as C2nRths;

            TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
            HumidityFeedback    = new IntFeedback(() => _device.HumidityFeedback.UShortValue);

            _device.BaseEvent += DeviceOnBaseEvent;
        }
Ejemplo n.º 12
0
 /// <summary>
 /// Private constructor. Use GetDevice factory method
 /// </summary>
 /// <param name="key"></param>
 /// <param name="name"></param>
 /// <param name="shade"></param>
 CrestronBasicShadesController(string key, string name, ShadeWithBasicSettings shade) :
     base(key, name, shade)
 {
     Shade                 = shade;
     IsStoppedFeedback     = new BoolFeedback(() => Shade.IsStopped.BoolValue);
     PositionFeedback      = new IntFeedback(() => Shade.PositionFeedback.UShortValue);
     ShadeIsOpenFeedback   = new BoolFeedback(() => Shade.IsFullyOpened.BoolValue);
     ShadeIsClosedFeedback = new BoolFeedback(() => shade.IsFullyClosed.BoolValue);
 }
        /// <summary>
        /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue.
        /// </summary>
        /// <param name="config">Configuration Object</param>
        private void Initialize(TesiraRoomCombinerBlockConfig config)
        {
            if (config.Enabled)
            {
                DeviceManager.AddDevice(this);
            }

            Debug.Console(2, this, "Adding RoomCombiner '{0}'", Key);

            IsSubscribed = false;

            HasMute                     = config.HasMute;
            HasLevel                    = config.HasLevel;
            UseAbsoluteValue            = config.UseAbsoluteValue;
            Enabled                     = config.Enabled;
            Permissions                 = config.Permissions;
            IncrementAmount             = config.IncrementAmount;
            AutomaticUnmuteOnVolumeUp   = config.UnmuteOnVolChange;
            _volumeUpRepeatTimer        = new CTimer((o) => VolumeUpRepeat(), Timeout.Infinite);
            _volumeDownRepeatTimer      = new CTimer((o) => VolumeDownRepeat(), Timeout.Infinite);
            _volumeUpRepeatDelayTimer   = new CTimer((o) => VolumeUpRepeatDelay(), Timeout.Infinite);
            _volumeDownRepeatDelayTimer = new CTimer((o) => VolumeDownRepeatDelay(), Timeout.Infinite);

            _pollTimer = new CTimer((o) => DoPoll(), Timeout.Infinite);


            if (HasMute && HasLevel)
            {
                ControlType = 0;
            }
            else if (!HasMute && HasLevel)
            {
                ControlType = 1;
            }

            else if (HasMute && !HasLevel)
            {
                ControlType = 2;
            }

            MuteFeedback    = new BoolFeedback(Key + "-MuteFeedback", () => OutIsMuted);
            VisibleFeedback = new BoolFeedback(Key + "-VisibleFeedback", () => Enabled);

            RoomGroupFeedback   = new IntFeedback(Key + "-RoomGroupFeedback", () => RoomGroup);
            VolumeLevelFeedback = new IntFeedback(Key + "-LevelFeedback", () => OutVolumeLevel);
            ControlTypeFeedback = new IntFeedback(Key + "-ControlTypeFeedback", () => ControlType);
            PermissionsFeedback = new IntFeedback(Key + "-PermissionsFeedback", () => Permissions);

            Feedbacks.Add(MuteFeedback);
            Feedbacks.Add(VolumeLevelFeedback);
            Feedbacks.Add(NameFeedback);
            Feedbacks.Add(VisibleFeedback);
            Feedbacks.Add(ControlTypeFeedback);
            Feedbacks.Add(PermissionsFeedback);

            Parent.Feedbacks.AddRange(Feedbacks);
        }
Ejemplo 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); });
            PresetFeedback = new IntFeedback(() => { return(CurrentPreset); });

            CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
            CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
            return(true);
        }
Ejemplo n.º 15
0
        public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
            : base(key, name, device)
        {
            AirMedia = device;

            DeviceConfig = dc;

            PropertiesConfig = props;

            InputPorts  = new RoutingPortCollection <RoutingInputPort>();
            OutputPorts = new RoutingPortCollection <RoutingOutputPort>();

            InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));

            if (AirMedia is Am300)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
            }

            AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);

            IsInSessionFeedback            = new BoolFeedback(new Func <bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0));
            ErrorFeedback                  = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
            NumberOfUsersConnectedFeedback = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
            LoginCodeFeedback              = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
            ConnectionAddressFeedback      = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
            HostnameFeedback               = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.HostNameFeedback.StringValue));

            // TODO: Figure out if we can actually get the TSID/Serial
            SerialNumberFeedback = new StringFeedback(new Func <string>(() => "unknown"));

            AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);

            VideoOutFeedback = new IntFeedback(new Func <int>(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
            AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));

            AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);

            HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
        }
Ejemplo n.º 16
0
        public CenOdtOccupancySensorBaseController(string key, string name, CenOdtCPoe sensor)
            : base(key, name, sensor)
        {
            OccSensor = sensor;

            RoomIsOccupiedFeedback = new BoolFeedback(RoomIsOccupiedFeedbackFunc);

            PirSensorEnabledFeedback = new BoolFeedback(() => OccSensor.PassiveInfraredSensorEnabledFeedback.BoolValue);

            LedFlashEnabledFeedback = new BoolFeedback(() => OccSensor.LedFlashEnabledFeedback.BoolValue);

            ShortTimeoutEnabledFeedback = new BoolFeedback(() => OccSensor.ShortTimeoutEnabledFeedback.BoolValue);

            PirSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInVacantStateFeedback);

            PirSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.PassiveInfraredSensorSensitivityInOccupiedStateFeedback);

            CurrentTimeoutFeedback = new IntFeedback(() => OccSensor.CurrentTimeoutFeedback.UShortValue);

            RemoteTimeoutFeedback = new IntFeedback(() => OccSensor.RemoteTimeout.UShortValue);

            GraceOccupancyDetectedFeedback = new BoolFeedback(() => OccSensor.GraceOccupancyDetectedFeedback.BoolValue);

            RawOccupancyFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedFeedback.BoolValue);

            InternalPhotoSensorValue = new IntFeedback(() => OccSensor.InternalPhotoSensorValueFeedback.UShortValue);

            //ExternalPhotoSensorValue = new IntFeedback(() => OccSensor.ex.UShortValue);

            AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);

            OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);

            UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideAEnabledFeedback.BoolValue);

            UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UltrasonicSensorSideBEnabledFeedback.BoolValue);

            RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByPassiveInfraredSensorFeedback.BoolValue);

            RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);

            UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);

            UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);

            OccSensor.BaseEvent += new Crestron.SimplSharpPro.BaseEventHandler(OccSensor_BaseEvent);

            OccSensor.CenOccupancySensorChange += new GenericEventHandler(OccSensor_CenOccupancySensorChange);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Constructor for Tesira Dsp Switcher Component
        /// </summary>
        /// <param name="key">Unique Key</param>
        /// <param name="config">Sqitcher Config Object</param>
        /// <param name="parent">Parent Object</param>
        public TesiraDspSwitcher(string key, TesiraSwitcherControlBlockConfig config, TesiraDsp parent)
            : base(config.SwitcherInstanceTag, String.Empty, config.Index1, 0, parent, string.Format(KeyFormatter, parent.Key, key), config.Label, config.BridgeIndex)
        {
            SourceIndexFeedback = new IntFeedback(Key + "-SourceIndexFeedback", () => SourceIndex);

            InputPorts  = new RoutingPortCollection <RoutingInputPort>();
            OutputPorts = new RoutingPortCollection <RoutingOutputPort>();

            Feedbacks.Add(SourceIndexFeedback);
            Feedbacks.Add(NameFeedback);

            parent.Feedbacks.AddRange(Feedbacks);

            Initialize(config);
        }
Ejemplo n.º 18
0
        public VideoCodecBase(DeviceConfig config)
            : base(config)
        {
            StandbyIsOnFeedback        = new BoolFeedback(StandbyIsOnFeedbackFunc);
            PrivacyModeIsOnFeedback    = new BoolFeedback(PrivacyModeIsOnFeedbackFunc);
            VolumeLevelFeedback        = new IntFeedback(VolumeLevelFeedbackFunc);
            MuteFeedback               = new BoolFeedback(MuteFeedbackFunc);
            SharingSourceFeedback      = new StringFeedback(SharingSourceFeedbackFunc);
            SharingContentIsOnFeedback = new BoolFeedback(SharingContentIsOnFeedbackFunc);

            InputPorts  = new RoutingPortCollection <RoutingInputPort>();
            OutputPorts = new RoutingPortCollection <RoutingOutputPort>();

            ActiveCalls = new List <CodecActiveCallItem>();
        }
Ejemplo n.º 19
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();
        }
Ejemplo n.º 20
0
        public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
            : base(key, name, sensor)
        {
            OccSensor = sensor;

            AndWhenVacatedFeedback = new BoolFeedback(() => OccSensor.AndWhenVacatedFeedback.BoolValue);

            OrWhenVacatedFeedback = new BoolFeedback(() => OccSensor.OrWhenVacatedFeedback.BoolValue);

            UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);

            UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);

            UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);

            UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
        }
Ejemplo n.º 21
0
        /// <summary>
        /// Initializes this attribute based on config values and generates subscriptions commands and adds commands to the parent's queue.
        /// </summary>
        public void Initialize(string key, string label, bool hasMute, bool hasLevel)
        {
            Key = string.Format("{0}--{1}", Parent.Key, key);

            DeviceManager.AddDevice(this);

            Debug.Console(2, this, "Adding LevelControl '{0}'", Key);

            this.IsSubscribed = false;

            MuteFeedback = new BoolFeedback(() => _IsMuted);

            VolumeLevelFeedback = new IntFeedback(() => _VolumeLevel);

            HasMute  = hasMute;
            HasLevel = hasLevel;
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Constructor
        /// </summary>
        public NecPaSeriesProjector(string key, string name)
            : base(key, name)
        {
            Lamp1RemainingPercent = new IntFeedback("Lamp1RemainingPercent", () => _Lamp1RemainingPercent);
            Lamp2RemainingPercent = new IntFeedback("Lamp2RemainingPercent", () => _Lamp2RemainingPercent);

            InputMap = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)
            {
                { "computer1", "\x02\x03\x00\x00\x02\x01\x01\x09" },
                { "computer2", "\x02\x03\x00\x00\x02\x01\x02\x0a" },
                { "computer3", "\x02\x03\x00\x00\x02\x01\x03\x0b" },
                { "hdmi", "\x02\x03\x00\x00\x02\x01\x1a\x22" },
                { "dp", "\x02\x03\x00\x00\x02\x01\x1b\x23" },
                { "video", "\x02\x03\x00\x00\x02\x01\x06\x0e" },
                { "viewer", "\x02\x03\x00\x00\x02\x01\x1f\x27" },
                { "network", "\x02\x03\x00\x00\x02\x01\x20\x28" },
            };
        }
        /// <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
        }
Ejemplo n.º 24
0
        public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix)
        {
            Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
            // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
            Comm.TextReceived += new EventHandler <GenericCommMethodReceiveTextArgs>(Communication_TextReceived);

            var socket = Comm as ISocketStatus;

            StatusFeedback    = new IntFeedback(() => { return((int)socket.ClientStatus); });
            ConnectedFeedback = new BoolFeedback(() => { return(Comm.IsConnected); });

            if (socket != null)
            {
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
            }
        }
Ejemplo n.º 25
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);
        }
Ejemplo n.º 26
0
        public ClearOneDSPVolumeControl(string key, ClearOneLevelControlBlockConfig config, ClearOneDSPDevice parent)
        {
            _config = config;
            _parent = parent;
            Key     = string.Format("{0}--{1}", _parent.Key, key);
            Name    = config.Label;

            DeviceManager.AddDevice(this);

            Debug.Console(2, this, "Adding LevelControl '{0}':{1}", Key, Name);

            _muteCmd = String.Format("{0}{1} {2} {3} {4}", _config.DeviceType.ToChar(), _config.DeviceId, @"MUTE", _config.Channel, _config.Group.ToChar());
            _gainCmd = String.Format("{0}{1} {2} {3} {4}", _config.DeviceType.ToChar(), _config.DeviceId, @"GAIN", _config.Channel, _config.Group.ToChar());

            _muteCmdFeedbackKey = "OK> #" + _muteCmd + ' ';
            _gainCmdFeedbackKey = "OK> #" + _gainCmd + ' ';

            MuteFeedback        = new BoolFeedback(() => _isMuted);
            VolumeLevelFeedback = new IntFeedback(() => _volumeLevel);
        }
Ejemplo n.º 27
0
        public SystemMonitorController(string key)
            : base(key)
        {
            Debug.Console(2, this, "Adding SystemMonitorController.");

            SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;

            TimeZoneFeedback     = new IntFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneNumber);
            TimeZoneTextFeedback = new StringFeedback(() => SystemMonitor.TimeZoneInformation.TimeZoneName);

            IoControllerVersionFeedback = new StringFeedback(() => SystemMonitor.VersionInformation.IOPVersion);
            SnmpVersionFeedback         = new StringFeedback(() => SystemMonitor.VersionInformation.SNMPVersion);
            BaCnetAppVersionFeedback    = new StringFeedback(() => SystemMonitor.VersionInformation.BACNetVersion);
            ControllerVersionFeedback   = new StringFeedback(() => SystemMonitor.VersionInformation.ControlSystemVersion);

            SerialNumberFeedback = new StringFeedback(() => CrestronEnvironment.SystemInfo.SerialNumber);
            ModelFeedback        = new StringFeedback(() => InitialParametersClass.ControllerPromptName);
            UptimeFeedback       = new StringFeedback(() => _uptime);
            LastStartFeedback    = new StringFeedback(() => _lastStart);

            ProgramStatusFeedbackCollection = new Dictionary <uint, ProgramStatusFeedbacks>();

            foreach (var prog in SystemMonitor.ProgramCollection)
            {
                var program = new ProgramStatusFeedbacks(prog);
                ProgramStatusFeedbackCollection.Add(prog.Number, program);
            }

            CreateEthernetStatusFeedbacks();
            UpdateEthernetStatusFeeedbacks();

            _uptimePollTimer = new CTimer(PollUptime, null, 0, UptimePollTime);

            SystemMonitor.ProgramChange += SystemMonitor_ProgramChange;
            SystemMonitor.TimeZoneInformation.TimeZoneChange += TimeZoneInformation_TimeZoneChange;
            CrestronEnvironment.EthernetEventHandler         += CrestronEnvironmentOnEthernetEventHandler;
            CrestronEnvironment.ProgramStatusEventHandler    += CrestronEnvironmentOnProgramStatusEventHandler;
        }
Ejemplo n.º 28
0
        public DmTx4k302CController(string key, string name, DmTx4k302C tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiIn1 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn1,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi1, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[1]));
            HdmiIn2 = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn2,
                                                            eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, eVst.Hdmi2, this,
                                                            VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInputs[2]));
            VgaIn = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                          eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, eVst.Vga, this,
                                                          VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));
            ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
                                                          () => ActualActiveVideoInput.ToString());

            Tx.HdmiInputs[1].InputStreamChange += InputStreamChangeEvent;
            Tx.HdmiInputs[2].InputStreamChange += InputStreamChangeEvent;
            Tx.BaseEvent += Tx_BaseEvent;

            VideoSourceNumericFeedback = new IntFeedback(() =>
            {
                return((int)Tx.VideoSourceFeedback);
            });
            AudioSourceNumericFeedback = new IntFeedback(() =>
            {
                return((int)Tx.AudioSourceFeedback);
            });

            HdmiIn1HdcpCapabilityFeedback = new IntFeedback("HdmiIn1HdcpCapability", () =>
            {
                return((int)tx.HdmiInputs[1].HdcpCapabilityFeedback);
            });

            HdmiIn2HdcpCapabilityFeedback = new IntFeedback("HdmiIn2HdcpCapability", () =>
            {
                return((int)tx.HdmiInputs[2].HdcpCapabilityFeedback);
            });

            HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;


            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == eVst.Hdmi1 &&
                                          tx.HdmiInputs[1].VideoAttributes.HdcpActiveFeedback.BoolValue) ||
                                         (ActualActiveVideoInput == eVst.Hdmi2 &&
                                          tx.HdmiInputs[2].VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    if (ActualActiveVideoInput == eVst.Hdmi2)
                    {
                        return(tx.HdmiInputs[2].VideoAttributes.HdcpStateFeedback.ToString());
                    }
                    return("");
                },

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == eVst.Hdmi1)
                    {
                        return(tx.HdmiInputs[1].VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == eVst.Hdmi2)
                    {
                        return(tx.HdmiInputs[2].VideoAttributes.GetVideoResolutionString());
                    }
                    if (ActualActiveVideoInput == eVst.Vga)
                    {
                        return(tx.VgaInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return("");
                },
                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == eVst.Hdmi1 &&
                                         tx.HdmiInputs[1].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Hdmi2 &&
                                         tx.HdmiInputs[2].SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == eVst.Vga &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue)
            };

            AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
                                                                  eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);

            DmOut = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                          eRoutingPortConnectionType.DmCat, null, this);
            HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);


            AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
                              AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
                              AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
                              AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiIn1HdcpCapabilityFeedback, HdmiIn2HdcpCapabilityFeedback);

            // Set Ports for CEC
            HdmiIn1.Port     = Tx.HdmiInputs[1];
            HdmiIn2.Port     = Tx.HdmiInputs[2];
            HdmiLoopOut.Port = Tx.HdmiOutput;
            DmOut.Port       = Tx.DmOutput;
        }
Ejemplo n.º 29
0
        public HdMdxxxCEController(string key, string name, HdMdxxxCE txRxPair)
            : base(key, name, txRxPair)
        {
            TxRxPair = txRxPair;

            RemoteEndDetectedFeedback = new BoolFeedback(() => TxRxPair.RemoteEndDetectedOnFeedback.BoolValue);

            AutoRouteOnFeedback = new BoolFeedback(() => TxRxPair.TransmitterAutoModeOnFeedback.BoolValue);

            PriorityRoutingOnFeedback = new BoolFeedback(() => TxRxPair.PriorityRoutingOnFeedback.BoolValue);

            InputOnScreenDisplayEnabledFeedback = new BoolFeedback(() => TxRxPair.OnScreenDisplayEnabledFeedback.BoolValue);

            InputPorts = new RoutingPortCollection <RoutingInputPort>();

            SyncDetectedFeedbacks = new Dictionary <uint, BoolFeedback>();

            // Add the HDMI input port on the receiver
            InputPorts.Add(new RoutingInputPort(DmPortName.Hdmi, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, 1, this));

            SyncDetectedFeedbacks.Add(1, new BoolFeedback(() => TxRxPair.HdmiInputs[1].VideoDetectedFeedback.BoolValue));

            if (txRxPair is HdMd400CE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 3, this));
                SyncDetectedFeedbacks.Add(3, new BoolFeedback(() => TxRxPair.HdmiInputs[3].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.VgaIn, eRoutingSignalType.Video | eRoutingSignalType.Audio,
                                                    eRoutingPortConnectionType.Vga, 4, this));
                SyncDetectedFeedbacks.Add(4, new BoolFeedback(() => TxRxPair.VgaInputs[1].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn1].Port = TxRxPair.HdmiInputs[1];
                InputPorts[DmPortName.HdmiIn2].Port = TxRxPair.HdmiInputs[2];
            }
            else if (txRxPair is HdMd300CE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                InputPorts.Add(new RoutingInputPort(DmPortName.VgaIn, eRoutingSignalType.Video | eRoutingSignalType.Audio,
                                                    eRoutingPortConnectionType.Vga, 3, this));
                SyncDetectedFeedbacks.Add(3, new BoolFeedback(() => TxRxPair.VgaInputs[1].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
            }
            else if (txRxPair is HdMd200CE || txRxPair is HdMd200C1GE)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.Hdmi, 2, this));
                SyncDetectedFeedbacks.Add(2, new BoolFeedback(() => TxRxPair.HdmiInputs[2].VideoDetectedFeedback.BoolValue));

                // Set Ports for CEC
                InputPorts[DmPortName.HdmiIn].Port = TxRxPair.HdmiInputs[1];
            }

            //ToRx = new RoutingOutputPort(DmPortName.ToTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
            //    eRoutingPortConnectionType.DmCat, null, this);

            //FromTx = new RoutingInputPort(DmPortName.FromTx, eRoutingSignalType.Audio | eRoutingSignalType.Video,
            //    eRoutingPortConnectionType.DmCat, null, this);

            HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                            eRoutingPortConnectionType.Hdmi, null, this);

            OutputPorts[DmPortName.HdmiOut].Port = TxRxPair.HdmiOutputs[1];

            TxRxPair.DMInputChange  += new DMInputEventHandler(TxRxPair_DMInputChange);
            TxRxPair.DMOutputChange += new DMOutputEventHandler(TxRxPair_DMOutputChange);
            TxRxPair.DMSystemChange += new DMSystemEventHandler(TxRxPair_DMSystemChange);

            VideoSourceFeedback = new IntFeedback(() => (int)TxRxPair.HdmiOutputs[1].VideoOutFeedback.Number);
        }
Ejemplo n.º 30
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="tx"></param>
        public DmTx201SController(string key, string name, DmTx201S tx)
            : base(key, name, tx)
        {
            Tx = tx;

            HdmiInput = new RoutingInputPortWithVideoStatuses(DmPortName.HdmiIn,
                                                              eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, DmTx200Base.eSourceSelection.Digital, this,
                                                              VideoStatusHelper.GetHdmiInputStatusFuncs(tx.HdmiInput));
            VgaInput = new RoutingInputPortWithVideoStatuses(DmPortName.VgaIn,
                                                             eRoutingSignalType.Video, eRoutingPortConnectionType.Vga, DmTx200Base.eSourceSelection.Analog, this,
                                                             VideoStatusHelper.GetVgaInputStatusFuncs(tx.VgaInput));

            ActiveVideoInputFeedback = new StringFeedback("ActiveVideoInput",
                                                          () => ActualActiveVideoInput.ToString());

            Tx.HdmiInput.InputStreamChange += InputStreamChangeEvent;
            Tx.VgaInput.InputStreamChange  += VgaInputOnInputStreamChange;
            Tx.BaseEvent          += Tx_BaseEvent;
            Tx.OnlineStatusChange += new OnlineStatusChangeEventHandler(Tx_OnlineStatusChange);

            VideoSourceNumericFeedback = new IntFeedback(() => (int)Tx.VideoSourceFeedback);

            AudioSourceNumericFeedback = new IntFeedback(() => (int)Tx.AudioSourceFeedback);

            HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
                                                           (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue ? 1 : 0));

            HdmiVideoSyncFeedback = new BoolFeedback(() => (bool)tx.HdmiInput.SyncDetectedFeedback.BoolValue);

            VgaVideoSyncFeedback = new BoolFeedback(() => (bool)tx.VgaInput.SyncDetectedFeedback.BoolValue);

            FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);

            VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);

            VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);

            tx.VgaInput.VideoControls.ControlChange += VideoControls_ControlChange;

            HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;

            var combinedFuncs = new VideoStatusFuncsWrapper
            {
                HdcpActiveFeedbackFunc = () =>
                                         (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                          tx.HdmiInput.VideoAttributes.HdcpActiveFeedback.BoolValue),

                HdcpStateFeedbackFunc = () => ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital ?
                                        tx.HdmiInput.VideoAttributes.HdcpStateFeedback.ToString() : "",

                VideoResolutionFeedbackFunc = () =>
                {
                    if (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital)
                    {
                        return(tx.HdmiInput.VideoAttributes.GetVideoResolutionString());
                    }
                    return(ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog ?
                           tx.VgaInput.VideoAttributes.GetVideoResolutionString() : "");
                },

                VideoSyncFeedbackFunc = () =>
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Digital &&
                                         tx.HdmiInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Analog &&
                                         tx.VgaInput.SyncDetectedFeedback.BoolValue) ||
                                        (ActualActiveVideoInput == DmTx200Base.eSourceSelection.Auto &&
                                         (tx.VgaInput.SyncDetectedFeedback.BoolValue || tx.HdmiInput.SyncDetectedFeedback.BoolValue))
            };

            AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
                                                                  eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);

            DmOutput    = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
            HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, null, this);

            AddToFeedbackList(ActiveVideoInputFeedback, VideoSourceNumericFeedback, AudioSourceNumericFeedback,
                              AnyVideoInput.VideoStatus.HasVideoStatusFeedback, AnyVideoInput.VideoStatus.HdcpActiveFeedback,
                              AnyVideoInput.VideoStatus.HdcpStateFeedback, AnyVideoInput.VideoStatus.VideoResolutionFeedback,
                              AnyVideoInput.VideoStatus.VideoSyncFeedback, HdmiInHdcpCapabilityFeedback, HdmiVideoSyncFeedback,
                              VgaVideoSyncFeedback);

            // Set Ports for CEC
            HdmiInput.Port   = Tx.HdmiInput;
            VgaInput.Port    = Tx.VgaInput;
            HdmiLoopOut.Port = Tx.HdmiOutput;
            DmOutput.Port    = Tx.DmOutput;
        }