mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
@ -222,6 +222,9 @@ int ClientInterface::functionTable(){
|
||||
flist[F_RECEIVER_SET_RECEIVER_ROI_METADATA] = &ClientInterface::set_receiver_roi_metadata;
|
||||
flist[F_RECEIVER_SET_NUM_TRANSCEIVER_SAMPLES] = &ClientInterface::set_num_transceiver_samples;
|
||||
flist[F_RECEIVER_SET_TRANSCEIVER_MASK] = &ClientInterface::set_transceiver_mask;
|
||||
flist[F_RECEIVER_SET_ROW] = &ClientInterface::set_row;
|
||||
flist[F_RECEIVER_SET_COLUMN] = &ClientInterface::set_column;
|
||||
|
||||
|
||||
for (int i = NUM_DET_FUNCTIONS + 1; i < NUM_REC_FUNCTIONS ; i++) {
|
||||
LOG(logDEBUG1) << "function fnum: " << i << " (" <<
|
||||
@ -1799,4 +1802,26 @@ int ClientInterface::set_transceiver_mask(Interface &socket) {
|
||||
return socket.sendResult(retval);
|
||||
}
|
||||
|
||||
int ClientInterface::set_row(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
if (value < 0) {
|
||||
throw RuntimeError("Invalid row " + std::to_string(value));
|
||||
}
|
||||
verifyIdle(socket);
|
||||
LOG(logDEBUG1) << "Setting num rows to " << value;
|
||||
impl()->setRow(value);
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
int ClientInterface::set_column(Interface &socket) {
|
||||
auto value = socket.Receive<int>();
|
||||
if (value < 0) {
|
||||
throw RuntimeError("Invalid column " + std::to_string(value));
|
||||
}
|
||||
verifyIdle(socket);
|
||||
LOG(logDEBUG1) << "Setting column to " << value;
|
||||
impl()->setColumn(value);
|
||||
return socket.Send(OK);
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
|
@ -172,6 +172,8 @@ class ClientInterface : private virtual slsDetectorDefs {
|
||||
int set_receiver_roi_metadata(ServerInterface &socket);
|
||||
int set_num_transceiver_samples(ServerInterface &socket);
|
||||
int set_transceiver_mask(ServerInterface &socket);
|
||||
int set_row(ServerInterface &socket);
|
||||
int set_column(ServerInterface &socket);
|
||||
|
||||
Implementation *impl() {
|
||||
if (receiver != nullptr) {
|
||||
|
@ -550,10 +550,10 @@ void DataProcessor::RearrangeDbitData(size_t &size, char *data) {
|
||||
size = totalNumBytes * sizeof(uint8_t) + nAnalogDataBytes + ctbDbitOffset +
|
||||
nTransceiverDataBytes;
|
||||
LOG(logDEBUG1) << "totalNumBytes: " << totalNumBytes
|
||||
<< " nAnalogDataBytes:" << nAnalogDataBytes
|
||||
<< " ctbDbitOffset:" << ctbDbitOffset
|
||||
<< " nTransceiverDataBytes:" << nTransceiverDataBytes
|
||||
<< " size:" << size;
|
||||
<< " nAnalogDataBytes:" << nAnalogDataBytes
|
||||
<< " ctbDbitOffset:" << ctbDbitOffset
|
||||
<< " nTransceiverDataBytes:" << nTransceiverDataBytes
|
||||
<< " size:" << size;
|
||||
}
|
||||
|
||||
void DataProcessor::CropImage(size_t &size, char *data) {
|
||||
|
@ -284,6 +284,20 @@ void Implementation::setModulePositionId(const int id) {
|
||||
}
|
||||
}
|
||||
|
||||
void Implementation::setRow(const int value) {
|
||||
for (unsigned int i = 0; i < listener.size(); ++i) {
|
||||
int col = listener[i]->GetHardCodedPosition().second;
|
||||
listener[i]->SetHardCodedPosition(value, col);
|
||||
}
|
||||
}
|
||||
|
||||
void Implementation::setColumn(const int value) {
|
||||
for (unsigned int i = 0; i < listener.size(); ++i) {
|
||||
int row = listener[i]->GetHardCodedPosition().first;
|
||||
listener[i]->SetHardCodedPosition(row, value);
|
||||
}
|
||||
}
|
||||
|
||||
std::string Implementation::getDetectorHostname() const { return detHostname; }
|
||||
|
||||
void Implementation::setDetectorHostname(const std::string &c) {
|
||||
|
@ -41,6 +41,8 @@ class Implementation : private virtual slsDetectorDefs {
|
||||
void setDetectorSize(const xy size);
|
||||
int getModulePositionId() const;
|
||||
void setModulePositionId(const int id);
|
||||
void setRow(const int value);
|
||||
void setColumn(const int value);
|
||||
std::string getDetectorHostname() const;
|
||||
void setDetectorHostname(const std::string &c);
|
||||
bool getSilentMode() const;
|
||||
|
@ -251,6 +251,10 @@ void Listener::SetHardCodedPosition(uint16_t r, uint16_t c) {
|
||||
<< "] (row: " << row << ", col: " << column << ")";
|
||||
}
|
||||
|
||||
std::pair<uint16_t, uint16_t> Listener::GetHardCodedPosition() {
|
||||
return std::make_pair(row, column);
|
||||
}
|
||||
|
||||
void Listener::ThreadExecution() {
|
||||
char *buffer;
|
||||
fifo->GetNewAddress(buffer);
|
||||
|
@ -61,6 +61,7 @@ class Listener : private virtual slsDetectorDefs, public ThreadObject {
|
||||
* packets/deactivated) c when used is in 2d
|
||||
*/
|
||||
void SetHardCodedPosition(uint16_t r, uint16_t c);
|
||||
std::pair<uint16_t, uint16_t> GetHardCodedPosition();
|
||||
|
||||
private:
|
||||
void RecordFirstIndex(uint64_t fnum);
|
||||
|
Reference in New Issue
Block a user