예제 #1
0
        /// <summary>
        /// Default constructor for a QsysFader
        /// </summary>
        /// <param name="Name">The component name of the gain.</param>
        public QsysGainComponent(int _coreID, string _componentName)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>();

            names.Add(new ControlName {
                Name = "gain"
            });
            names.Add(new ControlName {
                Name = "mute"
            });
            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #2
0
        public QsysMatrixMixer(int _coreID, string _componentName, int _input, int _output)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            this.crossName = string.Format("input_{0}_output_{1}_mute", input, output);
            this.input     = _input;
            this.output    = _output;

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>()
            {
                new ControlName {
                    Name = this.crossName
                }
            };

            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #3
0
 /// <summary>
 /// Default constructor for a QsysNamedControl
 /// </summary>
 /// <param name="Name">The component name of the gain.</param>
 public QsysNamedControl(int _coreID, string _controlName, eControlType _controlType)
 {
     this.controlName = _controlName;
     this.controlType = _controlType;
     this.myCore      = QsysMain.AddOrGetCoreObject(_coreID);
     if (this.myCore.RegisterNamedControl(this.controlName))
     {
         this.myCore.Controls[_controlName].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Control_OnNewEvent);
         this.registered = true;
     }
 }
예제 #4
0
파일: QsysCamera.cs 프로젝트: ryanww/Qsys
        public QsysCamera(int _coreID, string _componentName)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>();

            names.Add(new ControlName()
            {
                Name = "ptz_preset"
            });
            names.Add(new ControlName()
            {
                Name = "setup_pan_speed"
            });
            names.Add(new ControlName()
            {
                Name = "setup_tilt_speed"
            });
            names.Add(new ControlName()
            {
                Name = "setup_zoom_speed"
            });
            names.Add(new ControlName()
            {
                Name = "aaaa_setup_snapshot_speed"
            });
            names.Add(new ControlName()
            {
                Name = "focus_auto"
            });
            names.Add(new ControlName()
            {
                Name = "toggle_privacy"
            });
            names.Add(new ControlName()
            {
                Name = "preset_home_load"
            });
            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #5
0
 public void Initialize(ushort _coreID, SimplSharpString _host, ushort _port, SimplSharpString _user, SimplSharpString _pass)
 {
     this.core = QsysMain.AddOrGetCoreObject(_coreID);
     if (core.Initialize((int)_coreID, _host.ToString(), _port, _user.ToString(), _pass.ToString()))
     {
         core.setDebug(debug);
         core.RegisterSimplClient(Convert.ToString(_coreID));
         core.SimplClients[Convert.ToString(_coreID)].OnNewEvent += new EventHandler <SimplEventArgs>(QsysProcessor_SimplEvent);
         this.isRegistered = true;
     }
     else
     {
         //TODO: Remove all changegroups and re-add all, re-sync
     }
 }
예제 #6
0
        /// <summary>
        /// Initialize new core
        /// </summary>
        public bool Initialize(int _coreID, string _host, ushort _port, string _user, string _pass)
        {
            if (this.initRun)
            {
                return(false);
            }

            bool added = QsysMain.AddCore(this, this.coreID);

            this.coreID    = _coreID;
            this.coreIP    = _host;
            this.corePort  = _port;
            this.loginUser = _user;
            this.loginPass = _pass;

            if (added)
            {
                this.SendDebug(string.Format("Add core {0} @ {1}:{2} & initialize", coreID, coreIP, corePort));
            }

            if (this.commandQueue == null)
            {
                this.commandQueue = new CrestronQueue <string>();
            }

            if (this.responseQueue == null)
            {
                this.responseQueue = new CrestronQueue <string>();
            }

            if (this.commandQueueTimer == null)
            {
                this.commandQueueTimer = new CTimer(CommandQueueDequeue, null, 0, 50);
            }

            if (this.responseQueueTimer == null)
            {
                this.responseQueueTimer = new CTimer(ResponseQueueDequeue, null, 0, 50);
            }

            if (this.isConnected == false)
            {
                this.initializeConnection();
            }
            this.initRun = true;
            return(true);
        }
예제 #7
0
        public QsysPotsController(int _coreID, string _componentName)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>();

            names.Add(new ControlName {
                Name = "call_offhook"
            });
            names.Add(new ControlName {
                Name = "call_ringing"
            });
            names.Add(new ControlName {
                Name = "call_autoanswer"
            });
            names.Add(new ControlName {
                Name = "call_dnd"
            });
            names.Add(new ControlName {
                Name = "call_number"
            });
            names.Add(new ControlName {
                Name = "call_cid_name"
            });
            names.Add(new ControlName {
                Name = "call_cid_number"
            });
            names.Add(new ControlName {
                Name = "call_status"
            });
            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #8
0
        public QsysNv32hDecoder(int _coreID, string _componentName)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>();

            names.Add(new ControlName());
            names[0].Name      = "hdmi_out_0_select_index";
            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #9
0
        public QsysRouter(int _coreID, string _componentName, int _output)
        {
            this.componentName = _componentName;
            this.myOutput      = _output;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);

            Component component = new Component();

            component.Name = this.componentName;
            List <ControlName> names = new List <ControlName>();

            names.Add(new ControlName());
            names[0].Name = string.Format("select_{0}", this.myOutput);

            component.Controls = names;

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #10
0
파일: QsysMeter.cs 프로젝트: ryanww/Qsys
        public QsysMeter(int _coreID, string _componentName, int _index)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);
            this.meterIndex    = _index;

            Component component = new Component()
            {
                Name = this.componentName, Controls = new List <ControlName>()
                {
                    new ControlName()
                    {
                        Name = string.Format("meter_{0}", this.meterIndex)
                    }
                }
            };

            if (this.myCore.RegisterNamedComponent(component))
            {
                this.myCore.Components[component].OnNewEvent += new EventHandler <QsysInternalEventsArgs>(Component_OnNewEvent);
                this.registered  = true;
                this.isComponent = true;
            }
        }
예제 #11
0
파일: QsysSnapshot.cs 프로젝트: ryanww/Qsys
        //Internal Vars

        //Events

        public QsysSnapshot(int _coreID, string _componentName)
        {
            this.componentName = _componentName;
            this.myCore        = QsysMain.AddOrGetCoreObject(_coreID);
        }