This commit is contained in:
Erik Frojdh 2019-08-08 15:36:03 +02:00
parent 6a780de22f
commit 0b006b5080
3 changed files with 86 additions and 13 deletions

View File

@ -254,14 +254,13 @@ class Detector {
// Erik // Erik
Result<int> getFramesCaughtByReceiver(Positions pos = {}) const; Result<int> getFramesCaughtByReceiver(Positions pos = {}) const;
Result<uint64_t> getReceiverCurrentFrameIndex(Positions pos = {}) const; Result<uint64_t> getReceiverCurrentFrameIndex(Positions pos = {}) const;
void resetFramesCaught(Positions pos = {}); void resetFramesCaught(Positions pos = {});
//TODO! // TODO!
// int createReceivingDataSockets(const bool destroy = false); // int createReceivingDataSockets(const bool destroy = false);
// void readFrameFromReceiver(); // void readFrameFromReceiver();
@ -403,6 +402,33 @@ class Detector {
* @param delay delay in ps(1 bit=25ps, max of 775 ps) * @param delay delay in ps(1 bit=25ps, max of 775 ps)
*/ */
void setDigitalIODelay(uint64_t pinMask, int delay, Positions pos = {}); void setDigitalIODelay(uint64_t pinMask, int delay, Positions pos = {});
Result<int> getFileIndex(Positions pos = {}) const;
void setFileIndex(int i, Positions pos = {});
Result<defs::fileFormat> getFileFormat(Positions pos = {}) const;
void setFileFormat(defs::fileFormat f, Positions pos = {});
Result<bool> getPartialFramesPadding(Positions pos = {}) const;
void setPartialFramesPadding(bool value, Positions pos = {});
void setReceiverFrameDiscardPolicy(defs::frameDiscardPolicy f,
Positions pos = {});
Result<defs::frameDiscardPolicy>
getReceiverFrameDiscardPolicy(Positions pos = {}) const;
void setFramesPerFile(int n, Positions pos = {});
Result<int> getFramesPerFile(Positions pos = {}) const;
// void execReceiverCommand(const std::string &cmd, int detPos = -1);
// void exitReceiver(int detPos = -1);
Result<std::string> getReceiverLastClientIP(Positions pos = {}) const;
}; };
} // namespace sls } // namespace sls

View File

@ -1788,7 +1788,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns IP of last client connecting to receiver * @returns IP of last client connecting to receiver
*/ */
std::string getReceiverLastClientIP(int detPos = -1); std::string getReceiverLastClientIP(int detPos = -1); //
/** /**
* Turns off the receiver server! * Turns off the receiver server!
@ -1840,14 +1840,14 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns max frames per file in receiver * @returns max frames per file in receiver
*/ */
int setFramesPerFile(int f = -1, int detPos = -1); int setFramesPerFile(int f = -1, int detPos = -1); //
/** /**
* Gets the max frames per file in receiver * Gets the max frames per file in receiver
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns max frames per file in receiver * @returns max frames per file in receiver
*/ */
int getFramesPerFile(int detPos = -1) const; int getFramesPerFile(int detPos = -1) const; //
/** /**
* Sets the frames discard policy in receiver * Sets the frames discard policy in receiver
@ -1856,7 +1856,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @returns frames discard policy set in receiver * @returns frames discard policy set in receiver
*/ */
frameDiscardPolicy setReceiverFramesDiscardPolicy( frameDiscardPolicy setReceiverFramesDiscardPolicy(
frameDiscardPolicy f = GET_FRAME_DISCARD_POLICY, int detPos = -1); frameDiscardPolicy f = GET_FRAME_DISCARD_POLICY, int detPos = -1); //
/** /**
* Sets the partial frames padding enable in receiver * Sets the partial frames padding enable in receiver
@ -1864,16 +1864,16 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns partial frames padding enable in receiver * @returns partial frames padding enable in receiver
*/ */
int setPartialFramesPadding(bool padding, int detPos = -1); int setPartialFramesPadding(bool padding, int detPos = -1); //
int getPartialFramesPadding(int detPos = -1) const; int getPartialFramesPadding(int detPos = -1) const; //
/** /**
* Returns file format * Returns file format
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns file name * @returns file name
*/ */
fileFormat getFileFormat(int detPos = -1); fileFormat getFileFormat(int detPos = -1); //
/** /**
* Sets up the file format * Sets up the file format
@ -1881,7 +1881,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns file format * @returns file format
*/ */
fileFormat setFileFormat(fileFormat f, int detPos = -1); fileFormat setFileFormat(fileFormat f, int detPos = -1); //
/** /**
* Sets up the file index * Sets up the file index
@ -1889,7 +1889,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* @param detPos -1 for all detectors in list or specific detector position * @param detPos -1 for all detectors in list or specific detector position
* @returns file index * @returns file index
*/ */
int setFileIndex(int i, int detPos = -1); int setFileIndex(int i, int detPos = -1); //
/** /**
* Get File index * Get File index
@ -1897,7 +1897,7 @@ class multiSlsDetector : public virtual slsDetectorDefs {
* position * position
* @returns file index * @returns file index
*/ */
int getFileIndex(int detPos = -1) const; int getFileIndex(int detPos = -1) const; //
/** /**
* Receiver starts listening to packets * Receiver starts listening to packets

View File

@ -207,7 +207,7 @@ void Detector::setMaxNumberOfChannels(const defs::coordinates value) {
// //
// //
// Erik // Erik
Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const{ Result<int> Detector::getFramesCaughtByReceiver(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos); return pimpl->Parallel(&slsDetector::getFramesCaughtByReceiver, pos);
} }
@ -336,4 +336,51 @@ void Detector::setDigitalIODelay(uint64_t pinMask, int delay, Positions pos) {
pimpl->Parallel(&slsDetector::setDigitalIODelay, pos, pinMask, delay); pimpl->Parallel(&slsDetector::setDigitalIODelay, pos, pinMask, delay);
} }
Result<int> Detector::getFileIndex(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFileIndex, pos);
}
void Detector::setFileIndex(int i, Positions pos) {
pimpl->Parallel(&slsDetector::setFileIndex, pos, i);
}
Result<defs::fileFormat> Detector::getFileFormat(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFileFormat, pos);
}
void Detector::setFileFormat(defs::fileFormat f, Positions pos) {
pimpl->Parallel(&slsDetector::setFileFormat, pos, f);
}
Result<bool> Detector::getPartialFramesPadding(Positions pos) const {
return pimpl->Parallel(&slsDetector::getPartialFramesPadding, pos);
}
void Detector::setPartialFramesPadding(bool value, Positions pos) {
pimpl->Parallel(&slsDetector::setPartialFramesPadding, pos, value);
}
void Detector::setReceiverFrameDiscardPolicy(defs::frameDiscardPolicy f,
Positions pos) {
pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos, f);
}
Result<defs::frameDiscardPolicy>
Detector::getReceiverFrameDiscardPolicy(Positions pos) const {
return pimpl->Parallel(&slsDetector::setReceiverFramesDiscardPolicy, pos,
defs::GET_FRAME_DISCARD_POLICY);
}
void Detector::setFramesPerFile(int n, Positions pos) {
pimpl->Parallel(&slsDetector::setFramesPerFile, pos, n);
}
Result<int> Detector::getFramesPerFile(Positions pos) const {
return pimpl->Parallel(&slsDetector::getFramesPerFile, pos);
}
Result<std::string> Detector::getReceiverLastClientIP(Positions pos) const{
return pimpl->Parallel(&slsDetector::getReceiverLastClientIP, pos);
}
} // namespace sls } // namespace sls