mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
Startingfnum (#40)
* starting fnum * by default starting fnum disabled in gui * insignificant change * adding binary * virtual eiger server working now * test:: namespace
This commit is contained in:
parent
e3f151851c
commit
6e4e2c4524
@ -10,9 +10,9 @@ class MultiDetectorFixture {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
MultiDetectorFixture() : d(0, true, true) {
|
MultiDetectorFixture() : d(0, true, true) {
|
||||||
d.setHostname(hostname.c_str());
|
d.setHostname(test::hostname.c_str());
|
||||||
if (my_ip != "undefined")
|
if (test::my_ip != "undefined")
|
||||||
d.setReceiverHostname(my_ip);
|
d.setReceiverHostname(test::my_ip);
|
||||||
}
|
}
|
||||||
~MultiDetectorFixture() { d.freeSharedMemory(); }
|
~MultiDetectorFixture() { d.freeSharedMemory(); }
|
||||||
};
|
};
|
||||||
@ -99,7 +99,6 @@ int to_time(uint32_t reg) {
|
|||||||
|
|
||||||
TEST_CASE_METHOD(MultiDetectorFixture, "Read/write register",
|
TEST_CASE_METHOD(MultiDetectorFixture, "Read/write register",
|
||||||
"[.eigerintegration][cli]") {
|
"[.eigerintegration][cli]") {
|
||||||
d.setTimer(ti::MEASUREMENTS_NUMBER, 1);
|
|
||||||
d.setNumberOfFrames(1);
|
d.setNumberOfFrames(1);
|
||||||
d.setExposureTime(10000);
|
d.setExposureTime(10000);
|
||||||
d.acquire();
|
d.acquire();
|
||||||
@ -132,7 +131,7 @@ TEST_CASE_METHOD(MultiDetectorFixture, "Get time left",
|
|||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
|
TEST_CASE_METHOD(MultiDetectorFixture, "Get ID", "[.eigerintegration][cli]") {
|
||||||
std::string hn = hostname;
|
std::string hn = test::hostname;
|
||||||
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
|
hn.erase(std::remove(begin(hn), end(hn), 'b'), end(hn));
|
||||||
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
|
hn.erase(std::remove(begin(hn), end(hn), 'e'), end(hn));
|
||||||
auto hostnames = sls::split(hn, '+');
|
auto hostnames = sls::split(hn, '+');
|
||||||
|
@ -16,27 +16,27 @@
|
|||||||
// Header holding all configurations for different detectors
|
// Header holding all configurations for different detectors
|
||||||
#include "tests/config.h"
|
#include "tests/config.h"
|
||||||
#include "tests/globals.h"
|
#include "tests/globals.h"
|
||||||
|
// using namespace test;
|
||||||
// using dt = slsDetectorDefs::detectorType;
|
// using dt = slsDetectorDefs::detectorType;
|
||||||
// extern std::string hostname;
|
// extern std::string hostname;
|
||||||
// extern std::string detector_type;
|
// extern std::string detector_type;
|
||||||
// extern dt type;
|
// extern dt type;
|
||||||
|
|
||||||
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
TEST_CASE("Single detector no receiver", "[.integration][.single]") {
|
||||||
auto t = slsDetector::getTypeFromDetector(hostname);
|
auto t = slsDetector::getTypeFromDetector(test::hostname);
|
||||||
CHECK(t == type);
|
CHECK(t == test::type);
|
||||||
|
|
||||||
slsDetector d(t);
|
slsDetector d(t);
|
||||||
CHECK(d.getDetectorTypeAsEnum() == t);
|
CHECK(d.getDetectorTypeAsEnum() == t);
|
||||||
CHECK(d.getDetectorTypeAsString() == detector_type);
|
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||||
|
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
CHECK(d.getHostname() == hostname);
|
CHECK(d.getHostname() == test::hostname);
|
||||||
|
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
CHECK(d.getOnlineFlag() == true);
|
CHECK(d.getOnlineFlag() == true);
|
||||||
|
|
||||||
CHECK(d.setDetectorType() == type);
|
CHECK(d.setDetectorType() == test::type);
|
||||||
|
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
@ -54,8 +54,8 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
int new_cport = 1993;
|
int new_cport = 1993;
|
||||||
int new_sport = 2000;
|
int new_sport = 2000;
|
||||||
{
|
{
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
CHECK(d.getControlPort() == old_cport);
|
CHECK(d.getControlPort() == old_cport);
|
||||||
d.setControlPort(new_cport);
|
d.setControlPort(new_cport);
|
||||||
@ -64,8 +64,8 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setControlPort(new_cport);
|
d.setControlPort(new_cport);
|
||||||
d.setStopPort(new_sport);
|
d.setStopPort(new_sport);
|
||||||
CHECK(d.getControlPort() == new_cport);
|
CHECK(d.getControlPort() == new_cport);
|
||||||
@ -79,8 +79,8 @@ TEST_CASE("Set control port then create a new object with this control port",
|
|||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
CHECK(d.getStopPort() == DEFAULT_PORTNO + 1);
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
@ -143,8 +143,8 @@ TEST_CASE("single EIGER detector no receiver basic set and get",
|
|||||||
|
|
||||||
|
|
||||||
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
|
|
||||||
// Check that detector server is unlocked then lock
|
// Check that detector server is unlocked then lock
|
||||||
@ -161,13 +161,13 @@ TEST_CASE("Locking mechanism and last ip", "[.integration][.single]") {
|
|||||||
d.lockServer(0);
|
d.lockServer(0);
|
||||||
CHECK(d.lockServer() == 0);
|
CHECK(d.lockServer() == 0);
|
||||||
|
|
||||||
CHECK(d.getLastClientIP() == my_ip);
|
CHECK(d.getLastClientIP() == test::my_ip);
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("Set settings", "[.integration][.single]"){
|
TEST_CASE("Set settings", "[.integration][.single]"){
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
CHECK(d.setSettings(defs::STANDARD) == defs::STANDARD);
|
||||||
}
|
}
|
||||||
@ -197,8 +197,8 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
// MEASURED_SUBPERIOD, /**< measured subperiod */
|
||||||
// MAX_TIMERS
|
// MAX_TIMERS
|
||||||
|
|
||||||
slsDetector d(type);
|
slsDetector d(test::type);
|
||||||
d.setHostname(hostname);
|
d.setHostname(test::hostname);
|
||||||
d.setOnline(true);
|
d.setOnline(true);
|
||||||
|
|
||||||
// Number of frames
|
// Number of frames
|
||||||
@ -214,14 +214,14 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD, period);
|
||||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD) == period);
|
CHECK(d.setTimer(slsDetectorDefs::timerIndex::FRAME_PERIOD) == period);
|
||||||
|
|
||||||
if (type != dt::EIGER) {
|
if (test::type != dt::EIGER) {
|
||||||
auto delay = 10000;
|
auto delay = 10000;
|
||||||
d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER, delay);
|
d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER, delay);
|
||||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER) ==
|
CHECK(d.setTimer(slsDetectorDefs::timerIndex::DELAY_AFTER_TRIGGER) ==
|
||||||
delay);
|
delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != dt::EIGER) {
|
if (test::type != dt::EIGER) {
|
||||||
auto gates = 1;
|
auto gates = 1;
|
||||||
d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER, gates);
|
d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER, gates);
|
||||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER) == gates);
|
CHECK(d.setTimer(slsDetectorDefs::timerIndex::GATES_NUMBER) == gates);
|
||||||
@ -231,7 +231,7 @@ TEST_CASE("Timer functions", "[.integration][cli]") {
|
|||||||
d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER, cycles);
|
d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER, cycles);
|
||||||
CHECK(d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER) == cycles);
|
CHECK(d.setTimer(slsDetectorDefs::timerIndex::CYCLES_NUMBER) == cycles);
|
||||||
|
|
||||||
if (type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
auto subtime = 200;
|
auto subtime = 200;
|
||||||
d.setTimer(slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME,
|
d.setTimer(slsDetectorDefs::timerIndex::SUBFRAME_ACQUISITION_TIME,
|
||||||
subtime);
|
subtime);
|
||||||
|
@ -7,19 +7,19 @@
|
|||||||
using namespace Catch::literals;
|
using namespace Catch::literals;
|
||||||
|
|
||||||
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
||||||
auto hostnames = sls::split(hostname, '+');
|
auto hostnames = sls::split(test::hostname, '+');
|
||||||
|
|
||||||
multiSlsDetector d(0, true, true);
|
multiSlsDetector d(0, true, true);
|
||||||
d.setHostname(hostname.c_str());
|
d.setHostname(test::hostname.c_str());
|
||||||
REQUIRE(d.setOnline() == true); // get!
|
REQUIRE(d.setOnline() == true); // get!
|
||||||
|
|
||||||
CHECK(d.getHostname() == hostname);
|
CHECK(d.getHostname() == test::hostname);
|
||||||
for (size_t i = 0; i != hostnames.size(); ++i) {
|
for (size_t i = 0; i != hostnames.size(); ++i) {
|
||||||
CHECK(d.getHostname(i) == hostnames[i]);
|
CHECK(d.getHostname(i) == hostnames[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
CHECK(d.getDetectorTypeAsEnum() == type);
|
CHECK(d.getDetectorTypeAsEnum() == test::type);
|
||||||
CHECK(d.getDetectorTypeAsString() == detector_type);
|
CHECK(d.getDetectorTypeAsString() == test::detector_type);
|
||||||
|
|
||||||
CHECK(d.getNumberOfDetectors() == hostnames.size());
|
CHECK(d.getNumberOfDetectors() == hostnames.size());
|
||||||
d.freeSharedMemory();
|
d.freeSharedMemory();
|
||||||
@ -30,7 +30,7 @@ TEST_CASE("Initialize a multi detector", "[.integration][.multi]") {
|
|||||||
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
||||||
|
|
||||||
multiSlsDetector d(0, true, true);
|
multiSlsDetector d(0, true, true);
|
||||||
d.setHostname(hostname.c_str());
|
d.setHostname(test::hostname.c_str());
|
||||||
|
|
||||||
// FRAME_NUMBER
|
// FRAME_NUMBER
|
||||||
int n_frames = 3;
|
int n_frames = 3;
|
||||||
@ -58,9 +58,6 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
// PROGRESS, /**< fraction of measurement elapsed - only get! */
|
||||||
// MEASUREMENTS_NUMBER,
|
// MEASUREMENTS_NUMBER,
|
||||||
|
|
||||||
int measurements = 2;
|
|
||||||
d.setTimer(ti::MEASUREMENTS_NUMBER, measurements);
|
|
||||||
CHECK(d.setTimer(ti::MEASUREMENTS_NUMBER, -1) == measurements);
|
|
||||||
|
|
||||||
// FRAMES_FROM_START,
|
// FRAMES_FROM_START,
|
||||||
// FRAMES_FROM_START_PG,
|
// FRAMES_FROM_START_PG,
|
||||||
@ -68,7 +65,7 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
|
|
||||||
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
// SUBFRAME_ACQUISITION_TIME, /**< subframe exposure time */
|
||||||
double subframe_exposure = 2000000; // ns
|
double subframe_exposure = 2000000; // ns
|
||||||
if (type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
d.setSubFrameExposureTime(subframe_exposure);
|
d.setSubFrameExposureTime(subframe_exposure);
|
||||||
CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure));
|
CHECK(d.setSubFrameExposureTime(-1) == Approx(subframe_exposure));
|
||||||
}
|
}
|
||||||
@ -77,13 +74,13 @@ TEST_CASE("Set and read timers", "[.integration][.multi]") {
|
|||||||
|
|
||||||
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
// SUBFRAME_DEADTIME, /**< subframe deadtime */
|
||||||
double subframe_deadtime = 4000; // ns
|
double subframe_deadtime = 4000; // ns
|
||||||
if (type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
d.setSubFrameExposureDeadTime(subframe_deadtime);
|
d.setSubFrameExposureDeadTime(subframe_deadtime);
|
||||||
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
CHECK(d.setSubFrameExposureDeadTime(-1) == Approx(subframe_deadtime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (type == dt::EIGER) {
|
if (test::type == dt::EIGER) {
|
||||||
// 32bit is needed for subframe exposure
|
// 32bit is needed for subframe exposure
|
||||||
d.setDynamicRange(32);
|
d.setDynamicRange(32);
|
||||||
CHECK(d.setDynamicRange(-1) == 32);
|
CHECK(d.setDynamicRange(-1) == 32);
|
||||||
|
@ -255,6 +255,27 @@
|
|||||||
<enum>QFrame::Plain</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lblIndex">
|
||||||
|
<property name="text">
|
||||||
|
<string>Run Index:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="chkFile">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><nobr>Sets output file name prefix</nobr><br>
|
||||||
|
<nobr>Check the box to enable write to file. </nobr></string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>File Name:</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="spinIndex">
|
<widget class="QSpinBox" name="spinIndex">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -322,24 +343,62 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="2" column="1">
|
||||||
<widget class="QLabel" name="lblIndex">
|
<widget class="QSpinBox" name="spinStartingFrameNumber">
|
||||||
<property name="text">
|
<property name="enabled">
|
||||||
<string>Run Index:</string>
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string><html><head/><body><p>The starting frame number of next acquisition.</p><p>#startingfnum</p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="statusTip">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
<property name="keyboardTracking">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="suffix">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>-1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2000000000</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="chkFile">
|
<widget class="QLabel" name="lblStartingFrameNumber">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string><nobr>Sets output file name prefix</nobr><br>
|
<string><html><head/><body><p>The starting frame number of next acquisition.</p><p>#startingfnum</p></body></html></string>
|
||||||
<nobr>Check the box to enable write to file. </nobr></string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>File Name:</string>
|
<string>Next Frame Number: </string>
|
||||||
</property>
|
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -33,6 +33,7 @@ private slots:
|
|||||||
void SetFileWrite(bool val);
|
void SetFileWrite(bool val);
|
||||||
void SetFileName();
|
void SetFileName();
|
||||||
void SetRunIndex(int val);
|
void SetRunIndex(int val);
|
||||||
|
void SetStartingFrameNumber(int val);
|
||||||
void UpdateProgress();
|
void UpdateProgress();
|
||||||
void StartAcquisition();
|
void StartAcquisition();
|
||||||
void StopAcquisition();
|
void StopAcquisition();
|
||||||
@ -54,6 +55,7 @@ private:
|
|||||||
void GetFileWrite();
|
void GetFileWrite();
|
||||||
void GetFileName();
|
void GetFileName();
|
||||||
void GetRunIndex();
|
void GetRunIndex();
|
||||||
|
void GetStartingFrameNumber();
|
||||||
|
|
||||||
void ResetProgress();
|
void ResetProgress();
|
||||||
|
|
||||||
@ -81,6 +83,7 @@ private:
|
|||||||
QPalette red;
|
QPalette red;
|
||||||
bool delayImplemented;
|
bool delayImplemented;
|
||||||
bool sampleImplemented;
|
bool sampleImplemented;
|
||||||
|
bool startingFnumImplemented;
|
||||||
bool isAcquisitionStopped{false};
|
bool isAcquisitionStopped{false};
|
||||||
int numMeasurements{1};
|
int numMeasurements{1};
|
||||||
int currentMeasurement{0};
|
int currentMeasurement{0};
|
||||||
|
@ -37,7 +37,8 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
|
|
||||||
sampleImplemented = false;
|
sampleImplemented = false;
|
||||||
delayImplemented = true;
|
delayImplemented = true;
|
||||||
// by default, delay is disabled in form
|
startingFnumImplemented = false;
|
||||||
|
// by default, delay and starting fnum is disabled in form
|
||||||
lblDelay->setEnabled(true);
|
lblDelay->setEnabled(true);
|
||||||
spinDelay->setEnabled(true);
|
spinDelay->setEnabled(true);
|
||||||
comboDelayUnit->setEnabled(true);
|
comboDelayUnit->setEnabled(true);
|
||||||
@ -50,6 +51,14 @@ void qTabMeasurement::SetupWidgetWindow() {
|
|||||||
break;
|
break;
|
||||||
case slsDetectorDefs::EIGER:
|
case slsDetectorDefs::EIGER:
|
||||||
delayImplemented = false;
|
delayImplemented = false;
|
||||||
|
lblStartingFrameNumber->setEnabled(true);
|
||||||
|
spinStartingFrameNumber->setEnabled(true);
|
||||||
|
startingFnumImplemented = true;
|
||||||
|
break;
|
||||||
|
case slsDetectorDefs::JUNGFRAU:
|
||||||
|
lblStartingFrameNumber->setEnabled(true);
|
||||||
|
spinStartingFrameNumber->setEnabled(true);
|
||||||
|
startingFnumImplemented = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -83,6 +92,9 @@ void qTabMeasurement::Initialization() {
|
|||||||
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
||||||
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
connect(dispFileName, SIGNAL(editingFinished()), this, SLOT(SetFileName()));
|
||||||
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(SetRunIndex(int)));
|
||||||
|
if (startingFnumImplemented) {
|
||||||
|
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this, SLOT(SetStartingFrameNumber(int)));
|
||||||
|
}
|
||||||
connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress()));
|
connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress()));
|
||||||
connect(btnStart, SIGNAL(clicked()), this, SLOT(StartAcquisition()));
|
connect(btnStart, SIGNAL(clicked()), this, SLOT(StartAcquisition()));
|
||||||
connect(btnStop, SIGNAL(clicked()), this, SLOT(StopAcquisition()));
|
connect(btnStop, SIGNAL(clicked()), this, SLOT(StopAcquisition()));
|
||||||
@ -512,6 +524,26 @@ void qTabMeasurement::SetRunIndex(int val) {
|
|||||||
} CATCH_HANDLE("Could not set acquisition file index.", "qTabMeasurement::SetRunIndex", this, &qTabMeasurement::GetRunIndex)
|
} CATCH_HANDLE("Could not set acquisition file index.", "qTabMeasurement::SetRunIndex", this, &qTabMeasurement::GetRunIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::GetStartingFrameNumber() {
|
||||||
|
FILE_LOG(logDEBUG) << "Getting Starting Frame Number";
|
||||||
|
disconnect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this, SLOT(SetStartingFrameNumber(int)));
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto retval = myDet->getStartingFrameNumber();
|
||||||
|
spinStartingFrameNumber->setValue(retval);
|
||||||
|
} CATCH_DISPLAY ("Could not get starting frame number.", "qTabMeasurement::GetStartingFrameNumber")
|
||||||
|
|
||||||
|
connect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this, SLOT(SetStartingFrameNumber(int)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void qTabMeasurement::SetStartingFrameNumber(int val) {
|
||||||
|
FILE_LOG(logINFO) << "Setting Starting frame number to " << val;
|
||||||
|
|
||||||
|
try {
|
||||||
|
myDet->setStartingFrameNumber(val);
|
||||||
|
} CATCH_HANDLE("Could not set starting frame number.", "qTabMeasurement::SetStartingFrameNumber", this, &qTabMeasurement::GetStartingFrameNumber)
|
||||||
|
}
|
||||||
|
|
||||||
void qTabMeasurement::ResetProgress() {
|
void qTabMeasurement::ResetProgress() {
|
||||||
FILE_LOG(logDEBUG) << "Resetting progress";
|
FILE_LOG(logDEBUG) << "Resetting progress";
|
||||||
lblCurrentFrame->setText("0");
|
lblCurrentFrame->setText("0");
|
||||||
@ -590,6 +622,9 @@ void qTabMeasurement::AcquireFinished() {
|
|||||||
FILE_LOG(logDEBUG) << "Acquire Finished";
|
FILE_LOG(logDEBUG) << "Acquire Finished";
|
||||||
UpdateProgress();
|
UpdateProgress();
|
||||||
GetRunIndex();
|
GetRunIndex();
|
||||||
|
if (startingFnumImplemented) {
|
||||||
|
GetStartingFrameNumber();
|
||||||
|
}
|
||||||
FILE_LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished";
|
FILE_LOG(logDEBUG) << "Measurement " << currentMeasurement << " finished";
|
||||||
// next measurement if acq is not stopped
|
// next measurement if acq is not stopped
|
||||||
if (!isAcquisitionStopped && ((currentMeasurement + 1) < numMeasurements)) {
|
if (!isAcquisitionStopped && ((currentMeasurement + 1) < numMeasurements)) {
|
||||||
@ -639,6 +674,9 @@ void qTabMeasurement::Refresh() {
|
|||||||
GetFileWrite();
|
GetFileWrite();
|
||||||
GetFileName();
|
GetFileName();
|
||||||
GetRunIndex();
|
GetRunIndex();
|
||||||
|
if (startingFnumImplemented) {
|
||||||
|
GetStartingFrameNumber();
|
||||||
|
}
|
||||||
ResetProgress();
|
ResetProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,7 +1302,7 @@ int Beb_SetStartingFrameNumber(uint64_t value) {
|
|||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
FILE_LOG(logERROR, ("Set Start Frame Number FAIL\n"));
|
FILE_LOG(logERROR, ("Set Start Frame Number FAIL\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
} else {
|
}
|
||||||
// since the read is not implemented in firmware yet
|
// since the read is not implemented in firmware yet
|
||||||
Beb_deactivatedStartFrameNumber = value;
|
Beb_deactivatedStartFrameNumber = value;
|
||||||
|
|
||||||
@ -1311,38 +1311,68 @@ int Beb_SetStartingFrameNumber(uint64_t value) {
|
|||||||
Beb_Write32(csp0base, UDP_HEADER_FRAME_NUMBER_LSB_OFST, valueInFirmware & (0xffffffff));
|
Beb_Write32(csp0base, UDP_HEADER_FRAME_NUMBER_LSB_OFST, valueInFirmware & (0xffffffff));
|
||||||
Beb_Write32(csp0base, UDP_HEADER_FRAME_NUMBER_MSB_OFST, (valueInFirmware >> 32) & (0xffffffff));
|
Beb_Write32(csp0base, UDP_HEADER_FRAME_NUMBER_MSB_OFST, (valueInFirmware >> 32) & (0xffffffff));
|
||||||
Beb_close(fd,csp0base);
|
Beb_close(fd,csp0base);
|
||||||
}
|
|
||||||
|
|
||||||
uint64_t retval = -1;
|
|
||||||
if ((Beb_GetStartingFrameNumber(&retval) == OK) && (retval == value)) {
|
|
||||||
FILE_LOG(logINFO, ("Going to reset Frame Number\n"));
|
FILE_LOG(logINFO, ("Going to reset Frame Number\n"));
|
||||||
Beb_ResetFrameNumber();
|
Beb_ResetFrameNumber();
|
||||||
}
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Beb_GetStartingFrameNumber(uint64_t* retval) {
|
int Beb_GetStartingFrameNumber(uint64_t* retval, int tengigaEnable) {
|
||||||
if (!Beb_activated) {
|
if (!Beb_activated) {
|
||||||
*retval = Beb_deactivatedStartFrameNumber;
|
*retval = Beb_deactivatedStartFrameNumber;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
FILE_LOG(logDEBUG1, ("Getting start frame number\n"));
|
|
||||||
|
|
||||||
// since it is not implemented in firmware yet
|
FILE_LOG(logDEBUG1, ("Getting start frame number\n"));
|
||||||
*retval = Beb_deactivatedStartFrameNumber;
|
|
||||||
/*
|
|
||||||
u_int32_t* csp0base = 0;
|
u_int32_t* csp0base = 0;
|
||||||
int fd = Beb_open(&csp0base, XPAR_PLB_GPIO_TEST_BASEADDR);
|
int fd = Beb_open(&csp0base, XPAR_COUNTER_BASEADDR);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
FILE_LOG(logERROR, ("Set Start Frame Number FAIL\n"));
|
FILE_LOG(logERROR, ("Get Start Frame Number FAIL\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
} else {
|
|
||||||
*retval = Beb_Read32(csp0base, UDP_HEADER_FRAME_NUMBER_MSB_OFST);
|
|
||||||
uint32_t lretval = Beb_Read32(csp0base, UDP_HEADER_FRAME_NUMBER_MSB_OFST);
|
|
||||||
*retval = (*retval << 32) | lretval;
|
|
||||||
Beb_close(fd,csp0base);
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
uint32_t temp = 0;
|
||||||
|
if (!tengigaEnable) {
|
||||||
|
uint64_t left1g = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_MSB_OFST);
|
||||||
|
temp = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_LSB_OFST);
|
||||||
|
left1g = ((left1g << 32) | temp) >> 16;
|
||||||
|
++left1g; // increment for firmware
|
||||||
|
|
||||||
|
uint64_t right1g = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_MSB_OFST);
|
||||||
|
temp = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_LSB_OFST);
|
||||||
|
right1g = ((right1g << 32) | temp) >> 16;
|
||||||
|
++right1g; // increment for firmware
|
||||||
|
|
||||||
|
Beb_close(fd,csp0base);
|
||||||
|
if (left1g != right1g) {
|
||||||
|
FILE_LOG(logERROR, ("Retrieved inconsistent frame numbers from 1g left %llu and right %llu\n",
|
||||||
|
(long long int)left1g, (long long int)right1g));
|
||||||
|
*retval = (left1g > right1g) ? left1g : right1g; // give max to set it to when stopping acq & different value
|
||||||
|
return -2; // to differentiate between failed address mapping
|
||||||
|
}
|
||||||
|
*retval = left1g;
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
uint64_t left10g = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_MSB_OFST);
|
||||||
|
temp = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_LSB_OFST);
|
||||||
|
left10g = ((left10g << 32) | temp) >> 16;
|
||||||
|
++left10g; // increment for firmware
|
||||||
|
|
||||||
|
uint64_t right10g = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_MSB_OFST);
|
||||||
|
temp = Beb_Read32(csp0base, UDP_HEADER_GET_FNUM_1G_LEFT_LSB_OFST);
|
||||||
|
right10g = ((right10g << 32) | temp) >> 16;
|
||||||
|
Beb_close(fd,csp0base);
|
||||||
|
++right10g; // increment for firmware
|
||||||
|
|
||||||
|
if (left10g != right10g) {
|
||||||
|
FILE_LOG(logERROR, ("Retrieved inconsistent frame numbers from `0g left %llu and right %llu\n",
|
||||||
|
(long long int)left10g, (long long int)right10g));
|
||||||
|
*retval = (left10g > right10g) ? left10g : right10g; // give max to set it to when stopping acq & different value
|
||||||
|
return -2; // to differentiate between failed address mapping
|
||||||
|
}
|
||||||
|
*retval = left10g;
|
||||||
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void Beb_SetQuad(int value);
|
|||||||
int Beb_GetQuad();
|
int Beb_GetQuad();
|
||||||
int Beb_SetDetectorPosition(int pos[]);
|
int Beb_SetDetectorPosition(int pos[]);
|
||||||
int Beb_SetStartingFrameNumber(uint64_t value);
|
int Beb_SetStartingFrameNumber(uint64_t value);
|
||||||
int Beb_GetStartingFrameNumber(uint64_t* retval);
|
int Beb_GetStartingFrameNumber(uint64_t* retval, int tengigaEnable);
|
||||||
|
|
||||||
uint16_t Beb_swap_uint16( uint16_t val);
|
uint16_t Beb_swap_uint16( uint16_t val);
|
||||||
int Beb_open(u_int32_t** csp0base, u_int32_t offset);
|
int Beb_open(u_int32_t** csp0base, u_int32_t offset);
|
||||||
|
@ -202,9 +202,6 @@
|
|||||||
#define UDP_HEADER_Y_OFST (16)
|
#define UDP_HEADER_Y_OFST (16)
|
||||||
#define UDP_HEADER_Y_MSK (0xFFFF << UDP_HEADER_Y_OFST)
|
#define UDP_HEADER_Y_MSK (0xFFFF << UDP_HEADER_Y_OFST)
|
||||||
|
|
||||||
// udp header (frame number)
|
|
||||||
#define UDP_HEADER_FRAME_NUMBER_LSB_OFST (0x0140)
|
|
||||||
#define UDP_HEADER_FRAME_NUMBER_MSB_OFST (0x0160)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
@ -666,7 +666,7 @@ int getStartingFrameNumber(uint64_t* retval) {
|
|||||||
*retval = eiger_virtual_startingframenumber;
|
*retval = eiger_virtual_startingframenumber;
|
||||||
return OK;
|
return OK;
|
||||||
#else
|
#else
|
||||||
return Beb_GetStartingFrameNumber(retval);
|
return Beb_GetStartingFrameNumber(retval, send_to_ten_gig);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,11 +1311,17 @@ int setDetectorPosition(int pos[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setQuad(int value) {
|
void setQuad(int value) {
|
||||||
|
#ifndef VIRTUAL
|
||||||
Beb_SetQuad(value);
|
Beb_SetQuad(value);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int getQuad() {
|
int getQuad() {
|
||||||
|
#ifdef VIRTUAL
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
return Beb_GetQuad();
|
return Beb_GetQuad();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int enableTenGigabitEthernet(int val) {
|
int enableTenGigabitEthernet(int val) {
|
||||||
@ -1793,11 +1799,17 @@ int stopStateMachine() {
|
|||||||
eiger_virtual_stop = 0;
|
eiger_virtual_stop = 0;
|
||||||
return OK;
|
return OK;
|
||||||
#else
|
#else
|
||||||
|
if ((Feb_Control_StopAcquisition() != STATUS_IDLE) || (!Beb_StopAcquisition()) ) {
|
||||||
if ((Feb_Control_StopAcquisition() == STATUS_IDLE) & Beb_StopAcquisition())
|
|
||||||
return OK;
|
|
||||||
FILE_LOG(logERROR, ("failed to stop acquisition\n"));
|
FILE_LOG(logERROR, ("failed to stop acquisition\n"));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ensure all have same starting frame numbers
|
||||||
|
uint64_t retval = 0;
|
||||||
|
if(Beb_GetStartingFrameNumber(&retval, send_to_ten_gig) == -2) {
|
||||||
|
Beb_SetStartingFrameNumber(retval + 1);
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,16 +56,34 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
/** Version Numbers */
|
/** Version Numbers */
|
||||||
#define XPAR_VERSION 0xc6000000
|
#define XPAR_VERSION 0xc6000000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_GPIO_TEST */
|
/* Definitions for peripheral PLB_GPIO_TEST */
|
||||||
#define XPAR_PLB_GPIO_TEST_BASEADDR 0xD1010000
|
#define XPAR_PLB_GPIO_TEST_BASEADDR 0xD1010000
|
||||||
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
||||||
|
|
||||||
|
// udp header (set frame number)
|
||||||
|
#define UDP_HEADER_FRAME_NUMBER_LSB_OFST (0x0140)
|
||||||
|
#define UDP_HEADER_FRAME_NUMBER_MSB_OFST (0x0160)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for packet, frame and delay down counters */
|
/* Definitions for packet, frame and delay down counters */
|
||||||
#define XPAR_COUNTER_BASEADDR 0xD1020000
|
#define XPAR_COUNTER_BASEADDR 0xD1020000
|
||||||
#define XPAR_COUNTER_HIGHADDR 0xD102FFFF
|
#define XPAR_COUNTER_HIGHADDR 0xD102FFFF
|
||||||
|
|
||||||
|
// udp header (get frame number)
|
||||||
|
#define UDP_HEADER_GET_FNUM_1G_LEFT_LSB_OFST (0x0004)
|
||||||
|
#define UDP_HEADER_GET_FNUM_1G_LEFT_MSB_OFST (0x0024)
|
||||||
|
#define UDP_HEADER_GET_FNUM_1G_RIGHT_LSB_OFST (0x0044)
|
||||||
|
#define UDP_HEADER_GET_FNUM_1G_RIGHT_MSB_OFST (0x0064)
|
||||||
|
#define UDP_HEADER_GET_FNUM_10G_LEFT_LSB_OFST (0x0084)
|
||||||
|
#define UDP_HEADER_GET_FNUM_10G_LEFT_MSB_OFST (0x00A4)
|
||||||
|
#define UDP_HEADER_GET_FNUM_10G_RIGHT_LSB_OFST (0x00C4)
|
||||||
|
#define UDP_HEADER_GET_FNUM_10G_RIGHT_MSB_OFST (0x00E4)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
||||||
|
@ -4044,6 +4044,9 @@ int set_starting_frame_number(int file_des) {
|
|||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
sprintf(mess, "Could not get starting frame number. Failed to map address.\n");
|
sprintf(mess, "Could not get starting frame number. Failed to map address.\n");
|
||||||
FILE_LOG(logERROR,(mess));
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else if (ret == -2) {
|
||||||
|
sprintf(mess, "Inconsistent starting frame number from left and right FPGA. Please set it.\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
} else {
|
} else {
|
||||||
if (arg != retval) {
|
if (arg != retval) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -4073,6 +4076,9 @@ int get_starting_frame_number(int file_des) {
|
|||||||
if (ret == FAIL) {
|
if (ret == FAIL) {
|
||||||
sprintf(mess, "Could not get starting frame number. Failed to map address.\n");
|
sprintf(mess, "Could not get starting frame number. Failed to map address.\n");
|
||||||
FILE_LOG(logERROR,(mess));
|
FILE_LOG(logERROR,(mess));
|
||||||
|
} else if (ret == -2) {
|
||||||
|
sprintf(mess, "Inconsistent starting frame number from left and right FPGA. Please set it.\n");
|
||||||
|
FILE_LOG(logERROR,(mess));
|
||||||
} else {
|
} else {
|
||||||
FILE_LOG(logDEBUG1, ("Start frame number retval: %u\n", retval));
|
FILE_LOG(logDEBUG1, ("Start frame number retval: %u\n", retval));
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#define APICTB 0x190604
|
#define APICTB 0x190604
|
||||||
#define APIGOTTHARD 0x190715
|
#define APIGOTTHARD 0x190715
|
||||||
#define APIJUNGFRAU 0x190718
|
#define APIJUNGFRAU 0x190718
|
||||||
#define APIEIGER 0x190722
|
#define APIEIGER 0x190723
|
||||||
#define APILIB 0x190723
|
#define APILIB 0x190723
|
||||||
#define APIRECEIVER 0x190722
|
#define APIRECEIVER 0x190722
|
||||||
#define APIGUI 0x190723
|
#define APIGUI 0x190723
|
||||||
|
Loading…
x
Reference in New Issue
Block a user