Function to rescale dimenions of events.

This commit is contained in:
Kyle Johnson 2013-05-30 20:25:18 -04:00
parent e107e34164
commit c2e2079818
1 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,17 @@ class AppModel extends Model {
$string = $zm_path_bin."/zmdc.pl status";
$daemon_status = shell_exec ( $string );
return $daemon_status;
}
}
public function reScale( $dimension, $dummy) {
$scale_base = Configure::read('SCALE_BASE');
for ( $i = 1; $i < func_num_args(); $i++ ) {
$scale = func_get_arg( $i );
if ( !empty($scale) && $scale != $scale_base ) {
$dimension = (int)(($dimension*$scale)/$scale_base);
}
}
return( $dimension );
}
}