JFJochStateMachine: Remove fetchign pedestal/mask through broker
This commit is contained in:
@@ -152,26 +152,6 @@ grpc::Status JFJochBroker::GetRadialIntegrationProfiles(grpc::ServerContext *con
|
||||
GRPC_RUN( *response = Convert(state_machine.GetRadialIntegrationProfiles()) );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetPedestalG0(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) {
|
||||
GRPC_RUN( *response = state_machine.GetPedestalG0() );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetPedestalG1(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) {
|
||||
GRPC_RUN( *response = state_machine.GetPedestalG1() );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetPedestalG2(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) {
|
||||
GRPC_RUN( *response = state_machine.GetPedestalG2() );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetMask(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) {
|
||||
GRPC_RUN( *response = state_machine.GetNeXusMask() );
|
||||
}
|
||||
|
||||
grpc::Status JFJochBroker::GetDetectorSettings(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::DetectorSettings *response) {
|
||||
GRPC_RUN( *response = state_machine.GetDetectorSettings() );
|
||||
|
||||
@@ -46,9 +46,6 @@ public:
|
||||
grpc::Status GetRadialIntegrationProfiles(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::RadialIntegrationProfiles *response) override;
|
||||
|
||||
grpc::Status GetPedestalG0(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) override;
|
||||
|
||||
grpc::Status GetCalibrationStatistics(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::JFCalibrationStatistics *response) override;
|
||||
|
||||
@@ -64,15 +61,6 @@ public:
|
||||
grpc::Status PutDataProcessingSettings(grpc::ServerContext *context, const JFJochProtoBuf::DataProcessingSettings *request,
|
||||
JFJochProtoBuf::Empty *response) override;
|
||||
|
||||
grpc::Status GetPedestalG1(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) override;
|
||||
|
||||
grpc::Status GetPedestalG2(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) override;
|
||||
|
||||
grpc::Status GetMask(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::Image *response) override;
|
||||
|
||||
grpc::Status GetMeasurementStatistics(grpc::ServerContext *context, const JFJochProtoBuf::Empty *request,
|
||||
JFJochProtoBuf::MeasurementStatistics *response) override;
|
||||
|
||||
|
||||
@@ -499,67 +499,6 @@ DiffractionExperiment &JFJochStateMachine::NotThreadSafe_Experiment() {
|
||||
return experiment;
|
||||
}
|
||||
|
||||
|
||||
JFJochProtoBuf::Image JFJochStateMachine::GetNeXusMask() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (state == JFJochState::Inactive)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Detector not calibrated");
|
||||
|
||||
JFJochProtoBuf::Image ret;
|
||||
auto mask = calibration->CalculateNexusMask(experiment);
|
||||
|
||||
ret.set_width(experiment.GetXPixelsNum());
|
||||
ret.set_height(experiment.GetYPixelsNum());
|
||||
ret.set_pixel_depth(4);
|
||||
*ret.mutable_data() = {mask.begin(), mask.end()};
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::Image JFJochStateMachine::GetPedestalG0() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (state == JFJochState::Inactive)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Detector not calibrated");
|
||||
|
||||
JFJochProtoBuf::Image ret;
|
||||
auto pedestal = calibration->GetPedestal(0);
|
||||
|
||||
ret.set_width(experiment.GetXPixelsNum());
|
||||
ret.set_height(experiment.GetYPixelsNum());
|
||||
ret.set_pixel_depth(2);
|
||||
*ret.mutable_data() = {pedestal.begin(), pedestal.end()};
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::Image JFJochStateMachine::GetPedestalG1() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (state == JFJochState::Inactive)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Detector not calibrated");
|
||||
|
||||
JFJochProtoBuf::Image ret;
|
||||
auto pedestal = calibration->GetPedestal(1);
|
||||
|
||||
ret.set_width(experiment.GetXPixelsNum());
|
||||
ret.set_height(experiment.GetYPixelsNum());
|
||||
ret.set_pixel_depth(2);
|
||||
*ret.mutable_data() = {pedestal.begin(), pedestal.end()};
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::Image JFJochStateMachine::GetPedestalG2() const {
|
||||
std::unique_lock<std::mutex> ul(m);
|
||||
if (state == JFJochState::Inactive)
|
||||
throw JFJochException(JFJochExceptionCategory::WrongDAQState, "Detector not calibrated");
|
||||
|
||||
JFJochProtoBuf::Image ret;
|
||||
auto pedestal = calibration->GetPedestal(2);
|
||||
|
||||
ret.set_width(experiment.GetXPixelsNum());
|
||||
ret.set_height(experiment.GetYPixelsNum());
|
||||
ret.set_pixel_depth(2);
|
||||
*ret.mutable_data() = {pedestal.begin(), pedestal.end()};
|
||||
return ret;
|
||||
}
|
||||
|
||||
JFJochProtoBuf::BrokerStatus JFJochStateMachine::GetStatus() const {
|
||||
JFJochProtoBuf::BrokerStatus ret;
|
||||
|
||||
|
||||
@@ -88,11 +88,6 @@ public:
|
||||
Plot GetPlots(const PlotRequest &request) const;
|
||||
RadialIntegrationProfiles GetRadialIntegrationProfiles() const;
|
||||
|
||||
JFJochProtoBuf::Image GetNeXusMask() const;
|
||||
JFJochProtoBuf::Image GetPedestalG0() const;
|
||||
JFJochProtoBuf::Image GetPedestalG1() const;
|
||||
JFJochProtoBuf::Image GetPedestalG2() const;
|
||||
|
||||
void SetDataProcessingSettings(const DataProcessingSettings& settings);
|
||||
DataProcessingSettings GetDataProcessingSettings() const;
|
||||
DataProcessingSettings GetDataAnalysisSettings() const;
|
||||
|
||||
@@ -164,18 +164,6 @@ message DataProcessingSettings {
|
||||
bool preview_indexed_only = 10;
|
||||
}
|
||||
|
||||
message Image {
|
||||
bytes data = 1;
|
||||
int64 width = 2;
|
||||
int64 height = 3;
|
||||
int64 pixel_depth = 4;
|
||||
}
|
||||
|
||||
message MaskToLoad {
|
||||
repeated uint32 mask = 1;
|
||||
int32 bit_to_set = 2;
|
||||
}
|
||||
|
||||
message MeasurementStatistics {
|
||||
string file_prefix = 1;
|
||||
int64 images_collected = 2;
|
||||
@@ -237,11 +225,6 @@ service gRPC_JFJochBroker {
|
||||
rpc GetPlots (PlotRequest) returns (Plot) {}
|
||||
rpc GetRadialIntegrationProfiles(Empty) returns (RadialIntegrationProfiles) {}
|
||||
|
||||
rpc GetPedestalG0 (Empty) returns (Image) {}
|
||||
rpc GetPedestalG1 (Empty) returns (Image) {}
|
||||
rpc GetPedestalG2 (Empty) returns (Image) {}
|
||||
rpc GetMask (Empty) returns (Image) {}
|
||||
|
||||
rpc GetDetectorList (Empty) returns (DetectorList) {}
|
||||
rpc SelectDetector (DetectorSelection) returns (Empty) {}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -94,26 +94,6 @@ class gRPC_JFJochBrokerStub(object):
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.RadialIntegrationProfiles.FromString,
|
||||
)
|
||||
self.GetPedestalG0 = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG0',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Image.FromString,
|
||||
)
|
||||
self.GetPedestalG1 = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG1',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Image.FromString,
|
||||
)
|
||||
self.GetPedestalG2 = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG2',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Image.FromString,
|
||||
)
|
||||
self.GetMask = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetMask',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
response_deserializer=jfjoch__pb2.Image.FromString,
|
||||
)
|
||||
self.GetDetectorList = channel.unary_unary(
|
||||
'/JFJochProtoBuf.gRPC_JFJochBroker/GetDetectorList',
|
||||
request_serializer=jfjoch__pb2.Empty.SerializeToString,
|
||||
@@ -225,30 +205,6 @@ class gRPC_JFJochBrokerServicer(object):
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetPedestalG0(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetPedestalG1(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetPedestalG2(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetMask(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def GetDetectorList(self, request, context):
|
||||
"""Missing associated documentation comment in .proto file."""
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
@@ -344,26 +300,6 @@ def add_gRPC_JFJochBrokerServicer_to_server(servicer, server):
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.RadialIntegrationProfiles.SerializeToString,
|
||||
),
|
||||
'GetPedestalG0': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetPedestalG0,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.Image.SerializeToString,
|
||||
),
|
||||
'GetPedestalG1': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetPedestalG1,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.Image.SerializeToString,
|
||||
),
|
||||
'GetPedestalG2': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetPedestalG2,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.Image.SerializeToString,
|
||||
),
|
||||
'GetMask': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetMask,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
response_serializer=jfjoch__pb2.Image.SerializeToString,
|
||||
),
|
||||
'GetDetectorList': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.GetDetectorList,
|
||||
request_deserializer=jfjoch__pb2.Empty.FromString,
|
||||
@@ -656,74 +592,6 @@ class gRPC_JFJochBroker(object):
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetPedestalG0(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG0',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.Image.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetPedestalG1(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG1',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.Image.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetPedestalG2(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochBroker/GetPedestalG2',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.Image.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetMask(request,
|
||||
target,
|
||||
options=(),
|
||||
channel_credentials=None,
|
||||
call_credentials=None,
|
||||
insecure=False,
|
||||
compression=None,
|
||||
wait_for_ready=None,
|
||||
timeout=None,
|
||||
metadata=None):
|
||||
return grpc.experimental.unary_unary(request, target, '/JFJochProtoBuf.gRPC_JFJochBroker/GetMask',
|
||||
jfjoch__pb2.Empty.SerializeToString,
|
||||
jfjoch__pb2.Image.FromString,
|
||||
options, channel_credentials,
|
||||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
||||
|
||||
@staticmethod
|
||||
def GetDetectorList(request,
|
||||
target,
|
||||
|
||||
Reference in New Issue
Block a user