Пример #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 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));
        }
Пример #4
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
            }));
        }
Пример #5
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));
        }
Пример #6
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));
        }
Пример #7
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));
        }
Пример #8
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));
        }
Пример #9
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));
        }
Пример #10
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));
        }
Пример #11
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));
        }
Пример #12
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);
        }
Пример #13
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);
        }
Пример #14
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
            }));
        }
Пример #15
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
            }));
        }
Пример #16
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
            }));
        }
Пример #17
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));
        }
Пример #18
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);
        }
Пример #19
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
            }));
        }
Пример #20
0
        public void NumPadClear()
        {
            ComponentChange cc = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = this.componentName
                }
            };
            ComponentSetValue ccv = new ComponentSetValue()
            {
                Name = "call_clear", Value = 1
            };

            cc.Params.Controls = new List <ComponentSetValue>()
            {
                ccv
            };
            this.myCore.SendDebug(string.Format("Component {0} :: NumPadClear", this.componentName));
            this.myCore.Enqueue(JsonConvert.SerializeObject(cc));
        }
Пример #21
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));
        }
Пример #22
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
            }));
        }
Пример #23
0
        /// <summary>
        /// Sets the current volume.
        /// </summary>
        /// <param name="value">The volume level to set to.</param>
        public void Volume(int value)
        {
            while (newValue != value)
            {
                ComponentChange newVolumeChange = new ComponentChange();
                newVolumeChange.Params = new ComponentChangeParams();
                newValue = value;

                newVolumeChange.Params.Name = cName;


                ComponentSetValue volume = new ComponentSetValue();

                volume.Name     = "gain";
                volume.Position = QsysProcessor.ScaleDown(newValue);

                newVolumeChange.Params.Controls = new List <ComponentSetValue>();
                newVolumeChange.Params.Controls.Add(volume);

                QsysProcessor.Enqueue(JsonConvert.SerializeObject(newVolumeChange, Formatting.None, new JsonSerializerSettings {
                    NullValueHandling = NullValueHandling.Ignore
                }));
            }
        }
Пример #24
0
        public void AutoAnswerToggle()
        {
            ComponentChange aAnswer = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName
                }
            };

            ComponentSetValue aAsnwerValue = new ComponentSetValue()
            {
                Name = "call_autoanswer", Value = Convert.ToDouble(!autoAnswer)
            };

            aAnswer.Params.Controls = new List <ComponentSetValue>()
            {
                aAsnwerValue
            };

            QsysProcessor.Enqueue(JsonConvert.SerializeObject(aAnswer, Formatting.None, new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Пример #25
0
        public void DndToggle()
        {
            ComponentChange d = new ComponentChange()
            {
                Params = new ComponentChangeParams()
                {
                    Name = cName
                }
            };

            ComponentSetValue dValue = new ComponentSetValue()
            {
                Name = "call_dnd", Value = Convert.ToDouble(!dnd)
            };

            d.Params.Controls = new List <ComponentSetValue>()
            {
                dValue
            };

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