Пример #1
0
        public void NumPad(string number)
        {
            dialString.Append(number);

            if (hookState)
            {
                ComponentChange pinPad = new ComponentChange();
                pinPad.Params = new ComponentChangeParams();

                pinPad.Params.Name = cName;

                ComponentSetValue pinPadSetValue = new ComponentSetValue();
                pinPadSetValue.Name  = string.Format("call_pinpad_{0}", number);
                pinPadSetValue.Value = 1;

                pinPad.Params.Controls = new List <ComponentSetValue>();
                pinPad.Params.Controls.Add(pinPadSetValue);

                QsysProcessor.Enqueue(JsonConvert.SerializeObject(pinPad, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }

            QsysPotsControllerEvent(this, new QsysEventsArgs(eQscEventIds.PotsControllerDialString, cName, true, dialString.Length, dialString.ToString(), null));
        }
Пример #2
0
        /// <summary>
        /// Sets the current mute state.
        /// </summary>
        /// <param name="value">The state to set the mute.</param>
        public void Mute(bool value)
        {
            if (currentMute != value)
            {
                ComponentChange newMuteChange = new ComponentChange();
                newMuteChange.Params = new ComponentChangeParams();

                newMuteChange.Params.Name = cName;

                ComponentSetValue mute = new ComponentSetValue();
                mute.Name = "mute";

                if (value)
                {
                    mute.Value = 1;
                }
                else
                {
                    mute.Value = 0;
                }

                newMuteChange.Params.Controls = new List <ComponentSetValue>();
                newMuteChange.Params.Controls.Add(mute);

                QsysProcessor.Enqueue(JsonConvert.SerializeObject(newMuteChange, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }
        }
Пример #3
0
        public void InfiniteHold(bool value)
        {
            if (infiniteHold != value && registered)
            {
                var intValue = Convert.ToInt16(value);

                ComponentChange newChange = new ComponentChange()
                {
                    Params = new ComponentChangeParams()
                    {
                        Name = cName, Controls = new List <ComponentSetValue>()
                        {
                            new ComponentSetValue()
                            {
                                Name = "infinite_hold", Value = intValue
                            }
                        }
                    }
                };

                QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(newChange, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }
        }
Пример #4
0
        public void HoldTimeDecrement()
        {
            if (registered)
            {
                double newHoldtime;

                if ((holdTime - 6553.5) >= 0)
                {
                    newHoldtime = QsysCoreManager.ScaleDown(holdTime - 6553.5);
                }
                else
                {
                    newHoldtime = QsysCoreManager.ScaleDown(0);
                }

                ComponentChange newChange = new ComponentChange()
                {
                    Params = new ComponentChangeParams()
                    {
                        Name = cName, Controls = new List <ComponentSetValue>()
                        {
                            new ComponentSetValue()
                            {
                                Name = "hold_time", Position = newHoldtime
                            }
                        }
                    }
                };

                QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(newChange, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }
        }
Пример #5
0
        public void ThresholdIncrement()
        {
            if (registered)
            {
                double newThreshold;

                if ((threshold + 6553.5) <= 65535)
                {
                    newThreshold = QsysCoreManager.ScaleDown(threshold + 6553.5);
                }
                else
                {
                    newThreshold = QsysCoreManager.ScaleDown(65535);
                }

                ComponentChange newChange = new ComponentChange()
                {
                    Params = new ComponentChangeParams()
                    {
                        Name = cName, Controls = new List <ComponentSetValue>()
                        {
                            new ComponentSetValue()
                            {
                                Name = "threshold", Position = newThreshold
                            }
                        }
                    }
                };

                QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(newChange, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }
        }
Пример #6
0
        public void SetWall(int wall, bool state)
        {
            if (registered)
            {
                if (wallState.Length >= wall)
                {
                    if (wallState[wall - 1] != state)
                    {
                        ComponentChange newState = new ComponentChange {
                            Params = new ComponentChangeParams {
                                Name = cName, Controls = new List <ComponentSetValue> {
                                    new ComponentSetValue {
                                        Name = string.Format("wall_{0}_open", wall), Value = Convert.ToDouble(state)
                                    }
                                }
                            }
                        };

                        QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(newState, Formatting.None, new JsonSerializerSettings {
                            NullValueHandling = NullValueHandling.Ignore
                        }));
                    }
                }
            }
        }
Пример #7
0
        public void StopPTZ(ePtzTypes type)
        {
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = this.componentName;
            ComponentSetValue camera = new ComponentSetValue();

            switch (type)
            {
            case ePtzTypes.Up:
                camera.Name  = "tilt_up";
                camera.Value = 0;
                break;

            case ePtzTypes.Down:
                camera.Name  = "tilt_down";
                camera.Value = 0;
                break;

            case ePtzTypes.Left:
                camera.Name  = "pan_left";
                camera.Value = 0;
                break;

            case ePtzTypes.Right:
                camera.Name  = "pan_right";
                camera.Value = 0;
                break;

            case ePtzTypes.ZoomIn:
                camera.Name  = "zoom_in";
                camera.Value = 0;
                break;

            case ePtzTypes.ZoomOut:
                camera.Name  = "zoom_out";
                camera.Value = 0;
                break;

            case ePtzTypes.FocusFar:
                camera.Name  = "focus_far";
                camera.Value = 0;
                break;

            case ePtzTypes.FocusNear:
                camera.Name  = "focus_near";
                camera.Value = 0;
                break;

            default:
                break;
            }
            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(camera);
            this.myCore.Enqueue(JsonConvert.SerializeObject(cameraChange));
        }
Пример #8
0
        public void StopPTZ(PtzTypes type)
        {
            ComponentChange cameraChange = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName, Controls = new List <ComponentSetValue>()
                }
            };

            ComponentSetValue camera = new ComponentSetValue();

            switch (type)
            {
            case PtzTypes.Up:
                camera.Name  = "tilt_up";
                camera.Value = 0;
                break;

            case PtzTypes.Down:
                camera.Name  = "tilt_down";
                camera.Value = 0;
                break;

            case PtzTypes.Left:
                camera.Name  = "pan_left";
                camera.Value = 0;
                break;

            case PtzTypes.Right:
                camera.Name  = "pan_right";
                camera.Value = 0;
                break;

            case PtzTypes.ZoomIn:
                camera.Name  = "zoom_in";
                camera.Value = 0;
                break;

            case PtzTypes.ZoomOut:
                camera.Name  = "zoom_out";
                camera.Value = 0;
                break;

            default:
                break;
            }

            cameraChange.Params.Controls.Add(camera);

            QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(cameraChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #9
0
        public void SetPrivacyMode(bool _state)
        {
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = this.componentName;
            ComponentSetValue setVal = new ComponentSetValue()
            {
                Name = "toggle_privacy", Value = Convert.ToInt16(_state)
            };

            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(setVal);
            this.myCore.Enqueue(JsonConvert.SerializeObject(cameraChange));
        }
Пример #10
0
        public void SaveHome()
        {
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = this.componentName;
            ComponentSetValue setVal = new ComponentSetValue()
            {
                Name = "preset_home_save_trigger", Value = 1
            };

            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(setVal);
            this.myCore.Enqueue(JsonConvert.SerializeObject(cameraChange));
        }
Пример #11
0
        public void FocusAutoMode()
        {
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = this.componentName;
            ComponentSetValue setVal = new ComponentSetValue()
            {
                Name = "focus_auto", Value = 1
            };

            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(setVal);
            this.myCore.Enqueue(JsonConvert.SerializeObject(cameraChange));
        }
Пример #12
0
        public void InputSelect(int _input)
        {
            ComponentChange newInputSelectedChange = new ComponentChange();

            newInputSelectedChange.Params      = new ComponentChangeParams();
            newInputSelectedChange.Params.Name = this.componentName;

            ComponentSetValue inputSelected = new ComponentSetValue();

            inputSelected.Name  = string.Format("select_{0}", this.myOutput);
            inputSelected.Value = _input;
            newInputSelectedChange.Params.Controls = new List <ComponentSetValue>();
            newInputSelectedChange.Params.Controls.Add(inputSelected);

            this.myCore.Enqueue(JsonConvert.SerializeObject(newInputSelectedChange));
        }
Пример #13
0
        public void SetRecallSpeed(double _value)
        {
            double          newVal       = clamp(_value, 0, 1);
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = this.componentName;
            ComponentSetValue setVal = new ComponentSetValue()
            {
                Name = "aaaa_setup_snapshot_speed", Value = newVal
            };

            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(setVal);
            this.myCore.Enqueue(JsonConvert.SerializeObject(cameraChange));
        }
Пример #14
0
        private void DialNow()
        {
            //QsysPotsControllerEvent(this, new QsysEventsArgs(eQscEventIds.PotsControllerDialString, cName, false, 0, string.Empty, null));

            if (onDialingEvent != null)
            {
                onDialStringEvent(string.Empty);
            }

            ComponentChangeString dialNumber = new ComponentChangeString()
            {
                Params = new ComponentChangeParamsString()
                {
                    Name     = cName,
                    Controls = new List <ComponentSetValueString>()
                    {
                        new ComponentSetValueString()
                        {
                            Name = "call_number", Value = currentlyCalling
                        }
                    }
                }
            };

            QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(dialNumber, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));

            ComponentChange dial = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name     = cName,
                    Controls = new List <ComponentSetValue>()
                    {
                        new ComponentSetValue()
                        {
                            Name = "call_connect", Value = 1
                        }
                    }
                }
            };

            QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(dial, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #15
0
        public void SaveSnapshot(int _number)
        {
            ComponentChange saveSnapshot = new ComponentChange();

            saveSnapshot.Params      = new ComponentChangeParams();
            saveSnapshot.Params.Name = this.componentName;

            ComponentSetValue save = new ComponentSetValue();

            save.Name  = string.Format("save_{0}", _number);
            save.Value = 1;

            saveSnapshot.Params.Controls = new List <ComponentSetValue>();
            saveSnapshot.Params.Controls.Add(save);

            this.myCore.Enqueue(JsonConvert.SerializeObject(saveSnapshot));
        }
Пример #16
0
        public void LoadSnapshot(int _number)
        {
            ComponentChange loadSnapshot = new ComponentChange();

            loadSnapshot.Params      = new ComponentChangeParams();
            loadSnapshot.Params.Name = this.componentName;

            ComponentSetValue load = new ComponentSetValue();

            load.Name  = string.Format("load_{0}", _number);
            load.Value = 1;

            loadSnapshot.Params.Controls = new List <ComponentSetValue>();
            loadSnapshot.Params.Controls.Add(load);

            this.myCore.Enqueue(JsonConvert.SerializeObject(loadSnapshot));
        }
Пример #17
0
        public void SetVolumeString(string _value)
        {
            ComponentChange newMuteChange = new ComponentChange();

            newMuteChange.Params      = new ComponentChangeParams();
            newMuteChange.Params.Name = this.componentName;
            ComponentSetValue mute = new ComponentSetValue {
                Name = "gain", Value = Convert.ToDouble(_value), Ramp = this.rampTime
            };

            newMuteChange.Params.Controls = new List <ComponentSetValue>();
            newMuteChange.Params.Controls.Add(mute);
            string jsonIgnoreNullValues = JsonConvert.SerializeObject(newMuteChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            this.myCore.Enqueue(jsonIgnoreNullValues);
        }
Пример #18
0
        public void SetMute(bool _value)
        {
            ComponentChange newMuteChange = new ComponentChange();

            newMuteChange.Params      = new ComponentChangeParams();
            newMuteChange.Params.Name = this.componentName;
            ComponentSetValue mute = new ComponentSetValue {
                Name = "mute", Value = _value ? 1:0
            };

            newMuteChange.Params.Controls = new List <ComponentSetValue>();
            newMuteChange.Params.Controls.Add(mute);
            string jsonIgnoreNullValues = JsonConvert.SerializeObject(newMuteChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            this.myCore.Enqueue(jsonIgnoreNullValues);
        }
Пример #19
0
        public void ChangeInput(int source)
        {
            ComponentChange inputChange = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = this.componentName, Controls = new List <ComponentSetValue>()
                    {
                        new ComponentSetValue()
                        {
                            Name = "hdmi_out_0_select_index", Value = source
                        }
                    }
                }
            };

            this.myCore.Enqueue(JsonConvert.SerializeObject(inputChange));
        }
Пример #20
0
        public void SaveSnapshot(int number)
        {
            ComponentChange saveSnapshot = new ComponentChange();

            saveSnapshot.Params      = new ComponentChangeParams();
            saveSnapshot.Params.Name = cName;

            ComponentSetValue save = new ComponentSetValue();

            save.Name  = string.Format("save_{0}", number);
            save.Value = 1;

            saveSnapshot.Params.Controls = new List <ComponentSetValue>();
            saveSnapshot.Params.Controls.Add(save);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(saveSnapshot, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #21
0
        public void RecallHome()
        {
            ComponentChange cameraChange = new ComponentChange();

            cameraChange.Params      = new ComponentChangeParams();
            cameraChange.Params.Name = cName;

            ComponentSetValue camera = new ComponentSetValue();

            camera.Name  = "preset_home_load";
            camera.Value = 1;

            cameraChange.Params.Controls = new List <ComponentSetValue>();
            cameraChange.Params.Controls.Add(camera);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(cameraChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #22
0
        public void Dial()
        {
            currentlyCalling = dialString.ToString();
            dialString.Remove(0, dialString.Length);

            QsysPotsControllerEvent(this, new QsysEventsArgs(eQscEventIds.PotsControllerDialString, cName, false, 0, string.Empty, null));

            ComponentChangeString dialNumber = new ComponentChangeString();

            dialNumber.Params = new ComponentChangeParamsString();

            dialNumber.Params.Name = cName;

            ComponentSetValueString dialStringSetValue = new ComponentSetValueString();

            dialStringSetValue.Name  = "call_number";
            dialStringSetValue.Value = currentlyCalling;

            dialNumber.Params.Controls = new List <ComponentSetValueString>();
            dialNumber.Params.Controls.Add(dialStringSetValue);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(dialNumber, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));

            ComponentChange dial = new ComponentChange();

            dial.Params = new ComponentChangeParams();

            dial.Params.Name = cName;

            ComponentSetValue dialSetValue = new ComponentSetValue();

            dialSetValue.Name  = "call_connect";
            dialSetValue.Value = 1;

            dial.Params.Controls = new List <ComponentSetValue>();
            dial.Params.Controls.Add(dialSetValue);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(dial, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #23
0
        public void SetPosition(double _position)
        {
            double          newP            = clamp(_position, 0.0, 1.0);
            ComponentChange newVolumeChange = new ComponentChange();

            newVolumeChange.Params          = new ComponentChangeParams();
            newVolumeChange.Params.Name     = this.componentName;
            newVolumeChange.Params.Controls = new List <ComponentSetValue>();
            ComponentSetValue volume = new ComponentSetValue {
                Name = "gain", Position = Math.Round(newP, 8), Ramp = this.rampTime, typePos = true
            };

            newVolumeChange.Params.Controls.Add(volume);

            string jsonIgnoreNullValues = JsonConvert.SerializeObject(newVolumeChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });

            this.myCore.Enqueue(jsonIgnoreNullValues);
        }
Пример #24
0
        public void DndToggle()
        {
            ComponentChange cc = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = this.componentName
                }
            };
            ComponentSetValue ccv = new ComponentSetValue()
            {
                Name = "call_dnd", Value = Convert.ToDouble(!this.dnd)
            };

            cc.Params.Controls = new List <ComponentSetValue>()
            {
                ccv
            };
            this.myCore.Enqueue(JsonConvert.SerializeObject(cc));
        }
Пример #25
0
        public void Disconnect()
        {
            ComponentChange disconnect = new ComponentChange();

            disconnect.Params = new ComponentChangeParams();

            disconnect.Params.Name = cName;

            ComponentSetValue disconnectValue = new ComponentSetValue();

            disconnectValue.Name  = "call_disconnect";
            disconnectValue.Value = 1;

            disconnect.Params.Controls = new List <ComponentSetValue>();
            disconnect.Params.Controls.Add(disconnectValue);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(disconnect, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #26
0
        public void RecallHome()
        {
            ComponentChange cameraChange = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName, Controls = new List <ComponentSetValue>()
                    {
                        new ComponentSetValue()
                        {
                            Name = "preset_home_load", Value = 1
                        }
                    }
                }
            };

            QsysCoreManager.Cores[coreId].Enqueue(JsonConvert.SerializeObject(cameraChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #27
0
        public void ChangeInput(int source)
        {
            ComponentChange inputChange = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName, Controls = new List <ComponentSetValue>()
                    {
                        new ComponentSetValue()
                        {
                            Name = "hdmi_out_0_select_index", Value = source
                        }
                    }
                }
            };

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(inputChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #28
0
        public void Connect()
        {
            ComponentChange dial = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName, Controls = new List <ComponentSetValue>()
                    {
                        new ComponentSetValue()
                        {
                            Name = "call_connect", Value = 1
                        }
                    }
                }
            };

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(dial, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #29
0
        public void AutoAnswerToggle()
        {
            ComponentChange cc = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = this.componentName
                }
            };
            ComponentSetValue ccv = new ComponentSetValue()
            {
                Name = "call_autoanswer", Value = Convert.ToDouble(!autoAnswer)
            };

            cc.Params.Controls = new List <ComponentSetValue>()
            {
                ccv
            };
            this.myCore.SendDebug(string.Format("Component {0} :: Setting AutoAnswer '{1}'", this.componentName, this.autoAnswer));
            this.myCore.Enqueue(JsonConvert.SerializeObject(cc));
        }
Пример #30
0
        public void InputSelect(int input)
        {
            ComponentChange newInputSelectedChange = new ComponentChange();

            newInputSelectedChange.Params = new ComponentChangeParams();

            newInputSelectedChange.Params.Name = cName;

            ComponentSetValue inputSelected = new ComponentSetValue();

            inputSelected.Name = string.Format("select_{0}", myOutput);

            inputSelected.Value = input;

            newInputSelectedChange.Params.Controls = new List <ComponentSetValue>();
            newInputSelectedChange.Params.Controls.Add(inputSelected);

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(newInputSelectedChange, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }