예제 #1
0
        private void PtzStop()
        {
            //OnvifPtz ptz = new OnvifPtz(IP, Port, txtUser.Text, txtPassword.Text);
            OnvifPtz ptz = new OnvifPtz(ServiceUris[OnvifNamespace.MEDIA], ServiceUris[OnvifNamespace.PTZ], DeviceTimeOffset, txtUser.Text, txtPassword.Text);

            ptz.Stop();
        }
예제 #2
0
        private void BtnZoomIn_MouseDown(object sender, MouseEventArgs e)
        {
            float    speed = (float)numPtzCmdSpeed.Value / 100;
            OnvifPtz ptz   = new OnvifPtz(ServiceUris[OnvifNamespace.MEDIA], ServiceUris[OnvifNamespace.PTZ], DeviceTimeOffset, txtUser.Text, txtPassword.Text);

            ptz.Zoom(speed);
            UpdatePtzLocation(ptz.GetPtzLocation());
        }
예제 #3
0
        private void btnAuxCmd_Click(object sender, EventArgs e)
        {
            Button   btn = (Button)sender;
            OnvifPtz ptz = new OnvifPtz(ServiceUris[OnvifNamespace.MEDIA], ServiceUris[OnvifNamespace.PTZ], DeviceTimeOffset, txtUser.Text, txtPassword.Text);

            try
            {
                Console.WriteLine(string.Format("Send AuxCmd {0}", tbAuxCmd.Text));
                tssLbl.Text = ptz.SendAuxiliaryCommand(tbAuxCmd.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
예제 #4
0
        private void BtnPreset_Click(object sender, EventArgs e)
        {
            Button   btn = (Button)sender;
            OnvifPtz ptz = new OnvifPtz(ServiceUris[OnvifNamespace.MEDIA], ServiceUris[OnvifNamespace.PTZ], DeviceTimeOffset, txtUser.Text, txtPassword.Text);

            try
            {
                ptz.ShowPreset(Convert.ToInt32(btn.Text));
                Console.WriteLine(string.Format("Moving to preset {0}", btn.Text));
                UpdatePtzLocation(ptz.GetPtzLocation());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }