Exemple #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;
            }
        }
Exemple #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;
            }
        }
Exemple #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;
     }
 }
Exemple #4
0
        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;
            }
        }
Exemple #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
     }
 }
Exemple #6
0
        internal static void AddCore(QsysCore core)
        {
            try
            {
                lock (Cores)
                {
                    if (!Cores.ContainsKey(core.CoreId))
                    {
                        Cores.Add(core.CoreId, core);

                        OnCoreAdded(new CoreAddedEventArgs(core.CoreId));
                    }
                }
            }
            catch (Exception e)
            {
            }
        }
Exemple #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;
            }
        }
Exemple #8
0
 public static bool AddCore(QsysCore _core, int _coreID)
 {
     try
     {
         lock (QsysMain.Cores)
         {
             if (QsysMain.Cores.ContainsKey(_coreID))
             {
                 return(false);
             }
             QsysMain.Cores.Add(_coreID, _core);
             return(true);
         }
     }
     catch (Exception ex)
     {
         ErrorLog.Error("Program {0} - QSYS Error - Adding Core {1} @ {2} - Details:{3}", (object)progslot, (object)_coreID, (object)_core.getCoreIP, (object)ex.Message);
         return(false);
     }
 }
Exemple #9
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;
            }
        }
Exemple #10
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;
            }
        }
Exemple #11
0
        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;
            }
        }
Exemple #12
0
 public static QsysCore AddOrGetCoreObject(int _coreID)
 {
     try
     {
         lock (QsysMain.Cores)
         {
             if (QsysMain.Cores.ContainsKey(_coreID))
             {
                 return(QsysMain.Cores[_coreID]);
             }
             else
             {
                 QsysCore c = new QsysCore();
                 QsysMain.Cores.Add(_coreID, c);
                 return(QsysMain.Cores[_coreID]);
             }
         }
     }
     catch (Exception ex)
     {
         ErrorLog.Error("Program {0} - QSYS Error - Adding Core {1} - Details:{3}", (object)progslot, (object)_coreID, (object)ex.Message);
         return((QsysCore)null);
     }
 }
Exemple #13
0
        //Internal Vars

        //Events

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