Page 1 of 2

Adding new control settings

Posted: Sat Jan 10, 2009 7:37 am
by foxtroop11
The person that got the Orbit sphere working with the older uvc streamer is helping me gain control of the Orbit with the newer mjpg_streamer within zoneminder. I thought this would be somewhat easy but I'm beginning to think there is something wrong with either 1.24 or the way I installed it.

I can see the feed from the Orbit inside 1.24 no problem. If I click on the cam, then click control that is where the problems start. I've dropped a test file the person sent me in the folder along with Visca.pm and such and restarted Zoneminder.

Now, if I click control type edit button it brings up another window where I select add new. So far so good, I fill out the first tab called main. I give it a name, select remote and input mjpg_streamer for the protocl since I named the file mjpg_streamer.pm. Now, no matter what I do, if I click save right then and there or go onto the next tab and select some options and click save, it dumps the last pages settings. So I can get it to keep the name and protcol, and it will save the next tab if I tell it it can move, but If I go to the next tab for tilt and pan it dumps the option I selected in the last tab for it to move.

edit: I can go in to phpmyadmin under zm and manually put 1 instead of 0 next to some of the options, and the change will stick. As soon as I use the web interface it doesn't seem to work.

Posted: Sat Jan 10, 2009 10:16 am
by foxtroop11
I just did another test install of zoneminder 1.23.3 from a deb package. That version has no issue's what so ever adding a new control device or parameter and saving it.

Re: Adding new control settings

Posted: Mon Jan 12, 2009 3:03 am
by dedmeet
I have also found this issue in 1.24.

The only way to get the settings for a new control to be done is to manipulate the db directly.

Posted: Mon Jan 12, 2009 8:32 am
by foxtroop11
Atleast I'm not the only one :)

I just find it strange that we are the only two people with this problem out of all the other people trying 1.24. I'm not sure what your using for your install base, but I'm using Kubuntu 8.04 and I went back and recompiled after installing, ah I forgot the name, libcpr3-dev maybe? This removed the warning while running the ./configure where it said something about May not be able to control network camera's. I also made sure I installed all the perl modules that it said was missing, like the X10 support, email support, and a couple others.

Posted: Sat Jan 24, 2009 9:24 pm
by foxtroop11
I installed the newest build and this bug is still there. I find it hard to beleive only two people are having this issue. So no one else notices that when you try and add a new Camera control the settings are not saved per page? Honestly the only way you can setup a new Control entry is using phpmyadmin or something similar to directly edit the database, otherwise you cannot save any entries other then the first page of adding a new control.

Posted: Sun Jan 25, 2009 2:35 am
by nuck
foxtroop11 wrote:I installed the newest build and this bug is still there. I find it hard to beleive only two people are having this issue. So no one else notices that when you try and add a new Camera control the settings are not saved per page? Honestly the only way you can setup a new Control entry is using phpmyadmin or something similar to directly edit the database, otherwise you cannot save any entries other then the first page of adding a new control.
No, I've seen it too. Setting up monitors isn't the only place these sorts of glitches are happening. Keep in mind afterall that 1.24 is still in development.

Posted: Sun Jan 25, 2009 7:14 am
by foxtroop11
Understood, just wanted to make sure it wasn't over looked. No one else was saying anything so I was beginning to think it was a mistake in how I installed it.

Posted: Sun Jan 25, 2009 3:25 pm
by nuck
foxtroop11 wrote:No one else was saying anything so I was beginning to think it was a mistake in how I installed it.
No, it's not just you. :mrgreen:
http://www.zoneminder.com/forums/viewto ... 4&start=45

Posted: Mon Jan 26, 2009 12:55 am
by cordel
I have verified the problem and yes it does exist. There are no errors on the page so I assume that only the arrays for the current tab are loaded but when it saves it try's to save all the data from all the tabs even though it only has one tabs array or it try's to reload the array from the database, either case the array is not behaving properly.

I'll see if I can sort it out. Likely just need to move the call for data in the script.

Posted: Mon Jan 26, 2009 3:51 pm
by foxtroop11
Cool, atleast it's not an install error. I just used phpmyadmin to get around it all and edit what I needed manually.

Posted: Wed Jan 28, 2009 3:06 pm
by zoneminder
I am looking at this issue now,

Posted: Wed Jan 28, 2009 3:13 pm
by cordel
:D Good because I'm not finding this one.
Settings for the checkboxs get lost between switching tabs.
Seems like the other values are okay :?

Posted: Wed Jan 28, 2009 5:25 pm
by zoneminder
Try the latest RC (2734) or apply the patch below

Code: Select all

