diff --git a/slsDetectorGui/client/qClient.cpp b/slsDetectorGui/client/qClient.cpp index 1583bae52..e89eed56e 100644 --- a/slsDetectorGui/client/qClient.cpp +++ b/slsDetectorGui/client/qClient.cpp @@ -65,9 +65,6 @@ qClient::~qClient() { int qClient::executeLine(int narg, char *args[]){ - char arg[MAX_STR_LENGTH] = ""; - int iarg = -1; - char answer[100]; string retval = ""; string cmd = args[0]; string argument; diff --git a/slsDetectorGui/include/qCloneWidget.h b/slsDetectorGui/include/qCloneWidget.h index 8e1312660..07d4cff4c 100644 --- a/slsDetectorGui/include/qCloneWidget.h +++ b/slsDetectorGui/include/qCloneWidget.h @@ -119,11 +119,10 @@ private: int id; /** Default Save file path */ string filePath; - - /** clone 2D Plot */ - SlsQt2DPlotLayout* cloneplot2D; /** clone 1D Plot */ SlsQt1DPlot* cloneplot1D; + /** clone 2D Plot */ + SlsQt2DPlotLayout* cloneplot2D; /** vector of 1D hist values */ QVector cloneplot1D_hists; diff --git a/slsDetectorGui/include/qDebugStream.h b/slsDetectorGui/include/qDebugStream.h index 2c728dd25..4335dbd0a 100644 --- a/slsDetectorGui/include/qDebugStream.h +++ b/slsDetectorGui/include/qDebugStream.h @@ -59,7 +59,8 @@ public: // output anything that is left if (!m_string.empty()) { pthread_mutex_lock(&mutex); - QApplication::postEvent(log_window, new qStreamEvent(m_string.c_str())); + const char* c_string = m_string.c_str(); + QApplication::postEvent(log_window, new qStreamEvent(c_string)); pthread_mutex_unlock(&mutex); } m_stream.rdbuf(m_old_buf); @@ -71,7 +72,8 @@ protected: virtual int_type overflow(int_type v){ if (v == '\n'){ pthread_mutex_lock(&mutex); - QApplication::postEvent(log_window, new qStreamEvent(m_string.c_str())); + const char* c_string = m_string.c_str(); + QApplication::postEvent(log_window, new qStreamEvent(c_string)); m_string.erase(m_string.begin(), m_string.end()); pthread_mutex_unlock(&mutex); } @@ -87,13 +89,14 @@ protected: m_string.append(p, p + n); //changed from uint because of 64 bit - int pos = 0; + size_t pos = 0; while (pos != string::npos){ pos = m_string.find('\n'); if (pos != string::npos){ string tmp(m_string.begin(), m_string.begin() + pos); - QApplication::postEvent(log_window, new qStreamEvent(tmp.c_str())); + const char* c_tmp = tmp.c_str(); + QApplication::postEvent(log_window, new qStreamEvent(c_tmp)); m_string.erase(m_string.begin(), m_string.begin() + pos + 1); } } diff --git a/slsDetectorGui/src/qCloneWidget.cpp b/slsDetectorGui/src/qCloneWidget.cpp index 5d4f79692..892980e9a 100644 --- a/slsDetectorGui/src/qCloneWidget.cpp +++ b/slsDetectorGui/src/qCloneWidget.cpp @@ -20,7 +20,7 @@ qCloneWidget::qCloneWidget(QWidget *parent,int id,QString title,QString xTitle, QString yTitle, QString zTitle, int numDim,string FilePath,bool displayStats, QString min, QString max, QString sum): - QMainWindow(parent),id(id),cloneplot2D(0),cloneplot1D(0),filePath(FilePath) + QMainWindow(parent),id(id),filePath(FilePath),cloneplot1D(0),cloneplot2D(0) { // Window title char winTitle[300],currTime[50]; @@ -267,12 +267,13 @@ void qCloneWidget::SavePlot(){ cloneBox->render(&painter); fName = QFileDialog::getSaveFileName(this,tr("Save Snapshot "),fName,tr("PNG Files (*.png);;XPM Files(*.xpm);;JPEG Files(*.jpg)"),0,QFileDialog::ShowDirsOnly); - if (!fName.isEmpty()) + if (!fName.isEmpty()) { if((img.save(fName))) qDefs::Message(qDefs::INFORMATION,"The SnapShot has been successfully saved","qCloneWidget::SavePlot"); else qDefs::Message(qDefs::WARNING,"Attempt to save snapshot failed.\n" "Formats: .png, .jpg, .xpm.","qCloneWidget::SavePlot"); + } } diff --git a/slsDetectorGui/src/qTabDebugging.cpp b/slsDetectorGui/src/qTabDebugging.cpp index 150f8dbe7..45b737144 100644 --- a/slsDetectorGui/src/qTabDebugging.cpp +++ b/slsDetectorGui/src/qTabDebugging.cpp @@ -404,11 +404,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){ det = myDet->getSlsDetector(i); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); lblDetectorId->setText(comboDetector->itemText(i)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); lblDetectorSerial->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); lblDetectorFirmware ->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); lblDetectorSoftware->setText(QString(value)); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); @@ -425,17 +425,17 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){ det = myDet->getSlsDetector(i); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); lblDetectorId->setText(comboDetector->itemText(i)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); lblDetectorSerial->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); lblDetectorFirmware ->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); lblDetectorSoftware->setText(QString(value)); lblModuleId->setText(QString("%1").arg(im)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER,im)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::MODULE_SERIAL_NUMBER,im)); lblModuleSerial->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::MODULE_FIRMWARE_VERSION,im)); lblModuleFirmware->setText(QString(value)); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); @@ -457,11 +457,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){ det = myDet->getSlsDetector(i); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); lblDetectorId->setText(comboDetector->itemText(i)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); lblDetectorSerial->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); lblDetectorFirmware ->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); lblDetectorSoftware->setText(QString(value)); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); @@ -481,11 +481,11 @@ void qTabDebugging::SetParameters(QTreeWidgetItem *item){ det = myDet->getSlsDetector(i); qDefs::checkErrorMessage(myDet,"qTabDebugging::SetParameters"); lblDetectorId->setText(comboDetector->itemText(i)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SERIAL_NUMBER)); lblDetectorSerial->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_FIRMWARE_VERSION)); lblDetectorFirmware ->setText(QString(value)); - sprintf(value,"%llx",det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); + sprintf(value,"%llx",(long long unsigned int)det->getId(slsDetectorDefs::DETECTOR_SOFTWARE_VERSION)); lblDetectorSoftware->setText(QString(value)); qDefs::checkErrorMessage(det,"qTabDebugging::SetParameters"); diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index e75bd0e8b..33046ab71 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -734,7 +734,6 @@ void qTabMeasurement::SetTimingMode(int mode){ //Frame Period between exposures - qDefs::timeUnit unit; if(lblPeriod->isEnabled()) CheckAcqPeriodGreaterThanExp(); else{ diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index bd943e162..0f31610ce 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -69,11 +69,12 @@ void qTabSettings::GetDynamicRange(int setvalue){ cout << "Getting dynamic range" << endl; #endif int ret = myDet->setDynamicRange(-1); - if(detType == slsDetectorDefs::MYTHEN) + if(detType == slsDetectorDefs::MYTHEN) { if(ret==24) ret=32; else if(ret==24) cout<<"ret:"<