Merge branch 'developer' into gui

This commit is contained in:
2019-06-03 11:13:03 +02:00
201 changed files with 25684 additions and 2843 deletions

View File

@ -12,8 +12,8 @@
#include "container_utils.h"
#include "string_utils.h"
#include "network_utils.h"
#include "string_utils.h"
#include <cstring>
#include <iomanip>
@ -421,7 +421,7 @@ void multiSlsDetector::addSlsDetector(const std::string &hostname) {
}
// get type by connecting
detectorType type = slsDetector::getTypeFromDetector(hostname.c_str(), DEFAULT_PORTNO);
detectorType type = slsDetector::getTypeFromDetector(hostname, DEFAULT_PORTNO);
int pos = (int)detectors.size();
detectors.push_back(sls::make_unique<slsDetector>(type, multiId, pos, false));
multi_shm()->numberOfDetectors = detectors.size();
@ -1071,6 +1071,34 @@ int multiSlsDetector::configureMAC(int detPos) {
return sls::allEqualTo(r, static_cast<int>(OK)) ? OK : FAIL;
}
void multiSlsDetector::setStartingFrameNumber(const uint64_t value, int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->setStartingFrameNumber(value);
}
// multi
parallelCall(&slsDetector::setStartingFrameNumber, value);
}
uint64_t multiSlsDetector::getStartingFrameNumber(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getStartingFrameNumber();
}
// multi
auto r = parallelCall(&slsDetector::getStartingFrameNumber);
if (sls::allEqual(r)) {
return r.front();
}
// can't have different values for next acquisition
std::ostringstream ss;
ss << "Error: Different Values for starting frame number";
throw RuntimeError(ss.str());
}
int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int detPos) {
// single
if (detPos >= 0) {
@ -1113,89 +1141,50 @@ int64_t multiSlsDetector::setTimer(timerIndex index, int64_t t, int detPos) {
return ret;
}
int64_t multiSlsDetector::secondsToNanoSeconds(double t){
int64_t ns = lround(t * 1E9);
return (ns < 0) ? -1: ns;
}
double multiSlsDetector::setExposureTime(double t, bool inseconds, int detPos) {
if (!inseconds) {
return setTimer(ACQUISITION_TIME, (int64_t)t, detPos);
}
// + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) {
tms = -1;
}
tms = setTimer(ACQUISITION_TIME, tms, detPos);
if (tms < 0) {
return -1;
}
return ((1E-9) * (double)tms);
auto t_ns = setTimer(ACQUISITION_TIME, secondsToNanoSeconds(t), detPos);
return (t_ns < 0) ? -1 : 1E-9 * t_ns;
}
double multiSlsDetector::setExposurePeriod(double t, bool inseconds, int detPos) {
if (!inseconds) {
return setTimer(FRAME_PERIOD, (int64_t)t, detPos);
}
// + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) {
tms = -1;
}
tms = setTimer(FRAME_PERIOD, tms, detPos);
if (tms < 0) {
return -1;
}
return ((1E-9) * (double)tms);
auto t_ns = setTimer(FRAME_PERIOD, secondsToNanoSeconds(t), detPos);
return (t_ns < 0) ? -1 : 1E-9 * t_ns;
}
double multiSlsDetector::setDelayAfterTrigger(double t, bool inseconds, int detPos) {
if (!inseconds) {
return setTimer(DELAY_AFTER_TRIGGER, (int64_t)t, detPos);
}
// + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) {
tms = -1;
}
tms = setTimer(DELAY_AFTER_TRIGGER, tms, detPos);
if (tms < 0) {
return -1;
}
return ((1E-9) * (double)tms);
auto t_ns = setTimer(DELAY_AFTER_TRIGGER, secondsToNanoSeconds(t), detPos);
return (t_ns < 0) ? -1 : 1E-9 * t_ns;
}
double multiSlsDetector::setSubFrameExposureTime(double t, bool inseconds, int detPos) {
if (!inseconds) {
return setTimer(SUBFRAME_ACQUISITION_TIME, (int64_t)t, detPos);
} else {
// + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) {
tms = -1;
}
tms = setTimer(SUBFRAME_ACQUISITION_TIME, tms, detPos);
if (tms < 0) {
return -1;
}
return ((1E-9) * (double)tms);
}
auto t_ns = setTimer(SUBFRAME_ACQUISITION_TIME, secondsToNanoSeconds(t), detPos);
return (t_ns < 0) ? -1 : 1E-9 * t_ns;
}
double multiSlsDetector::setSubFrameExposureDeadTime(double t, bool inseconds, int detPos) {
if (!inseconds) {
return setTimer(SUBFRAME_DEADTIME, (int64_t)t, detPos);
} else {
// + 0.5 to round for precision lost from converting double to int64_t
int64_t tms = (int64_t)(t * (1E+9) + 0.5);
if (t < 0) {
tms = -1;
}
tms = setTimer(SUBFRAME_DEADTIME, tms, detPos);
if (tms < 0) {
return -1;
}
return ((1E-9) * (double)tms);
}
auto t_ns = setTimer(SUBFRAME_DEADTIME, secondsToNanoSeconds(t), detPos);
return (t_ns < 0) ? -1 : 1E-9 * t_ns;
}
int64_t multiSlsDetector::setNumberOfFrames(int64_t t, int detPos) {
@ -3185,7 +3174,7 @@ int multiSlsDetector::getFramesCaughtByReceiver(int detPos) {
return ((sls::sum(r)) / (int)detectors.size());
}
int multiSlsDetector::getReceiverCurrentFrameIndex(int detPos) {
uint64_t multiSlsDetector::getReceiverCurrentFrameIndex(int detPos) {
// single
if (detPos >= 0) {
return detectors[detPos]->getReceiverCurrentFrameIndex();
@ -3195,7 +3184,7 @@ int multiSlsDetector::getReceiverCurrentFrameIndex(int detPos) {
auto r = parallelCall(&slsDetector::getReceiverCurrentFrameIndex);
// prevent divide by all or do not take avg when -1 for "did not connect"
if ((detectors.empty()) || (sls::anyEqualTo(r, -1))) {
if ((detectors.empty()) || (sls::anyEqualTo(r, static_cast<uint64_t>(-1)))) {
return -1;
}
@ -3390,7 +3379,10 @@ void multiSlsDetector::readFrameFromReceiver() {
uint32_t xoffset = coordX * nPixelsX * bytesPerPixel;
uint32_t yoffset = coordY * nPixelsY;
uint32_t singledetrowoffset = nPixelsX * bytesPerPixel;
uint32_t rowoffset = nX * singledetrowoffset;
uint32_t rowoffset = nX * singledetrowoffset;
if (getDetectorTypeAsEnum() == CHIPTESTBOARD) {
singledetrowoffset=size;
}
FILE_LOG(logDEBUG1) << "Multi Image Info:"
"\n\txoffset: "
<< xoffset << "\n\tyoffset: " << yoffset

View File

@ -1,8 +1,5 @@
#include "slsDetector.h"
#include "ClientInterface.h"
#include "ClientSocket.h"
#include "MySocketTCP.h"
#include "ServerInterface.h"
#include "SharedMemory.h"
#include "file_utils.h"
#include "multiSlsDetector.h"
@ -340,7 +337,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
shm()->detectorIP2 = DEFAULT_DET_MAC2;
shm()->numUDPInterfaces = 1;
shm()->selectedUDPInterface = 1;
shm()->selectedUDPInterface = 0;
shm()->rxOnlineFlag = OFFLINE_FLAG;
shm()->tenGigaEnable = 0;
shm()->flippedData[X] = 0;
@ -389,8 +386,6 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
shm()->rxFileWrite = true;
shm()->rxMasterFileWrite = true;
shm()->rxFileOverWrite = true;
shm()->rxDbitListSize = 0;
memset(shm()->rxDbitList, 0, MAX_RX_DBIT * sizeof(int));
shm()->rxDbitOffset = 0;
// get the detector parameters based on type
@ -1442,7 +1437,7 @@ int slsDetector::configureMAC() {
// 2d positions to detector to put into udp header
{
int pos[2] = {0, 0};
int max = shm()->multiSize[1] * (shm()->numUDPInterfaces);
int max = shm()->multiSize[Y] * (shm()->numUDPInterfaces);
// row
pos[0] = (detId % max);
// col for horiz. udp ports
@ -1502,6 +1497,23 @@ int slsDetector::configureMAC() {
return ret;
}
void slsDetector::setStartingFrameNumber(const uint64_t value) {
FILE_LOG(logDEBUG1) << "Setting starting frame number to " << value;
if (shm()->onlineFlag == ONLINE_FLAG) {
sendToDetector(F_SET_STARTING_FRAME_NUMBER, value, nullptr);
}
}
uint64_t slsDetector::getStartingFrameNumber() {
uint64_t retval = -1;
FILE_LOG(logDEBUG1) << "Getting starting frame number";
if (shm()->onlineFlag == ONLINE_FLAG) {
sendToDetector(F_GET_STARTING_FRAME_NUMBER, nullptr, retval);
FILE_LOG(logDEBUG1) << "Starting frame number :" << retval;
}
return retval;
}
int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
int ret = FAIL;
int64_t args[]{static_cast<int64_t>(index), t};
@ -1559,6 +1571,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t) {
DIGITAL_SAMPLES,
STORAGE_CELL_NUMBER};
// if in list (lambda)
if (std::any_of(std::begin(rt), std::end(rt),
[index](timerIndex t) { return t == index; })) {
args[1] = shm()->timerValue[index];
@ -1907,7 +1920,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
<< "\nrx streaming source ip:" << shm()->rxZmqip
<< "\nrx additional json header:" << shm()->rxAdditionalJsonHeader
<< "\nrx_datastream:" << enableDataStreamingFromReceiver(-1)
<< "\nrx_dbitlistsize:" << shm()->rxDbitListSize
<< "\nrx_dbitlistsize:" << shm()->rxDbitList.size()
<< "\nrx_DbitOffset:" << shm()->rxDbitOffset
<< std::endl;
@ -1948,7 +1961,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
enableTenGigabitEthernet(shm()->tenGigaEnable);
setReadOutFlags(GET_READOUT_FLAGS);
break;
case CHIPTESTBOARD:
setTimer(ANALOG_SAMPLES, shm()->timerValue[ANALOG_SAMPLES]);
setTimer(DIGITAL_SAMPLES, shm()->timerValue[DIGITAL_SAMPLES]);
@ -1974,8 +1987,7 @@ std::string slsDetector::setReceiverHostname(const std::string &receiverIP) {
}
if (shm()->myDetectorType == CHIPTESTBOARD) {
std::vector<int> list(shm()->rxDbitList, shm()->rxDbitList + shm()->rxDbitListSize);
setReceiverDbitList(list);
setReceiverDbitList(shm()->rxDbitList);
}
setReceiverSilentMode(static_cast<int>(shm()->rxSilentMode));
@ -2097,7 +2109,7 @@ int slsDetector::selectUDPInterface(int n) {
if (shm()->myDetectorType != JUNGFRAU) {
throw RuntimeError("Cannot select an interface for this detector");
}
shm()->selectedUDPInterface = (n > 1 ? 2 : 1);
shm()->selectedUDPInterface = (n == 0 ? 0 : 1);
if (strcmp(shm()->rxHostname, "none") == 0) {
FILE_LOG(logDEBUG1) << "Receiver hostname not set yet";
} else if (setUDPConnection() == FAIL) {
@ -2178,7 +2190,7 @@ void slsDetector::setReceiverStreamingIP(std::string sourceIP) {
memset(shm()->rxZmqip, 0, MAX_STR_LENGTH);
sls::strcpy_safe(shm()->rxZmqip, args);
// if zmqip is empty, update it
if (strlen(shm()->zmqip) != 0u) {
if (shm()->zmqip != 0u) {
sls::strcpy_safe(shm()->zmqip, args);
}
FILE_LOG(logDEBUG1) << "Sending receiver streaming IP to receiver: "
@ -2354,7 +2366,7 @@ int64_t slsDetector::getReceiverRealUDPSocketBufferSize() {
int slsDetector::setUDPConnection() {
int ret = FAIL;
char args[6][MAX_STR_LENGTH]{};
char args[5][MAX_STR_LENGTH]{};
char retvals[2][MAX_STR_LENGTH]{};
FILE_LOG(logDEBUG1) << "Setting UDP Connection";
@ -2371,9 +2383,8 @@ int slsDetector::setUDPConnection() {
shm()->rxUDPIP = HostnameToIp(shm()->rxHostname);
}
}
// jungfrau 2 interfaces or (1 interface and 2nd interface), copy udpip if
// udpip2 empty
if (shm()->numUDPInterfaces == 2 || shm()->selectedUDPInterface == 2) {
// jungfrau 2 interfaces, copy udpip if udpip2 empty
if (shm()->numUDPInterfaces == 2) {
if (shm()->rxUDPIP2 == 0) {
shm()->rxUDPIP2 = shm()->rxUDPIP;
}
@ -2381,15 +2392,12 @@ int slsDetector::setUDPConnection() {
// copy arguments to args[][]
snprintf(args[0], sizeof(args[0]), "%d", shm()->numUDPInterfaces);
snprintf(args[1], sizeof(args[1]), "%d", shm()->selectedUDPInterface);
sls::strcpy_safe(args[2], getReceiverUDPIP().str());
sls::strcpy_safe(args[3], getReceiverUDPIP2().str());
snprintf(args[4], sizeof(args[4]), "%d", shm()->rxUDPPort);
snprintf(args[5], sizeof(args[5]), "%d", shm()->rxUDPPort2);
sls::strcpy_safe(args[1], getReceiverUDPIP().str());
sls::strcpy_safe(args[2], getReceiverUDPIP2().str());
snprintf(args[3], sizeof(args[3]), "%d", shm()->rxUDPPort);
snprintf(args[4], sizeof(args[4]), "%d", shm()->rxUDPPort2);
FILE_LOG(logDEBUG1) << "Receiver Number of UDP Interfaces: "
<< shm()->numUDPInterfaces;
FILE_LOG(logDEBUG1) << "Receiver Selected Interface: "
<< shm()->selectedUDPInterface;
FILE_LOG(logDEBUG1) << "Receiver udp ip address: " << shm()->rxUDPIP;
FILE_LOG(logDEBUG1) << "Receiver udp ip address2: " << shm()->rxUDPIP2;
FILE_LOG(logDEBUG1) << "Receiver udp port: " << shm()->rxUDPPort;
@ -2731,51 +2739,20 @@ void slsDetector::setReceiverDbitList(std::vector<int> list) {
throw sls::RuntimeError("Dbit list value must be between 0 and 63\n");
}
}
// copy size and vector to shm
shm()->rxDbitListSize = list.size();
std::copy(list.begin(), list.end(), shm()->rxDbitList);
shm()->rxDbitList = list;
if (shm()->rxOnlineFlag == ONLINE_FLAG) {
int args[list.size() + 1];
args[0] = list.size();
std::copy(std::begin(list), std::end(list), args + 1);
sendToReceiver(F_SET_RECEIVER_DBIT_LIST, args, sizeof(args), nullptr, 0);
sendToReceiver(F_SET_RECEIVER_DBIT_LIST, shm()->rxDbitList, nullptr);
}
}
std::vector<int> slsDetector::getReceiverDbitList() {
int fnum = F_GET_RECEIVER_DBIT_LIST;
int ret = FAIL;
std::vector <int> retval;
int retsize = 0;
sls::FixedCapacityContainer<int, MAX_RX_DBIT> retval;
FILE_LOG(logDEBUG1) << "Getting Receiver Dbit List";
if (shm()->rxOnlineFlag == ONLINE_FLAG) {
auto receiver =
sls::ClientSocket("Receiver", shm()->rxHostname, shm()->rxTCPPort);
receiver.sendData(&fnum, sizeof(fnum));
receiver.receiveData(&ret, sizeof(ret));
if (ret == FAIL) {
char mess[MAX_STR_LENGTH]{};
receiver.receiveData(mess, MAX_STR_LENGTH);
throw ReceiverError("Receiver " + std::to_string(detId) +
" returned error: " + std::string(mess));
}
receiver.receiveData(&retsize, sizeof(retsize));
int list[retsize];
receiver.receiveData(list, sizeof(list));
// copy after no errors
shm()->rxDbitListSize = retsize;
std::copy(list, list + retsize, shm()->rxDbitList);
sendToReceiver(F_GET_RECEIVER_DBIT_LIST, nullptr, retval);
shm()->rxDbitList = retval;
}
if (shm()->rxDbitListSize) {
retval.resize(shm()->rxDbitListSize);
std::copy(shm()->rxDbitList, shm()->rxDbitList + shm()->rxDbitListSize, std::begin(retval));
}
return retval;
return shm()->rxDbitList;
}
int slsDetector::setReceiverDbitOffset(int value) {
@ -3256,10 +3233,10 @@ int slsDetector::setReceiverOnline(int value) {
} else {
shm()->rxOnlineFlag = OFFLINE_FLAG;
if (value == ONLINE_FLAG) {
// connect and set offline flag
auto receiver =
ReceiverSocket(shm()->rxHostname, shm()->rxTCPPort);
receiver.close();
// Connect and ask for receiver id to verify that
// it's online and working
int64_t retval{0};
sendToReceiver(F_GET_RECEIVER_ID, nullptr, retval);
shm()->rxOnlineFlag = ONLINE_FLAG;
if (shm()->receiverAPIVersion == 0) {
checkReceiverVersionCompatibility();
@ -3422,15 +3399,11 @@ int slsDetector::updateCachedReceiverVariables() const {
n += receiver.receiveData(&i32, sizeof(i32));
shm()->rxSilentMode = static_cast<bool>(i32);
// dbit list size
// dbit list
{
int listsize = 0;
n += receiver.receiveData(&listsize, sizeof(listsize));
int list[listsize];
n += receiver.receiveData(list, sizeof(list));
// copy after no errors
shm()->rxDbitListSize = listsize;
std::copy(list, list + listsize, shm()->rxDbitList);
sls::FixedCapacityContainer<int, MAX_RX_DBIT> temp;
n += receiver.receiveData(&temp, sizeof(temp));
shm()->rxDbitList = temp;
}
// dbit offset
@ -3637,8 +3610,8 @@ int slsDetector::getFramesCaughtByReceiver() {
return retval;
}
int slsDetector::getReceiverCurrentFrameIndex() {
int retval = -1;
uint64_t slsDetector::getReceiverCurrentFrameIndex() {
uint64_t retval = -1;
FILE_LOG(logDEBUG1) << "Getting Current Frame Index of Receiver";
if (shm()->rxOnlineFlag == ONLINE_FLAG) {
sendToReceiver(F_GET_RECEIVER_FRAME_INDEX, nullptr, retval);

View File

@ -3,6 +3,7 @@
#include "string_utils.h"
#include <cstdlib>
#include <cmath>
#include <fstream>
#include <iostream>
#include <sstream>
@ -595,6 +596,13 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
++i;
/*! \page timing
- <b>startingfnum [i]</b> sets/gets starting frame number for the next acquisition. Only for Jungfrau and Eiger. \c Returns \c (long long int)
*/
descrToFuncMap[i].m_pFuncName = "startingfnum";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimer;
++i;
/*! \page timing
- <b>cycles [i]</b> sets/gets number of triggers. Timing mode should be set appropriately. \c Returns \c (long long int)
*/
@ -675,19 +683,12 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page timing
- <b>delayl</b> gets delay left. Used in GOTTHARD only. Only get! \c Returns \c (double with 9 decimal digits)
- <b>delayl</b> gets delay left. Used in GOTTHARD, JUNGFRAU, MOENCH and CTB only. Only get! \c Returns \c (double with 9 decimal digits)
*/
descrToFuncMap[i].m_pFuncName = "delayl";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft;
++i;
/*! \page timing
- <b>gatesl</b> gets number of gates left. Used in GOTTHARD only. Only get! \c Returns \c (double with 9 decimal digits)
*/
descrToFuncMap[i].m_pFuncName = "gatesl";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdTimeLeft;
++i;
/*! \page config
- <b>framesl</b> gets number of frames left. Used in GOTTHARD and Jungfrau only. Only get! \c Returns \c (double with 9 decimal digits)
*/
@ -1587,7 +1588,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page network
- <b>rx_udpip2 [ip]</b> sets/gets the ip address of the second receiver UDP interface where the data from the bottom half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0. JUNGFRAU only. \c Returns \c (string)
- <b>rx_udpip2 [ip]</b> sets/gets the ip address of the second receiver UDP interface where the data from the top half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). Used if different from eth0. JUNGFRAU only. \c Returns \c (string)
*/
descrToFuncMap[i].m_pFuncName = "rx_udpip2";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
@ -1601,7 +1602,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page network
- <b>rx_udpmac2 [mac]</b> sets/gets the mac address of the second receiver UDP interface where the data from the bottom half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). JUNGFRAU only.\c Returns \c (string)
- <b>rx_udpmac2 [mac]</b> sets/gets the mac address of the second receiver UDP interface where the data from the top half module of the detector will be streamed to. Normally used for single detectors (Can be multi-detector). JUNGFRAU only.\c Returns \c (string)
*/
descrToFuncMap[i].m_pFuncName = "rx_udpmac2";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
@ -1615,7 +1616,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page network
- <b>rx_udpport2 [port]</b> sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-detector command. Used for EIGERand JUNGFRAU only. \c Returns \c (int)
- <b>rx_udpport2 [port]</b> sets/gets the second port of the receiver UDP interface where the data from the second half of the detector will be streamed to. Use single-detector command. For Eiger, it is the right half and for Jungfrau, it is the top half module. \c Returns \c (int)
*/
descrToFuncMap[i].m_pFuncName = "rx_udpport2";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
@ -1643,35 +1644,35 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page network
- <b>detectormac2 [mac]</b> sets/gets the mac address of the second half of the detector UDP interface from where the bottom half module of the detector will stream data. Use single-detector command. Normally unused. JUNGFRAU only. \c Returns \c (string)
- <b>detectormac2 [mac]</b> sets/gets the mac address of the second half of the detector UDP interface from where the top half module of the detector will stream data. Use single-detector command. Normally unused. JUNGFRAU only. \c Returns \c (string)
*/
descrToFuncMap[i].m_pFuncName = "detectormac2";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
++i;
/*! \page network
- <b>detectorip [ip]</b> sets/gets the ip address of the detector UDP interface from where the bottom half of the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip (if rx_udpip specified). \c Returns \c (string)
- <b>detectorip [ip]</b> sets/gets the ip address of the detector UDP interface from where the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip (if rx_udpip specified). \c Returns \c (string)
*/
descrToFuncMap[i].m_pFuncName = "detectorip";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
++i;
/*! \page network
- <b>detectorip2 [ip]</b> sets/gets the ip address of the second half of the detector UDP interface from where the bottom half of the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip2 (if rx_udpip2 specified). JUNGFRAU only. \c Returns \c (string)
- <b>detectorip2 [ip]</b> sets/gets the ip address of the top half of the detector UDP interface from where the top half of the detector will stream data. Use single-detector command. Keep in same subnet as rx_udpip2 (if rx_udpip2 specified). JUNGFRAU only. \c Returns \c (string)
*/
descrToFuncMap[i].m_pFuncName = "detectorip2";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
++i;
/*! \page network
- <b>numinterfaces [n]</b> sets/gets the number of interfaces used to stream out from the detector. Options: 1, 2. JUNGFRAU only. \c Returns \c (int)
- <b>numinterfaces [n]</b> sets/gets the number of interfaces used to stream out from the detector. Options: 1(default), 2. JUNGFRAU only. \c Returns \c (int)
*/
descrToFuncMap[i].m_pFuncName = "numinterfaces";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
++i;
/*! \page network
- <b>selinterface [n]</b> sets/gets the 1st or the 2nd interface to use to stream data out of the detector. Options: 1, 2. Effective only when \c numinterfaces is 1. JUNGFRAU only. \c Returns \c (int)
- <b>selinterface [n]</b> sets/gets interface to use to stream data out of the detector. Options: 0 (outer, default), 1(inner). Effective only when \c numinterfaces is 1. JUNGFRAU only. \c Returns \c (int)
*/
descrToFuncMap[i].m_pFuncName = "selinterface";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
@ -1699,7 +1700,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
++i;
/*! \page network
- <b>flowcontrol_10g [delay]</b> Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER only. \c Returns \c (int)
- <b>flowcontrol_10g [delay]</b> Enables/disables 10 GbE flow control. 1 enables, 0 disables. Used for EIGER and JUNGFRAU only. \c Returns \c (int)
*/
descrToFuncMap[i].m_pFuncName = "flowcontrol_10g";
descrToFuncMap[i].m_pFuncPtr = &slsDetectorCommand::cmdNetworkParameter;
@ -2129,7 +2130,7 @@ slsDetectorCommand::slsDetectorCommand(multiSlsDetector *det) {
//-----------------------------------------------------------
std::string slsDetectorCommand::executeLine(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::executeLine(int narg, const char * const args[], int action, int detPos) {
if (action == READOUT_ACTION)
return cmdAcquire(narg, args, action, detPos);
@ -2160,14 +2161,14 @@ std::string slsDetectorCommand::executeLine(int narg, char *args[], int action,
return cmdUnknown(narg, args, action, detPos);
}
std::string slsDetectorCommand::cmdUnknown(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdUnknown(int narg, const char * const args[], int action, int detPos) {
return std::string("Unknown command ") + std::string(args[0]) + std::string("\n") + helpLine(0, args, action, detPos);
}
std::string slsDetectorCommand::cmdUnderDevelopment(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdUnderDevelopment(int narg, const char * const args[], int action, int detPos) {
return std::string("Must still develop ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
}
std::string slsDetectorCommand::helpLine(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::helpLine(int narg, const char * const args[], int action, int detPos) {
std::ostringstream os;
@ -2186,7 +2187,7 @@ std::string slsDetectorCommand::helpLine(int narg, char *args[], int action, int
return executeLine(narg, args, HELP_ACTION, detPos);
}
std::string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdAcquire(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2231,7 +2232,7 @@ std::string slsDetectorCommand::helpAcquire(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdData(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdData(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
@ -2263,7 +2264,7 @@ std::string slsDetectorCommand::helpData(int action) {
return std::string("data \t gets all data from the detector (if any) processes them and writes them to file according to the preferences already setup\n");
}
std::string slsDetectorCommand::cmdStatus(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdStatus(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
@ -2316,7 +2317,7 @@ std::string slsDetectorCommand::helpStatus(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdDataStream(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdDataStream(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
@ -2350,7 +2351,7 @@ std::string slsDetectorCommand::helpDataStream(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdFree(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdFree(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
@ -2366,7 +2367,7 @@ std::string slsDetectorCommand::helpFree(int action) {
return std::string("free \t frees the shared memory\n");
}
std::string slsDetectorCommand::cmdHostname(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdHostname(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2428,7 +2429,7 @@ std::string slsDetectorCommand::helpHostname(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdUser(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdUser(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2458,7 +2459,7 @@ std::string slsDetectorCommand::helpUser(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdHelp(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdHelp(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2471,7 +2472,7 @@ std::string slsDetectorCommand::cmdHelp(int narg, char *args[], int action, int
return helpLine(0, args, action, detPos);
}
std::string slsDetectorCommand::cmdExitServer(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdExitServer(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2519,7 +2520,7 @@ std::string slsDetectorCommand::helpExitServer(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdSettingsDir(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdSettingsDir(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -2547,7 +2548,7 @@ std::string slsDetectorCommand::helpSettingsDir(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdTrimEn(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdTrimEn(int narg, const char * const args[], int action, int detPos) {
std::vector<int> energies;
if (action == HELP_ACTION)
return helpTrimEn(action);
@ -2578,7 +2579,7 @@ std::string slsDetectorCommand::helpTrimEn(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdOutDir(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdOutDir(int narg, const char * const args[], int action, int detPos) {
myDet->setReceiverOnline(ONLINE_FLAG, detPos);
if (action == HELP_ACTION)
return helpOutDir(action);
@ -2598,7 +2599,7 @@ std::string slsDetectorCommand::helpOutDir(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdFileName(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdFileName(int narg, const char * const args[], int action, int detPos) {
myDet->setReceiverOnline(ONLINE_FLAG, detPos);
if (action == HELP_ACTION)
return helpFileName(action);
@ -2634,7 +2635,7 @@ std::string slsDetectorCommand::helpFileName(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdEnablefwrite(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdEnablefwrite(int narg, const char * const args[], int action, int detPos) {
int i;
char ans[100];
@ -2680,7 +2681,7 @@ std::string slsDetectorCommand::helpEnablefwrite(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdOverwrite(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdOverwrite(int narg, const char * const args[], int action, int detPos) {
int i;
char ans[100];
myDet->setReceiverOnline(ONLINE_FLAG, detPos);
@ -2706,7 +2707,7 @@ std::string slsDetectorCommand::helpOverwrite(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdFileIndex(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdFileIndex(int narg, const char * const args[], int action, int detPos) {
myDet->setReceiverOnline(ONLINE_FLAG, detPos);
if (action == HELP_ACTION) {
return helpFileName(action);
@ -2726,7 +2727,7 @@ std::string slsDetectorCommand::helpFileIndex(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdRateCorr(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdRateCorr(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION) {
return helpRateCorr(action);
@ -2753,7 +2754,7 @@ std::string slsDetectorCommand::helpRateCorr(int action) {
return os.str();
}
// std::string slsDetectorCommand::cmdThreaded(int narg, char *args[], int action, int detPos){
// std::string slsDetectorCommand::cmdThreaded(int narg, const char * const args[], int action, int detPos){
// int ival;
// char answer[1000];
@ -2779,7 +2780,7 @@ std::string slsDetectorCommand::helpThreaded(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdImage(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdImage(int narg, const char * const args[], int action, int detPos) {
std::string sval;
int retval = FAIL;
if (action == HELP_ACTION)
@ -2814,7 +2815,7 @@ std::string slsDetectorCommand::helpImage(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdCounter(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdCounter(int narg, const char * const args[], int action, int detPos) {
int ival;
char answer[100];
std::string sval;
@ -2875,7 +2876,7 @@ std::string slsDetectorCommand::helpCounter(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdNetworkParameter(int narg, const char * const args[], int action, int detPos) {
char ans[100] = {0};
int i;
@ -2919,7 +2920,7 @@ std::string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int
if (action == PUT_ACTION) {
myDet->setReceiverUDPIP2(args[1], detPos);
}
return myDet->getReceiverUDPIP(detPos);
return myDet->getReceiverUDPIP2(detPos);
} else if (cmd == "rx_udpmac") {
if (action == PUT_ACTION) {
myDet->setReceiverUDPMAC(args[1], detPos);
@ -2929,7 +2930,7 @@ std::string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int
if (action == PUT_ACTION) {
myDet->setReceiverUDPMAC2(args[1], detPos);
}
return myDet->getReceiverUDPMAC(detPos);
return myDet->getReceiverUDPMAC2(detPos);
} else if (cmd == "rx_udpport") {
if (action == PUT_ACTION) {
if (!(sscanf(args[1], "%d", &i))) {
@ -3069,13 +3070,13 @@ std::string slsDetectorCommand::helpNetworkParameter(int action) {
os << "rx_udpmac mac \n sets receiver udp mac to mac" << std::endl;
os << "rx_udpmac2 mac \n sets receiver udp mac of 2nd udp interface to mac. Jungfrau only." << std::endl;
os << "rx_udpport port \n sets receiver udp port to port" << std::endl;
os << "rx_udpport2 port \n sets receiver udp port to port. For Eiger and Jungfrau, it is the second half module and for other detectors, same as rx_udpport" << std::endl;
os << "numinterfaces n \n sets the number of interfaces to n used to stream out from the detector. Options: 1, 2. JUNGFRAU only. " << std::endl;
os << "selinterface n \n sets the 1st or the 2nd interface to use to stream data out of the detector. Options: 1, 2. Effective only when numinterfaces is 1. JUNGFRAU only. " << std::endl;
os << "rx_udpport2 port \n sets receiver udp port to port. For Eiger, it is the right half and for Jungfrau, it is the top half module and for other detectors, same as rx_udpport" << std::endl;
os << "numinterfaces n \n sets the number of interfaces to n used to stream out from the detector. Options: 1 (default), 2. JUNGFRAU only. " << std::endl;
os << "selinterface n \n sets interface to use to stream data out of the detector. Options: 0 (outer, default), 1(inner). Effective only when numinterfaces is 1. JUNGFRAU only. " << std::endl;
os << "txndelay_left port \n sets detector transmission delay of the left port" << std::endl;
os << "txndelay_right port \n sets detector transmission delay of the right port" << std::endl;
os << "txndelay_frame port \n sets detector transmission delay of the entire frame" << std::endl;
os << "flowcontrol_10g port \n sets flow control for 10g for eiger" << std::endl;
os << "flowcontrol_10g port \n sets flow control for 10g for eiger and jungfrau" << std::endl;
os << "zmqport port \n sets the 0MQ (TCP) port of the client to where final data is streamed to (eg. for GUI). The default already connects with rx_zmqport for the GUI. "
"Use single-detector command to set individually or multi-detector command to calculate based on port for the rest."
"Must restart streaming in client with new port from gui/external gui"
@ -3109,13 +3110,13 @@ std::string slsDetectorCommand::helpNetworkParameter(int action) {
os << "rx_udpip \n gets receiver udp mac " << std::endl;
os << "rx_udpip2 \n gets receiver udp mac of 2nd udp interface. Jungfrau only" << std::endl;
os << "rx_udpport \n gets receiver udp port " << std::endl;
os << "rx_udpport2 \n gets receiver udp port of 2nd udp interface. For Eiger and Jungfrau, it is the second half module and for other detectors, same as rx_udpport" << std::endl;
os << "numinterfaces \n gets the number of interfaces to n used to stream out from the detector. Options: 1, 2. JUNGFRAU only. " << std::endl;
os << "selinterface \n gets the interface selected to use to stream data out of the detector. Options: 1, 2. Effective only when numinterfaces is 1. JUNGFRAU only. " << std::endl;
os << "rx_udpport2 \n gets receiver udp port of 2nd udp interface. For Eiger, it is the right half and for Jungfrau, it is the top half module and for other detectors, same as rx_udpport" << std::endl;
os << "numinterfaces \n gets the number of interfaces to n used to stream out from the detector. Options: 1 (default), 2. JUNGFRAU only. " << std::endl;
os << "selinterface \n gets interface to use to stream data out of the detector. Options: 0 (outer, default), 1(inner). Effective only when numinterfaces is 1. JUNGFRAU only. " << std::endl;
os << "txndelay_left \n gets detector transmission delay of the left port" << std::endl;
os << "txndelay_right \n gets detector transmission delay of the right port" << std::endl;
os << "txndelay_frame \n gets detector transmission delay of the entire frame" << std::endl;
os << "flowcontrol_10g \n gets flow control for 10g for eiger" << std::endl;
os << "flowcontrol_10g \n gets flow control for 10g for eiger and jungfrau" << std::endl;
os << "zmqport \n gets the 0MQ (TCP) port of the client to where final data is streamed to" << std::endl;
os << "rx_zmqport \n gets the 0MQ (TCP) port of the receiver from where data is streamed from" << std::endl;
os << "zmqip \n gets the 0MQ (TCP) ip of the client to where final data is streamed to.If no custom ip, empty until first time connect to receiver" << std::endl;
@ -3126,7 +3127,7 @@ std::string slsDetectorCommand::helpNetworkParameter(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdPort(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdPort(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpPort(action);
@ -3174,7 +3175,7 @@ std::string slsDetectorCommand::helpPort(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdLock(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdLock(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpLock(action);
@ -3225,7 +3226,7 @@ std::string slsDetectorCommand::helpLock(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdLastClient(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdLastClient(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpLastClient(action);
@ -3256,7 +3257,7 @@ std::string slsDetectorCommand::helpLastClient(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdOnline(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdOnline(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION) {
return helpOnline(action);
@ -3340,7 +3341,7 @@ std::string slsDetectorCommand::helpOnline(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdConfigureMac(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdConfigureMac(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION) {
return helpConfigureMac(action);
@ -3371,7 +3372,7 @@ std::string slsDetectorCommand::helpConfigureMac(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdDetectorSize(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpDetectorSize(action);
@ -3439,7 +3440,7 @@ std::string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int acti
ret = myDet->setDynamicRange(val, detPos);
} else if (cmd == "roi") {
const ROI* r = myDet->getROI(ret, detPos);
if (r != NULL)
delete [] r;
} else if (cmd == "detsizechan") {
sprintf(ans, "%d %d", myDet->getMaxNumberOfChannelsPerDetector(X), myDet->getMaxNumberOfChannelsPerDetector(Y));
@ -3488,7 +3489,7 @@ std::string slsDetectorCommand::helpDetectorSize(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdSettings(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdSettings(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpSettings(action);
@ -3606,7 +3607,7 @@ std::string slsDetectorCommand::helpSettings(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdSN(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdSN(int narg, const char * const args[], int action, int detPos) {
char answer[1000];
@ -3699,7 +3700,7 @@ std::string slsDetectorCommand::helpSN(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdDigiTest(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdDigiTest(int narg, const char * const args[], int action, int detPos) {
char answer[1000];
@ -3750,7 +3751,7 @@ std::string slsDetectorCommand::helpDigiTest(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdRegister(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdRegister(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpRegister(action);
@ -3868,7 +3869,7 @@ std::string slsDetectorCommand::helpRegister(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdDAC(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdDAC(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpDAC(action);
@ -4214,7 +4215,7 @@ std::string slsDetectorCommand::helpDAC(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdADC(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdADC(int narg, const char * const args[], int action, int detPos) {
dacIndex adc;
int idac;
@ -4341,7 +4342,7 @@ std::string slsDetectorCommand::helpADC(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdTempControl(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdTempControl(int narg, const char * const args[], int action, int detPos) {
char answer[1000] = "";
int val = -1;
@ -4408,7 +4409,7 @@ std::string slsDetectorCommand::helpTempControl(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdTiming(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdTiming(int narg, const char * const args[], int action, int detPos) {
#ifdef VERBOSE
std::cout << std::string("Executing command ") + std::string(args[0]) + std::string(" ( ") + cmd + std::string(" )\n");
#endif
@ -4434,7 +4435,7 @@ std::string slsDetectorCommand::helpTiming(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdTimer(int narg, const char * const args[], int action, int detPos) {
timerIndex index;
int64_t t = -1, ret;
double val, rval;
@ -4483,6 +4484,16 @@ std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int
}
sprintf(answer, "%d", myDet->setStoragecellStart(-1, detPos));
return std::string(answer);
} else if (cmd == "startingfnum") {
myDet->setOnline(ONLINE_FLAG, detPos);
if (action == PUT_ACTION) {
uint64_t ival = -1;
if (!sscanf(args[1], "%lu", &ival))
return std::string("cannot scan starting frame number value ") + std::string(args[1]);
myDet->setStartingFrameNumber(ival, detPos);
return std::string(args[1]);
}
return std::to_string(myDet->getStartingFrameNumber(detPos));
} else
return std::string("could not decode timer ") + cmd;
@ -4496,10 +4507,9 @@ std::string slsDetectorCommand::cmdTimer(int narg, char *args[], int action, int
if (index == ACQUISITION_TIME || index == SUBFRAME_ACQUISITION_TIME ||
index == FRAME_PERIOD || index == DELAY_AFTER_TRIGGER ||
index == SUBFRAME_DEADTIME || index == STORAGE_CELL_DELAY) {
// +0.5 for precision of eg.0.0000325
t = (val * 1E9 + 0.5);
t = lround(val * 1E9);
} else
t = (int64_t)val;
t = static_cast<int64_t>(val);
}
myDet->setOnline(ONLINE_FLAG, detPos);
@ -4535,6 +4545,7 @@ std::string slsDetectorCommand::helpTimer(int action) {
os << "period t \t sets the frame period in s" << std::endl;
os << "delay t \t sets the delay after trigger in s" << std::endl;
os << "frames t \t sets the number of frames per cycle (e.g. after each trigger)" << std::endl;
os << "startingfnum t \t sets starting frame number for the next acquisition. Only for Jungfrau and Eiger." << std::endl;
os << "cycles t \t sets the number of cycles (e.g. number of triggers)" << std::endl;
os << "samples t \t sets the number of samples (both analog and digital) expected from the ctb" << std::endl;
os << "asamples t \t sets the number of analog samples expected from the ctb" << std::endl;
@ -4552,6 +4563,7 @@ std::string slsDetectorCommand::helpTimer(int action) {
os << "period \t gets the frame period in s" << std::endl;
os << "delay \t gets the delay after trigger in s" << std::endl;
os << "frames \t gets the number of frames per cycle (e.g. after each trigger)" << std::endl;
os << "startingfnum \t gets starting frame number for the next acquisition. Only for Jungfrau and Eiger." << std::endl;
os << "cycles \t gets the number of cycles (e.g. number of triggers)" << std::endl;
os << "samples \t gets the number of samples (both analog and digital) expected from the ctb" << std::endl;
os << "asamples \t gets the number of analog samples expected from the ctb" << std::endl;
@ -4565,7 +4577,7 @@ std::string slsDetectorCommand::helpTimer(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdTimeLeft(int narg, const char * const args[], int action, int detPos) {
timerIndex index;
int64_t ret;
double rval;
@ -4581,8 +4593,6 @@ std::string slsDetectorCommand::cmdTimeLeft(int narg, char *args[], int action,
index = FRAME_PERIOD;
else if (cmd == "delayl")
index = DELAY_AFTER_TRIGGER;
else if (cmd == "gatesl")
index = GATES_NUMBER;
else if (cmd == "framesl")
index = FRAME_NUMBER;
else if (cmd == "cyclesl")
@ -4635,7 +4645,7 @@ std::string slsDetectorCommand::helpTimeLeft(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdSpeed(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdSpeed(int narg, const char * const args[], int action, int detPos) {
speedVariable index;
int t = -1, ret = 0, mode = 0;
@ -4732,7 +4742,7 @@ std::string slsDetectorCommand::helpSpeed(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdAdvanced(int narg, const char * const args[], int action, int detPos) {
char answer[1000] = "";
@ -4970,7 +4980,7 @@ std::string slsDetectorCommand::helpAdvanced(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdConfiguration(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdConfiguration(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpConfiguration(action);
@ -5040,7 +5050,7 @@ std::string slsDetectorCommand::helpConfiguration(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdReceiver(int narg, const char * const args[], int action, int detPos) {
char answer[100];
int ival = -1;
@ -5087,7 +5097,7 @@ std::string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action,
if (action == PUT_ACTION)
return std::string("cannot put");
else {
sprintf(answer, "%d", myDet->getReceiverCurrentFrameIndex(detPos));
sprintf(answer, "%lu", myDet->getReceiverCurrentFrameIndex(detPos));
return std::string(answer);
}
} else if (cmd == "r_readfreq") {
@ -5288,7 +5298,7 @@ std::string slsDetectorCommand::helpPattern(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdPattern(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdPattern(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpPattern(action);
@ -5758,7 +5768,7 @@ std::string slsDetectorCommand::helpPulse(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdPulse(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdPulse(int narg, const char * const args[], int action, int detPos) {
int retval = FAIL;
if (action == HELP_ACTION)
@ -5820,7 +5830,7 @@ std::string slsDetectorCommand::helpProcessor(int action) {
return os.str();
}
std::string slsDetectorCommand::cmdProcessor(int narg, char *args[], int action, int detPos) {
std::string slsDetectorCommand::cmdProcessor(int narg, const char * const args[], int action, int detPos) {
if (action == HELP_ACTION)
return helpProcessor(action);

View File

@ -27,7 +27,5 @@ int main(int argc, char *argv[]) {
int action = slsDetectorDefs::HELP_ACTION;
#endif
// if (argc > 1)
// argv++;
multiSlsDetectorClient(argc, argv, action);
}