Class: ONVIF::PtzAction::ContinuousMove
- Defined in:
- lib/ruby_onvif_client/ptz/continuous_move.rb
Instance Method Summary collapse
-
#run(options, cb) ⇒ Object
options 的结构 { profile_token: “xxxxxxx”,// A reference to the MediaProfile where the operation should take place. velocity: { //optional pan_tilt: { //optional x: 1, //[float] y: 2, //[float] space: “www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace”, //[anyURI] // www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace // www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace // www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace // www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace }, zoom: { //optional x: 1,// space: “www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace”,//[anyURI] } }, timeout: ” //optional [duration] }.
Methods inherited from Action
#attribute, #callback, #create_event_onvif_message, #create_media_onvif_message, #create_ptz_onvif_message, #initialize, #send_message, #value
Constructor Details
This class inherits a constructor from ONVIF::Action
Instance Method Details
#run(options, cb) ⇒ Object
options 的结构
{
profile_token: "xxxxxxx",//[ReferenceToken] A reference to the MediaProfile where the operation should take place.
velocity: { //optional
pan_tilt: { //optional
x: 1, //[float]
y: 2, //[float]
space: "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace", //[anyURI]
// http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace
// http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace
// http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace
// http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace
},
zoom: { //optional
x: 1,//[float]
space: "http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace",//[anyURI]
}
},
timeout: '' //optional [duration]
}
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/ruby_onvif_client/ptz/continuous_move.rb', line 26 def run , cb = namespaces: {:'xmlns:sch' => 'http://www.onvif.org/ver10/schema'} .body = ->(xml) do xml.wsdl(:ContinuousMove) do xml.wsdl :ProfileToken, [:profile_token] unless [:velocity].nil? xml.wsdl(:Velocity) do unless [:velocity][:pan_tilt].nil? xml.sch :PanTilt, { "x" => [:velocity][:pan_tilt][:x], "y" => [:velocity][:pan_tilt][:y], "space" => [:velocity][:pan_tilt][:space] } end unless [:velocity][:zoom].nil? xml.sch :Zoom, { "x" => [:velocity][:zoom][:x], "space" => [:velocity][:zoom][:space] } end end end xml.wsdl :Timeout, [:timeout] unless [:timeout].nil? end end do |success, result| callback cb, success, result end end |