diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 3058d3e53..7a8d6c475 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -5,11 +5,12 @@ #include #include -class DetectorImpl; + class detectorData; namespace sls { using ns = std::chrono::nanoseconds; +class DetectorImpl; class MacAddr; class IpAddr; diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 8c09b2546..0ea4c02bb 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -7,6 +7,7 @@ #include "DetectorImpl.h" #include "Module.h" #include "sls_detector_defs.h" +#include "versionAPI.h" #include @@ -97,11 +98,11 @@ void Detector::setVirtualDetectorServers(int numServers, int startingPort) { int Detector::getShmId() const { return pimpl->getMultiId(); } std::string Detector::getPackageVersion() const { - return pimpl->getPackageVersion(); + return GITBRANCH; } int64_t Detector::getClientVersion() const { - return pimpl->getClientSoftwareVersion(); + return APILIB; } Result Detector::getFirmwareVersion(Positions pos) const { diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 3967a57b7..825fe4d20 100755 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -26,7 +26,7 @@ #include #include -using namespace sls; +namespace sls{ DetectorImpl::DetectorImpl(int multi_id, bool verify, bool update) : multiId(multi_id), multi_shm(multi_id, -1) { @@ -49,10 +49,6 @@ void DetectorImpl::setAcquiringFlag(bool flag) { int DetectorImpl::getMultiId() const { return multiId; } -std::string DetectorImpl::getPackageVersion() const { return GITBRANCH; } - -int64_t DetectorImpl::getClientSoftwareVersion() const { return APILIB; } - void DetectorImpl::freeSharedMemory(int multiId, int detPos) { // single if (detPos >= 0) { @@ -821,46 +817,6 @@ bool DetectorImpl::enableDataStreamingToClient(int enable) { return client_downstream; } -void DetectorImpl::savePattern(const std::string &fname) { - // std::ofstream outfile; - // outfile.open(fname.c_str(), std::ios_base::out); - // if (!outfile.is_open()) { - // throw RuntimeError("Could not create file to save pattern"); - // } - // // get pattern limits - // auto r = Parallel(&Module::setPatternLoopAddresses, {}, -1, -1, -1) - // .tsquash("Inconsistent pattern limits"); - // // pattern words - // for (int i = r[0]; i <= r[1]; ++i) { - // std::ostringstream os; - // os << "patword 0x" << std::hex << i; - // std::string cmd = os.str(); - // multiSlsDetectorClient(cmd, GET_ACTION, this, outfile); - // } - // // rest of pattern file - // const std::vector commands{ - // "patioctrl", - // "patclkctrl", - // "patlimits", - // "patloop0", - // "patnloop0", - // "patloop1", - // "patnloop1", - // "patloop2", - // "patnloop2", - // "patwait0", - // "patwaittime0", - // "patwait1", - // "patwaittime1", - // "patwait2", - // "patwaittime2", - // "patmask", - // "patsetbit", - // }; - // for (const auto &cmd : commands) - // multiSlsDetectorClient(cmd, GET_ACTION, this, outfile); -} - void DetectorImpl::registerAcquisitionFinishedCallback(void (*func)(double, int, void *), void *pArg) { @@ -1198,3 +1154,5 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname) { LOG(logINFO) << "Read file into memory"; return buffer; } + +}//namespace sls \ No newline at end of file diff --git a/slsDetectorSoftware/src/DetectorImpl.h b/slsDetectorSoftware/src/DetectorImpl.h index 3990d33b4..107aada8a 100755 --- a/slsDetectorSoftware/src/DetectorImpl.h +++ b/slsDetectorSoftware/src/DetectorImpl.h @@ -5,10 +5,6 @@ #include "logger.h" #include "sls_detector_defs.h" -namespace sls{ - class Module; -} - class ZmqSocket; class detectorData; @@ -25,6 +21,11 @@ class detectorData; #include #include + +namespace sls{ + +class Module; + /** * @short structure allocated in shared memory to store detector settings * for IPC and cache @@ -199,10 +200,6 @@ class DetectorImpl : public virtual slsDetectorDefs { /** return multi detector shared memory ID */ int getMultiId() const; - std::string getPackageVersion() const; - - int64_t getClientSoftwareVersion() const; - /** Free specific shared memory from the command line without creating object */ static void freeSharedMemory(int multiId, int detPos = -1); @@ -252,8 +249,6 @@ class DetectorImpl : public virtual slsDetectorDefs { */ bool enableDataStreamingToClient(int enable = -1); - void savePattern(const std::string &fname); - /** * register callback for accessing acquisition final data * @param func function to be called at the end of the acquisition. @@ -437,3 +432,5 @@ class DetectorImpl : public virtual slsDetectorDefs { void (*dataReady)(detectorData *, uint64_t, uint32_t, void *){nullptr}; void *pCallbackArg{nullptr}; }; + +}//namespace sls \ No newline at end of file