mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 17:18:00 +02:00
Commandline (#66)
* WIP * WIP * removed status to string from defs * WIP * WIP * WIP removed unused functions in multi * WIP * print hex in a terrible way * WIP, loadconfig error * WIP, type to string * WIP * fix to conversion * WIP, hostname doesnt work * WIP * WIP * WIP * WIP, threshold * WIP, threshold * WIP * WIP, triggers * WIP, cycles to triggers * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * rx_udsocksize fx, WIP * WIP * WIP * WIP * file index (64 bit), WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * merge * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * New python mod
This commit is contained in:
@ -59,7 +59,7 @@ void qDacWidget::SetDac() {
|
||||
FILE_LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data() << " : " << val;
|
||||
|
||||
try {
|
||||
det->setDAC(val, index, 0, {detectorIndex});
|
||||
det->setDAC(index, val, 0, {detectorIndex});
|
||||
} CATCH_DISPLAY (std::string("Could not set dac ") + std::to_string(index), "qDacWidget::SetDac")
|
||||
|
||||
// update mV anyway
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "qTabMessages.h"
|
||||
|
||||
#include "versionAPI.h"
|
||||
#include "ToString.h"
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QScrollArea>
|
||||
@ -231,13 +232,13 @@ void qDetectorMain::SetUpDetector(const std::string fName, int multiID) {
|
||||
default:
|
||||
std::ostringstream os;
|
||||
os << det->getHostname() << " has " <<
|
||||
slsDetectorDefs::detectorTypeToString(det->getDetectorType().squash()) << " detector type (" <<
|
||||
sls::ToString(det->getDetectorType().squash()) << " detector type (" <<
|
||||
std::to_string(detType) << "). Exiting GUI.";
|
||||
std::string errorMess = os.str();
|
||||
throw sls::RuntimeError(errorMess.c_str());
|
||||
}
|
||||
std::ostringstream os;
|
||||
os << "SLS Detector GUI : " << slsDetectorDefs::detectorTypeToString(det->getDetectorType().squash())
|
||||
os << "SLS Detector GUI : " << sls::ToString(det->getDetectorType().squash())
|
||||
<< " - " << det->getHostname();
|
||||
std::string title = os.str();
|
||||
FILE_LOG(logINFO) << title;
|
||||
@ -384,7 +385,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
}
|
||||
|
||||
else if (action == actionLoadTrimbits) {
|
||||
QString fName = QString((det->getSettingsDir().squash("/tmp/")).c_str());
|
||||
QString fName = QString((det->getSettingsPath().squash("/tmp/")).c_str());
|
||||
FILE_LOG(logDEBUG) << "Loading Trimbits";
|
||||
// so that even nonexisting files can be selected
|
||||
QFileDialog *fileDialog = new QFileDialog(
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "qCloneWidget.h"
|
||||
|
||||
#include "detectorData.h"
|
||||
#include "ToString.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QPainter>
|
||||
@ -570,8 +571,11 @@ void qDrawPlot::AcquireFinished() {
|
||||
FILE_LOG(logERROR) << "Acquisition Finished with an exception: " << mess;
|
||||
qDefs::ExceptionMessage("Acquire unsuccessful.", mess, "qDrawPlot::AcquireFinished");
|
||||
try{
|
||||
det->stopAcquisition();
|
||||
} CATCH_DISPLAY("Could not stop acquisition and receiver.", "qDrawPlot::AcquireFinished");
|
||||
det->stopDetector();
|
||||
} CATCH_DISPLAY("Could not stop detector acquisition.", "qDrawPlot::AcquireFinished");
|
||||
try{
|
||||
det->stopReceiver();
|
||||
} CATCH_DISPLAY("Could not stop receiver.", "qDrawPlot::AcquireFinished");
|
||||
emit AbortSignal();
|
||||
}
|
||||
FILE_LOG(logDEBUG) << "End of Acquisition Finished";
|
||||
@ -599,7 +603,7 @@ void qDrawPlot::GetDataCallBack(detectorData *data, uint64_t frameIndex, uint32_
|
||||
|
||||
void qDrawPlot::AcquisitionFinished(double currentProgress, int detectorStatus) {
|
||||
progress = currentProgress;
|
||||
std::string status = slsDetectorDefs::runStatusType(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
|
||||
std::string status = sls::ToString(static_cast<slsDetectorDefs::runStatus>(detectorStatus));
|
||||
|
||||
if (detectorStatus == slsDetectorDefs::ERROR) {
|
||||
qDefs::Message(qDefs::WARNING, std::string("<nobr>The acquisiton has ended abruptly. Current Detector Status: ") + status + std::string(".</nobr>"), "qDrawPlot::AcquisitionFinished");
|
||||
|
@ -205,7 +205,7 @@ void qTabAdvanced::GetCltZMQIP() {
|
||||
|
||||
try {
|
||||
auto retval =
|
||||
det->getClientZmqIp({comboDetector->currentIndex()})[0];
|
||||
det->getClientZmqIp({comboDetector->currentIndex()})[0].str();
|
||||
dispZMQIP->setText(QString(retval.c_str()));
|
||||
} CATCH_DISPLAY ("Could not get client zmq ip.", "qTabAdvanced::GetCltZMQIP")
|
||||
|
||||
@ -303,7 +303,7 @@ void qTabAdvanced::GetRxrZMQIP() {
|
||||
|
||||
try {
|
||||
auto retval =
|
||||
det->getRxZmqIP({comboDetector->currentIndex()})[0];
|
||||
det->getRxZmqIP({comboDetector->currentIndex()})[0].str();
|
||||
dispRxrZMQIP->setText(QString(retval.c_str()));
|
||||
} CATCH_DISPLAY ("Could not get receiver zmq ip.", "qTabAdvanced::GetRxrZMQIP")
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "qTabDebugging.h"
|
||||
#include "qDefs.h"
|
||||
|
||||
#include "ToString.h"
|
||||
|
||||
#include <QDesktopWidget>
|
||||
#include <QGridLayout>
|
||||
#include <QTreeWidget>
|
||||
@ -65,7 +67,7 @@ void qTabDebugging::GetDetectorStatus() {
|
||||
FILE_LOG(logDEBUG) << "Getting Status";
|
||||
|
||||
try {
|
||||
std::string status = slsDetectorDefs::runStatusType(det->getDetectorStatus({comboDetector->currentIndex()})[0]);
|
||||
std::string status = sls::ToString(det->getDetectorStatus({comboDetector->currentIndex()})[0]);
|
||||
lblStatus->setText(QString(status.c_str()).toUpper());
|
||||
} CATCH_DISPLAY ("Could not get detector status.", "qTabDebugging::GetDetectorStatus")
|
||||
}
|
||||
@ -88,7 +90,7 @@ void qTabDebugging::GetInfo() {
|
||||
//to make sure the size is constant
|
||||
lblDetectorFirmware->setFixedWidth(100);
|
||||
layout->addWidget(dispFrame, 0, 1);
|
||||
QString detName = QString(slsDetectorDefs::detectorTypeToString(det->getDetectorType().squash()).c_str());
|
||||
QString detName = QString(sls::ToString(det->getDetectorType().squash()).c_str());
|
||||
|
||||
switch (det->getDetectorType().squash()) {
|
||||
|
||||
|
@ -524,7 +524,7 @@ void qTabMeasurement::StopAcquisition() {
|
||||
FILE_LOG(logINFORED) << "Stopping Acquisition";
|
||||
try{
|
||||
isAcquisitionStopped = true;
|
||||
det->stopAcquisition();
|
||||
det->stopDetector();
|
||||
} CATCH_DISPLAY("Could not stop acquisition.", "qTabMeasurement::StopAcquisition")
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
#include "qTabSettings.h"
|
||||
#include "qDefs.h"
|
||||
|
||||
#include "ToString.h"
|
||||
|
||||
#include <QStandardItemModel>
|
||||
|
||||
#include <cmath>
|
||||
@ -129,8 +131,8 @@ void qTabSettings::GetSettings() {
|
||||
void qTabSettings::SetSettings(int index) {
|
||||
// settings
|
||||
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
|
||||
FILE_LOG(logINFO) << "Setting Settings to " << slsDetectorDefs::getDetectorSettings(val);
|
||||
try {
|
||||
FILE_LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
|
||||
det->setSettings(val);
|
||||
} CATCH_HANDLE ("Could not set settings.", "qTabSettings::SetSettings", this, &qTabSettings::GetSettings)
|
||||
// threshold
|
||||
|
Reference in New Issue
Block a user