whitespacing updates

This commit is contained in:
Isaac Connor
2016-06-21 12:21:18 -04:00
parent 31a5252afa
commit 6a8db582ff
20 changed files with 3841 additions and 3838 deletions

View File

@@ -504,7 +504,7 @@ Monitor::Monitor(
}
bool Monitor::connect() {
Debug(3, "Connecting to monitor. Purpose is %d", purpose );
Debug(3, "Connecting to monitor. Purpose is %d", purpose );
#if ZM_MEM_MAPPED
snprintf( mem_file, sizeof(mem_file), "%s/zm.mmap.%d", config.path_map, id );
map_fd = open( mem_file, O_RDWR|O_CREAT, (mode_t)0600 );
@@ -564,7 +564,7 @@ bool Monitor::connect() {
Debug(3,"Aligning shared memory images to the next 16 byte boundary");
shared_images = (uint8_t*)((unsigned long)shared_images + (16 - ((unsigned long)shared_images % 16)));
}
Debug(3, "Allocating %d image buffers", image_buffer_count );
Debug(3, "Allocating %d image buffers", image_buffer_count );
image_buffer = new Snapshot[image_buffer_count];
for ( int i = 0; i < image_buffer_count; i++ ) {
image_buffer[i].timestamp = &(shared_timestamps[i]);
@@ -1338,7 +1338,7 @@ bool Monitor::Analyse()
if ( shared_data->action )
{
// Can there be more than 1 bit set in the action? Shouldn't these be elseifs?
// Can there be more than 1 bit set in the action? Shouldn't these be elseifs?
if ( shared_data->action & RELOAD )
{
Info( "Received reload indication at count %d", image_count );
@@ -1352,7 +1352,7 @@ bool Monitor::Analyse()
Info( "Received suspend indication at count %d", image_count );
shared_data->active = false;
//closeEvent();
} else {
} else {
Info( "Received suspend indication at count %d, but wasn't active", image_count );
}
if ( config.max_suspend_time )
@@ -1401,7 +1401,7 @@ bool Monitor::Analyse()
{
bool signal = shared_data->signal;
bool signal_change = (signal != last_signal);
Debug(3, "Motion detection is enabled signal(%d) signal_change(%d)", signal, signal_change);
Debug(3, "Motion detection is enabled signal(%d) signal_change(%d)", signal, signal_change);
//Set video recording flag for event start constructor and easy reference in code
// TODO: Use enum instead of the # 2. Makes for easier reading
@@ -1467,9 +1467,9 @@ bool Monitor::Analyse()
// Get new score.
motion_score = DetectMotion( *snap_image, zoneSet );
Debug( 3, "After motion detection, last_motion_score(%d), new motion score(%d)", last_motion_score, motion_score );
// Why are we updating the last_motion_score too?
last_motion_score = motion_score;
Debug( 3, "After motion detection, last_motion_score(%d), new motion score(%d)", last_motion_score, motion_score );
// Why are we updating the last_motion_score too?
last_motion_score = motion_score;
}
//int motion_score = DetectBlack( *snap_image, zoneSet );
if ( motion_score )
@@ -1531,27 +1531,27 @@ bool Monitor::Analyse()
//TODO: We shouldn't have to do this every time. Not sure why it clears itself if this isn't here??
snprintf(video_store_data->event_file, sizeof(video_store_data->event_file), "%s", event->getEventFile());
if ( section_length ) {
int section_mod = timestamp->tv_sec%section_length;
Debug( 3, "Section length (%d) Last Section Mod(%d), new section mod(%d)", section_length, last_section_mod, section_mod );
if ( section_mod < last_section_mod ) {
//if ( state == IDLE || state == TAPE || event_close_mode == CLOSE_TIME ) {
//if ( state == TAPE ) {
//shared_data->state = state = IDLE;
//Info( "%s: %03d - Closing event %d, section end", name, image_count, event->Id() )
//} else {
Info( "%s: %03d - Closing event %d, section end forced ", name, image_count, event->Id() );
//}
closeEvent();
last_section_mod = 0;
//} else {
//Debug( 2, "Time to close event, but state (%d) is not IDLE or TAPE and event_close_mode is not CLOSE_TIME (%d)", state, event_close_mode );
//}
} else {
last_section_mod = section_mod;
}
}
} // end if section_length
if ( section_length ) {
int section_mod = timestamp->tv_sec%section_length;
Debug( 3, "Section length (%d) Last Section Mod(%d), new section mod(%d)", section_length, last_section_mod, section_mod );
if ( section_mod < last_section_mod ) {
//if ( state == IDLE || state == TAPE || event_close_mode == CLOSE_TIME ) {
//if ( state == TAPE ) {
//shared_data->state = state = IDLE;
//Info( "%s: %03d - Closing event %d, section end", name, image_count, event->Id() )
//} else {
Info( "%s: %03d - Closing event %d, section end forced ", name, image_count, event->Id() );
//}
closeEvent();
last_section_mod = 0;
//} else {
//Debug( 2, "Time to close event, but state (%d) is not IDLE or TAPE and event_close_mode is not CLOSE_TIME (%d)", state, event_close_mode );
//}
} else {
last_section_mod = section_mod;
}
}
} // end if section_length
if ( !event )
{
@@ -4412,14 +4412,14 @@ void Monitor::SingleImageZip( int scale)
fwrite( img_buffer, img_buffer_size, 1, stdout );
}
unsigned int Monitor::Colours() const { return( camera->Colours() ); }
unsigned int Monitor::SubpixelOrder() const { return( camera->SubpixelOrder() ); }
int Monitor::PrimeCapture() {
return( camera->PrimeCapture() );
}
int Monitor::PreCapture() {
return( camera->PreCapture() );
}
int Monitor::PostCapture() {
return( camera->PostCapture() );
}
unsigned int Monitor::SubpixelOrder() const { return( camera->SubpixelOrder() ); }
int Monitor::PrimeCapture() {
return( camera->PrimeCapture() );
}
int Monitor::PreCapture() {
return( camera->PreCapture() );
}
int Monitor::PostCapture() {
return( camera->PostCapture() );
}
Monitor::Orientation Monitor::getOrientation()const { return orientation; }