public void setPreset(string name,int PanSpeed,int TiltSpeed,int ZoomSpeed)
{
if (ptzClient == null)
setPTZClient();
PTZVector pv = new PTZVector();
pv.panTilt = new Vector2D();
pv.zoom = new Vector1D();
pv.panTilt.x = (float)10;
pv.panTilt.y = (float)10;
pv.zoom.x = (float)10;
PTZPreset ps = new PTZPreset();
ps.token = "20";
ps.name = name;
ps.ptzPosition = pv;
PTZSpeed pzs = new PTZSpeed();
pzs.panTilt = new Vector2D();
pzs.zoom = new Vector1D();
pzs.panTilt.x = (float)TiltSpeed;
pzs.panTilt.y = (float)PanSpeed;
pzs.zoom.x = (float)ZoomSpeed;
var setpresetres = new SetPresetResponse();
setpresetres = ptzClient.SetPreset(new SetPresetRequest("Profile_1", name,null));
var presetres = new GetPresetsResponse();
presetres = ptzClient.GetPresets(new GetPresetsRequest("Profile_1"));
}
我为set preset ....写了这个方法但是我不知道我在哪里设置了PTZSpeed的对象,PTZVector
请帮助我....
答案 0 :(得分:0)
我想你在这里混合东西。使用SoapUi或同等版本来查看要发送的soap消息。
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdl="http://www.onvif.org/ver20/ptz/wsdl">
<soap:Header/>
<soap:Body>
<wsdl:SetPreset>
<wsdl:ProfileToken>?</wsdl:ProfileToken>
<wsdl:PresetName>?</wsdl:PresetName>
<wsdl:PresetToken>?</wsdl:PresetToken>
</wsdl:SetPreset>
</soap:Body>
</soap:Envelope>
请注意,您只需提交个人资料标记,预设名称和预设标记。如果我没记错的话,将在响应中返回预设标记。配置文件令牌是Mediaservice.GetProfiles方法返回的项目之一。
平移,倾斜,缩放的速度设置仅在使用Move,GoToHome或GoToPreset命令时使用。