Moench rewrite (#597)

* copied jungfrau server to moench and adapted

* fixed image size and num packets

* read n rows allows 16

* commneted out configure_asic_timer at server startup. To be removed later the ASIC_CTRL_REG and storage cell options

* moench:removing the decrement (which was in jf)  in read n rows to register

* removed lblsamples from gui
This commit is contained in:
Dhanya Thattil
2022-12-15 09:16:51 +01:00
committed by GitHub
parent 7ab3b25f87
commit 39b1f5bbf2
58 changed files with 4309 additions and 5499 deletions

View File

@@ -351,7 +351,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
}
impl()->setUDPPortNumber(arg.udp_dstport);
impl()->setUDPPortNumber2(arg.udp_dstport2);
if (detType == JUNGFRAU || detType == GOTTHARD2) {
if (detType == JUNGFRAU || detType == MOENCH || detType == GOTTHARD2) {
try {
impl()->setNumberofUDPInterfaces(arg.udpInterfaces);
} catch (const RuntimeError &e) {
@@ -367,10 +367,10 @@ int ClientInterface::setup_receiver(Interface &socket) {
if (detType == GOTTHARD2) {
impl()->setNumberOfBursts(arg.bursts);
}
if (detType == JUNGFRAU) {
if (detType == JUNGFRAU || detType == MOENCH) {
impl()->setNumberOfAdditionalStorageCells(arg.additionalStorageCells);
}
if (detType == MOENCH || detType == CHIPTESTBOARD) {
if (detType == CHIPTESTBOARD) {
try {
impl()->setNumberofAnalogSamples(arg.analogSamples);
} catch (const RuntimeError &e) {
@@ -408,7 +408,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
}
impl()->setThresholdEnergy(arg.thresholdEnergyeV[0]);
}
if (detType == EIGER || detType == JUNGFRAU) {
if (detType == EIGER || detType == JUNGFRAU || detType == MOENCH) {
impl()->setReadNRows(arg.readNRows);
}
if (detType == MYTHEN3) {
@@ -428,8 +428,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
}
}
impl()->setTimingMode(arg.timMode);
if (detType == EIGER || detType == MOENCH || detType == CHIPTESTBOARD ||
detType == MYTHEN3) {
if (detType == EIGER || detType == CHIPTESTBOARD || detType == MYTHEN3) {
try {
impl()->setTenGigaEnable(arg.tenGiga);
} catch (const RuntimeError &e) {
@@ -444,7 +443,7 @@ int ClientInterface::setup_receiver(Interface &socket) {
"due to fifo memory allocation.");
}
}
if (detType == CHIPTESTBOARD || detType == MOENCH) {
if (detType == CHIPTESTBOARD) {
try {
impl()->setADCEnableMask(arg.adcMask);
} catch (const RuntimeError &e) {
@@ -488,8 +487,8 @@ void ClientInterface::setDetectorType(detectorType arg) {
case GOTTHARD:
case EIGER:
case CHIPTESTBOARD:
case MOENCH:
case JUNGFRAU:
case MOENCH:
case MYTHEN3:
case GOTTHARD2:
break;
@@ -611,7 +610,7 @@ int ClientInterface::set_burst_mode(Interface &socket) {
int ClientInterface::set_num_analog_samples(Interface &socket) {
auto value = socket.Receive<int>();
LOG(logDEBUG1) << "Setting num analog samples to " << value;
if (detType != CHIPTESTBOARD && detType != MOENCH) {
if (detType != CHIPTESTBOARD) {
functionNotImplemented();
}
try {
@@ -939,8 +938,7 @@ int ClientInterface::get_overwrite(Interface &socket) {
int ClientInterface::enable_tengiga(Interface &socket) {
auto val = socket.Receive<int>();
if (detType != EIGER && detType != CHIPTESTBOARD && detType != MOENCH &&
detType != MYTHEN3)
if (detType != EIGER && detType != CHIPTESTBOARD && detType != MYTHEN3)
functionNotImplemented();
if (val >= 0) {
@@ -1365,7 +1363,7 @@ int ClientInterface::set_read_n_rows(Interface &socket) {
auto arg = socket.Receive<int>();
if (arg >= 0) {
verifyIdle(socket);
if (detType != EIGER && detType != JUNGFRAU) {
if (detType != EIGER && detType != JUNGFRAU && detType != MOENCH) {
throw RuntimeError("Could not set number of rows. Not implemented "
"for this detector");
}
@@ -1448,7 +1446,7 @@ MacAddr ClientInterface::setUdpIp2(IpAddr arg) {
int ClientInterface::set_udp_ip2(Interface &socket) {
auto arg = socket.Receive<IpAddr>();
verifyIdle(socket);
if (detType != JUNGFRAU && detType != GOTTHARD2) {
if (detType != JUNGFRAU && detType != MOENCH && detType != GOTTHARD2) {
throw RuntimeError(
"UDP Destination IP2 not implemented for this detector");
}
@@ -1467,7 +1465,8 @@ int ClientInterface::set_udp_port(Interface &socket) {
int ClientInterface::set_udp_port2(Interface &socket) {
auto arg = socket.Receive<int>();
verifyIdle(socket);
if (detType != JUNGFRAU && detType != EIGER && detType != GOTTHARD2) {
if (detType != JUNGFRAU && detType != MOENCH && detType != EIGER &&
detType != GOTTHARD2) {
throw RuntimeError(
"UDP Destination Port2 not implemented for this detector");
}
@@ -1480,7 +1479,7 @@ int ClientInterface::set_num_interfaces(Interface &socket) {
auto arg = socket.Receive<int>();
arg = (arg > 1 ? 2 : 1);
verifyIdle(socket);
if (detType != JUNGFRAU && detType != GOTTHARD2) {
if (detType != JUNGFRAU && detType != MOENCH && detType != GOTTHARD2) {
throw RuntimeError(
"Number of interfaces not implemented for this detector");
}
@@ -1727,7 +1726,7 @@ int ClientInterface::get_receiver_roi(Interface &socket) {
int ClientInterface::set_receiver_roi(Interface &socket) {
auto arg = socket.Receive<ROI>();
if (detType == CHIPTESTBOARD || detType == MOENCH)
if (detType == CHIPTESTBOARD)
functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI: " << ToString(arg);
verifyIdle(socket);
@@ -1741,7 +1740,7 @@ int ClientInterface::set_receiver_roi(Interface &socket) {
int ClientInterface::set_receiver_roi_metadata(Interface &socket) {
auto arg = socket.Receive<ROI>();
if (detType == CHIPTESTBOARD || detType == MOENCH)
if (detType == CHIPTESTBOARD)
functionNotImplemented();
LOG(logDEBUG1) << "Set Receiver ROI Metadata: " << ToString(arg);
verifyIdle(socket);