private void UpdateDahuaPtzInfo(CameraModel model, string info = null) { model.ModelName = "DahuaPtz"; model.PtzCgi = "http://192.168.111.127/cgi-bin/ptz.cgi"; model.InfoCgi = "http://192.168.111.127/cgi-bin/ptz.cgi"; model.GetPositionCommand = "action=getStatus"; model.GoToPositionCommand = "action=start&channel=0&code=PositionABS&arg1={0}&arg2={1}&arg3={2}"; model.ParsePositionSeparator = "="; model.ParsePositionPan = "status.Postion[0]"; model.ParsePositionTilt = "status.Postion[1]"; model.ParsePositionZoom = "status.Postion[2]"; model.MinPanValue = 0; model.MaxPanValue = 360; model.MinTiltValue = -15; model.MaxTiltValue = 90; model.MinZoomValue = 1; model.MaxZoomValue = 128; model.FoldZoom = 30; model.MinFocalLength = 4.3; model.MaxFocalLength = 129; model.MatrixSize = 1 / 3f; //1.0/3.0, model.AspectRatioWidth = 16; model.AspectRatioHeight = 9; model.VideoStreamPath = "rtsp://{0}:{1}@{2}/cam/realmonitor?channel=1&subtype=0"; model.OffsetMultiplicity = 1; model.PanReverse = false; model.TiltReverse = false; model.ZoomReverse = false; //model.FocalLengthByZoomStepsExpression = "4.3 + ([zoomSteps] - 1) * (129 - 4.3) / (128 - 1)"; //model.ZoomStepsByFocalLengthExpression = "Round(1 + ([focalLength] - 4.3) * (128 - 1) / (129 - 4.3))"; model.FocalLengthByZoomStepsExpression = "0.0037 * [zoomSteps] * [zoomSteps] + 0.711 * [zoomSteps] + 2.9955"; model.ZoomStepsByFocalLengthExpression = "-0.0054 * [focalLength] * [focalLength] + 1.3667 * [focalLength] - 3.7474"; model.ZoomStepsParameter = "zoomSteps"; model.FocalLengthParameter = "focalLength"; }
private void UpdateInfo(CameraModel model, string info = null) { model.PtzCgi = "http://192.168.100.100/-wvhttp-01-/control.cgi"; model.InfoCgi = "http://192.168.100.100/-wvhttp-01-/info.cgi"; model.GetPositionCommand = ""; model.GoToPositionCommand = "pan={0}&tilt={1}&zoom={2}"; model.MinTiltValue = -90; model.MaxTiltValue = 10; model.MinPanValue = -170; model.MaxPanValue = 170; model.MinZoomValue = 320; model.MaxZoomValue = 6040; model.FoldZoom = 20; model.MinFocalLength = 4.7; model.MaxFocalLength = 94; model.MatrixSize = 1 / 3f; //1.0/3.0, model.AspectRatioWidth = 16; model.AspectRatioHeight = 9; model.OffsetMultiplicity = 100; model.PanReverse = true; model.TiltReverse = true; model.ZoomReverse = true; model.ParsePositionSeparator = ":="; model.ParsePositionPan = "c.1.pan"; model.ParsePositionTilt = "c.1.tilt"; model.ParsePositionZoom = "c.1.zoom"; model.FocalLengthByZoomStepsExpression = "26926.3465 * Pow([zoomSteps], -0.9896)"; model.ZoomStepsByFocalLengthExpression = "29852.0733 * Pow([focalLength], -1.009)"; model.ZoomStepsParameter = "zoomSteps"; model.FocalLengthParameter = "focalLength"; }
public MainWindow() { InitializeComponent(); CreateCommands(); //grabber = new HttpGrabber(); grabber = new DefaultGrabber(); grabber.Start(new CameraEntity()); grabber.GrabberSubject.Subscribe(_ => ImageFrame = _.JpegData); ptz = new HttpPtz(); //ptz = new CanonHttpPtz(); var model = new CameraModel(); //UpdateInfo(model); UpdateDahuaPtzInfo(model); ptz.Open(new CameraEntity() { Model = model, //IpAddress = "192.168.100.100", Login = "******", Password = "******", IpAddress = "192.168.111.127", }); DataContext = this; }