mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
replaced old logger
This commit is contained in:
@ -35,7 +35,7 @@ qCloneWidget::~qCloneWidget() {
|
||||
void qCloneWidget::SetupWidgetWindow(QString title) {
|
||||
|
||||
std::string winTitle = std::string("Snapshot:") + std::to_string(id) +
|
||||
std::string(" - ") + NowTime();
|
||||
std::string(" - ") + sls::Logger::Timestamp();
|
||||
setWindowTitle(QString(winTitle.c_str()));
|
||||
|
||||
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||
@ -97,7 +97,7 @@ void qCloneWidget::SavePlot() {
|
||||
QString fName = filePath + QString('/') + fileName + QString("_clone") +
|
||||
QString("%1").arg(id) + QString("_acq") +
|
||||
QString("%1").arg(acqIndex) + QString(".png");
|
||||
FILE_LOG(logINFO) << "Saving Clone:" << fName.toAscii().constData();
|
||||
LOG(logINFO) << "Saving Clone:" << fName.toAscii().constData();
|
||||
// save
|
||||
QImage img(centralwidget->size().width(), centralwidget->size().height(),
|
||||
QImage::Format_RGB32);
|
||||
@ -113,13 +113,13 @@ void qCloneWidget::SavePlot() {
|
||||
qDefs::Message(qDefs::INFORMATION,
|
||||
"The SnapShot has been successfully saved",
|
||||
"qCloneWidget::SavePlot");
|
||||
FILE_LOG(logINFO) << "The SnapShot has been successfully saved";
|
||||
LOG(logINFO) << "The SnapShot has been successfully saved";
|
||||
} else {
|
||||
qDefs::Message(
|
||||
qDefs::WARNING,
|
||||
"Attempt to save snapshot failed.\n Formats: .png, .jpg, .xpm.",
|
||||
"qCloneWidget::SavePlot");
|
||||
FILE_LOG(logWARNING) << "Attempt to save snapshot failed";
|
||||
LOG(logWARNING) << "Attempt to save snapshot failed";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ void qDacWidget::SetDetectorIndex(int id) {
|
||||
}
|
||||
|
||||
void qDacWidget::GetDac() {
|
||||
FILE_LOG(logDEBUG) << "Getting Dac " << index;
|
||||
LOG(logDEBUG) << "Getting Dac " << index;
|
||||
|
||||
disconnect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
|
||||
try {
|
||||
@ -56,7 +56,7 @@ void qDacWidget::GetDac() {
|
||||
|
||||
void qDacWidget::SetDac() {
|
||||
int val = (int)spinDac->value();
|
||||
FILE_LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data()
|
||||
LOG(logINFO) << "Setting dac:" << lblDac->text().toAscii().data()
|
||||
<< " : " << val;
|
||||
|
||||
try {
|
||||
@ -70,7 +70,7 @@ void qDacWidget::SetDac() {
|
||||
}
|
||||
|
||||
void qDacWidget::GetAdc() {
|
||||
FILE_LOG(logDEBUG) << "Getting ADC " << index;
|
||||
LOG(logDEBUG) << "Getting ADC " << index;
|
||||
|
||||
try {
|
||||
auto retval = det->getTemperature(index, {detectorIndex}).squash(-1);
|
||||
|
@ -57,7 +57,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
case 'f':
|
||||
fname = optarg;
|
||||
FILE_LOG(logDEBUG)
|
||||
LOG(logDEBUG)
|
||||
<< long_options[option_index].name << " " << optarg;
|
||||
break;
|
||||
|
||||
@ -71,7 +71,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
case 'v':
|
||||
tempval = APIGUI;
|
||||
FILE_LOG(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
|
||||
LOG(logINFO) << "SLS Detector GUI " << GITBRANCH << " (0x"
|
||||
<< std::hex << tempval << ")";
|
||||
return 0;
|
||||
|
||||
@ -87,7 +87,7 @@ int main(int argc, char **argv) {
|
||||
"i. Default: 0. Required \n" +
|
||||
"\t only when more than one multi "
|
||||
"detector object is needed.\n\n";
|
||||
FILE_LOG(logERROR) << help_message;
|
||||
LOG(logERROR) << help_message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
|
||||
// plot setup
|
||||
plot = new qDrawPlot(dockWidgetPlot, det.get());
|
||||
FILE_LOG(logDEBUG) << "DockPlot ready";
|
||||
LOG(logDEBUG) << "DockPlot ready";
|
||||
dockWidgetPlot->setWidget(plot);
|
||||
|
||||
// tabs setup
|
||||
@ -185,7 +185,7 @@ void qDetectorMain::SetUpWidgetWindow() {
|
||||
|
||||
// mode setup - to set up the tabs initially as disabled, not in form so
|
||||
// done here
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Dockable Mode: 0, Debug Mode: 0, Expert Mode: 0, Developer Mode: "
|
||||
<< isDeveloper;
|
||||
tabs->setTabEnabled(DEBUGGING, false);
|
||||
@ -246,7 +246,7 @@ void qDetectorMain::SetUpDetector(const std::string& config_file, int multiID) {
|
||||
<< sls::ToString(det->getDetectorType().squash()) << " - "
|
||||
<< det->getHostname();
|
||||
std::string title = os.str();
|
||||
FILE_LOG(logINFO) << title;
|
||||
LOG(logINFO) << title;
|
||||
setWindowTitle(QString(title.c_str()));
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ void qDetectorMain::Initialization() {
|
||||
|
||||
void qDetectorMain::LoadConfigFile(const std::string& config_file) {
|
||||
|
||||
FILE_LOG(logINFO) << "Loading config file at start up:" << config_file;
|
||||
LOG(logINFO) << "Loading config file at start up:" << config_file;
|
||||
|
||||
struct stat st_buf;
|
||||
QString file = QString(config_file.c_str());
|
||||
@ -299,7 +299,7 @@ void qDetectorMain::LoadConfigFile(const std::string& config_file) {
|
||||
"following file does not exist:</nobr><br><nobr>") +
|
||||
config_file,
|
||||
"qDetectorMain::LoadConfigFile");
|
||||
FILE_LOG(logWARNING) << "Config file does not exist";
|
||||
LOG(logWARNING) << "Config file does not exist";
|
||||
}
|
||||
// not a file
|
||||
else if (!S_ISREG(st_buf.st_mode)) {
|
||||
@ -310,7 +310,7 @@ void qDetectorMain::LoadConfigFile(const std::string& config_file) {
|
||||
"file is not a recognized file format:</nobr><br><nobr>") +
|
||||
config_file,
|
||||
"qDetectorMain::LoadConfigFile");
|
||||
FILE_LOG(logWARNING) << "File not recognized";
|
||||
LOG(logWARNING) << "File not recognized";
|
||||
} else {
|
||||
try {
|
||||
det->loadConfig(config_file);
|
||||
@ -327,7 +327,7 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
if (action == actionDebug) {
|
||||
enable = actionDebug->isChecked();
|
||||
tabs->setTabEnabled(DEBUGGING, enable);
|
||||
FILE_LOG(logINFO) << "Debug Mode: " << qDefs::stringEnable(enable);
|
||||
LOG(logINFO) << "Debug Mode: " << qDefs::stringEnable(enable);
|
||||
|
||||
}
|
||||
|
||||
@ -338,7 +338,7 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
tabs->setTabEnabled(ADVANCED, enable);
|
||||
actionLoadTrimbits->setVisible(enable &&
|
||||
detType == slsDetectorDefs::EIGER);
|
||||
FILE_LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||
LOG(logINFO) << "Expert Mode: " << qDefs::stringEnable(enable);
|
||||
}
|
||||
|
||||
// Set DockableMode
|
||||
@ -350,7 +350,7 @@ void qDetectorMain::EnableModes(QAction *action) {
|
||||
dockWidgetPlot->setFloating(false);
|
||||
dockWidgetPlot->setFeatures(QDockWidget::NoDockWidgetFeatures);
|
||||
}
|
||||
FILE_LOG(logINFO) << "Dockable Mode: " << qDefs::stringEnable(enable);
|
||||
LOG(logINFO) << "Dockable Mode: " << qDefs::stringEnable(enable);
|
||||
}
|
||||
}
|
||||
|
||||
@ -359,7 +359,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
try {
|
||||
|
||||
if (action == actionLoadConfiguration) {
|
||||
FILE_LOG(logDEBUG) << "Loading Configuration";
|
||||
LOG(logDEBUG) << "Loading Configuration";
|
||||
QString fName = QString(det->getFilePath().squash("/tmp/").c_str());
|
||||
fName = QFileDialog::getOpenFileName(
|
||||
this, tr("Load Detector Configuration"), fName,
|
||||
@ -372,13 +372,13 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
"The Configuration Parameters have been "
|
||||
"configured successfully.",
|
||||
"qDetectorMain::ExecuteUtilities");
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Configuration Parameters loaded successfully";
|
||||
}
|
||||
}
|
||||
|
||||
else if (action == actionLoadParameters) {
|
||||
FILE_LOG(logDEBUG) << "Loading Parameters";
|
||||
LOG(logDEBUG) << "Loading Parameters";
|
||||
QString fName = QString(det->getFilePath().squash("/tmp/").c_str());
|
||||
fName = QFileDialog::getOpenFileName(
|
||||
this, tr("Load Measurement Setup"), fName,
|
||||
@ -391,14 +391,14 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
"The Detector Parameters have been "
|
||||
"configured successfully.",
|
||||
"qDetectorMain::ExecuteUtilities");
|
||||
FILE_LOG(logINFO) << "Parameters loaded successfully";
|
||||
LOG(logINFO) << "Parameters loaded successfully";
|
||||
}
|
||||
}
|
||||
|
||||
else if (action == actionLoadTrimbits) {
|
||||
QString fName =
|
||||
QString((det->getSettingsPath().squash("/tmp/")).c_str());
|
||||
FILE_LOG(logDEBUG) << "Loading Trimbits";
|
||||
LOG(logDEBUG) << "Loading Trimbits";
|
||||
// so that even nonexisting files can be selected
|
||||
QFileDialog *fileDialog = new QFileDialog(
|
||||
this, tr("Load Detector Trimbits"), fName,
|
||||
@ -413,7 +413,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
qDefs::Message(qDefs::INFORMATION,
|
||||
"The Trimbits have been loaded successfully.",
|
||||
"qDetectorMain::ExecuteUtilities");
|
||||
FILE_LOG(logINFO) << "Trimbits loaded successfully";
|
||||
LOG(logINFO) << "Trimbits loaded successfully";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -437,7 +437,7 @@ void qDetectorMain::ExecuteUtilities(QAction *action) {
|
||||
|
||||
void qDetectorMain::ExecuteHelp(QAction *action) {
|
||||
if (action == actionAbout) {
|
||||
FILE_LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
|
||||
LOG(logINFO) << "About Common GUI for Jungfrau, Eiger, Mythen3, "
|
||||
"Gotthard, Gotthard2 and Moench detectors";
|
||||
|
||||
std::string guiVersion = std::to_string(APIGUI);
|
||||
@ -472,7 +472,7 @@ void qDetectorMain::ExecuteHelp(QAction *action) {
|
||||
}
|
||||
|
||||
void qDetectorMain::Refresh(int index) {
|
||||
FILE_LOG(logDEBUG) << "Refresh Main Tab";
|
||||
LOG(logDEBUG) << "Refresh Main Tab";
|
||||
|
||||
if (!tabs->isTabEnabled(index))
|
||||
tabs->setCurrentIndex((index++) < (tabs->count() - 1) ? index
|
||||
@ -511,14 +511,14 @@ void qDetectorMain::Refresh(int index) {
|
||||
}
|
||||
|
||||
void qDetectorMain::ResizeMainWindow(bool b) {
|
||||
FILE_LOG(logDEBUG1) << "Resizing Main Window: height:" << height();
|
||||
LOG(logDEBUG1) << "Resizing Main Window: height:" << height();
|
||||
|
||||
// undocked from the main window
|
||||
if (b) {
|
||||
// sets the main window height to a smaller maximum to get rid of space
|
||||
setMaximumHeight(height() - heightPlotWindow - 9);
|
||||
dockWidgetPlot->setMinimumHeight(0);
|
||||
FILE_LOG(logINFO) << "Undocking from main window";
|
||||
LOG(logINFO) << "Undocking from main window";
|
||||
} else {
|
||||
setMaximumHeight(QWIDGETSIZE_MAX);
|
||||
// the minimum for plot will be set when the widget gets resized
|
||||
@ -546,7 +546,7 @@ void qDetectorMain::resizeEvent(QResizeEvent *event) {
|
||||
}
|
||||
|
||||
void qDetectorMain::EnableTabs(bool enable) {
|
||||
FILE_LOG(logDEBUG) << "qDetectorMain::EnableTabs";
|
||||
LOG(logDEBUG) << "qDetectorMain::EnableTabs";
|
||||
|
||||
// normal tabs
|
||||
tabs->setTabEnabled(DATAOUTPUT, enable);
|
||||
|
@ -16,7 +16,7 @@ qDrawPlot::qDrawPlot(QWidget *parent, sls::Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logINFO) << "Plots ready";
|
||||
LOG(logINFO) << "Plots ready";
|
||||
}
|
||||
|
||||
qDrawPlot::~qDrawPlot() {
|
||||
@ -50,7 +50,7 @@ void qDrawPlot::SetupWidgetWindow() {
|
||||
pixelMask = ((1 << 14) - 1);
|
||||
gainMask = (3 << 14);
|
||||
gainOffset = 14;
|
||||
FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask
|
||||
LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask
|
||||
<< ", Gain Mask:" << gainMask
|
||||
<< ", Gain Offset:" << std::dec << gainOffset;
|
||||
break;
|
||||
@ -58,7 +58,7 @@ void qDrawPlot::SetupWidgetWindow() {
|
||||
pixelMask = ((1 << 12) - 1);
|
||||
gainMask = (3 << 12);
|
||||
gainOffset = 12;
|
||||
FILE_LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask
|
||||
LOG(logINFO) << "Pixel Mask: " << std::hex << pixelMask
|
||||
<< ", Gain Mask:" << gainMask
|
||||
<< ", Gain Offset:" << std::dec << gainOffset;
|
||||
break;
|
||||
@ -113,8 +113,8 @@ void qDrawPlot::SetupPlots() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
FILE_LOG(logINFO) << "nPixelsX:" << nPixelsX;
|
||||
FILE_LOG(logINFO) << "nPixelsY:" << nPixelsY;
|
||||
LOG(logINFO) << "nPixelsX:" << nPixelsX;
|
||||
LOG(logINFO) << "nPixelsY:" << nPixelsY;
|
||||
|
||||
boxPlot->setFont(QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||
widgetStatistics->hide();
|
||||
@ -287,12 +287,12 @@ void qDrawPlot::Select1dPlot(bool enable) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetPlotTitlePrefix(QString title) {
|
||||
FILE_LOG(logINFO) << "Setting Title to " << title.toAscii().constData();
|
||||
LOG(logINFO) << "Setting Title to " << title.toAscii().constData();
|
||||
plotTitlePrefix = title;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetXAxisTitle(QString title) {
|
||||
FILE_LOG(logINFO) << "Setting X Axis Title to "
|
||||
LOG(logINFO) << "Setting X Axis Title to "
|
||||
<< title.toAscii().constData();
|
||||
if (is1d) {
|
||||
xTitle1d = title;
|
||||
@ -302,7 +302,7 @@ void qDrawPlot::SetXAxisTitle(QString title) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetYAxisTitle(QString title) {
|
||||
FILE_LOG(logINFO) << "Setting Y Axis Title to "
|
||||
LOG(logINFO) << "Setting Y Axis Title to "
|
||||
<< title.toAscii().constData();
|
||||
if (is1d) {
|
||||
yTitle1d = title;
|
||||
@ -312,19 +312,19 @@ void qDrawPlot::SetYAxisTitle(QString title) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetZAxisTitle(QString title) {
|
||||
FILE_LOG(logINFO) << "Setting Z Axis Title to "
|
||||
LOG(logINFO) << "Setting Z Axis Title to "
|
||||
<< title.toAscii().constData();
|
||||
zTitle2d = title;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetXYRangeChanged(bool disable, double *xy, bool *isXY) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "XY Range has changed";
|
||||
LOG(logINFO) << "XY Range has changed";
|
||||
xyRangeChanged = true;
|
||||
std::copy(xy, xy + 4, xyRange);
|
||||
std::copy(isXY, isXY + 4, isXYRange);
|
||||
|
||||
FILE_LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha
|
||||
LOG(logDEBUG) << "Setting Disable zoom to " << std::boolalpha
|
||||
<< disable << std::noboolalpha;
|
||||
disableZoom = disable;
|
||||
}
|
||||
@ -363,7 +363,7 @@ double qDrawPlot::GetYMaximum() {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetDataCallBack(bool enable) {
|
||||
FILE_LOG(logINFO) << "Setting data call back to " << std::boolalpha
|
||||
LOG(logINFO) << "Setting data call back to " << std::boolalpha
|
||||
<< enable << std::noboolalpha;
|
||||
if (enable) {
|
||||
isPlot = true;
|
||||
@ -377,7 +377,7 @@ void qDrawPlot::SetDataCallBack(bool enable) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetBinary(bool enable, int from, int to) {
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
||||
<< " Binary output from " << from << " to " << to;
|
||||
binaryFrom = from;
|
||||
binaryTo = to;
|
||||
@ -385,13 +385,13 @@ void qDrawPlot::SetBinary(bool enable, int from, int to) {
|
||||
}
|
||||
|
||||
void qDrawPlot::SetPersistency(int val) {
|
||||
FILE_LOG(logINFO) << "Setting Persistency to " << val;
|
||||
LOG(logINFO) << "Setting Persistency to " << val;
|
||||
persistency = val;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetLines(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Lines to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Lines to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
isLines = enable;
|
||||
for (int i = 0; i < nHists; ++i) {
|
||||
@ -402,7 +402,7 @@ void qDrawPlot::SetLines(bool enable) {
|
||||
|
||||
void qDrawPlot::SetMarkers(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Markers to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Markers to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
isMarkers = enable;
|
||||
for (int i = 0; i < nHists; ++i) {
|
||||
@ -413,76 +413,76 @@ void qDrawPlot::SetMarkers(bool enable) {
|
||||
|
||||
void qDrawPlot::Set1dLogY(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Log Y to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Log Y to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
plot1d->SetLogY(enable);
|
||||
}
|
||||
|
||||
void qDrawPlot::SetInterpolate(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Interpolate to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Interpolate to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
plot2d->SetInterpolate(enable);
|
||||
}
|
||||
|
||||
void qDrawPlot::SetContour(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Countour to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Countour to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
plot2d->SetContour(enable);
|
||||
}
|
||||
|
||||
void qDrawPlot::SetLogz(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << "Setting Log Z to " << std::boolalpha << enable
|
||||
LOG(logINFO) << "Setting Log Z to " << std::boolalpha << enable
|
||||
<< std::noboolalpha;
|
||||
plot2d->SetLogz(enable, isZRange[0], isZRange[1], zRange[0], zRange[1]);
|
||||
}
|
||||
|
||||
void qDrawPlot::SetPedestal(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Pedestal";
|
||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Pedestal";
|
||||
isPedestal = enable;
|
||||
resetPedestal = true;
|
||||
}
|
||||
|
||||
void qDrawPlot::RecalculatePedestal() {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logDEBUG) << "Recalculating Pedestal";
|
||||
LOG(logDEBUG) << "Recalculating Pedestal";
|
||||
resetPedestal = true;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetAccumulate(bool enable) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Accumulation";
|
||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Accumulation";
|
||||
isAccumulate = enable;
|
||||
resetAccumulate = true;
|
||||
}
|
||||
|
||||
void qDrawPlot::ResetAccumulate() {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logDEBUG) << "Resetting Accumulation";
|
||||
LOG(logDEBUG) << "Resetting Accumulation";
|
||||
resetAccumulate = true;
|
||||
}
|
||||
|
||||
void qDrawPlot::DisplayStatistics(bool enable) {
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling")
|
||||
<< " Statistics Display";
|
||||
displayStatistics = enable;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetNumDiscardBits(int value) {
|
||||
FILE_LOG(logINFO) << "Setting number of bits to discard: " << value;
|
||||
LOG(logINFO) << "Setting number of bits to discard: " << value;
|
||||
numDiscardBits = value;
|
||||
}
|
||||
|
||||
void qDrawPlot::EnableGainPlot(bool enable) {
|
||||
FILE_LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Gain Plot";
|
||||
LOG(logINFO) << (enable ? "Enabling" : "Disabling") << " Gain Plot";
|
||||
hasGainData = enable;
|
||||
}
|
||||
|
||||
void qDrawPlot::SetSaveFileName(QString val) {
|
||||
FILE_LOG(logDEBUG) << "Setting Clone/Save File Name to "
|
||||
LOG(logDEBUG) << "Setting Clone/Save File Name to "
|
||||
<< val.toAscii().constData();
|
||||
fileSaveName = val;
|
||||
}
|
||||
@ -496,7 +496,7 @@ void qDrawPlot::ClonePlot() {
|
||||
SlsQt2DPlot *clonegainplot2D = nullptr;
|
||||
|
||||
if (is1d) {
|
||||
FILE_LOG(logDEBUG) << "Cloning 1D Image";
|
||||
LOG(logDEBUG) << "Cloning 1D Image";
|
||||
cloneplot1D = new SlsQt1DPlot();
|
||||
cloneplot1D->setFont(
|
||||
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||
@ -538,7 +538,7 @@ void qDrawPlot::ClonePlot() {
|
||||
h->Attach(clonegainplot1D);
|
||||
}
|
||||
} else {
|
||||
FILE_LOG(logDEBUG) << "Cloning 2D Image";
|
||||
LOG(logDEBUG) << "Cloning 2D Image";
|
||||
cloneplot2D = new SlsQt2DPlot();
|
||||
cloneplot2D->setFont(
|
||||
QFont("Sans Serif", qDefs::Q_FONT_SIZE, QFont::Normal));
|
||||
@ -618,7 +618,7 @@ void qDrawPlot::SavePlot() {
|
||||
}
|
||||
|
||||
void qDrawPlot::GetStatistics(double &min, double &max, double &sum) {
|
||||
FILE_LOG(logDEBUG) << "Calculating Statistics";
|
||||
LOG(logDEBUG) << "Calculating Statistics";
|
||||
double *array = data2d;
|
||||
int size = nPixelsX * nPixelsY;
|
||||
if (is1d) {
|
||||
@ -645,7 +645,7 @@ void qDrawPlot::DetachHists() {
|
||||
}
|
||||
|
||||
void qDrawPlot::StartAcquisition() {
|
||||
FILE_LOG(logDEBUG) << "Starting Acquisition in qDrawPlot";
|
||||
LOG(logDEBUG) << "Starting Acquisition in qDrawPlot";
|
||||
progress = 0;
|
||||
currentFrame = 0;
|
||||
boxPlot->setTitle("Old Plot");
|
||||
@ -669,22 +669,22 @@ void qDrawPlot::StartAcquisition() {
|
||||
}
|
||||
|
||||
emit StartAcquireSignal();
|
||||
FILE_LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
|
||||
LOG(logDEBUG) << "End of Starting Acquisition in qDrawPlot";
|
||||
}
|
||||
|
||||
void qDrawPlot::AcquireThread() {
|
||||
FILE_LOG(logDEBUG) << "Acquire Thread";
|
||||
LOG(logDEBUG) << "Acquire Thread";
|
||||
std::string mess;
|
||||
try {
|
||||
det->acquire();
|
||||
} catch (const std::exception &e) {
|
||||
mess = std::string(e.what());
|
||||
}
|
||||
FILE_LOG(logINFO) << "Acquisition Finished";
|
||||
LOG(logINFO) << "Acquisition Finished";
|
||||
// exception in acquire will not call acquisition finished call back, so
|
||||
// handle it
|
||||
if (!mess.empty()) {
|
||||
FILE_LOG(logERROR) << "Acquisition Finished with an exception: "
|
||||
LOG(logERROR) << "Acquisition Finished with an exception: "
|
||||
<< mess;
|
||||
qDefs::ExceptionMessage("Acquire unsuccessful.", mess,
|
||||
"qDrawPlot::AcquireFinished");
|
||||
@ -699,7 +699,7 @@ void qDrawPlot::AcquireThread() {
|
||||
CATCH_DISPLAY("Could not stop receiver.", "qDrawPlot::AcquireFinished");
|
||||
emit AbortSignal();
|
||||
}
|
||||
FILE_LOG(logDEBUG) << "End of Acquisition Finished";
|
||||
LOG(logDEBUG) << "End of Acquisition Finished";
|
||||
}
|
||||
|
||||
void qDrawPlot::GetAcquisitionFinishedCallBack(double currentProgress,
|
||||
@ -707,13 +707,13 @@ void qDrawPlot::GetAcquisitionFinishedCallBack(double currentProgress,
|
||||
void *this_pointer) {
|
||||
((qDrawPlot *)this_pointer)
|
||||
->AcquisitionFinished(currentProgress, detectorStatus);
|
||||
FILE_LOG(logDEBUG) << "Acquisition Finished Call back successful";
|
||||
LOG(logDEBUG) << "Acquisition Finished Call back successful";
|
||||
}
|
||||
|
||||
void qDrawPlot::GetDataCallBack(detectorData *data, uint64_t frameIndex,
|
||||
uint32_t subFrameIndex, void *this_pointer) {
|
||||
((qDrawPlot *)this_pointer)->GetData(data, frameIndex, subFrameIndex);
|
||||
FILE_LOG(logDEBUG) << "Get Data Call back successful";
|
||||
LOG(logDEBUG) << "Get Data Call back successful";
|
||||
}
|
||||
|
||||
void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
@ -728,9 +728,9 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
"Current Detector Status: ") +
|
||||
status + std::string(".</nobr>"),
|
||||
"qDrawPlot::AcquisitionFinished");
|
||||
FILE_LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||
LOG(logERROR) << "Acquisition finished [Status: ERROR]";
|
||||
} else {
|
||||
FILE_LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||
LOG(logINFO) << "Acquisition finished [ Status:" << status
|
||||
<< ", Progress: " << currentProgress << " ]";
|
||||
}
|
||||
emit AcquireFinishedSignal();
|
||||
@ -739,7 +739,7 @@ void qDrawPlot::AcquisitionFinished(double currentProgress,
|
||||
void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
uint32_t subFrameIndex) {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logDEBUG) << "* GetData Callback *" << std::endl
|
||||
LOG(logDEBUG) << "* GetData Callback *" << std::endl
|
||||
<< " frame index: " << frameIndex << std::endl
|
||||
<< " sub frame index: "
|
||||
<< (((int)subFrameIndex == -1) ? (int)-1 : subFrameIndex)
|
||||
@ -758,7 +758,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
progress = (int)data->progressIndex;
|
||||
currentAcqIndex = data->fileIndex;
|
||||
currentFrame = frameIndex;
|
||||
FILE_LOG(logDEBUG) << "[ Progress:" << progress
|
||||
LOG(logDEBUG) << "[ Progress:" << progress
|
||||
<< ", Frame:" << currentFrame << " ]";
|
||||
|
||||
// 2d (only image, not gain data, not pedestalvals),
|
||||
@ -767,7 +767,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
static_cast<int>(nPixelsY) != data->ny)) {
|
||||
nPixelsX = data->nx;
|
||||
nPixelsY = data->ny;
|
||||
FILE_LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:"
|
||||
LOG(logINFO) << "Change in Detector Shape:\n\tnPixelsX:"
|
||||
<< nPixelsX << " nPixelsY:" << nPixelsY;
|
||||
|
||||
delete[] data2d;
|
||||
@ -819,7 +819,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
}
|
||||
// calculate the pedestal value
|
||||
if (pedestalCount == NUM_PEDESTAL_FRAMES) {
|
||||
FILE_LOG(logINFO) << "Pedestal Calculated after "
|
||||
LOG(logINFO) << "Pedestal Calculated after "
|
||||
<< NUM_PEDESTAL_FRAMES << " frames";
|
||||
for (unsigned int px = 0; px < nPixels; ++px)
|
||||
tempPedestalVals[px] =
|
||||
@ -836,7 +836,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex,
|
||||
}
|
||||
delete[] rawData;
|
||||
|
||||
FILE_LOG(logDEBUG) << "End of Get Data";
|
||||
LOG(logDEBUG) << "End of Get Data";
|
||||
emit UpdateSignal();
|
||||
}
|
||||
|
||||
@ -1112,7 +1112,7 @@ void qDrawPlot::toDoublePixelData(double *dest, char *source, int size,
|
||||
|
||||
void qDrawPlot::UpdatePlot() {
|
||||
std::lock_guard<std::mutex> lock(mPlots);
|
||||
FILE_LOG(logDEBUG) << "Update Plot";
|
||||
LOG(logDEBUG) << "Update Plot";
|
||||
|
||||
boxPlot->setTitle(plotTitle);
|
||||
if (is1d) {
|
||||
@ -1132,5 +1132,5 @@ void qDrawPlot::UpdatePlot() {
|
||||
widgetStatistics->hide();
|
||||
}
|
||||
|
||||
FILE_LOG(logDEBUG) << "End of Update Plot";
|
||||
LOG(logDEBUG) << "End of Update Plot";
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ qTabAdvanced::qTabAdvanced(QWidget *parent, sls::Detector *detector,
|
||||
: QWidget(parent), det(detector), plot(p) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Advanced ready";
|
||||
LOG(logDEBUG) << "Advanced ready";
|
||||
}
|
||||
|
||||
qTabAdvanced::~qTabAdvanced() {}
|
||||
@ -119,7 +119,7 @@ void qTabAdvanced::Initialization() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::PopulateDetectors() {
|
||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||
LOG(logDEBUG) << "Populating detectors";
|
||||
disconnect(comboDetector, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetDetector()));
|
||||
disconnect(comboReadout, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -142,7 +142,7 @@ void qTabAdvanced::PopulateDetectors() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetControlPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting control port ";
|
||||
LOG(logDEBUG) << "Getting control port ";
|
||||
disconnect(spinControlPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetControlPort(int)));
|
||||
|
||||
@ -158,7 +158,7 @@ void qTabAdvanced::GetControlPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetStopPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting stop port";
|
||||
LOG(logDEBUG) << "Getting stop port";
|
||||
disconnect(spinStopPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStopPort(int)));
|
||||
|
||||
@ -174,7 +174,7 @@ void qTabAdvanced::GetStopPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetDetectorUDPIP() {
|
||||
FILE_LOG(logDEBUG) << "Getting Detector UDP IP";
|
||||
LOG(logDEBUG) << "Getting Detector UDP IP";
|
||||
disconnect(dispDetectorUDPIP, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPIP()));
|
||||
|
||||
@ -191,7 +191,7 @@ void qTabAdvanced::GetDetectorUDPIP() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetDetectorUDPMAC() {
|
||||
FILE_LOG(logDEBUG) << "Getting Detector UDP MAC";
|
||||
LOG(logDEBUG) << "Getting Detector UDP MAC";
|
||||
disconnect(dispDetectorUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetDetectorUDPMAC()));
|
||||
|
||||
@ -208,7 +208,7 @@ void qTabAdvanced::GetDetectorUDPMAC() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetCltZMQPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting Client ZMQ port";
|
||||
LOG(logDEBUG) << "Getting Client ZMQ port";
|
||||
disconnect(spinZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetCltZMQPort(int)));
|
||||
|
||||
@ -224,7 +224,7 @@ void qTabAdvanced::GetCltZMQPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetCltZMQIP() {
|
||||
FILE_LOG(logDEBUG) << "Getting Client ZMQ IP";
|
||||
LOG(logDEBUG) << "Getting Client ZMQ IP";
|
||||
disconnect(dispZMQIP, SIGNAL(editingFinished()), this, SLOT(SetCltZMQIP()));
|
||||
|
||||
try {
|
||||
@ -238,7 +238,7 @@ void qTabAdvanced::GetCltZMQIP() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrHostname() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver Hostname";
|
||||
LOG(logDEBUG) << "Getting Receiver Hostname";
|
||||
disconnect(dispRxrHostname, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrHostname()));
|
||||
|
||||
@ -254,7 +254,7 @@ void qTabAdvanced::GetRxrHostname() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrTCPPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver TCP port";
|
||||
LOG(logDEBUG) << "Getting Receiver TCP port";
|
||||
disconnect(spinRxrTCPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrTCPPort(int)));
|
||||
|
||||
@ -270,7 +270,7 @@ void qTabAdvanced::GetRxrTCPPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrUDPPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver UDP port";
|
||||
LOG(logDEBUG) << "Getting Receiver UDP port";
|
||||
disconnect(spinRxrUDPPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrUDPPort(int)));
|
||||
|
||||
@ -287,7 +287,7 @@ void qTabAdvanced::GetRxrUDPPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrUDPIP() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver UDP IP";
|
||||
LOG(logDEBUG) << "Getting Receiver UDP IP";
|
||||
disconnect(dispRxrUDPIP, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrUDPIP()));
|
||||
|
||||
@ -302,7 +302,7 @@ void qTabAdvanced::GetRxrUDPIP() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrUDPMAC() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver UDP MAC";
|
||||
LOG(logDEBUG) << "Getting Receiver UDP MAC";
|
||||
disconnect(dispRxrUDPMAC, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrUDPMAC()));
|
||||
|
||||
@ -319,7 +319,7 @@ void qTabAdvanced::GetRxrUDPMAC() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrZMQPort() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver ZMQ port";
|
||||
LOG(logDEBUG) << "Getting Receiver ZMQ port";
|
||||
disconnect(spinRxrZMQPort, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRxrZMQPort(int)));
|
||||
|
||||
@ -335,7 +335,7 @@ void qTabAdvanced::GetRxrZMQPort() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetRxrZMQIP() {
|
||||
FILE_LOG(logDEBUG) << "Getting Receiver ZMQ IP";
|
||||
LOG(logDEBUG) << "Getting Receiver ZMQ IP";
|
||||
disconnect(dispRxrZMQIP, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetRxrZMQIP()));
|
||||
|
||||
@ -349,7 +349,7 @@ void qTabAdvanced::GetRxrZMQIP() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetDetector() {
|
||||
FILE_LOG(logDEBUG) << "Set Detector: "
|
||||
LOG(logDEBUG) << "Set Detector: "
|
||||
<< comboDetector->currentText().toAscii().data();
|
||||
|
||||
GetControlPort();
|
||||
@ -366,11 +366,11 @@ void qTabAdvanced::SetDetector() {
|
||||
GetRxrZMQPort();
|
||||
GetRxrZMQIP();
|
||||
|
||||
FILE_LOG(logDEBUG) << det->printRxConfiguration();
|
||||
LOG(logDEBUG) << det->printRxConfiguration();
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetControlPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Control Port:" << port;
|
||||
LOG(logINFO) << "Setting Control Port:" << port;
|
||||
try {
|
||||
det->setControlPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -379,7 +379,7 @@ void qTabAdvanced::SetControlPort(int port) {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetStopPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Stop Port:" << port;
|
||||
LOG(logINFO) << "Setting Stop Port:" << port;
|
||||
try {
|
||||
det->setStopPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -389,7 +389,7 @@ void qTabAdvanced::SetStopPort(int port) {
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPIP() {
|
||||
std::string s = dispDetectorUDPIP->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
LOG(logINFO) << "Setting Detector UDP IP:" << s;
|
||||
try {
|
||||
det->setSourceUDPIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -400,7 +400,7 @@ void qTabAdvanced::SetDetectorUDPIP() {
|
||||
|
||||
void qTabAdvanced::SetDetectorUDPMAC() {
|
||||
std::string s = dispDetectorUDPMAC->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
LOG(logINFO) << "Setting Detector UDP MAC:" << s;
|
||||
try {
|
||||
det->setSourceUDPMAC(sls::MacAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -410,7 +410,7 @@ void qTabAdvanced::SetDetectorUDPMAC() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
||||
LOG(logINFO) << "Setting Client ZMQ Port:" << port;
|
||||
try {
|
||||
det->setClientZmqPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -421,7 +421,7 @@ void qTabAdvanced::SetCltZMQPort(int port) {
|
||||
|
||||
void qTabAdvanced::SetCltZMQIP() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
LOG(logINFO) << "Setting Client ZMQ IP:" << s;
|
||||
try {
|
||||
det->setClientZmqIp(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -431,7 +431,7 @@ void qTabAdvanced::SetCltZMQIP() {
|
||||
|
||||
void qTabAdvanced::SetRxrHostname() {
|
||||
std::string s = dispZMQIP->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||
LOG(logINFO) << "Setting Receiver Hostname:" << s;
|
||||
try {
|
||||
det->setRxHostname(s, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -443,7 +443,7 @@ void qTabAdvanced::SetRxrHostname() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrTCPPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
||||
LOG(logINFO) << "Setting Receiver TCP Port:" << port;
|
||||
try {
|
||||
det->setRxPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -453,7 +453,7 @@ void qTabAdvanced::SetRxrTCPPort(int port) {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrUDPPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Receiver UDP Port:" << port;
|
||||
LOG(logINFO) << "Setting Receiver UDP Port:" << port;
|
||||
try {
|
||||
det->setRxPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -464,7 +464,7 @@ void qTabAdvanced::SetRxrUDPPort(int port) {
|
||||
|
||||
void qTabAdvanced::SetRxrUDPIP() {
|
||||
std::string s = dispRxrUDPIP->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
LOG(logINFO) << "Setting Receiver UDP IP:" << s;
|
||||
try {
|
||||
det->setDestinationUDPIP(sls::IpAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
@ -475,7 +475,7 @@ void qTabAdvanced::SetRxrUDPIP() {
|
||||
|
||||
void qTabAdvanced::SetRxrUDPMAC() {
|
||||
std::string s = dispRxrUDPMAC->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
LOG(logINFO) << "Setting Receiver UDP MAC:" << s;
|
||||
try {
|
||||
det->setDestinationUDPMAC(sls::MacAddr{s},
|
||||
{comboDetector->currentIndex()});
|
||||
@ -486,7 +486,7 @@ void qTabAdvanced::SetRxrUDPMAC() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
FILE_LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
||||
LOG(logINFO) << "Setting Receiver ZMQ Port:" << port;
|
||||
try {
|
||||
det->setRxZmqPort(port, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -497,7 +497,7 @@ void qTabAdvanced::SetRxrZMQPort(int port) {
|
||||
|
||||
void qTabAdvanced::SetRxrZMQIP() {
|
||||
std::string s = dispRxrZMQIP->text().toAscii().constData();
|
||||
FILE_LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
LOG(logINFO) << "Setting Receiver ZMQ IP:" << s;
|
||||
try {
|
||||
det->setRxZmqIP(sls::IpAddr{s}, {comboDetector->currentIndex()});
|
||||
}
|
||||
@ -506,7 +506,7 @@ void qTabAdvanced::SetRxrZMQIP() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetROI() {
|
||||
FILE_LOG(logDEBUG) << "Getting ROI";
|
||||
LOG(logDEBUG) << "Getting ROI";
|
||||
try {
|
||||
slsDetectorDefs::ROI roi =
|
||||
det->getROI({comboReadout->currentIndex()})[0];
|
||||
@ -517,11 +517,11 @@ void qTabAdvanced::GetROI() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::ClearROI() {
|
||||
FILE_LOG(logINFO) << "Clearing ROI";
|
||||
LOG(logINFO) << "Clearing ROI";
|
||||
spinXmin->setValue(-1);
|
||||
spinXmax->setValue(-1);
|
||||
SetROI();
|
||||
FILE_LOG(logDEBUG) << "ROIs cleared";
|
||||
LOG(logDEBUG) << "ROIs cleared";
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetROI() {
|
||||
@ -531,7 +531,7 @@ void qTabAdvanced::SetROI() {
|
||||
roi.xmax = spinXmax->value();
|
||||
|
||||
// set roi
|
||||
FILE_LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax
|
||||
LOG(logINFO) << "Setting ROI: [" << roi.xmin << ", " << roi.xmax
|
||||
<< "]";
|
||||
try {
|
||||
det->setROI(roi, {comboReadout->currentIndex()});
|
||||
@ -543,7 +543,7 @@ void qTabAdvanced::SetROI() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetAllTrimbits() {
|
||||
FILE_LOG(logDEBUG) << "Getting all trimbits value";
|
||||
LOG(logDEBUG) << "Getting all trimbits value";
|
||||
disconnect(spinSetAllTrimbits, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetAllTrimbits()));
|
||||
|
||||
@ -559,7 +559,7 @@ void qTabAdvanced::GetAllTrimbits() {
|
||||
|
||||
void qTabAdvanced::SetAllTrimbits() {
|
||||
int value = spinSetAllTrimbits->value();
|
||||
FILE_LOG(logINFO) << "Setting all trimbits:" << value;
|
||||
LOG(logINFO) << "Setting all trimbits:" << value;
|
||||
|
||||
try {
|
||||
det->setAllTrimbits(value);
|
||||
@ -569,7 +569,7 @@ void qTabAdvanced::SetAllTrimbits() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetNumStoragecells() {
|
||||
FILE_LOG(logDEBUG) << "Getting number of additional storage cells";
|
||||
LOG(logDEBUG) << "Getting number of additional storage cells";
|
||||
disconnect(spinNumStoragecells, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumStoragecells(int)));
|
||||
|
||||
@ -586,7 +586,7 @@ void qTabAdvanced::GetNumStoragecells() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::SetNumStoragecells(int value) {
|
||||
FILE_LOG(logINFO) << "Setting number of additional stoarge cells: "
|
||||
LOG(logINFO) << "Setting number of additional stoarge cells: "
|
||||
<< value;
|
||||
try {
|
||||
det->setNumberOfAdditionalStorageCells(value);
|
||||
@ -597,7 +597,7 @@ void qTabAdvanced::SetNumStoragecells(int value) {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetSubExposureTime() {
|
||||
FILE_LOG(logDEBUG) << "Getting sub exposure time";
|
||||
LOG(logDEBUG) << "Getting sub exposure time";
|
||||
disconnect(spinSubExpTime, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetSubExposureTime()));
|
||||
disconnect(comboSubExpTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -621,7 +621,7 @@ void qTabAdvanced::SetSubExposureTime() {
|
||||
auto timeNS = qDefs::getNSTime(std::make_pair(
|
||||
spinSubExpTime->value(),
|
||||
static_cast<qDefs::timeUnit>(comboSubExpTimeUnit->currentIndex())));
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Setting sub frame acquisition time to " << timeNS.count() << " ns"
|
||||
<< "/" << spinSubExpTime->value()
|
||||
<< qDefs::getUnitString(
|
||||
@ -636,7 +636,7 @@ void qTabAdvanced::SetSubExposureTime() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::GetSubDeadTime() {
|
||||
FILE_LOG(logDEBUG) << "Getting sub dead time";
|
||||
LOG(logDEBUG) << "Getting sub dead time";
|
||||
disconnect(spinSubDeadTime, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetSubDeadTime()));
|
||||
disconnect(comboSubDeadTimeUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -661,7 +661,7 @@ void qTabAdvanced::SetSubDeadTime() {
|
||||
spinSubDeadTime->value(),
|
||||
static_cast<qDefs::timeUnit>(comboSubDeadTimeUnit->currentIndex())));
|
||||
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Setting sub frame dead time to " << timeNS.count() << " ns"
|
||||
<< "/" << spinSubDeadTime->value()
|
||||
<< qDefs::getUnitString(
|
||||
@ -675,7 +675,7 @@ void qTabAdvanced::SetSubDeadTime() {
|
||||
}
|
||||
|
||||
void qTabAdvanced::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Advanced Tab";
|
||||
LOG(logDEBUG) << "**Updating Advanced Tab";
|
||||
|
||||
// trimming
|
||||
if (tab_trimming->isEnabled()) {
|
||||
@ -701,5 +701,5 @@ void qTabAdvanced::Refresh() {
|
||||
GetSubDeadTime();
|
||||
}
|
||||
|
||||
FILE_LOG(logDEBUG) << "**Updated Advanced Tab";
|
||||
LOG(logDEBUG) << "**Updated Advanced Tab";
|
||||
}
|
||||
|
@ -7,11 +7,13 @@
|
||||
#include <QString>
|
||||
#include <string>
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
qTabDataOutput::qTabDataOutput(QWidget *parent, sls::Detector *detector)
|
||||
: QWidget(parent), det(detector), btnGroupRate(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "DataOutput ready";
|
||||
LOG(logDEBUG) << "DataOutput ready";
|
||||
}
|
||||
|
||||
qTabDataOutput::~qTabDataOutput() { delete btnGroupRate; }
|
||||
@ -80,7 +82,7 @@ void qTabDataOutput::Initialization() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::PopulateDetectors() {
|
||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||
LOG(logDEBUG) << "Populating detectors";
|
||||
|
||||
comboDetector->clear();
|
||||
comboDetector->addItem("All");
|
||||
@ -93,7 +95,7 @@ void qTabDataOutput::PopulateDetectors() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::EnableBrowse() {
|
||||
FILE_LOG(logDEBUG) << "Getting browse enable";
|
||||
LOG(logDEBUG) << "Getting browse enable";
|
||||
try {
|
||||
btnOutputBrowse->setEnabled(false); // exception default
|
||||
std::string rxHostname =
|
||||
@ -123,7 +125,7 @@ void qTabDataOutput::EnableBrowse() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFileWrite() {
|
||||
FILE_LOG(logDEBUG) << "Getting file write enable";
|
||||
LOG(logDEBUG) << "Getting file write enable";
|
||||
try {
|
||||
boxFileWriteEnabled->setEnabled(true); // exception default
|
||||
auto retval = det->getFileWrite().tsquash(
|
||||
@ -134,7 +136,7 @@ void qTabDataOutput::GetFileWrite() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFileName() {
|
||||
FILE_LOG(logDEBUG) << "Getting file name";
|
||||
LOG(logDEBUG) << "Getting file name";
|
||||
try {
|
||||
auto retval = det->getFileNamePrefix().tsquash(
|
||||
"File name is inconsistent for all detectors.");
|
||||
@ -145,7 +147,7 @@ void qTabDataOutput::GetFileName() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetOutputDir() {
|
||||
FILE_LOG(logDEBUG) << "Getting file path";
|
||||
LOG(logDEBUG) << "Getting file path";
|
||||
disconnect(dispOutputDir, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetOutputDir()));
|
||||
try {
|
||||
@ -160,7 +162,7 @@ void qTabDataOutput::GetOutputDir() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::BrowseOutputDir() {
|
||||
FILE_LOG(logDEBUG) << "Browsing output directory";
|
||||
LOG(logDEBUG) << "Browsing output directory";
|
||||
QString directory = QFileDialog::getExistingDirectory(
|
||||
this, tr("Choose Output Directory "), dispOutputDir->text());
|
||||
if (!directory.isEmpty())
|
||||
@ -169,7 +171,7 @@ void qTabDataOutput::BrowseOutputDir() {
|
||||
|
||||
void qTabDataOutput::SetOutputDir() {
|
||||
QString path = dispOutputDir->text();
|
||||
FILE_LOG(logDEBUG) << "Setting output directory to "
|
||||
LOG(logDEBUG) << "Setting output directory to "
|
||||
<< path.toAscii().constData();
|
||||
|
||||
// empty
|
||||
@ -177,7 +179,7 @@ void qTabDataOutput::SetOutputDir() {
|
||||
qDefs::Message(qDefs::WARNING,
|
||||
"Invalid Output Path. Must not be empty.",
|
||||
"qTabDataOutput::SetOutputDir");
|
||||
FILE_LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
LOG(logWARNING) << "Invalid Output Path. Must not be empty.";
|
||||
GetOutputDir();
|
||||
} else {
|
||||
// chop off trailing '/'
|
||||
@ -197,7 +199,7 @@ void qTabDataOutput::SetOutputDir() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFileFormat() {
|
||||
FILE_LOG(logDEBUG) << "Getting File Format";
|
||||
LOG(logDEBUG) << "Getting File Format";
|
||||
disconnect(comboFileFormat, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFileFormat(int)));
|
||||
try {
|
||||
@ -219,7 +221,7 @@ void qTabDataOutput::GetFileFormat() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetFileFormat(int format) {
|
||||
FILE_LOG(logINFO) << "Setting File Format to "
|
||||
LOG(logINFO) << "Setting File Format to "
|
||||
<< comboFileFormat->currentText().toAscii().data();
|
||||
try {
|
||||
det->setFileFormat(static_cast<slsDetectorDefs::fileFormat>(
|
||||
@ -230,7 +232,7 @@ void qTabDataOutput::SetFileFormat(int format) {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFileOverwrite() {
|
||||
FILE_LOG(logDEBUG) << "Getting File Over Write Enable";
|
||||
LOG(logDEBUG) << "Getting File Over Write Enable";
|
||||
disconnect(chkOverwriteEnable, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetOverwriteEnable(bool)));
|
||||
try {
|
||||
@ -246,7 +248,7 @@ void qTabDataOutput::GetFileOverwrite() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetOverwriteEnable(bool enable) {
|
||||
FILE_LOG(logINFO) << "Setting File Over Write Enable to " << enable;
|
||||
LOG(logINFO) << "Setting File Over Write Enable to " << enable;
|
||||
try {
|
||||
det->setFileOverWrite(enable);
|
||||
}
|
||||
@ -256,7 +258,7 @@ void qTabDataOutput::SetOverwriteEnable(bool enable) {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetTenGigaEnable() {
|
||||
FILE_LOG(logDEBUG) << "Getting 10GbE enable";
|
||||
LOG(logDEBUG) << "Getting 10GbE enable";
|
||||
disconnect(chkTenGiga, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetTenGigaEnable(bool)));
|
||||
try {
|
||||
@ -271,7 +273,7 @@ void qTabDataOutput::GetTenGigaEnable() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetTenGigaEnable(bool enable) {
|
||||
FILE_LOG(logINFO) << "Setting 10GbE to " << enable;
|
||||
LOG(logINFO) << "Setting 10GbE to " << enable;
|
||||
try {
|
||||
det->setTenGiga(enable);
|
||||
}
|
||||
@ -281,7 +283,7 @@ void qTabDataOutput::SetTenGigaEnable(bool enable) {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetRateCorrection() {
|
||||
FILE_LOG(logDEBUG) << "Getting Rate Correction";
|
||||
LOG(logDEBUG) << "Getting Rate Correction";
|
||||
disconnect(chkRate, SIGNAL(toggled(bool)), this,
|
||||
SLOT(EnableRateCorrection()));
|
||||
disconnect(btnGroupRate, SIGNAL(buttonClicked(int)), this,
|
||||
@ -313,7 +315,7 @@ void qTabDataOutput::EnableRateCorrection() {
|
||||
SetRateCorrection();
|
||||
return;
|
||||
}
|
||||
FILE_LOG(logINFO) << "Disabling Rate correction";
|
||||
LOG(logINFO) << "Disabling Rate correction";
|
||||
// disable
|
||||
try {
|
||||
det->setRateCorrection(sls::ns(0));
|
||||
@ -332,14 +334,14 @@ void qTabDataOutput::SetRateCorrection() {
|
||||
// custom dead time
|
||||
if (radioCustomDeadtime->isChecked()) {
|
||||
int64_t deadtime = spinCustomDeadTime->value();
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Setting Rate Correction with custom dead time: "
|
||||
<< deadtime;
|
||||
det->setRateCorrection(sls::ns(deadtime));
|
||||
}
|
||||
// default dead time
|
||||
else {
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Setting Rate Correction with default dead time";
|
||||
det->setDefaultRateCorrection();
|
||||
}
|
||||
@ -350,7 +352,7 @@ void qTabDataOutput::SetRateCorrection() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetSpeed() {
|
||||
FILE_LOG(logDEBUG) << "Getting Speed";
|
||||
LOG(logDEBUG) << "Getting Speed";
|
||||
disconnect(comboEigerClkDivider, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSpeed(int)));
|
||||
try {
|
||||
@ -364,7 +366,7 @@ void qTabDataOutput::GetSpeed() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::SetSpeed(int speed) {
|
||||
FILE_LOG(logINFO) << "Setting Speed to "
|
||||
LOG(logINFO) << "Setting Speed to "
|
||||
<< comboEigerClkDivider->currentText().toAscii().data();
|
||||
;
|
||||
try {
|
||||
@ -375,7 +377,7 @@ void qTabDataOutput::SetSpeed(int speed) {
|
||||
}
|
||||
|
||||
void qTabDataOutput::GetFlags() {
|
||||
FILE_LOG(logDEBUG) << "Getting readout flags";
|
||||
LOG(logDEBUG) << "Getting readout flags";
|
||||
disconnect(comboEigerParallelFlag, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetFlags()));
|
||||
try {
|
||||
@ -396,7 +398,7 @@ void qTabDataOutput::SetFlags() {
|
||||
auto mode =
|
||||
comboEigerParallelFlag->currentIndex() == PARALLEL ? true : false;
|
||||
try {
|
||||
FILE_LOG(logINFO)
|
||||
LOG(logINFO)
|
||||
<< "Setting Readout Flags to "
|
||||
<< comboEigerParallelFlag->currentText().toAscii().data();
|
||||
det->setParallelMode(mode);
|
||||
@ -406,7 +408,7 @@ void qTabDataOutput::SetFlags() {
|
||||
}
|
||||
|
||||
void qTabDataOutput::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating DataOutput Tab";
|
||||
LOG(logDEBUG) << "**Updating DataOutput Tab";
|
||||
|
||||
EnableBrowse();
|
||||
GetFileWrite();
|
||||
@ -425,5 +427,5 @@ void qTabDataOutput::Refresh() {
|
||||
GetFlags();
|
||||
}
|
||||
|
||||
FILE_LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||
LOG(logDEBUG) << "**Updated DataOutput Tab";
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ qTabDebugging::qTabDebugging(QWidget *parent, sls::Detector *detector)
|
||||
lblDetectorSoftware(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Debugging ready";
|
||||
LOG(logDEBUG) << "Debugging ready";
|
||||
}
|
||||
|
||||
qTabDebugging::~qTabDebugging() {
|
||||
@ -47,7 +47,7 @@ void qTabDebugging::Initialization() {
|
||||
}
|
||||
|
||||
void qTabDebugging::PopulateDetectors() {
|
||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||
LOG(logDEBUG) << "Populating detectors";
|
||||
|
||||
comboDetector->clear();
|
||||
auto res = det->getHostname();
|
||||
@ -57,7 +57,7 @@ void qTabDebugging::PopulateDetectors() {
|
||||
}
|
||||
|
||||
void qTabDebugging::GetDetectorStatus() {
|
||||
FILE_LOG(logDEBUG) << "Getting Status";
|
||||
LOG(logDEBUG) << "Getting Status";
|
||||
|
||||
try {
|
||||
std::string status = sls::ToString(
|
||||
@ -69,7 +69,7 @@ void qTabDebugging::GetDetectorStatus() {
|
||||
}
|
||||
|
||||
void qTabDebugging::GetInfo() {
|
||||
FILE_LOG(logDEBUG) << "Getting Readout Info";
|
||||
LOG(logDEBUG) << "Getting Readout Info";
|
||||
|
||||
// open info in a new popup
|
||||
QFrame *popup1 = new QFrame(this, Qt::Popup | Qt::SubWindow);
|
||||
@ -190,7 +190,7 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item) {
|
||||
}
|
||||
|
||||
void qTabDebugging::TestDetector() {
|
||||
FILE_LOG(logINFO) << "Testing Readout";
|
||||
LOG(logINFO) << "Testing Readout";
|
||||
|
||||
try {
|
||||
QString moduleName = "Module";
|
||||
@ -208,7 +208,7 @@ void qTabDebugging::TestDetector() {
|
||||
det->executeFirmwareTest({comboDetector->currentIndex()});
|
||||
message.append(QString("<nobr>%1 Firmware: PASS</nobr><br>")
|
||||
.arg(moduleName));
|
||||
FILE_LOG(logINFO) << "Detector Firmware Test: Pass";
|
||||
LOG(logINFO) << "Detector Firmware Test: Pass";
|
||||
}
|
||||
CATCH_DISPLAY("Firmware test failed.",
|
||||
"qTabDebugging::TestDetector")
|
||||
@ -220,7 +220,7 @@ void qTabDebugging::TestDetector() {
|
||||
det->executeBusTest({comboDetector->currentIndex()});
|
||||
message.append(
|
||||
QString("<nobr>%1 Bus: PASS</nobr><br>").arg(moduleName));
|
||||
FILE_LOG(logINFO) << "Detector Bus Test: Pass";
|
||||
LOG(logINFO) << "Detector Bus Test: Pass";
|
||||
}
|
||||
CATCH_DISPLAY("Bus test failed.", "qTabDebugging::TestDetector")
|
||||
}
|
||||
@ -234,7 +234,7 @@ void qTabDebugging::TestDetector() {
|
||||
}
|
||||
|
||||
void qTabDebugging::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Debugging Tab";
|
||||
LOG(logDEBUG) << "**Updating Debugging Tab";
|
||||
GetDetectorStatus();
|
||||
FILE_LOG(logDEBUG) << "**Updated Debugging Tab";
|
||||
LOG(logDEBUG) << "**Updated Debugging Tab";
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ qTabDeveloper::qTabDeveloper(QWidget *parent, sls::Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Developer ready";
|
||||
LOG(logDEBUG) << "Developer ready";
|
||||
}
|
||||
|
||||
qTabDeveloper::~qTabDeveloper() {}
|
||||
@ -295,7 +295,7 @@ void qTabDeveloper::Initialization() {
|
||||
}
|
||||
|
||||
void qTabDeveloper::PopulateDetectors() {
|
||||
FILE_LOG(logDEBUG) << "Populating detectors";
|
||||
LOG(logDEBUG) << "Populating detectors";
|
||||
|
||||
comboDetector->clear();
|
||||
comboDetector->addItem("All");
|
||||
@ -312,7 +312,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
// not enabled for eiger
|
||||
if (!comboHV->isVisible() && !spinHV->isVisible())
|
||||
return;
|
||||
FILE_LOG(logDEBUG) << "Getting High Voltage";
|
||||
LOG(logDEBUG) << "Getting High Voltage";
|
||||
disconnect(spinHV, SIGNAL(editingFinished()), this, SLOT(SetHighVoltage()));
|
||||
disconnect(comboHV, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetHighVoltage()));
|
||||
@ -368,7 +368,7 @@ void qTabDeveloper::GetHighVoltage() {
|
||||
void qTabDeveloper::SetHighVoltage() {
|
||||
int val = (comboHV->isVisible() ? comboHV->currentText().toInt()
|
||||
: spinHV->value());
|
||||
FILE_LOG(logINFO) << "Setting high voltage:" << val;
|
||||
LOG(logINFO) << "Setting high voltage:" << val;
|
||||
|
||||
try {
|
||||
det->setHighVoltage({comboDetector->currentIndex() - 1});
|
||||
@ -594,7 +594,7 @@ qTabDeveloper::getSLSIndex(slsDetectorDefs::detectorType detType, int index) {
|
||||
}
|
||||
|
||||
void qTabDeveloper::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Developer Tab\n";
|
||||
LOG(logDEBUG) << "**Updating Developer Tab\n";
|
||||
for (const auto &it : dacWidgets) {
|
||||
it->SetDetectorIndex(comboDetector->currentIndex() - 1);
|
||||
}
|
||||
@ -602,5 +602,5 @@ void qTabDeveloper::Refresh() {
|
||||
it->SetDetectorIndex(comboDetector->currentIndex() - 1);
|
||||
}
|
||||
GetHighVoltage();
|
||||
FILE_LOG(logDEBUG) << "**Updated Developer Tab";
|
||||
LOG(logDEBUG) << "**Updated Developer Tab";
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ qTabMeasurement::qTabMeasurement(QWidget *parent, sls::Detector *detector,
|
||||
: QWidget(parent), det(detector), plot(p), progressTimer(nullptr) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Measurement ready";
|
||||
LOG(logDEBUG) << "Measurement ready";
|
||||
}
|
||||
|
||||
qTabMeasurement::~qTabMeasurement() { delete progressTimer; }
|
||||
@ -133,7 +133,7 @@ void qTabMeasurement::ShowTriggerDelay() {
|
||||
bool showTrigger = true;
|
||||
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
|
||||
try {
|
||||
FILE_LOG(logDEBUG) << "Getting burst mode";
|
||||
LOG(logDEBUG) << "Getting burst mode";
|
||||
auto retval = det->getBurstMode().tsquash(
|
||||
"Inconsistent burst mode for all detectors.");
|
||||
// burst mode and auto timing mode
|
||||
@ -181,7 +181,7 @@ void qTabMeasurement::SetupTimingMode() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
FILE_LOG(logDEBUG) << "Enabling Widgets for Timing Mode";
|
||||
LOG(logDEBUG) << "Enabling Widgets for Timing Mode";
|
||||
|
||||
// default
|
||||
lblNumFrames->setEnabled(false);
|
||||
@ -266,7 +266,7 @@ void qTabMeasurement::EnableWidgetsforTimingMode() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetTimingMode() {
|
||||
FILE_LOG(logDEBUG) << "Getting timing mode";
|
||||
LOG(logDEBUG) << "Getting timing mode";
|
||||
disconnect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetTimingMode(int)));
|
||||
try {
|
||||
@ -296,7 +296,7 @@ void qTabMeasurement::GetTimingMode() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetTimingMode(int val) {
|
||||
FILE_LOG(logINFO) << "Setting timing mode:"
|
||||
LOG(logINFO) << "Setting timing mode:"
|
||||
<< comboTimingMode->currentText().toAscii().data();
|
||||
try {
|
||||
det->setTimingMode(static_cast<slsDetectorDefs::timingMode>(val));
|
||||
@ -307,12 +307,12 @@ void qTabMeasurement::SetTimingMode(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumMeasurements(int val) {
|
||||
FILE_LOG(logINFO) << "Setting Number of Measurements to " << val;
|
||||
LOG(logINFO) << "Setting Number of Measurements to " << val;
|
||||
numMeasurements = val;
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetNumFrames() {
|
||||
FILE_LOG(logDEBUG) << "Getting number of frames";
|
||||
LOG(logDEBUG) << "Getting number of frames";
|
||||
disconnect(spinNumFrames, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumFrames(int)));
|
||||
try {
|
||||
@ -327,7 +327,7 @@ void qTabMeasurement::GetNumFrames() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumFrames(int val) {
|
||||
FILE_LOG(logINFO) << "Setting number of frames to " << val;
|
||||
LOG(logINFO) << "Setting number of frames to " << val;
|
||||
try {
|
||||
det->setNumberOfFrames(val);
|
||||
}
|
||||
@ -337,7 +337,7 @@ void qTabMeasurement::SetNumFrames(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetNumTriggers() {
|
||||
FILE_LOG(logDEBUG) << "Getting number of triggers";
|
||||
LOG(logDEBUG) << "Getting number of triggers";
|
||||
disconnect(spinNumTriggers, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumTriggers(int)));
|
||||
try {
|
||||
@ -352,7 +352,7 @@ void qTabMeasurement::GetNumTriggers() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumTriggers(int val) {
|
||||
FILE_LOG(logINFO) << "Setting number of triggers to " << val;
|
||||
LOG(logINFO) << "Setting number of triggers to " << val;
|
||||
try {
|
||||
det->setNumberOfTriggers(val);
|
||||
}
|
||||
@ -362,7 +362,7 @@ void qTabMeasurement::SetNumTriggers(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetNumBursts() {
|
||||
FILE_LOG(logDEBUG) << "Getting number of bursts";
|
||||
LOG(logDEBUG) << "Getting number of bursts";
|
||||
disconnect(spinNumBursts, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumBursts(int)));
|
||||
try {
|
||||
@ -377,7 +377,7 @@ void qTabMeasurement::GetNumBursts() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumBursts(int val) {
|
||||
FILE_LOG(logINFO) << "Setting number of bursts to " << val;
|
||||
LOG(logINFO) << "Setting number of bursts to " << val;
|
||||
try {
|
||||
det->setNumberOfBursts(val);
|
||||
}
|
||||
@ -387,7 +387,7 @@ void qTabMeasurement::SetNumBursts(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetNumSamples() {
|
||||
FILE_LOG(logDEBUG) << "Getting number of samples";
|
||||
LOG(logDEBUG) << "Getting number of samples";
|
||||
disconnect(spinNumSamples, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetNumSamples(int)));
|
||||
try {
|
||||
@ -402,7 +402,7 @@ void qTabMeasurement::GetNumSamples() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetNumSamples(int val) {
|
||||
FILE_LOG(logINFO) << "Setting number of samples to " << val;
|
||||
LOG(logINFO) << "Setting number of samples to " << val;
|
||||
try {
|
||||
det->setNumberOfAnalogSamples(val);
|
||||
}
|
||||
@ -412,7 +412,7 @@ void qTabMeasurement::SetNumSamples(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetExposureTime() {
|
||||
FILE_LOG(logDEBUG) << "Getting exposure time";
|
||||
LOG(logDEBUG) << "Getting exposure time";
|
||||
disconnect(spinExpTime, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetExposureTime()));
|
||||
disconnect(comboExpUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -437,7 +437,7 @@ void qTabMeasurement::GetExposureTime() {
|
||||
void qTabMeasurement::SetExposureTime() {
|
||||
auto val = spinExpTime->value();
|
||||
auto unit = static_cast<qDefs::timeUnit>(comboExpUnit->currentIndex());
|
||||
FILE_LOG(logINFO) << "Setting exposure time to " << val << " "
|
||||
LOG(logINFO) << "Setting exposure time to " << val << " "
|
||||
<< qDefs::getUnitString(unit);
|
||||
try {
|
||||
auto timeNS = qDefs::getNSTime(std::make_pair(val, unit));
|
||||
@ -450,7 +450,7 @@ void qTabMeasurement::SetExposureTime() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetAcquisitionPeriod() {
|
||||
FILE_LOG(logDEBUG) << "Getting acquisition period";
|
||||
LOG(logDEBUG) << "Getting acquisition period";
|
||||
disconnect(spinPeriod, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetAcquisitionPeriod()));
|
||||
disconnect(comboPeriodUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -475,7 +475,7 @@ void qTabMeasurement::GetAcquisitionPeriod() {
|
||||
void qTabMeasurement::SetAcquisitionPeriod() {
|
||||
auto val = spinPeriod->value();
|
||||
auto unit = static_cast<qDefs::timeUnit>(comboPeriodUnit->currentIndex());
|
||||
FILE_LOG(logINFO) << "Setting acquisition period to " << val << " "
|
||||
LOG(logINFO) << "Setting acquisition period to " << val << " "
|
||||
<< qDefs::getUnitString(unit);
|
||||
try {
|
||||
auto timeNS = qDefs::getNSTime(std::make_pair(val, unit));
|
||||
@ -488,7 +488,7 @@ void qTabMeasurement::SetAcquisitionPeriod() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::CheckAcqPeriodGreaterThanExp() {
|
||||
FILE_LOG(logDEBUG) << "Checking period >= exptime";
|
||||
LOG(logDEBUG) << "Checking period >= exptime";
|
||||
bool error = false;
|
||||
if (lblPeriod->isEnabled()) {
|
||||
auto exptimeNS = qDefs::getNSTime(std::make_pair(
|
||||
@ -515,7 +515,7 @@ void qTabMeasurement::CheckAcqPeriodGreaterThanExp() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetDelay() {
|
||||
FILE_LOG(logDEBUG) << "Getting delay";
|
||||
LOG(logDEBUG) << "Getting delay";
|
||||
disconnect(spinDelay, SIGNAL(valueChanged(double)), this, SLOT(SetDelay()));
|
||||
disconnect(comboDelayUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetDelay()));
|
||||
@ -536,7 +536,7 @@ void qTabMeasurement::GetDelay() {
|
||||
void qTabMeasurement::SetDelay() {
|
||||
auto val = spinDelay->value();
|
||||
auto unit = static_cast<qDefs::timeUnit>(comboDelayUnit->currentIndex());
|
||||
FILE_LOG(logINFO) << "Setting delay to " << val << " "
|
||||
LOG(logINFO) << "Setting delay to " << val << " "
|
||||
<< qDefs::getUnitString(unit);
|
||||
try {
|
||||
auto timeNS = qDefs::getNSTime(std::make_pair(val, unit));
|
||||
@ -547,7 +547,7 @@ void qTabMeasurement::SetDelay() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetBurstPeriod() {
|
||||
FILE_LOG(logDEBUG) << "Getting Burst Period";
|
||||
LOG(logDEBUG) << "Getting Burst Period";
|
||||
disconnect(spinBurstPeriod, SIGNAL(valueChanged(double)), this,
|
||||
SLOT(SetBurstPeriod()));
|
||||
disconnect(comboBurstPeriodUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -572,7 +572,7 @@ void qTabMeasurement::SetBurstPeriod() {
|
||||
auto val = spinBurstPeriod->value();
|
||||
auto unit =
|
||||
static_cast<qDefs::timeUnit>(comboBurstPeriodUnit->currentIndex());
|
||||
FILE_LOG(logINFO) << "Setting burst period to " << val << " "
|
||||
LOG(logINFO) << "Setting burst period to " << val << " "
|
||||
<< qDefs::getUnitString(unit);
|
||||
try {
|
||||
auto timeNS = qDefs::getNSTime(std::make_pair(val, unit));
|
||||
@ -584,7 +584,7 @@ void qTabMeasurement::SetBurstPeriod() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetFileWrite() {
|
||||
FILE_LOG(logDEBUG) << "Getting File Write Enable";
|
||||
LOG(logDEBUG) << "Getting File Write Enable";
|
||||
disconnect(chkFile, SIGNAL(toggled(bool)), this, SLOT(SetFileWrite(bool)));
|
||||
try {
|
||||
dispFileName->setEnabled(true); // default, even when exception
|
||||
@ -603,7 +603,7 @@ void qTabMeasurement::GetFileWrite() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetFileWrite(bool val) {
|
||||
FILE_LOG(logINFO) << "Set File Write to " << val;
|
||||
LOG(logINFO) << "Set File Write to " << val;
|
||||
try {
|
||||
det->setFileWrite(val);
|
||||
dispFileName->setEnabled(val);
|
||||
@ -616,7 +616,7 @@ void qTabMeasurement::SetFileWrite(bool val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetFileName() {
|
||||
FILE_LOG(logDEBUG) << "Getting file name prefix";
|
||||
LOG(logDEBUG) << "Getting file name prefix";
|
||||
disconnect(dispFileName, SIGNAL(editingFinished()), this,
|
||||
SLOT(SetFileName()));
|
||||
try {
|
||||
@ -631,7 +631,7 @@ void qTabMeasurement::GetFileName() {
|
||||
|
||||
void qTabMeasurement::SetFileName() {
|
||||
std::string val = std::string(dispFileName->text().toAscii().constData());
|
||||
FILE_LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||
LOG(logINFO) << "Setting File Name Prefix:" << val;
|
||||
try {
|
||||
det->setFileNamePrefix(val);
|
||||
}
|
||||
@ -643,7 +643,7 @@ void qTabMeasurement::SetFileName() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetRunIndex() {
|
||||
FILE_LOG(logDEBUG) << "Getting Acquisition File index";
|
||||
LOG(logDEBUG) << "Getting Acquisition File index";
|
||||
disconnect(spinIndex, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetRunIndex(int)));
|
||||
try {
|
||||
@ -657,7 +657,7 @@ void qTabMeasurement::GetRunIndex() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetRunIndex(int val) {
|
||||
FILE_LOG(logINFO) << "Setting Acquisition File Index to " << val;
|
||||
LOG(logINFO) << "Setting Acquisition File Index to " << val;
|
||||
try {
|
||||
det->setAcquisitionIndex(val);
|
||||
}
|
||||
@ -667,7 +667,7 @@ void qTabMeasurement::SetRunIndex(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::GetStartingFrameNumber() {
|
||||
FILE_LOG(logDEBUG) << "Getting Starting Frame Number";
|
||||
LOG(logDEBUG) << "Getting Starting Frame Number";
|
||||
disconnect(spinStartingFrameNumber, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetStartingFrameNumber(int)));
|
||||
try {
|
||||
@ -682,7 +682,7 @@ void qTabMeasurement::GetStartingFrameNumber() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::SetStartingFrameNumber(int val) {
|
||||
FILE_LOG(logINFO) << "Setting Starting frame number to " << val;
|
||||
LOG(logINFO) << "Setting Starting frame number to " << val;
|
||||
try {
|
||||
det->setStartingFrameNumber(val);
|
||||
}
|
||||
@ -692,14 +692,14 @@ void qTabMeasurement::SetStartingFrameNumber(int val) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::ResetProgress() {
|
||||
FILE_LOG(logDEBUG) << "Resetting progress";
|
||||
LOG(logDEBUG) << "Resetting progress";
|
||||
lblCurrentFrame->setText("0");
|
||||
lblCurrentMeasurement->setText("0");
|
||||
progressBar->setValue(0);
|
||||
}
|
||||
|
||||
void qTabMeasurement::UpdateProgress() {
|
||||
FILE_LOG(logDEBUG) << "Updating progress";
|
||||
LOG(logDEBUG) << "Updating progress";
|
||||
progressBar->setValue(plot->GetProgress());
|
||||
lblCurrentFrame->setText(QString::number(plot->GetCurrentFrameIndex()));
|
||||
lblCurrentMeasurement->setText(QString::number(currentMeasurement));
|
||||
@ -741,7 +741,7 @@ void qTabMeasurement::StartAcquisition() {
|
||||
}
|
||||
}
|
||||
|
||||
FILE_LOG(logINFOBLUE) << "Starting Acquisition";
|
||||
LOG(logINFOBLUE) << "Starting Acquisition";
|
||||
plot->SetRunning(true);
|
||||
isAcquisitionStopped = false;
|
||||
currentMeasurement = 0;
|
||||
@ -753,7 +753,7 @@ void qTabMeasurement::StartAcquisition() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::StopAcquisition() {
|
||||
FILE_LOG(logINFORED) << "Stopping Acquisition";
|
||||
LOG(logINFORED) << "Stopping Acquisition";
|
||||
try {
|
||||
isAcquisitionStopped = true;
|
||||
det->stopDetector();
|
||||
@ -765,13 +765,13 @@ void qTabMeasurement::StopAcquisition() {
|
||||
void qTabMeasurement::AcquireFinished() {
|
||||
// to catch only once (if abort acquire also calls acq finished call back)
|
||||
if (!btnStart->isEnabled()) {
|
||||
FILE_LOG(logDEBUG) << "Acquire Finished";
|
||||
LOG(logDEBUG) << "Acquire Finished";
|
||||
UpdateProgress();
|
||||
GetRunIndex();
|
||||
if (startingFnumImplemented) {
|
||||
GetStartingFrameNumber();
|
||||
}
|
||||
FILE_LOG(logDEBUG) << "Measurement " << currentMeasurement
|
||||
LOG(logDEBUG) << "Measurement " << currentMeasurement
|
||||
<< " finished";
|
||||
// next measurement if acq is not stopped
|
||||
if (!isAcquisitionStopped &&
|
||||
@ -791,7 +791,7 @@ void qTabMeasurement::AcquireFinished() {
|
||||
}
|
||||
|
||||
void qTabMeasurement::AbortAcquire() {
|
||||
FILE_LOG(logINFORED) << "Abort Acquire";
|
||||
LOG(logINFORED) << "Abort Acquire";
|
||||
isAcquisitionStopped = true;
|
||||
AcquireFinished();
|
||||
}
|
||||
@ -806,7 +806,7 @@ void qTabMeasurement::Enable(bool enable) {
|
||||
}
|
||||
|
||||
void qTabMeasurement::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Measurement Tab";
|
||||
LOG(logDEBUG) << "**Updating Measurement Tab";
|
||||
|
||||
if (!plot->GetIsRunning()) {
|
||||
GetTimingMode();
|
||||
@ -835,5 +835,5 @@ void qTabMeasurement::Refresh() {
|
||||
ResetProgress();
|
||||
}
|
||||
|
||||
FILE_LOG(logDEBUG) << "**Updated Measurement Tab";
|
||||
LOG(logDEBUG) << "**Updated Measurement Tab";
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
qTabMessages::qTabMessages(QWidget *parent) : QWidget(parent) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Messages ready";
|
||||
LOG(logDEBUG) << "Messages ready";
|
||||
}
|
||||
|
||||
qTabMessages::~qTabMessages() {
|
||||
@ -74,7 +74,7 @@ void qTabMessages::ExecuteCommand() {
|
||||
|
||||
QString command = param.at(0);
|
||||
param.removeFirst();
|
||||
FILE_LOG(logINFO) << "Executing Command:[" << command.toAscii().constData()
|
||||
LOG(logINFO) << "Executing Command:[" << command.toAscii().constData()
|
||||
<< "] with Arguments:["
|
||||
<< param.join(" ").toAscii().constData() << "]";
|
||||
|
||||
@ -92,14 +92,14 @@ void qTabMessages::AppendOutput() {
|
||||
result.replace("\n", "<br>");
|
||||
dispLog->append(QString("<font color = \"DarkBlue\">") + result +
|
||||
QString("</font>"));
|
||||
FILE_LOG(logDEBUG) << "Command executed successfully";
|
||||
LOG(logDEBUG) << "Command executed successfully";
|
||||
PrintNextLine();
|
||||
}
|
||||
|
||||
void qTabMessages::AppendError() {
|
||||
dispLog->append(QString("<font color = \"Red\">") + process->errorString() +
|
||||
QString("</font>"));
|
||||
FILE_LOG(logERROR) << "Error executing command";
|
||||
LOG(logERROR) << "Error executing command";
|
||||
PrintNextLine();
|
||||
}
|
||||
|
||||
@ -118,9 +118,9 @@ void qTabMessages::SaveLog() {
|
||||
std::string("The Log has been successfully saved to ") +
|
||||
fName.toAscii().constData();
|
||||
qDefs::Message(qDefs::INFORMATION, mess, "TabMessages::SaveLog");
|
||||
FILE_LOG(logINFO) << mess;
|
||||
LOG(logINFO) << mess;
|
||||
} else {
|
||||
FILE_LOG(logWARNING) << "Attempt to save log file failed: "
|
||||
LOG(logWARNING) << "Attempt to save log file failed: "
|
||||
<< fName.toAscii().constData();
|
||||
qDefs::Message(qDefs::WARNING, "Attempt to save log file failed.",
|
||||
"qTabMessages::SaveLog");
|
||||
@ -131,7 +131,7 @@ void qTabMessages::SaveLog() {
|
||||
|
||||
void qTabMessages::ClearLog() {
|
||||
dispLog->clear();
|
||||
FILE_LOG(logINFO) << "Log Cleared";
|
||||
LOG(logINFO) << "Log Cleared";
|
||||
PrintNextLine();
|
||||
dispCommand->setFocus();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ qTabPlot::qTabPlot(QWidget *parent, sls::Detector *detector, qDrawPlot *p)
|
||||
: QWidget(parent), det(detector), plot(p), is1d(false) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Plot ready";
|
||||
LOG(logDEBUG) << "Plot ready";
|
||||
}
|
||||
|
||||
qTabPlot::~qTabPlot() { delete btnGroupPlotType; }
|
||||
@ -188,7 +188,7 @@ void qTabPlot::Initialization() {
|
||||
}
|
||||
|
||||
void qTabPlot::Select1DPlot(bool enable) {
|
||||
FILE_LOG(logDEBUG) << "Selecting " << (enable ? "1" : "2") << "D Plot";
|
||||
LOG(logDEBUG) << "Selecting " << (enable ? "1" : "2") << "D Plot";
|
||||
is1d = enable;
|
||||
box1D->setEnabled(enable);
|
||||
box2D->setEnabled(!enable);
|
||||
@ -209,9 +209,9 @@ void qTabPlot::Select1DPlot(bool enable) {
|
||||
void qTabPlot::SetPlot() {
|
||||
bool plotEnable = false;
|
||||
if (radioNoPlot->isChecked()) {
|
||||
FILE_LOG(logINFO) << "Setting Plot Type: No Plot";
|
||||
LOG(logINFO) << "Setting Plot Type: No Plot";
|
||||
} else if (radioDataGraph->isChecked()) {
|
||||
FILE_LOG(logINFO) << "Setting Plot Type: Datagraph";
|
||||
LOG(logINFO) << "Setting Plot Type: Datagraph";
|
||||
plotEnable = true;
|
||||
}
|
||||
boxFrequency->setEnabled(plotEnable);
|
||||
@ -232,7 +232,7 @@ void qTabPlot::SetPlot() {
|
||||
}
|
||||
|
||||
void qTabPlot::Set1DPlotOptionsRight() {
|
||||
FILE_LOG(logDEBUG) << "1D Options Right";
|
||||
LOG(logDEBUG) << "1D Options Right";
|
||||
int i = stackedWidget1D->currentIndex();
|
||||
if (i == (stackedWidget1D->count() - 1))
|
||||
stackedWidget1D->setCurrentIndex(0);
|
||||
@ -243,7 +243,7 @@ void qTabPlot::Set1DPlotOptionsRight() {
|
||||
}
|
||||
|
||||
void qTabPlot::Set1DPlotOptionsLeft() {
|
||||
FILE_LOG(logDEBUG) << "1D Options Left";
|
||||
LOG(logDEBUG) << "1D Options Left";
|
||||
int i = stackedWidget1D->currentIndex();
|
||||
if (i == 0)
|
||||
stackedWidget1D->setCurrentIndex(stackedWidget1D->count() - 1);
|
||||
@ -254,7 +254,7 @@ void qTabPlot::Set1DPlotOptionsLeft() {
|
||||
}
|
||||
|
||||
void qTabPlot::Set2DPlotOptionsRight() {
|
||||
FILE_LOG(logDEBUG) << "2D Options Right";
|
||||
LOG(logDEBUG) << "2D Options Right";
|
||||
int i = stackedWidget2D->currentIndex();
|
||||
if (i == (stackedWidget2D->count() - 1))
|
||||
stackedWidget2D->setCurrentIndex(0);
|
||||
@ -265,7 +265,7 @@ void qTabPlot::Set2DPlotOptionsRight() {
|
||||
}
|
||||
|
||||
void qTabPlot::Set2DPlotOptionsLeft() {
|
||||
FILE_LOG(logDEBUG) << "2D Options Left";
|
||||
LOG(logDEBUG) << "2D Options Left";
|
||||
int i = stackedWidget2D->currentIndex();
|
||||
if (i == 0)
|
||||
stackedWidget2D->setCurrentIndex(stackedWidget2D->count() - 1);
|
||||
@ -276,7 +276,7 @@ void qTabPlot::Set2DPlotOptionsLeft() {
|
||||
}
|
||||
|
||||
void qTabPlot::EnablePersistency(bool enable) {
|
||||
FILE_LOG(logINFO) << "Superimpose " << (enable ? "enabled" : "disabled");
|
||||
LOG(logINFO) << "Superimpose " << (enable ? "enabled" : "disabled");
|
||||
lblPersistency->setEnabled(enable);
|
||||
spinPersistency->setEnabled(enable);
|
||||
if (enable)
|
||||
@ -289,7 +289,7 @@ void qTabPlot::SetBinary() {
|
||||
bool binary1D = chkBinary->isChecked();
|
||||
bool binary2D = chkBinary_2->isChecked();
|
||||
if (is1d) {
|
||||
FILE_LOG(logINFO) << "Binary Plot "
|
||||
LOG(logINFO) << "Binary Plot "
|
||||
<< (binary1D ? "enabled" : "disabled");
|
||||
lblFrom->setEnabled(binary1D);
|
||||
lblTo->setEnabled(binary1D);
|
||||
@ -297,7 +297,7 @@ void qTabPlot::SetBinary() {
|
||||
spinTo->setEnabled(binary1D);
|
||||
plot->SetBinary(binary1D, spinFrom->value(), spinTo->value());
|
||||
} else {
|
||||
FILE_LOG(logINFO) << "Binary Plot "
|
||||
LOG(logINFO) << "Binary Plot "
|
||||
<< (binary2D ? "enabled" : "disabled");
|
||||
lblFrom_2->setEnabled(binary2D);
|
||||
lblTo_2->setEnabled(binary2D);
|
||||
@ -308,7 +308,7 @@ void qTabPlot::SetBinary() {
|
||||
}
|
||||
|
||||
void qTabPlot::GetGapPixels() {
|
||||
FILE_LOG(logDEBUG) << "Getting gap pixels";
|
||||
LOG(logDEBUG) << "Getting gap pixels";
|
||||
disconnect(chkGapPixels, SIGNAL(toggled(bool)), this,
|
||||
SLOT(SetGapPixels(bool)));
|
||||
try {
|
||||
@ -322,7 +322,7 @@ void qTabPlot::GetGapPixels() {
|
||||
}
|
||||
|
||||
void qTabPlot::SetGapPixels(bool enable) {
|
||||
FILE_LOG(logINFO) << "Setting Gap Pixels Enable to " << enable;
|
||||
LOG(logINFO) << "Setting Gap Pixels Enable to " << enable;
|
||||
try {
|
||||
det->setRxAddGapPixels(enable);
|
||||
}
|
||||
@ -331,7 +331,7 @@ void qTabPlot::SetGapPixels(bool enable) {
|
||||
}
|
||||
|
||||
void qTabPlot::SetTitles() {
|
||||
FILE_LOG(logDEBUG) << "Setting Plot Titles";
|
||||
LOG(logDEBUG) << "Setting Plot Titles";
|
||||
disconnect(chkTitle, SIGNAL(toggled(bool)), this, SLOT(SetTitles()));
|
||||
disconnect(chkXAxis, SIGNAL(toggled(bool)), this, SLOT(SetTitles()));
|
||||
disconnect(chkYAxis, SIGNAL(toggled(bool)), this, SLOT(SetTitles()));
|
||||
@ -393,7 +393,7 @@ void qTabPlot::SetTitles() {
|
||||
}
|
||||
|
||||
void qTabPlot::SetXRange() {
|
||||
FILE_LOG(logDEBUG) << "Enable X axis range";
|
||||
LOG(logDEBUG) << "Enable X axis range";
|
||||
|
||||
if (chkAspectRatio->isChecked()) {
|
||||
MaintainAspectRatio(static_cast<int>(slsDetectorDefs::Y));
|
||||
@ -403,7 +403,7 @@ void qTabPlot::SetXRange() {
|
||||
}
|
||||
|
||||
void qTabPlot::SetYRange() {
|
||||
FILE_LOG(logDEBUG) << "Enable Y axis range";
|
||||
LOG(logDEBUG) << "Enable Y axis range";
|
||||
|
||||
if (chkAspectRatio->isChecked()) {
|
||||
MaintainAspectRatio(static_cast<int>(slsDetectorDefs::X));
|
||||
@ -421,7 +421,7 @@ void qTabPlot::CheckAspectRatio() {
|
||||
}
|
||||
|
||||
void qTabPlot::SetXYRange() {
|
||||
FILE_LOG(logDEBUG) << "Set XY Range";
|
||||
LOG(logDEBUG) << "Set XY Range";
|
||||
bool disablezoom = false;
|
||||
bool isRange[4]{false, false, false, false};
|
||||
double xyRange[4]{0, 0, 0, 0};
|
||||
@ -434,7 +434,7 @@ void qTabPlot::SetXYRange() {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (chkVal[i] && !dispVal[i].isEmpty()) {
|
||||
double val = dispVal[i].toDouble();
|
||||
FILE_LOG(logDEBUG)
|
||||
LOG(logDEBUG)
|
||||
<< "Setting "
|
||||
<< qDefs::getRangeAsString(static_cast<qDefs::range>(i))
|
||||
<< " to " << val;
|
||||
@ -449,7 +449,7 @@ void qTabPlot::SetXYRange() {
|
||||
}
|
||||
|
||||
void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
FILE_LOG(logDEBUG) << "Maintaining Aspect Ratio";
|
||||
LOG(logDEBUG) << "Maintaining Aspect Ratio";
|
||||
|
||||
disconnect(chkXMin, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
disconnect(chkXMax, SIGNAL(toggled(bool)), this, SLOT(SetXRange()));
|
||||
@ -482,7 +482,7 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
ranges[qDefs::YMAX] = plot->GetYMaximum();
|
||||
double idealAspectratio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||
FILE_LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio
|
||||
LOG(logDEBUG) << "Ideal Aspect ratio: " << idealAspectratio
|
||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
||||
@ -494,7 +494,7 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
ranges[qDefs::YMAX] = dispYMax->text().toDouble();
|
||||
double currentAspectRatio = (ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]);
|
||||
FILE_LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio
|
||||
LOG(logDEBUG) << "Current Aspect ratio: " << currentAspectRatio
|
||||
<< " for x(" << ranges[qDefs::XMIN] << " - "
|
||||
<< ranges[qDefs::XMAX] << "), y(" << ranges[qDefs::YMIN]
|
||||
<< " - " << ranges[qDefs::YMAX] << ")";
|
||||
@ -519,14 +519,14 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
if (newval <= plot->GetXMaximum()) {
|
||||
ranges[qDefs::XMAX] = newval;
|
||||
dispXMax->setText(QString::number(newval));
|
||||
FILE_LOG(logDEBUG) << "New XMax: " << newval;
|
||||
LOG(logDEBUG) << "New XMax: " << newval;
|
||||
} else {
|
||||
newval = ranges[qDefs::XMAX] -
|
||||
(idealAspectratio *
|
||||
(ranges[qDefs::YMAX] - ranges[qDefs::YMIN]));
|
||||
ranges[qDefs::XMIN] = newval;
|
||||
dispXMin->setText(QString::number(newval));
|
||||
FILE_LOG(logDEBUG) << "New XMin: " << newval;
|
||||
LOG(logDEBUG) << "New XMin: " << newval;
|
||||
}
|
||||
}
|
||||
// adjust y
|
||||
@ -537,14 +537,14 @@ void qTabPlot::MaintainAspectRatio(int dimension) {
|
||||
if (newval <= plot->GetYMaximum()) {
|
||||
ranges[qDefs::YMAX] = newval;
|
||||
dispYMax->setText(QString::number(newval));
|
||||
FILE_LOG(logDEBUG) << "New YMax: " << newval;
|
||||
LOG(logDEBUG) << "New YMax: " << newval;
|
||||
} else {
|
||||
newval = ranges[qDefs::YMAX] -
|
||||
((ranges[qDefs::XMAX] - ranges[qDefs::XMIN]) /
|
||||
idealAspectratio);
|
||||
ranges[qDefs::YMIN] = newval;
|
||||
dispYMin->setText(QString::number(newval));
|
||||
FILE_LOG(logDEBUG) << "New YMax: " << newval;
|
||||
LOG(logDEBUG) << "New YMax: " << newval;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -569,19 +569,19 @@ void qTabPlot::SetZRange() {
|
||||
|
||||
if (isZRange[0] && !dispZMin->text().isEmpty()) {
|
||||
double val = dispZMin->text().toDouble();
|
||||
FILE_LOG(logDEBUG) << "Setting zmin to " << val;
|
||||
LOG(logDEBUG) << "Setting zmin to " << val;
|
||||
zRange[0] = val;
|
||||
}
|
||||
if (isZRange[1] && !dispZMax->text().isEmpty()) {
|
||||
double val = dispZMax->text().toDouble();
|
||||
FILE_LOG(logDEBUG) << "Setting zmax to " << val;
|
||||
LOG(logDEBUG) << "Setting zmax to " << val;
|
||||
zRange[1] = val;
|
||||
}
|
||||
plot->SetZRange(zRange, isZRange);
|
||||
}
|
||||
|
||||
void qTabPlot::GetStreamingFrequency() {
|
||||
FILE_LOG(logDEBUG) << "Getting Streaming Frequency";
|
||||
LOG(logDEBUG) << "Getting Streaming Frequency";
|
||||
disconnect(comboFrequency, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetStreamingFrequency()));
|
||||
disconnect(comboTimeGapUnit, SIGNAL(currentIndexChanged(int)), this,
|
||||
@ -639,10 +639,10 @@ void qTabPlot::SetStreamingFrequency() {
|
||||
stackedTimeInterval->setCurrentIndex(comboFrequency->currentIndex());
|
||||
try {
|
||||
if (frequency) {
|
||||
FILE_LOG(logINFO) << "Setting Streaming Frequency to " << freqVal;
|
||||
LOG(logINFO) << "Setting Streaming Frequency to " << freqVal;
|
||||
det->setRxZmqFrequency(freqVal);
|
||||
} else {
|
||||
FILE_LOG(logINFO) << "Setting Streaming Timer to " << timeVal << " "
|
||||
LOG(logINFO) << "Setting Streaming Timer to " << timeVal << " "
|
||||
<< qDefs::getUnitString(timeUnit);
|
||||
auto timeMS = qDefs::getMSTime(std::make_pair(timeVal, timeUnit));
|
||||
det->setRxZmqTimer(timeMS.count());
|
||||
@ -654,7 +654,7 @@ void qTabPlot::SetStreamingFrequency() {
|
||||
}
|
||||
|
||||
void qTabPlot::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Plot Tab";
|
||||
LOG(logDEBUG) << "**Updating Plot Tab";
|
||||
|
||||
if (!plot->GetIsRunning()) {
|
||||
boxPlotType->setEnabled(true);
|
||||
@ -687,5 +687,5 @@ void qTabPlot::Refresh() {
|
||||
chkGapPixels->setEnabled(false);
|
||||
}
|
||||
|
||||
FILE_LOG(logDEBUG) << "**Updated Plot Tab";
|
||||
LOG(logDEBUG) << "**Updated Plot Tab";
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ qTabSettings::qTabSettings(QWidget *parent, sls::Detector *detector)
|
||||
: QWidget(parent), det(detector) {
|
||||
setupUi(this);
|
||||
SetupWidgetWindow();
|
||||
FILE_LOG(logDEBUG) << "Settings ready";
|
||||
LOG(logDEBUG) << "Settings ready";
|
||||
}
|
||||
|
||||
qTabSettings::~qTabSettings() {}
|
||||
@ -93,7 +93,7 @@ void qTabSettings::SetupDetectorSettings() {
|
||||
item[(int)G4_LOWGAIN]->setEnabled(true);
|
||||
break;
|
||||
default:
|
||||
FILE_LOG(logDEBUG) << "Unknown detector type. Exiting GUI.";
|
||||
LOG(logDEBUG) << "Unknown detector type. Exiting GUI.";
|
||||
qDefs::Message(qDefs::CRITICAL,
|
||||
"Unknown detector type. Exiting GUI.",
|
||||
"qTabSettings::SetupDetectorSettings");
|
||||
@ -120,7 +120,7 @@ void qTabSettings::Initialization() {
|
||||
}
|
||||
|
||||
void qTabSettings::GetSettings() {
|
||||
FILE_LOG(logDEBUG) << "Getting settings";
|
||||
LOG(logDEBUG) << "Getting settings";
|
||||
disconnect(comboSettings, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(SetSettings(int)));
|
||||
try {
|
||||
@ -151,7 +151,7 @@ void qTabSettings::SetSettings(int index) {
|
||||
// settings
|
||||
auto val = static_cast<slsDetectorDefs::detectorSettings>(index);
|
||||
try {
|
||||
FILE_LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
|
||||
LOG(logINFO) << "Setting Settings to " << sls::ToString(val);
|
||||
det->setSettings(val);
|
||||
}
|
||||
CATCH_HANDLE("Could not set settings.", "qTabSettings::SetSettings", this,
|
||||
@ -163,7 +163,7 @@ void qTabSettings::SetSettings(int index) {
|
||||
}
|
||||
|
||||
void qTabSettings::GetDynamicRange() {
|
||||
FILE_LOG(logDEBUG) << "Getting dynamic range";
|
||||
LOG(logDEBUG) << "Getting dynamic range";
|
||||
disconnect(comboDynamicRange, SIGNAL(activated(int)), this,
|
||||
SLOT(SetDynamicRange(int)));
|
||||
try {
|
||||
@ -195,7 +195,7 @@ void qTabSettings::GetDynamicRange() {
|
||||
}
|
||||
|
||||
void qTabSettings::SetDynamicRange(int index) {
|
||||
FILE_LOG(logINFO) << "Setting dynamic range to "
|
||||
LOG(logINFO) << "Setting dynamic range to "
|
||||
<< comboDynamicRange->currentText().toAscii().data();
|
||||
try {
|
||||
switch (index) {
|
||||
@ -222,7 +222,7 @@ void qTabSettings::SetDynamicRange(int index) {
|
||||
}
|
||||
|
||||
void qTabSettings::GetThresholdEnergy() {
|
||||
FILE_LOG(logDEBUG) << "Getting theshold energy";
|
||||
LOG(logDEBUG) << "Getting theshold energy";
|
||||
disconnect(spinThreshold, SIGNAL(valueChanged(int)), this,
|
||||
SLOT(SetThresholdEnergy(int)));
|
||||
try {
|
||||
@ -237,7 +237,7 @@ void qTabSettings::GetThresholdEnergy() {
|
||||
}
|
||||
|
||||
void qTabSettings::SetThresholdEnergy(int index) {
|
||||
FILE_LOG(logINFO) << "Setting Threshold Energy to " << index << " eV";
|
||||
LOG(logINFO) << "Setting Threshold Energy to " << index << " eV";
|
||||
try {
|
||||
det->setThresholdEnergy(index);
|
||||
}
|
||||
@ -248,7 +248,7 @@ void qTabSettings::SetThresholdEnergy(int index) {
|
||||
}
|
||||
|
||||
void qTabSettings::Refresh() {
|
||||
FILE_LOG(logDEBUG) << "**Updating Settings Tab";
|
||||
LOG(logDEBUG) << "**Updating Settings Tab";
|
||||
|
||||
if (comboSettings->isEnabled()) {
|
||||
GetSettings();
|
||||
@ -261,5 +261,5 @@ void qTabSettings::Refresh() {
|
||||
if (spinThreshold->isEnabled())
|
||||
GetThresholdEnergy();
|
||||
|
||||
FILE_LOG(logDEBUG) << "**Updated Settings Tab";
|
||||
LOG(logDEBUG) << "**Updated Settings Tab";
|
||||
}
|
||||
|
Reference in New Issue
Block a user