mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-15 06:17:12 +02:00
help should doesn't create detector object (#508)
* help should doesn't create detector object instead passing nullptr to the Proxy
This commit is contained in:
@ -85,6 +85,8 @@ This document describes the differences between v7.0.0 and v6.x.x
|
|||||||
- number of storage cells is not updated in teh receiver. done. and also allowing it to be modified in running status
|
- number of storage cells is not updated in teh receiver. done. and also allowing it to be modified in running status
|
||||||
- refactored memory structure in receiver and listener code (maybe resolves stuck issue, need to check)
|
- refactored memory structure in receiver and listener code (maybe resolves stuck issue, need to check)
|
||||||
- callback modified to have rx header and not rx header pointer
|
- callback modified to have rx header and not rx header pointer
|
||||||
|
-help should not create a new object
|
||||||
|
|
||||||
|
|
||||||
2. Resolved Issues
|
2. Resolved Issues
|
||||||
==================
|
==================
|
||||||
|
@ -53,16 +53,18 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (parser.isHelp())
|
if (parser.isHelp())
|
||||||
action = slsDetectorDefs::HELP_ACTION;
|
action = slsDetectorDefs::HELP_ACTION;
|
||||||
|
else {
|
||||||
|
|
||||||
// Free shared memory should work also without a detector
|
// Free shared memory should work also without a detector
|
||||||
// if we have an option for verify in the detector constructor
|
// if we have an option for verify in the detector constructor
|
||||||
// we could avoid this but clutter the code
|
// we could avoid this but clutter the code
|
||||||
if (parser.command() == "free" && action != slsDetectorDefs::HELP_ACTION) {
|
if (parser.command() == "free") {
|
||||||
if (parser.detector_id() != -1)
|
if (parser.detector_id() != -1)
|
||||||
std::cout << "Cannot free shared memory of sub-detector\n";
|
std::cout << "Cannot free shared memory of sub-detector\n";
|
||||||
else
|
else
|
||||||
sls::freeSharedMemory(parser.multi_id());
|
sls::freeSharedMemory(parser.multi_id());
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent mem size check
|
// prevent mem size check
|
||||||
@ -71,8 +73,11 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sls::Detector det(parser.multi_id());
|
std::unique_ptr<sls::Detector> det{nullptr};
|
||||||
sls::CmdProxy proxy(&det);
|
if (action != slsDetectorDefs::HELP_ACTION) {
|
||||||
|
det = sls::make_unique<sls::Detector>(parser.multi_id());
|
||||||
|
}
|
||||||
|
sls::CmdProxy proxy(det.get());
|
||||||
proxy.Call(parser.command(), parser.arguments(), parser.detector_id(),
|
proxy.Call(parser.command(), parser.arguments(), parser.detector_id(),
|
||||||
action, std::cout, parser.receiver_id());
|
action, std::cout, parser.receiver_id());
|
||||||
} catch (const sls::RuntimeError &e) {
|
} catch (const sls::RuntimeError &e) {
|
||||||
|
Reference in New Issue
Block a user