Page 2 of 2

Posted: Thu Feb 08, 2007 3:33 pm
by zoneminder
I think the .cpp file is correct, it is only the .php one that is wrong. And you don't need to recompile that, just change in situ if you prefer.

Try this combination instead of the lines I originally suggested.

Code: Select all

$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );

$new_alarm = ( $is_alarmed && !$was_alarmed );
$old_alarm = ( !$is_alarmed && $was_alarmed );
Again, I haven't actually run this so it may not work, or might have typos etc in.

Posted: Thu Feb 08, 2007 5:44 pm
by cordel
Okay, Phil this last change seems to have fixed the issue. I'll create a patch and get it on the wiki.

Code: Select all

--- ../ZoneMinder-1.22.3-Orig/web/zm_html_view_watchstatus.php	2006-03-27 14:01:33.000000000 -0800
+++ web/zm_html_view_watchstatus.php	2007-02-08 09:48:20.460895838 -0800
@@ -61,8 +61,11 @@
 	$status_string = $zmSlangRecord;
 }
 $fps_string = sprintf( "%.2f", $fps );
-$new_alarm = ( $status > STATE_PREALARM && $last_status <= STATE_PREALARM );
-$old_alarm = ( $status <= STATE_PREALARM && $last_status > STATE_PREALARM );
+$is_alarmed = ( $status == STATE_ALARM || $status == STATE_ALERT );
+$was_alarmed = ( $last_status == STATE_ALARM || $last_status == STATE_ALERT );
+
+$new_alarm = ( $is_alarmed && !$was_alarmed );
+$old_alarm = ( !$is_alarmed && $was_alarmed );
 
 $refresh = (isset($force)||$forced||isset($disable)||$disabled||(($status>=STATE_PREALARM)&&($status<=STATE_ALERT)))?1:ZM_WEB_REFRESH_STATUS;
 $url = "$PHP_SELF?view=watchstatus&mid=$mid&last_status=$status".(($force||$forced)?"&forced=1":"").(($disable||$disabled)?"&disabled=1":"");
Or maybe not since I have no way to upload it to downloads area :roll:
Thanks Paul for letting me in. Your all set to go.

Cheers

Posted: Thu Feb 08, 2007 6:49 pm
by cordel
Oh, Paul,
I forgot to mention that I rebuilt ZM so your binaries are all good. You should remove my login from zm's interface, and I'm jealous, you have sunshine :D

Posted: Thu Feb 08, 2007 8:43 pm
by zoneminder
I would suggest just posting it as text for now. If I get chance I will turn it into a proper patch.

fantastic..

Posted: Thu Feb 08, 2007 8:56 pm
by pmurdock
Works like a champ now! That's great guys! So it was just the PHP code.. easy fix.. ;)

Cheers!
Paul