Index: web/skins/classic/views/controlcap.php
===================================================================
--- web/skins/classic/views/controlcap.php	(revision 2720)
+++ web/skins/classic/views/controlcap.php	(working copy)
@@ -40,118 +40,122 @@
 else
     $tab = "main";
 
-if ( !empty($_REQUEST['cid']) )
+if ( isset( $_REQUEST['newControl'] ) )
 {
-    $control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
+    $newControl = $_REQUEST['newControl'];
 }
 else
 {
-    $control = array(
-        'Name' => $SLANG['New'],
-        'Type' => "Local",
-        'Protocol' => "",
-        'CanWake' => "",
-        'CanSleep' => "",
-        'CanReset' => "",
-        'CanMove' => "",
-        'CanMoveDiag' => "",
-        'CanMoveMap' => "",
-        'CanMoveAbs' => "",
-        'CanMoveRel' => "",
-        'CanMoveCon' => "",
-        'CanPan' => "",
-        'MinPanRange' => "",
-        'MaxPanRange' => "",
-        'MinPanStep' => "",
-        'MaxPanStep' => "",
-        'HasPanSpeed' => "",
-        'MinPanSpeed' => "",
-        'MaxPanSpeed' => "",
-        'HasTurboPan' => "",
-        'TurboPanSpeed' => "",
-        'CanTilt' => "",
-        'MinTiltRange' => "",
-        'MaxTiltRange' => "",
-        'MinTiltStep' => "",
-        'MaxTiltStep' => "",
-        'HasTiltSpeed' => "",
-        'MinTiltSpeed' => "",
-        'MaxTiltSpeed' => "",
-        'HasTurboTilt' => "",
-        'TurboTiltSpeed' => "",
-        'CanZoom' => "",
-        'CanZoomAbs' => "",
-        'CanZoomRel' => "",
-        'CanZoomCon' => "",
-        'MinZoomRange' => "",
-        'MaxZoomRange' => "",
-        'MinZoomStep' => "",
-        'MaxZoomStep' => "",
-        'HasZoomSpeed' => "",
-        'MinZoomSpeed' => "",
-        'MaxZoomSpeed' => "",
-        'CanFocus' => "",
-        'CanAutoFocus' => "",
-        'CanFocusAbs' => "",
-        'CanFocusRel' => "",
-        'CanFocusCon' => "",
-        'MinFocusRange' => "",
-        'MaxFocusRange' => "",
-        'MinFocusStep' => "",
-        'MaxFocusStep' => "",
-        'HasFocusSpeed' => "",
-        'MinFocusSpeed' => "",
-        'MaxFocusSpeed' => "",
-        'CanIris' => "",
-        'CanAutoIris' => "",
-        'CanIrisAbs' => "",
-        'CanIrisRel' => "",
-        'CanIrisCon' => "",
-        'MinIrisRange' => "",
-        'MaxIrisRange' => "",
-        'MinIrisStep' => "",
-        'MaxIrisStep' => "",
-        'HasIrisSpeed' => "",
-        'MinIrisSpeed' => "",
-        'MaxIrisSpeed' => "",
-        'CanGain' => "",
-        'CanAutoGain' => "",
-        'CanGainAbs' => "",
-        'CanGainRel' => "",
-        'CanGainCon' => "",
-        'MinGainRange' => "",
-        'MaxGainRange' => "",
-        'MinGainStep' => "",
-        'MaxGainStep' => "",
-        'HasGainSpeed' => "",
-        'MinGainSpeed' => "",
-        'MaxGainSpeed' => "",
-        'CanWhite' => "",
-        'CanAutoWhite' => "",
-        'CanWhiteAbs' => "",
-        'CanWhiteRel' => "",
-        'CanWhiteCon' => "",
-        'MinWhiteRange' => "",
-        'MaxWhiteRange' => "",
-        'MinWhiteStep' => "",
-        'MaxWhiteStep' => "",
-        'HasWhiteSpeed' => "",
-        'MinWhiteSpeed' => "",
-        'MaxWhiteSpeed' => "",
-        'HasPresets' => "",
-        'NumPresets' => "",
-        'HasHomePreset' => "",
-        'CanSetPresets' => "",
-    );
-}
-if ( !isset( $newControl ) )
-{
+    if ( !empty($_REQUEST['cid']) )
+    {
+        $control = dbFetchOne( "select * from Controls where Id = '".dbEscape($_REQUEST['cid'])."'" );
+    }
+    else
+    {
+        $control = array(
+            'Name' => $SLANG['New'],
+            'Type' => "Local",
+            'Protocol' => "",
+            'CanWake' => "",
+            'CanSleep' => "",
+            'CanReset' => "",
+            'CanMove' => "",
+            'CanMoveDiag' => "",
+            'CanMoveMap' => "",
+            'CanMoveAbs' => "",
+            'CanMoveRel' => "",
+            'CanMoveCon' => "",
+            'CanPan' => "",
+            'MinPanRange' => "",
+            'MaxPanRange' => "",
+            'MinPanStep' => "",
+            'MaxPanStep' => "",
+            'HasPanSpeed' => "",
+            'MinPanSpeed' => "",
+            'MaxPanSpeed' => "",
+            'HasTurboPan' => "",
+            'TurboPanSpeed' => "",
+            'CanTilt' => "",
+            'MinTiltRange' => "",
+            'MaxTiltRange' => "",
+            'MinTiltStep' => "",
+            'MaxTiltStep' => "",
+            'HasTiltSpeed' => "",
+            'MinTiltSpeed' => "",
+            'MaxTiltSpeed' => "",
+            'HasTurboTilt' => "",
+            'TurboTiltSpeed' => "",
+            'CanZoom' => "",
+            'CanZoomAbs' => "",
+            'CanZoomRel' => "",
+            'CanZoomCon' => "",
+            'MinZoomRange' => "",
+            'MaxZoomRange' => "",
+            'MinZoomStep' => "",
+            'MaxZoomStep' => "",
+            'HasZoomSpeed' => "",
+            'MinZoomSpeed' => "",
+            'MaxZoomSpeed' => "",
+            'CanFocus' => "",
+            'CanAutoFocus' => "",
+            'CanFocusAbs' => "",
+            'CanFocusRel' => "",
+            'CanFocusCon' => "",
+            'MinFocusRange' => "",
+            'MaxFocusRange' => "",
+            'MinFocusStep' => "",
+            'MaxFocusStep' => "",
+            'HasFocusSpeed' => "",
+            'MinFocusSpeed' => "",
+            'MaxFocusSpeed' => "",
+            'CanIris' => "",
+            'CanAutoIris' => "",
+            'CanIrisAbs' => "",
+            'CanIrisRel' => "",
+            'CanIrisCon' => "",
+            'MinIrisRange' => "",
+            'MaxIrisRange' => "",
+            'MinIrisStep' => "",
+            'MaxIrisStep' => "",
+            'HasIrisSpeed' => "",
+            'MinIrisSpeed' => "",
+            'MaxIrisSpeed' => "",
+            'CanGain' => "",
+            'CanAutoGain' => "",
+            'CanGainAbs' => "",
+            'CanGainRel' => "",
+            'CanGainCon' => "",
+            'MinGainRange' => "",
+            'MaxGainRange' => "",
+            'MinGainStep' => "",
+            'MaxGainStep' => "",
+            'HasGainSpeed' => "",
+            'MinGainSpeed' => "",
+            'MaxGainSpeed' => "",
+            'CanWhite' => "",
+            'CanAutoWhite' => "",
+            'CanWhiteAbs' => "",
+            'CanWhiteRel' => "",
+            'CanWhiteCon' => "",
+            'MinWhiteRange' => "",
+            'MaxWhiteRange' => "",
+            'MinWhiteStep' => "",
+            'MaxWhiteStep' => "",
+            'HasWhiteSpeed' => "",
+            'MinWhiteSpeed' => "",
+            'MaxWhiteSpeed' => "",
+            'HasPresets' => "",
+            'NumPresets' => "",
+            'HasHomePreset' => "",
+            'CanSetPresets' => "",
+        );
+    }
     $newControl = $control;
 }
 
 $focusWindow = true;
 
-xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$control['Name'] );
+xhtmlHeaders(__FILE__, $SLANG['ControlCap']." - ".$newControl['Name'] );
 ?>
 <body>
   <div id="page">
@@ -172,7 +176,7 @@
     else
     {
 ?>
-        <li><a href="?view=<?= $view ?>&cid=<?= requestVar( 'cid' ) ?>&tab=<?= $name ?>"><?= $value ?></a></li>
+        <li><a href="#" onclick="submitTab( '<?= $name ?>' ); return( false );"><?= $value ?></a></li>
 <?php
     }
 }
It's really only the last changed line that is significant I think however.

Posted: Wed Jan 28, 2009 5:39 pm
by foxtroop11
Thank you for fixing that, it will be so much easier now to setup controls.

Did you get the addon for mjpg_streamer control added? It's pretty cool to control my Orbit with Zoneminder.

Posted: Wed Jan 28, 2009 5:47 pm
by cordel
I don't think anyone send either one of us the module for the orbit.

I stared at that section of code for almost two hours Last night, I knew it had to be there :lol: