Bug 173 - Added default scale per monitor.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1524 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
b49bd14b0f
commit
d1e94f3130
|
@ -7,6 +7,7 @@ alter table Monitors add column Sequence smallint unsigned;
|
|||
alter table Monitors modify column Device tinytext;
|
||||
update Monitors set Device = concat( "/dev/video", Device );
|
||||
update Monitors set Device = NULL where Type = "Remote";
|
||||
alter table Monitors add column DefaultScale smallint unsigned after ReturnDelay;
|
||||
alter table Monitors modify column Type enum('Local','Remote','File') NOT NULL default 'Local';
|
||||
alter table Events add column Height smallint(5) unsigned not null default '0' after EndTime;
|
||||
alter table Events add column Width smallint(5) unsigned not null default '0' after EndTime;
|
||||
|
|
|
@ -727,20 +727,26 @@ function createImage( $monitor, $scale )
|
|||
return( $status );
|
||||
}
|
||||
|
||||
function reScale( $dimension, $scale=SCALE_SCALE )
|
||||
function reScale( $dimension, $dummy )
|
||||
{
|
||||
if ( $scale == SCALE_SCALE )
|
||||
return( $dimension );
|
||||
|
||||
return( (int)(($dimension*$scale)/SCALE_SCALE) );
|
||||
for ( $i = 1; $i < func_num_args(); $i++ )
|
||||
{
|
||||
$scale = func_get_arg( $i );
|
||||
if ( !empty($scale) && $scale != SCALE_SCALE )
|
||||
$dimension = (int)(($dimension*$scale)/SCALE_SCALE);
|
||||
}
|
||||
return( $dimension );
|
||||
}
|
||||
|
||||
function deScale( $dimension, $scale=SCALE_SCALE )
|
||||
function deScale( $dimension, $dummy )
|
||||
{
|
||||
if ( $scale == SCALE_SCALE )
|
||||
return( $dimension );
|
||||
|
||||
return( (int)(($dimension*SCALE_SCALE)/$scale) );
|
||||
for ( $i = 1; $i < func_num_args(); $i++ )
|
||||
{
|
||||
$scale = func_get_arg( $i );
|
||||
if ( !empty($scale) && $scale != SCALE_SCALE )
|
||||
$dimension = (int)(($dimension*SCALE_SCALE)/$scale);
|
||||
}
|
||||
return( $dimension );
|
||||
}
|
||||
|
||||
function parseSort( $save_to_session=false )
|
||||
|
@ -1066,4 +1072,14 @@ function fixSequences()
|
|||
$sequence++;
|
||||
}
|
||||
}
|
||||
|
||||
function firstSet()
|
||||
{
|
||||
foreach ( func_get_args() as $arg )
|
||||
{
|
||||
if ( !empty( $arg ) )
|
||||
return( $arg );
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -84,8 +84,10 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( $row['Function'] != 'None' )
|
||||
{
|
||||
$cycle_count++;
|
||||
if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
|
||||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
$scale_width = reScale( $row['Width'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$scale_height = reScale( $row['Height'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
if ( $max_width < $scale_width ) $max_width = $scale_width;
|
||||
if ( $max_height < $scale_height ) $max_height = $scale_height;
|
||||
}
|
||||
$monitors[] = $row = array_merge( $row, $row2, $row3 );
|
||||
$seq_id_list[] = $row['Id'];
|
||||
|
@ -329,8 +331,9 @@ foreach( $monitors as $monitor )
|
|||
{
|
||||
$fclass .= "em";
|
||||
}
|
||||
$scale = max( reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_SCALE );
|
||||
?>
|
||||
<td align="left" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=watch&mid=".$monitor['Id']."', 'zmWatch".$monitor['Id']."', ".($monitor['Width']+$jws['watch']['w']).", ".($monitor['Height']+$jws['watch']['h'])." );", $monitor['Name'], ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
||||
<td align="left" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=watch&mid=".$monitor['Id']."', 'zmWatch".$monitor['Id']."', ".(reScale( $monitor['Width'], $scale )+$jws['watch']['w']).", ".(reScale( $monitor['Height'], $scale )+$jws['watch']['h'])." );", $monitor['Name'], ($monitor['Function'] != 'None') && canView( 'Stream' ) ) ?></td>
|
||||
<td align="left" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=function&mid=".$monitor['Id']."', 'zmFunction', ".$jws['function']['w'].", ".$jws['function']['h']." );", "<span class=\"$fclass\">".$monitor['Function']."</span>", canEdit( 'Monitors' ) ) ?></td>
|
||||
<?php if ( $monitor['Type'] == "Local" ) { ?>
|
||||
<td align="left" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=monitor&mid=".$monitor['Id']."', 'zmMonitor', ".$jws['monitor']['w'].", ".$jws['monitor']['h']." );", "<span class=\"$dclass\">".$monitor['Device']." (".$monitor['Channel'].")</span>", canEdit( 'Monitors' ) ) ?></td>
|
||||
|
|
|
@ -47,8 +47,6 @@ if ( !$result )
|
|||
die( mysql_error() );
|
||||
$monitors = array();
|
||||
$mon_idx = 0;
|
||||
$max_width = 0;
|
||||
$max_height = 0;
|
||||
while( $row = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
if ( !visibleMonitor( $row['Id'] ) )
|
||||
|
@ -57,15 +55,15 @@ while( $row = mysql_fetch_assoc( $result ) )
|
|||
}
|
||||
if ( isset($mid) && $row['Id'] == $mid )
|
||||
$mon_idx = count($monitors);
|
||||
if ( $max_width < $row['Width'] ) $max_width = $row['Width'];
|
||||
if ( $max_height < $row['Height'] ) $max_height = $row['Height'];
|
||||
$row['ScaledWidth'] = reScale( $monitor['Width'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$row['ScaledHeight'] = reScale( $monitor['Height'], $row['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$monitors[] = $row;
|
||||
}
|
||||
|
||||
$monitor = $monitors[$mon_idx];
|
||||
$next_mid = $mon_idx==(count($monitors)-1)?$monitors[0]['Id']:$monitors[$mon_idx+1]['Id'];
|
||||
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:$monitor['Width'];
|
||||
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$monitor['Height'];
|
||||
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:$monitor['ScaledWidth'];
|
||||
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$monitor['ScaledHeight'];
|
||||
$width_scale = ($montage_width*SCALE_SCALE)/$monitor['Width'];
|
||||
$height_scale = ($montage_height*SCALE_SCALE)/$monitor['Height'];
|
||||
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
|
||||
|
|
|
@ -40,7 +40,7 @@ else
|
|||
$mid_sql = '';
|
||||
}
|
||||
|
||||
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
|
||||
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
|
@ -78,7 +78,7 @@ while ( $row = mysql_fetch_assoc( $result ) )
|
|||
if ( !isset( $rate ) )
|
||||
$rate = ZM_WEB_DEFAULT_RATE;
|
||||
if ( !isset( $scale ) )
|
||||
$scale = ZM_WEB_DEFAULT_SCALE;
|
||||
$scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
||||
$frames_per_page = ZM_WEB_FRAMES_PER_LINE * ZM_WEB_FRAME_LINES;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ if ( !canView( 'Events' ) )
|
|||
}
|
||||
|
||||
$count_sql = "select count(E.Id) as EventCount from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
|
||||
$events_sql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,E.Name,E.Cause,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
|
||||
$events_sql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,M.DefaultScale,E.Name,E.Cause,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived,E.LearnState from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where";
|
||||
if ( $user['MonitorIds'] )
|
||||
{
|
||||
$count_sql .= " M.Id in (".join( ",", preg_split( '/["\'\s]*,["\'\s]*/', $user['MonitorIds'] ) ).")";
|
||||
|
@ -128,8 +128,11 @@ else
|
|||
while( $event = mysql_fetch_assoc( $result ) )
|
||||
{
|
||||
$events[] = $event;
|
||||
if ( $max_width < $event['Width'] ) $max_width = $event['Width'];
|
||||
if ( $max_height < $event['Height'] ) $max_height = $event['Height'];
|
||||
$scale = max( reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_SCALE );
|
||||
$event_width = reScale( $event['Width'], $scale );
|
||||
$event_height = reScale( $event['Height'], $$scale );
|
||||
if ( $max_width < $event_width ) $max_width = $event_width;
|
||||
if ( $max_height < $event_height ) $max_height = $event_height;
|
||||
if ( $event['Archived'] )
|
||||
$archived = true;
|
||||
else
|
||||
|
@ -386,10 +389,12 @@ function viewEvents( form, name )
|
|||
$bgcolor = "#FFC0CB";
|
||||
else
|
||||
unset( $bgcolor );
|
||||
|
||||
$scale = max( reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_SCALE );
|
||||
?>
|
||||
<tr<?= ' bgcolor="'.(isset($bgcolor)?$bgcolor:"#FFFFFF").'"' ?> >
|
||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= $event['Width']+$jws['event']['w'] ?>, <?= $event['Height']+$jws['event']['h'] ?> );"><?= $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
|
||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= $event['Width']+$jws['event']['w'] ?>, <?= $event['Height']+$jws['event']['h'] ?> );"><?= $event['Name'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
|
||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= reScale( $event['Width'], $scale )+$jws['event']['w'] ?>, <?= reScale( $event['Height'], $scale )+$jws['event']['h'] ?> );"><?= $event['Id'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
|
||||
<td align="center" class="text"><a href="javascript: eventWindow( '<?= $PHP_SELF ?>?view=event&eid=<?= $event['Id'] ?><?= $filter_query ?><?= $sort_query ?>&page=1', 'zmEvent', <?= reScale( $event['Width'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['w'] ?>, <?= reScale( $event['Height'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['h'] ?> );"><?= $event['Name'] ?><?php if ( $event['Archived'] ) echo "*" ?></a></td>
|
||||
<td align="center" class="text"><?= $event['MonitorName'] ?></td>
|
||||
<td align="center" class="text"><?= makeLink( "javascript: newWindow( '$PHP_SELF?view=eventdetail&eid=".$event['Id']."', 'zmEventDetail', ".$jws['eventdetail']['w'].", ".$jws['eventdetail']['h']." );", $event['Cause'], canEdit( 'Events' ) ) ?></td>
|
||||
<td align="center" class="text"><?= strftime( "%m/%d %H:%M:%S", strtotime($event['StartTime']) ) ?></td>
|
||||
|
@ -398,13 +403,13 @@ function viewEvents( form, name )
|
|||
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frames&eid=<?= $event['Id'] ?>', 'zmFrames', <?= $jws['frames']['w'] ?>, <?= $jws['frames']['h'] ?> );"><?= $event['AlarmFrames'] ?></a></td>
|
||||
<td align="center" class="text"><?= $event['TotScore'] ?></td>
|
||||
<td align="center" class="text"><?= $event['AvgScore'] ?></td>
|
||||
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $event['Id'] ?>&fid=0', 'zmImage', <?= $event['Width']+$jws['image']['w'] ?>, <?= $event['Height']+$jws['image']['h'] ?> );"><?= $event['MaxScore'] ?></a></td>
|
||||
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $event['Id'] ?>&fid=0', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w'] ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><?= $event['MaxScore'] ?></a></td>
|
||||
<?php
|
||||
if ( ZM_WEB_LIST_THUMBS )
|
||||
{
|
||||
$thumb_data = createListThumbnail( $event );
|
||||
?>
|
||||
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $thumb_data['FrameId'] ?>', 'zmImage', <?= $event['Width']+$jws['image']['w'] ?>, <?= $event['Height']+$jws['image']['h'] ?> );"><img src="<?= $thumb_data['Path'] ?>" width="<?= $thumb_data['Width'] ?>" height="<?= $thumb_data['Height'] ?>" border="0" alt="<?= $thumb_data['FrameId'] ?>/<?= $event['MaxScore'] ?>"></a></td>
|
||||
<td align="center" class="text"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $event['Id'] ?>&fid=<?= $thumb_data['FrameId'] ?>', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w'] ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><img src="<?= $thumb_data['Path'] ?>" width="<?= $thumb_data['Width'] ?>" height="<?= $thumb_data['Height'] ?>" border="0" alt="<?= $thumb_data['FrameId'] ?>/<?= $event['MaxScore'] ?>"></a></td>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -23,7 +23,7 @@ if ( !canView( 'Events' ) )
|
|||
$view = "error";
|
||||
return;
|
||||
}
|
||||
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
|
||||
$result = mysql_query( "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E, Monitors as M where E.Id = '$eid' and E.MonitorId = M.Id" );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
|
@ -96,7 +96,7 @@ function deleteEvent()
|
|||
<td width="20%" align="center" class="text"><?php if ( canEdit( 'Events' ) ) { ?><a href="javascript: deleteEvent();"><?= $zmSlangDelete ?></a><?php } else { ?> <?php } ?></td>
|
||||
<td width="20%" align="right" class="text"><a href="javascript: closeWindow();"><?= $zmSlangClose ?></a></td>
|
||||
</tr>
|
||||
<tr><td colspan="3" align="center"><img src="<?= $image_path ?>" width="<?= $event['Width'] ?>" height="<?= $event['Height'] ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<tr><td colspan="3" align="center"><img src="<?= $image_path ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" height="<?= reScale( $event['Height'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<tr>
|
||||
<tr><td colspan="3" align="center"><table width="96%" cellpaddin="0" cellspacing="0" border="0"><tr>
|
||||
<?php if ( $fid > 1 ) { ?>
|
||||
|
@ -120,11 +120,13 @@ function deleteEvent()
|
|||
</table></td></tr>
|
||||
<?php if (file_exists ($d_image_path)) { ?>
|
||||
<tr><td colspan="3"><?= $d_image_path ?></tr>
|
||||
<tr><td colspan="3"><img src="<?= $d_image_path ?>" width="<?= $event['Width'] ?>" height="<?= $event['Height'] ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<tr><td colspan="3"><img src="<?= $d_image_path ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" height="<?= reScale( $event['He
|
||||
ight'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<?php } ?>
|
||||
<?php if (file_exists ($r_image_path)) { ?>
|
||||
<tr><td colspan="3"><?= $r_image_path ?></tr>
|
||||
<tr><td colspan="3"><img src="<?= $r_image_path ?>" width="<?= $event['Width'] ?>" height="<?= $event['Height'] ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<tr><td colspan="3"><img src="<?= $r_image_path ?>" width="<?= reScale( $event['Width'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" height="<?= reScale( $event['He
|
||||
ight'], $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>" class="<?= $img_class ?>"></td></tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</body>
|
||||
|
|
|
@ -95,6 +95,7 @@ else
|
|||
$monitor['MaxFPS'] = 0;
|
||||
$monitor['FPSReportInterval'] = 1000;
|
||||
$monitor['RefBlendPerc'] = 10;
|
||||
$monitor['DefaultScale'] = '100';
|
||||
$monitor['WebColour'] = 'red';
|
||||
$monitor['Triggers'] = "";
|
||||
}
|
||||
|
@ -327,6 +328,7 @@ if ( $tab != 'misc' )
|
|||
<input type="hidden" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>">
|
||||
<input type="hidden" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>">
|
||||
<input type="hidden" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>">
|
||||
<input type="hidden" name="new_monitor[DefaultScale]" value="<?= $new_monitor['DefaultScale'] ?>">
|
||||
<input type="hidden" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>">
|
||||
<?php
|
||||
}
|
||||
|
@ -491,6 +493,7 @@ switch ( $tab )
|
|||
<tr><td align="left" class="text"><?= $zmSlangMaximumFPS ?></td><td align="left" class="text"><input type="text" name="new_monitor[MaxFPS]" value="<?= $new_monitor['MaxFPS'] ?>" size="6" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangFPSReportInterval ?></td><td align="left" class="text"><input type="text" name="new_monitor[FPSReportInterval]" value="<?= $new_monitor['FPSReportInterval'] ?>" size="6" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangRefImageBlendPct ?></td><td align="left" class="text"><input type="text" name="new_monitor[RefBlendPerc]" value="<?= $new_monitor['RefBlendPerc'] ?>" size="4" class="form"></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangDefaultScale ?></td><td align="left" class="text"><?= buildSelect( "new_monitor[DefaultScale]", $scales ); ?></td></tr>
|
||||
<tr><td align="left" class="text"><?= $zmSlangWebColour ?></td><td align="left" class="text"><input type="text" name="new_monitor[WebColour]" value="<?= $new_monitor['WebColour'] ?>" size="10" class="form" onChange="document.getElementById('Swatch').style.backgroundColor=this.value"> <span id="Swatch" style="background-color: <?= $new_monitor['WebColour'] ?>; border: 1px solid black; width: 20px; height: 10px; padding: 0px;"> </span></td></tr>
|
||||
<?php
|
||||
break;
|
||||
|
|
|
@ -45,8 +45,8 @@ if ( !$result )
|
|||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
|
||||
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:$monitor['Width'];
|
||||
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$monitor['Height'];
|
||||
$montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
$width_scale = ($montage_width*SCALE_SCALE)/$monitor['Width'];
|
||||
$height_scale = ($montage_height*SCALE_SCALE)/$monitor['Height'];
|
||||
$scale = (int)(($width_scale<$height_scale)?$width_scale:$height_scale);
|
||||
|
|
|
@ -689,20 +689,22 @@ function getSlotLoadImageBehaviour( $slot )
|
|||
$image_path = $anal_image;
|
||||
}
|
||||
|
||||
$annotation = $monitors[$slot['event']['MonitorId']]['Name'].
|
||||
$monitor = &$monitors[$slot['event']['MonitorId']];
|
||||
$annotation = $monitor['Name'].
|
||||
"<br>".$slot['event']['Name'].(isset($slot['frame'])?("(".$slot['frame']['FrameId'].")"):"").
|
||||
"<br>".strftime( "%y/%m/%d %H:%M:%S", strtotime($slot['event']['StartTime']) ).
|
||||
" - ".$slot['event']['Length']."s".
|
||||
"<br>".htmlentities($slot['event']['Cause']).
|
||||
(!empty($slot['event']['Notes'])?("<br>".htmlentities($slot['event']['Notes'])):"");
|
||||
return( "\"loadEventImage( '".$image_path."', '".$annotation."', '".$PHP_SELF."?view=event&eid=".$slot['event']['Id']."', ".($monitors[$slot['event']['MonitorId']]['Width']+$jws['event']['w']).", ".($monitors[$slot['event']['MonitorId']]['Height']+$jws['event']['h'])." );\"" );
|
||||
return( "\"loadEventImage( '".$image_path."', '".$annotation."', '".$PHP_SELF."?view=event&eid=".$slot['event']['Id']."', ".(reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['w']).", ".(reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['h'])." );\"" );
|
||||
}
|
||||
|
||||
function getSlotViewEventBehaviour( $slot )
|
||||
{
|
||||
global $monitors, $jws, $PHP_SELF;
|
||||
|
||||
return( "\"eventWindow( '".$PHP_SELF."?view=event&eid=".$slot['event']['Id']."', 'zmEvent', ".($monitors[$slot['event']['MonitorId']]['Width']+$jws['event']['w']).", ".($monitors[$slot['event']['MonitorId']]['Height']+$jws['event']['h'])." );\"" );
|
||||
$monitor = &$monitors[$slot['event']['MonitorId']];
|
||||
return( "\"eventWindow( '".$PHP_SELF."?view=event&eid=".$slot['event']['Id']."', 'zmEvent', ".(reScale( $monitor['Width'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['w']).", ".(reScale( $monitor['Height'], $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE )+$jws['event']['h'])." );\"" );
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -32,16 +32,16 @@ else
|
|||
{
|
||||
$mid_sql = '';
|
||||
}
|
||||
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
|
||||
$sql = "select E.*,M.Name as MonitorName,M.Width,M.Height,M.DefaultScale from Events as E inner join Monitors as M on E.MonitorId = M.Id where E.Id = '$eid'$mid_sql";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$event = mysql_fetch_assoc( $result );
|
||||
|
||||
if ( !isset( $rate ) )
|
||||
$rate = RATE_SCALE;
|
||||
$rate = ZM_WEB_DEFAULT_RATE;
|
||||
if ( !isset( $scale ) )
|
||||
$scale = SCALE_SCALE;
|
||||
$scale = reScale( SCALE_SCALE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
||||
$event_dir = ZM_DIR_EVENTS."/".$event['MonitorId']."/".sprintf( "%d", $eid );
|
||||
|
||||
|
|
|
@ -29,10 +29,8 @@ if ( !$result )
|
|||
$monitor = mysql_fetch_assoc( $result );
|
||||
|
||||
if ( !isset($scale) )
|
||||
$scale = ZM_WEB_DEFAULT_SCALE;
|
||||
$scale = max( reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_SCALE );
|
||||
|
||||
$width_scale = ($scale<SCALE_SCALE)?SCALE_SCALE:$scale;
|
||||
$height_scale = $scale;
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<html>
|
||||
|
@ -40,14 +38,14 @@ $height_scale = $scale;
|
|||
<title><?= ZM_WEB_TITLE_PREFIX ?> - <?= $monitor['Name'] ?> - <?= $zmSlangWatch ?></title>
|
||||
<link rel="stylesheet" href="zm_html_styles.css" type="text/css">
|
||||
<script type="text/javascript">
|
||||
window.resizeTo( <?= reScale($monitor['Width'],$width_scale)+$jws['watch']['w'] ?>, <?= reScale($monitor['Height'],$height_scale)+$jws['watch']['h'] ?> );
|
||||
window.resizeTo( <?= reScale($monitor['Width'],$scale)+$jws['watch']['w'] ?>, <?= reScale($monitor['Height'],$scale)+$jws['watch']['h'] ?> );
|
||||
//opener.location.reload();
|
||||
window.focus();
|
||||
</script>
|
||||
</head>
|
||||
<frameset rows="24,<?= reScale($monitor['Height'],$height_scale)+8 ?>,16,*" border="0" frameborder="no" framespacing="0">
|
||||
<frame src="<?= $PHP_SELF ?>?view=watchmenu&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= $scale ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorMenu<?= $monitor['Id' ] ?>" scrolling="no">
|
||||
<frame src="<?= $PHP_SELF ?>?view=watchfeed&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= $scale ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorStream<?= $monitor['Id' ] ?>" scrolling="no">
|
||||
<frameset rows="24,<?= reScale($monitor['Height'],$scale)+8 ?>,16,*" border="0" frameborder="no" framespacing="0">
|
||||
<frame src="<?= $PHP_SELF ?>?view=watchmenu&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorMenu<?= $monitor['Id' ] ?>" scrolling="no">
|
||||
<frame src="<?= $PHP_SELF ?>?view=watchfeed&mode=<?= $mode ?>&mid=<?= $monitor['Id'] ?>&scale=<?= reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE ) ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorStream<?= $monitor['Id' ] ?>" scrolling="no">
|
||||
<frame src="<?= $PHP_SELF ?>?view=watchstatus&mid=<?= $monitor['Id'] ?>&control=<?= $control ?>" marginwidth="0" marginheight="0" name="MonitorStatus<?= $monitor['Id' ] ?>" scrolling="no">
|
||||
<?php
|
||||
if ( $control )
|
||||
|
|
|
@ -32,15 +32,15 @@ if ( empty($mode) )
|
|||
$mode = "still";
|
||||
}
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = ZM_WEB_DEFAULT_SCALE;
|
||||
|
||||
$sql = "select M.*,C.CanMoveMap,C.CanMoveRel from Monitors as M left join Controls as C on (M.ControlId = C.Id ) where M.Id = '$mid'";
|
||||
$result = mysql_query( $sql );
|
||||
if ( !$result )
|
||||
die( mysql_error() );
|
||||
$monitor = mysql_fetch_assoc( $result );
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = reScale( SCALE_SCALE, $monitor['DefaultScale'], ZM_WEB_DEFAULT_SCALE );
|
||||
|
||||
if ( $mode != "stream" )
|
||||
{
|
||||
// Prompt an image to be generated
|
||||
|
|
|
@ -38,7 +38,7 @@ if ( !$result )
|
|||
$monitor = mysql_fetch_assoc( $result );
|
||||
|
||||
if ( !isset( $scale ) )
|
||||
$scale = ZM_WEB_DEFAULT_SCALE;
|
||||
$scale = $monitor['DefaultScale'] * ZM_WEB_DEFAULT_SCALE;
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
|
|
|
@ -195,6 +195,7 @@ $zmSlangControlType = 'Control Type';
|
|||
$zmSlangCycle = 'Cycle';
|
||||
$zmSlangCycleWatch = 'Cycle Watch';
|
||||
$zmSlangDay = 'Day';
|
||||
$zmSlangDefaultScale = 'Default Scale';
|
||||
$zmSlangDeleteAndNext = 'Delete & Next';
|
||||
$zmSlangDeleteAndPrev = 'Delete & Prev';
|
||||
$zmSlangDelete = 'Delete';
|
||||
|
|
Loading…
Reference in New Issue