This commit is contained in:
Erik Frojdh 2020-03-11 18:10:37 +01:00
parent dc53887a48
commit f940397e3a
4 changed files with 15 additions and 58 deletions

View File

@ -5,11 +5,12 @@
#include <memory>
#include <vector>
class DetectorImpl;
class detectorData;
namespace sls {
using ns = std::chrono::nanoseconds;
class DetectorImpl;
class MacAddr;
class IpAddr;

View File

@ -7,6 +7,7 @@
#include "DetectorImpl.h"
#include "Module.h"
#include "sls_detector_defs.h"
#include "versionAPI.h"
#include <fstream>
@ -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<int64_t> Detector::getFirmwareVersion(Positions pos) const {

View File

@ -26,7 +26,7 @@
#include <future>
#include <vector>
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<std::string> 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<char> DetectorImpl::readProgrammingFile(const std::string &fname) {
LOG(logINFO) << "Read file into memory";
return buffer;
}
}//namespace sls

View File

@ -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 <future>
#include <numeric>
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