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(); }
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()); }
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); } }
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); } }