gotthard server bug fix: switching between roi and no roi has complex fnum reengineering as fnum and pnum doesnt exist for gotthard, sol at the moment: send an image when configuremac, identify first packet if first two channels is 0xcacacaca, ifthe fnum is odd, then increment. Looking at this only at first image in an acquisition, also reduces roi time by configuring mac only when setting roi, not when getting

This commit is contained in:
maliakal_d 2018-12-04 12:09:46 +01:00
parent 6b4a9be870
commit 3a51d107bd
8 changed files with 37 additions and 15 deletions

View File

@ -1438,6 +1438,31 @@ int configureMAC(int ipad,long long int macad,long long int detectormacad, int d
usleep(1000 * 1000);
/** send out first image as first packet does not give 0xcacacaca (needed to know if first image
* when switching back and forth between roi and no roi
*/
// remember old parameters
uint64_t oldtiming = setTiming(-1);
uint64_t oldframes = setFrames(-1);
uint64_t oldPeriod = setPeriod(-1);
uint64_t oldExptime = setExposureTime(-1);
// set to basic parameters
setTiming(AUTO_TIMING);
setFrames(1);
setPeriod(1e6);
setExposureTime(1e5);
// take an image
startStateMachine();
waitForAcquisitionFinish();
// set to previous parameters
setTiming(oldtiming);
setFrames(oldframes);
setPeriod(oldPeriod);
setExposureTime(oldExptime);
return adcConfigured;
}

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 05d8ef6277b9d367aea69cc5b57e322d40079e27
Revision: 242
Repsitory UUID: 6b4a9be870588436dea0576060b2b8f3675ef062
Revision: 244
Branch: 4.0.1-rc
Last Changed Author: Dhanya_Thattil
Last Changed Rev: 4029
Last Changed Date: 2018-12-03 10:46:49.000000002 +0100 ./server_defs.h
Last Changed Rev: 4039
Last Changed Date: 2018-12-04 11:37:14.000000002 +0100 ./firmware_funcs.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "05d8ef6277b9d367aea69cc5b57e322d40079e27"
#define GITREPUUID "6b4a9be870588436dea0576060b2b8f3675ef062"
#define GITAUTH "Dhanya_Thattil"
#define GITREV 0x4029
#define GITDATE 0x20181203
#define GITREV 0x4039
#define GITDATE 0x20181204
#define GITBRANCH "4.0.1-rc"

View File

@ -6128,7 +6128,7 @@ int slsDetector::sendROI(int n,ROI roiLimits[]) {
#endif
// old firmware requires configuremac after setting roi
if (thisDetector->myDetectorType == GOTTHARD) {
if (thisDetector->myDetectorType == GOTTHARD && n != -1) {
configureMAC();
}

View File

@ -284,7 +284,6 @@ private:
subFrameNumber = -1;
bunchId = -1;
frameNumber = ((uint32_t)(*((uint32_t*)(packetData))));
cprintf(BLUE,"Listening %d: first fnum:%lu\n", index, frameNumber);
if (oddStartingPacket)
frameNumber++;
packetNumber = frameNumber&packetIndexMask;
@ -383,9 +382,8 @@ private:
if (nPixelsX == 1280) {
uint32_t fnum = ((uint32_t)(*((uint32_t*)(packetData))));
uint32_t firstData = ((uint32_t)(*((uint32_t*)(packetData + 4))));
cprintf(BLUE,"Listening %d: (setoff)fnum:0x%x, firstdata:0x%x\n", index, fnum, firstData);
// first packet
if (firstData != 0xCACACACA) { cprintf(BLUE,"Listening %d: (setoff) first packet\n", index);
if (firstData == 0xCACACACA) {
// packet number should be 0, but is 1 => so odd starting packet
if (fnum & packetIndexMask) {
oddStartingPacket = true;
@ -394,7 +392,7 @@ private:
}
}
// second packet
else {cprintf(BLUE,"Listening %d: (setoff) second packet\n", index);
else {
// packet number should be 1, but is 0 => so odd starting packet
if (!(fnum & packetIndexMask)) {
oddStartingPacket = true;

View File

@ -548,7 +548,6 @@ uint32_t Listener::ListenToAnImage(char* buf) {
// set first packet to be odd or even (check required when switching from roi to no roi)
if (myDetectorType == GOTTHARD && !measurementStartedFlag) {
oddStartingPacket = generalData->SetOddStartingPacket(index, listeningPacket + esize);
cprintf(GREEN,"oddstartingpacket: %d\n", (int)oddStartingPacket);
}
generalData->GetHeaderInfo(index, listeningPacket + esize,
@ -566,11 +565,11 @@ uint32_t Listener::ListenToAnImage(char* buf) {
lastCaughtFrameIndex = fnum;
//#ifdef VERBOSE
#ifdef VERBOSE
//if (!index)
cprintf(GREEN,"Listening %d: currentfindex:%lu, fnum:%lu, pnum:%u numpackets:%u\n",
index,currentFrameIndex, fnum, pnum, numpackets);
//#endif
#endif
if (!measurementStartedFlag)
RecordFirstIndices(fnum);