JFJochStateMachine: Limit ProtoBuf structures
This commit is contained in:
@@ -63,10 +63,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ", "[JFJochReceiver]") {
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
JFJochProtoBuf::BrokerStatus status;
|
||||
BrokerStatus status;
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress() == Approx(0.0));
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::DATA_COLLECTION);
|
||||
REQUIRE(status.progress == Approx(0.0));
|
||||
REQUIRE(status.broker_state == JFJochState::Measuring);
|
||||
|
||||
for (int i = 0; i < ndatastream; i++) {
|
||||
for (int m = 0; m < state_machine.NotThreadSafe_Experiment().GetModulesNum(i); m++) {
|
||||
@@ -80,20 +80,20 @@ TEST_CASE("JFJochIntegrationTest_ZMQ", "[JFJochReceiver]") {
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::IDLE);
|
||||
REQUIRE(status.broker_state == JFJochState::Idle);
|
||||
|
||||
auto tmp = state_machine.GetMeasurementStatistics();
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.max_image_number_sent() == 4);
|
||||
REQUIRE(!statistics.cancelled());
|
||||
REQUIRE(statistics.file_prefix() == "integration_test");
|
||||
REQUIRE(statistics.detector_width() == 2068);
|
||||
REQUIRE(statistics.detector_height() == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth() == 2);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
REQUIRE(statistics.max_image_number_sent == 4);
|
||||
REQUIRE(!statistics.cancelled);
|
||||
REQUIRE(statistics.file_prefix == "integration_test");
|
||||
REQUIRE(statistics.detector_width == 2068);
|
||||
REQUIRE(statistics.detector_height == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth == 2);
|
||||
writer_future.get();
|
||||
}
|
||||
|
||||
@@ -149,10 +149,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_save_calibration", "[JFJochReceiver]") {
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
JFJochProtoBuf::BrokerStatus status;
|
||||
BrokerStatus status;
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress() == Approx(0.0));
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::DATA_COLLECTION);
|
||||
REQUIRE(status.progress == Approx(0.0));
|
||||
REQUIRE(status.broker_state == JFJochState::Measuring);
|
||||
|
||||
for (int i = 0; i < ndatastream; i++) {
|
||||
for (int m = 0; m < state_machine.NotThreadSafe_Experiment().GetModulesNum(i); m++) {
|
||||
@@ -166,20 +166,20 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_save_calibration", "[JFJochReceiver]") {
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::IDLE);
|
||||
REQUIRE(status.broker_state == JFJochState::Idle);
|
||||
|
||||
auto tmp = state_machine.GetMeasurementStatistics();
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.max_image_number_sent() == 4);
|
||||
REQUIRE(!statistics.cancelled());
|
||||
REQUIRE(statistics.file_prefix() == "integration_test_with_calibration");
|
||||
REQUIRE(statistics.detector_width() == 2068);
|
||||
REQUIRE(statistics.detector_height() == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth() == 2);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
REQUIRE(statistics.max_image_number_sent == 4);
|
||||
REQUIRE(!statistics.cancelled);
|
||||
REQUIRE(statistics.file_prefix == "integration_test_with_calibration");
|
||||
REQUIRE(statistics.detector_width == 2068);
|
||||
REQUIRE(statistics.detector_height == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth == 2);
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
|
||||
@@ -235,10 +235,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_2DataStreams_4Devices", "[JFJochReceiver]")
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
JFJochProtoBuf::BrokerStatus status;
|
||||
BrokerStatus status;
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress() == Approx(0.0));
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::DATA_COLLECTION);
|
||||
REQUIRE(status.progress == Approx(0.0));
|
||||
REQUIRE(status.broker_state == JFJochState::Measuring);
|
||||
|
||||
for (int i = 0; i < ndatastream; i++) {
|
||||
for (int m = 0; m < state_machine.NotThreadSafe_Experiment().GetModulesNum(i); m++) {
|
||||
@@ -252,20 +252,20 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_2DataStreams_4Devices", "[JFJochReceiver]")
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::IDLE);
|
||||
REQUIRE(status.broker_state == JFJochState::Idle);
|
||||
|
||||
auto tmp = state_machine.GetMeasurementStatistics();
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.max_image_number_sent() == 4);
|
||||
REQUIRE(!statistics.cancelled());
|
||||
REQUIRE(statistics.file_prefix() == "integration_test");
|
||||
REQUIRE(statistics.detector_width() == 2068);
|
||||
REQUIRE(statistics.detector_height() == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth() == 2);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
REQUIRE(statistics.max_image_number_sent == 4);
|
||||
REQUIRE(!statistics.cancelled);
|
||||
REQUIRE(statistics.file_prefix == "integration_test");
|
||||
REQUIRE(statistics.detector_width == 2068);
|
||||
REQUIRE(statistics.detector_height == 2164);
|
||||
REQUIRE(statistics.detector_pixel_depth == 2);
|
||||
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
@@ -326,10 +326,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_RAW", "[JFJochReceiver]") {
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
JFJochProtoBuf::BrokerStatus status;
|
||||
BrokerStatus status;
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress() == Approx(0.0));
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::DATA_COLLECTION);
|
||||
REQUIRE(status.progress == Approx(0.0));
|
||||
REQUIRE(status.broker_state == JFJochState::Measuring);
|
||||
|
||||
for (int i = 0; i < ndatastream; i++) {
|
||||
for (int m = 0; m < state_machine.NotThreadSafe_Experiment().GetModulesNum(i); m++) {
|
||||
@@ -343,18 +343,18 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_RAW", "[JFJochReceiver]") {
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::IDLE);
|
||||
REQUIRE(status.broker_state == JFJochState::Idle);
|
||||
|
||||
auto tmp = state_machine.GetMeasurementStatistics();
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.file_prefix() == "integration_raw_test");
|
||||
REQUIRE(statistics.detector_width() == 1024);
|
||||
REQUIRE(statistics.detector_height() == 8 * 512);
|
||||
REQUIRE(statistics.detector_pixel_depth() == 2);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
REQUIRE(statistics.file_prefix == "integration_raw_test");
|
||||
REQUIRE(statistics.detector_width == 1024);
|
||||
REQUIRE(statistics.detector_height == 8 * 512);
|
||||
REQUIRE(statistics.detector_pixel_depth == 2);
|
||||
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
@@ -415,10 +415,9 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_3Writers", "[JFJochReceiver]") {
|
||||
REQUIRE_NOTHROW(state_machine.Start(setup));
|
||||
logger.Info("Started measurement");
|
||||
|
||||
JFJochProtoBuf::BrokerStatus status;
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress() == Approx(0.0));
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::DATA_COLLECTION);
|
||||
auto status = state_machine.GetStatus();
|
||||
REQUIRE(status.progress == Approx(0.0));
|
||||
REQUIRE(status.broker_state == JFJochState::Measuring);
|
||||
|
||||
for (int i = 0; i < ndatastream; i++) {
|
||||
for (int image_num = 1; image_num <= nimages; image_num++) {
|
||||
@@ -432,14 +431,14 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_3Writers", "[JFJochReceiver]") {
|
||||
logger.Info("Stopped measurement");
|
||||
|
||||
status = state_machine.GetStatus();
|
||||
REQUIRE(status.broker_state() == JFJochProtoBuf::IDLE);
|
||||
REQUIRE(status.broker_state == JFJochState::Idle);
|
||||
|
||||
auto tmp = state_machine.GetMeasurementStatistics();
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == nimages);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == nimages);
|
||||
|
||||
REQUIRE_NOTHROW(writer_0_future.get());
|
||||
REQUIRE_NOTHROW(writer_1_future.get());
|
||||
@@ -510,10 +509,10 @@ TEST_CASE("JFJochIntegrationTest_Cancel", "[JFJochReceiver]") {
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 0.5);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.max_image_number_sent() == 4);
|
||||
REQUIRE(statistics.cancelled());
|
||||
REQUIRE(statistics.collection_efficiency == 0.5);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
REQUIRE(statistics.max_image_number_sent == 4);
|
||||
REQUIRE(statistics.cancelled);
|
||||
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
@@ -613,8 +612,8 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_with_preview", "[JFJochReceiver]") {
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
@@ -709,8 +708,8 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_with_preview_no_writer", "[JFJochReceiver]"
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 5);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 5);
|
||||
}
|
||||
|
||||
TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot", "[JFJochReceiver]") {
|
||||
@@ -815,8 +814,8 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot", "[JFJochReceiver]") {
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == 1);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == 1);
|
||||
|
||||
REQUIRE_NOTHROW(writer_future.get());
|
||||
}
|
||||
@@ -927,10 +926,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index", "[JFJochReceiver]
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.has_indexing_rate());
|
||||
REQUIRE(statistics.indexing_rate() == 1.0);
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == nimages);
|
||||
REQUIRE(statistics.has_indexing_rate);
|
||||
REQUIRE(statistics.indexing_rate == 1.0);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == nimages);
|
||||
|
||||
|
||||
writer_server->Shutdown();
|
||||
@@ -1158,10 +1157,10 @@ TEST_CASE("JFJochIntegrationTest_ZMQ_lysozyme_spot_and_index_sum", "[JFJochRecei
|
||||
REQUIRE(tmp.has_value());
|
||||
auto statistics = tmp.value();
|
||||
|
||||
REQUIRE(statistics.collection_efficiency() == 1.0);
|
||||
REQUIRE(statistics.images_collected() == nimages / 3);
|
||||
REQUIRE(statistics.has_indexing_rate());
|
||||
REQUIRE(statistics.indexing_rate() == 1.0);
|
||||
REQUIRE(statistics.collection_efficiency == 1.0);
|
||||
REQUIRE(statistics.images_collected == nimages / 3);
|
||||
REQUIRE(statistics.has_indexing_rate);
|
||||
REQUIRE(statistics.indexing_rate == 1.0);
|
||||
|
||||
|
||||
writer_server->Shutdown();
|
||||
|
||||
Reference in New Issue
Block a user