fix logic causing segfault instead of waiting for zmc. Remove trailing whitespaces

This commit is contained in:
Isaac Connor 2020-11-18 09:56:13 -05:00
parent 9713a2ec00
commit 6542072334
1 changed files with 16 additions and 20 deletions

View File

@ -425,8 +425,6 @@ Monitor::Monitor(
else
event_close_mode = CLOSE_IDLE;
Debug(1, "monitor purpose=%d", purpose);
mem_size = sizeof(SharedData)
+ sizeof(TriggerData)
+ sizeof(VideoStoreData) //Information to pass back to the capture process
@ -492,20 +490,18 @@ Monitor::Monitor(
//video_store_data->frameNumber = 0;
} else if ( purpose == ANALYSIS ) {
while (
(!zm_terminate)
and
( !(this->connect() and shared_data->valid) )
and
or
( shared_data->last_write_index == (unsigned int)image_buffer_count )
and
or
( shared_data->last_write_time == 0 )
) {
Debug(1, "blah");
Debug(1, "Waiting for capture daemon shared_data(%d) last_write_index(%d), last_write_time(%d)",
(shared_data ? 1:0),
(shared_data ? shared_data->last_write_index : 0),
(shared_data ? shared_data->last_write_time : 0));
usleep(100000);
sleep(1);
if ( zm_terminate ) break;
}
ref_image.Assign(width, height, camera->Colours(), camera->SubpixelOrder(),
@ -666,7 +662,7 @@ bool Monitor::connect() {
images = new Image *[pre_event_count];
last_signal = shared_data->signal;
} // end if purpose == ANALYSIS
Debug(3, "Success connecting");
Debug(3, "Success connecting");
return true;
} // end Monitor::connect