mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
Merge fix from 7.0.2 (#756)
- start acq list: mixup with master pos #743 : fix that only master starts second and not all (for start acq), typo with pos and masters list - synced master status running when setting to slave #747: synced master status running when setting to slave
This commit is contained in:
parent
65b8c9c5c1
commit
6fcb880538
@ -1,7 +1,7 @@
|
|||||||
SLS Detector Package Major Release 7.x.x released on xx.xx.2023
|
SLS Detector Package Major Release 7.x.x released on xx.xx.2023
|
||||||
===============================================================
|
===============================================================
|
||||||
|
|
||||||
This document describes the differences between v7.x.x and v7.0.0
|
This document describes the differences between v7.x.x and v7.0.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1388,14 +1388,18 @@ int setMaster(enum MASTERINDEX m) {
|
|||||||
char *master_names[] = {MASTER_NAMES};
|
char *master_names[] = {MASTER_NAMES};
|
||||||
LOG(logINFOBLUE, ("Setting up as %s in (%s server)\n", master_names[m],
|
LOG(logINFOBLUE, ("Setting up as %s in (%s server)\n", master_names[m],
|
||||||
(isControlServer ? "control" : "stop")));
|
(isControlServer ? "control" : "stop")));
|
||||||
|
|
||||||
|
int prevSync = getSynchronization();
|
||||||
|
setSynchronization(0);
|
||||||
int retval = -1;
|
int retval = -1;
|
||||||
|
int retMaster = OK;
|
||||||
switch (m) {
|
switch (m) {
|
||||||
case OW_MASTER:
|
case OW_MASTER:
|
||||||
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_MASTER_MSK);
|
bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_MASTER_MSK);
|
||||||
isMaster(&retval);
|
isMaster(&retval);
|
||||||
if (retval != 1) {
|
if (retval != 1) {
|
||||||
LOG(logERROR, ("Could not set master\n"));
|
LOG(logERROR, ("Could not set master\n"));
|
||||||
return FAIL;
|
retMaster = FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OW_SLAVE:
|
case OW_SLAVE:
|
||||||
@ -1403,15 +1407,16 @@ int setMaster(enum MASTERINDEX m) {
|
|||||||
isMaster(&retval);
|
isMaster(&retval);
|
||||||
if (retval != 0) {
|
if (retval != 0) {
|
||||||
LOG(logERROR, ("Could not set slave\n"));
|
LOG(logERROR, ("Could not set slave\n"));
|
||||||
return FAIL;
|
retMaster = FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LOG(logERROR, ("Cannot reset to hardware settings from client. Restart "
|
LOG(logERROR, ("Cannot reset to hardware settings from client. Restart "
|
||||||
"detector server.\n"));
|
"detector server.\n"));
|
||||||
return FAIL;
|
retMaster = FAIL;
|
||||||
}
|
}
|
||||||
return OK;
|
setSynchronization(prevSync);
|
||||||
|
return retMaster;
|
||||||
}
|
}
|
||||||
|
|
||||||
int isMaster(int *retval) {
|
int isMaster(int *retval) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "sls/sls_detector_defs.h"
|
#include "sls/sls_detector_defs.h"
|
||||||
|
|
||||||
#define MIN_REQRD_VRSN_T_RD_API 0x171220
|
#define MIN_REQRD_VRSN_T_RD_API 0x171220
|
||||||
#define REQRD_FRMWRE_VRSN_BOARD2 0x221104 // 1.0 pcb (version = 010)
|
#define REQRD_FRMWRE_VRSN_BOARD2 0x230515 // 1.0 pcb (version = 010)
|
||||||
#define REQRD_FRMWRE_VRSN 0x221103 // 2.0 pcb (version = 011)
|
#define REQRD_FRMWRE_VRSN 0x221103 // 2.0 pcb (version = 011)
|
||||||
|
|
||||||
#define NUM_HARDWARE_VERSIONS (2)
|
#define NUM_HARDWARE_VERSIONS (2)
|
||||||
|
@ -1298,7 +1298,7 @@ void DetectorImpl::startAcquisition(const bool blocking, Positions pos) {
|
|||||||
if (!masters.empty()) {
|
if (!masters.empty()) {
|
||||||
Parallel((blocking ? &Module::startAndReadAll
|
Parallel((blocking ? &Module::startAndReadAll
|
||||||
: &Module::startAcquisition),
|
: &Module::startAcquisition),
|
||||||
pos);
|
masters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// all in parallel
|
// all in parallel
|
||||||
@ -1372,7 +1372,7 @@ void DetectorImpl::processData(bool receiver) {
|
|||||||
if (fgetc(stdin) == 'q') {
|
if (fgetc(stdin) == 'q') {
|
||||||
LOG(logINFO)
|
LOG(logINFO)
|
||||||
<< "Caught the command to stop acquisition";
|
<< "Caught the command to stop acquisition";
|
||||||
Parallel(&Module::stopAcquisition, {});
|
stopDetector({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// get and print progress
|
// get and print progress
|
||||||
|
@ -523,6 +523,28 @@ TEST_CASE("sync", "[.cmd]") {
|
|||||||
proxy.Call("sync", {"1"}, -1, PUT, oss);
|
proxy.Call("sync", {"1"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "sync 1\n");
|
REQUIRE(oss.str() == "sync 1\n");
|
||||||
}
|
}
|
||||||
|
// setting to master or slave when synced
|
||||||
|
{
|
||||||
|
// get previous master
|
||||||
|
int prevMaster = 0;
|
||||||
|
auto previous = det.getMaster();
|
||||||
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
|
if (previous[i] == 1) {
|
||||||
|
prevMaster = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
proxy.Call("master", {"1"}, 0, PUT);
|
||||||
|
proxy.Call("master", {"0"}, 0, PUT);
|
||||||
|
std::ostringstream oss;
|
||||||
|
proxy.Call("status", {}, -1, GET, oss);
|
||||||
|
REQUIRE(oss.str() != "status running\n");
|
||||||
|
// set all to slaves, and then master
|
||||||
|
for (int i = 0; i != det.size(); ++i) {
|
||||||
|
det.setMaster(0, {i});
|
||||||
|
}
|
||||||
|
det.setMaster(1, prevMaster);
|
||||||
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("sync", {}, -1, GET, oss);
|
proxy.Call("sync", {}, -1, GET, oss);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define APICTB "developer 0x230525"
|
#define APICTB "developer 0x230525"
|
||||||
#define APIGOTTHARD "developer 0x230525"
|
#define APIGOTTHARD "developer 0x230525"
|
||||||
#define APIGOTTHARD2 "developer 0x230525"
|
#define APIGOTTHARD2 "developer 0x230525"
|
||||||
#define APIJUNGFRAU "developer 0x230525"
|
|
||||||
#define APIMYTHEN3 "developer 0x230525"
|
#define APIMYTHEN3 "developer 0x230525"
|
||||||
#define APIMOENCH "developer 0x230525"
|
#define APIMOENCH "developer 0x230525"
|
||||||
#define APIEIGER "developer 0x230525"
|
#define APIEIGER "developer 0x230525"
|
||||||
|
#define APIJUNGFRAU "developer 0x230525"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user