use Monitor Id in path to diag images instead of monitor name as the name is a convenience link and not guaranteed to exist

pull/2077/head
Isaac Connor 2017-09-25 18:45:58 -04:00
parent 1791d3d5b7
commit 9f93bfc23b
1 changed files with 2 additions and 2 deletions

View File

@ -112,7 +112,7 @@ void Zone::Setup(
if ( config.record_diag_images ) {
static char diag_path[PATH_MAX] = "";
if ( ! diag_path[0] ) {
snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-poly.jpg", staticConfig.DIR_EVENTS.c_str(), monitor->Name(), id);
snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-poly.jpg", staticConfig.DIR_EVENTS.c_str(), monitor->Id(), id);
}
pg_image->WriteJpeg( diag_path );
}
@ -233,7 +233,7 @@ bool Zone::CheckAlarms( const Image *delta_image ) {
if ( config.record_diag_images ) {
static char diag_path[PATH_MAX] = "";
if ( ! diag_path[0] ) {
snprintf( diag_path, sizeof(diag_path), "%s/%s/diag-%d-%d.jpg", staticConfig.DIR_EVENTS.c_str(), monitor->Name(), id, 1 );
snprintf( diag_path, sizeof(diag_path), "%s/%d/diag-%d-%d.jpg", staticConfig.DIR_EVENTS.c_str(), monitor->Id(), id, 1 );
}
diff_image->WriteJpeg( diag_path );
}