m_exportRawDataDialog.removeAllSignals();
c1 = connect(&m_exportRawDataDialog, SIGNAL(fileNameChanged(QString)), &exporter, SLOT(guessFormatFromSuffix(QString)));
c2 = connect(&exporter, SIGNAL(formatChanged(int)), &m_exportRawDataDialog, SLOT(onFormatChanged(int)));
- for (const std::string& s : sr->allKeys())
- m_exportRawDataDialog.addAvailableSignal(Helpers::signalTagToHumanReadable(s), s);
+ for (const auto& sm : sr->allSignals())
+ m_exportRawDataDialog.addAvailableSignal(sm.second->readableName(), sm.second->rawDescriptiveName());
do {
int dret = m_exportRawDataDialog.exec();
_c = std::shared_ptr<SignalController>(new SignalController(_s));
- sigs[_s->descriptiveName().toStdString()] = _s;
- ctrls[_s->descriptiveName().toStdString()] = _c;
+ sigs[_s->rawDescriptiveName()] = _s;
+ ctrls[_s->rawDescriptiveName()] = _c;
hpcs_free_mdata(md);
}
return name.mid(dotIdx+1).toLower();
}
-
-QString Helpers::signalTagToHumanReadable(const std::string& tag)
-{
- QString hr = QString::fromStdString(tag);
-
- hr.replace("_", " ");
-
- return hr;
-}
static int dpiY();
static double firstTick(const double from, const double step);
static QString getFileNameSuffix(const QString& name);
- static QString signalTagToHumanReadable(const std::string& tag);
template <typename T> static T average(T* vals, size_t len)
{
QString Signal::descriptiveName() const
{
- QString name = resourceAsString();
+ return QString(rawDescriptiveName().c_str());
+}
+
+std::string Signal::rawDescriptiveName() const
+{
+ std::string name = resourceAsString().toStdString();
if (m_resource == Resource::CE_DAD)
- name += "_SIG" + QString::number(m_wavelengthMeasured) + "-" + QString::number(m_wavelengthMeasuredInterval) + "_REF" +
- QString::number(m_wavelengthReference) + "-" + QString::number(m_wavelengthReferenceInterval);
+ name += "_SIG" + std::to_string(m_wavelengthMeasured) + "-" + std::to_string(m_wavelengthMeasuredInterval) + "_REF" +
+ std::to_string(m_wavelengthReference) + "-" + std::to_string(m_wavelengthReferenceInterval);
return name;
}
return m_values.at(idx);
}
+QString Signal::readableName() const
+{
+ QString name = resourceAsString();
+ if (m_resource == Resource::CE_DAD) {
+ return name + QString(" (Measured: %1/%2 nm, Reference %3/%4 nm)").arg(m_wavelengthMeasured).arg(m_wavelengthMeasuredInterval).arg(m_wavelengthReference).arg(m_wavelengthReferenceInterval);
+ }
+ return name;
+}
+
QString Signal::resourceAsString() const {
switch (m_resource) {
case Resource::CE_CCD:
double maximum() const { return m_max; }
double minimum() const { return m_min; }
TimeValuePair pairAt(const size_t idx) const;
+ std::string rawDescriptiveName() const;
+ QString readableName() const;
Resource resource() const { return m_resource; }
QString resourceAsString() const;
double timeAt(const size_t idx) const;