Class: ONVIF::PtzAction::AbsoluteMove
- Defined in:
- lib/ruby_onvif_client/ptz/absolute_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. position: { 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] } } speed: { //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] } } }.
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.
position: {
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]
}
}
speed: { //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]
}
}
}
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/ruby_onvif_client/ptz/absolute_move.rb', line 40 def run , cb = .body = ->(xml) do xml.wsdl(:AbsoluteMove) do xml.wsdl :ProfileToken, [:profile_token] xml.wsdl(:Position) do unless [:position][:pan_tilt].nil? xml.wsdl :PanTilt, { "x" => [:position][:pan_tilt][:x], "y" => [:position][:pan_tilt][:y], "space" => [:position][:pan_tilt][:space] } end unless [:position][:zoom].nil? xml.wsdl :Zoom, { "x" => [:position][:zoom][:x], "space" => [:position][:zoom][:space] } end end unless [:speed].nil? xml.wsdl(:Speed) do unless [:speed][:pan_tilt].nil? xml.wsdl :PanTilt, { "x" => [:speed][:pan_tilt][:x], "y" => [:speed][:pan_tilt][:y], "space" => [:speed][:pan_tilt][:space] } end unless [:speed][:zoom].nil? xml.wsdl :Zoom, { "x" => [:speed][:zoom][:x], "space" => [:speed][:zoom][:space] } end end end end end do |success, result| callback cb, success, result end end |