PTZ Control bug - Pan Left arrow button reversed, with fix

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
scapeghost
Posts: 7
Joined: Wed Aug 12, 2009 2:28 pm

PTZ Control bug - Pan Left arrow button reversed, with fix

Post by scapeghost »

I couldn't find any mention of this, so I apologize if this has already been covered.

I'm using ZM 1.24.2 with some PTZ cameras. I noticed that the left arrow (Pan Left) button is reversed... that is, the image of the arrow is fine... but when using absolute or relative movement, the button is reversing the input position. For example, when using relative control, clicking the base of the arrow is supposed to pan left a small amount, clicking the tip a large amount, and everywhere in between. This works fine with all other directions , including UpLeft and DownLeft diagonals, but it's reversed on the left arrow... i.e. the base moves far and the tip moves only slightly.

I traced it down to this line in [ZM_PATH_WEB]/skins/classic/includes/control_functions.php:

Code: Select all

     <div class="arrowBtn leftBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveLeft'] ?>',event,1,0)"></div>
This line should read:

Code: Select all

     <div class="arrowBtn leftBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveLeft'] ?>',event,-1,0)"></div>
Note the "event,1,0" must be changed to "event,-1,0". After making this correction the control will behave as it should.
scapeghost
Posts: 7
Joined: Wed Aug 12, 2009 2:28 pm

Post by scapeghost »

And here's a patch... :)

Code: Select all

--- control_functions.php	2009-03-20 12:07:05.000000000 +0000
+++ control_functions.php	2009-08-13 12:04:08.000000000 +0000
@@ -253,7 +253,7 @@
       <div class="arrowBtn upLeftBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUpLeft'] ?>',event,-1,-1)"></div>
       <div class="arrowBtn upBtn<?= $hasTilt?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUp'] ?>',event,0,-1)"></div>
       <div class="arrowBtn upRightBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveUpRight'] ?>',event,1,-1)"></div>
-      <div class="arrowBtn leftBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveLeft'] ?>',event,1,0)"></div>
+      <div class="arrowBtn leftBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveLeft'] ?>',event,-1,0)"></div>
       <div class="arrowBtn centerBtn" onclick="controlCmd('<?= $cmds['Center'] ?>')"></div>
       <div class="arrowBtn rightBtn<?= $hasPan?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveRight'] ?>',event,1,0)"></div>
       <div class="arrowBtn downLeftBtn<?= $hasDiag?'':' invisible' ?>" onclick="controlCmd('<?= $cmds['MoveDownLeft'] ?>',event,-1,1)"></div>
mrd
Posts: 269
Joined: Wed Apr 26, 2006 12:39 am
Location: Boston USA

Post by mrd »

I just ran into this after a fresh install of the Larch version of ZM 1.24.2.

Thanks for the fix! I hope it's in the next release.
MRD
Post Reply