if (ctrl == nullptr)
continue;
- header << "time [" + QString::fromStdString(ctrl->signal()->xunitToString()) + "]" << "area [" + QString::fromStdString(ctrl->signal()->xunitToString()) + " "
- + QString::fromStdString(ctrl->signal()->yunitToString()) + "]" << "width [" + QString::fromStdString(ctrl->signal()->xunitToString()) + "]"
- << "height [" + QString::fromStdString(ctrl->signal()->yunitToString()) + "]";
+ header << "time [" + ctrl->signal()->xunitAsString() + "]" << "area [" + ctrl->signal()->xunitAsString() + " "
+ + ctrl->signal()->yunitAsString() + "]" << "width [" + ctrl->signal()->xunitAsString() + "]"
+ << "height [" + ctrl->signal()->yunitAsString() + "]";
integrator = ctrl->cIntegrator();
/*for (std::multimap<size_t, std::shared_ptr<IntegratedPeak>>::const_iterator cit = integrator->peaksCBegin();
cit != integrator->peaksCEnd(); cit++) {*/
continue;
/* Create header */
- header << QString("time [" + QString::fromStdString(sig->xunitToString()) + "]") << QString("value [" + QString::fromStdString(sig->yunitToString()) + "]");
+ header << QString("time [" + sig->xunitAsString() + "]") << QString("value [" + sig->yunitAsString() + "]");
for (const Signal::TimeValuePair& tvp : sig->values()) {
QVariantList line;
line << tvp.first << tvp.second;
_c = std::shared_ptr<SignalController>(new SignalController(_s));
- sigs[_s->descriptiveName()] = _s;
- ctrls[_s->descriptiveName()] = _c;
+ sigs[_s->descriptiveName().toStdString()] = _s;
+ ctrls[_s->descriptiveName().toStdString()] = _c;
hpcs_free(md);
}
swp->setDataTableModel(ctrl->dataTableModel());
swp->setIntegrationTableModel(ctrl->integrationTableModel());
if (ctrl->signal()->resource() == Signal::Resource::CE_DAD)
- swp->setTypeText(QString::fromStdString(ctrl->signal()->resourceToString()) + QString(" Sig: ") + QString::number(ctrl->signal()->wavelengthAbsorbed()) + " nm, Ref: " +
+ swp->setTypeText(ctrl->signal()->resourceAsString() + " Sig: " + QString::number(ctrl->signal()->wavelengthAbsorbed()) + " nm, Ref: " +
QString::number(ctrl->signal()->wavelengthReference()) + " nm");
else
- swp->setTypeText(QString::fromStdString(ctrl->signal()->resourceToString()));
- swp->setXUnits(QString::fromStdString(ctrl->signal()->xunitToString()));
- swp->setYUnits(QString::fromStdString(ctrl->signal()->yunitToString()));
+ swp->setTypeText(ctrl->signal()->resourceAsString());
+ swp->setXUnits(ctrl->signal()->xunitAsString());
+ swp->setYUnits(ctrl->signal()->yunitAsString());
emit addToDashboard(swp);
#include "signal.h"
#include <cfloat>
-const std::string Signal::RES_CCD("CCD");
-const std::string Signal::RES_CURRENT("Current");
-const std::string Signal::RES_DAD("Absorbance");
-const std::string Signal::RES_POWER("Power");
-const std::string Signal::RES_VOLTAGE("Voltage");
-const std::string Signal::KILOVOTLS_SI("KV");
-const std::string Signal::MICROAMPERES_SI("\u03BCA");
-const std::string Signal::MILLIAU_SI("mAU");
-const std::string Signal::MILLIVOLTS_SI("mV");
-const std::string Signal::WATTS_SI("W");
+const QString Signal::RES_CCD("CCD");
+const QString Signal::RES_CURRENT("Current");
+const QString Signal::RES_DAD("Absorbance");
+const QString Signal::RES_POWER("Power");
+const QString Signal::RES_VOLTAGE("Voltage");
+const QString Signal::KILOVOTLS_SI("KV");
+const QString Signal::MICROAMPERES_SI("\u03BCA");
+const QString Signal::MILLIAU_SI("mAU");
+const QString Signal::MILLIVOLTS_SI("mV");
+const QString Signal::WATTS_SI("W");
Signal::Signal(const Equipment equipment, const Resource resource, const double samplingRate, const YUnit yunit, uint16_t wavelengthAbs, uint16_t wavelengthRef,
const std::vector<TimeValuePair>& values, QObject* parent) :
}
}
-std::string Signal::descriptiveName() const
+QString Signal::descriptiveName() const
{
- std::string name = resourceToString();
+ QString name = resourceAsString();
if (m_resource == Resource::CE_DAD)
- name += "_SIG" + std::to_string(m_wavelengthAbs) + "_REF" + std::to_string(m_wavelengthRef);
+ name += "_SIG" + QString::number(m_wavelengthAbs) + "_REF" + QString::number(m_wavelengthRef);
return name;
}
return m_values.at(idx);
}
-std::string Signal::resourceToString() const {
+QString Signal::resourceAsString() const {
switch (m_resource) {
case Resource::CE_CCD:
return RES_CCD;
return m_values.at(idx).second;
}
-std::string Signal::xunitToString() const
+QString Signal::xunitAsString() const
{
switch (m_xunit) {
case XUnit::MINUTE:
}
}
-std::string Signal::yunitToString() const
+QString Signal::yunitAsString() const
{
switch (m_yunit) {
case YUnit::KILOVOLTS:
explicit Signal(const Equipment equipment, const Resource resource, const double samplingRate, const YUnit yunit, const uint16_t wavelengthAbs,
const uint16_t wavelengthRef, const std::vector<TimeValuePair>& values, QObject* parent = nullptr);
uint count() const { return m_values.size(); }
- std::string descriptiveName() const;
+ QString descriptiveName() const;
Equipment equipment() const { return m_equipment; }
std::vector<TimeValuePair>::const_iterator iteratorFrom(const size_t idx) const;
double maximum() const { return m_max; }
double minimum() const { return m_min; }
TimeValuePair pairAt(const size_t idx) const;
Resource resource() const { return m_resource; }
- std::string resourceToString() const;
+ QString resourceAsString() const;
double timeAt(const size_t idx) const;
double samplingRate() const { return m_samplingRate; }
double valueAt(const size_t idx) const;
uint16_t wavelengthAbsorbed() const { return m_wavelengthAbs; }
uint16_t wavelengthReference() const { return m_wavelengthRef; }
XUnit xunit() const { return m_xunit; }
- std::string xunitToString() const;
+ QString xunitAsString() const;
YUnit yunit() const { return m_yunit; }
- std::string yunitToString() const;
+ QString yunitAsString() const;
private:
const Equipment m_equipment;
const XUnit m_xunit;
const YUnit m_yunit;
- static const std::string RES_ABSORBANCE;
- static const std::string RES_CCD;
- static const std::string RES_CURRENT;
- static const std::string RES_DAD;
- static const std::string RES_POWER;
- static const std::string RES_VOLTAGE;
- static const std::string KILOVOTLS_SI;
- static const std::string MICROAMPERES_SI;
- static const std::string MILLIAU_SI;
- static const std::string MILLIVOLTS_SI;
- static const std::string WATTS_SI;
+ static const QString RES_ABSORBANCE;
+ static const QString RES_CCD;
+ static const QString RES_CURRENT;
+ static const QString RES_DAD;
+ static const QString RES_POWER;
+ static const QString RES_VOLTAGE;
+ static const QString KILOVOTLS_SI;
+ static const QString MICROAMPERES_SI;
+ static const QString MILLIAU_SI;
+ static const QString MILLIVOLTS_SI;
+ static const QString WATTS_SI;
signals:
if (role == Qt::DisplayRole && orientation == Qt::Horizontal) {
switch (section) {
case 0:
- return QString("Time [") + QString::fromStdString(m_signal->xunitToString()) + QString("]");
+ return "Time [" + m_signal->xunitAsString() + "]";
case 1:
- return QString("Value [") + QString::fromStdString(m_signal->yunitToString()) + QString("]");
+ return "Value [" + m_signal->yunitAsString() + "]";
default:
return QVariant();
}
m_relYMin(constraints.fromY),
m_axisLabelFont(QFont("arial", 10)),
m_axisLabelFM(QFontMetrics(m_axisLabelFont)),
- m_xAxisLabelText("[" + QString::fromStdString(controller->signal()->xunitToString()) + "]"),
- m_yAxisLabelText("[" + QString::fromStdString(controller->signal()->yunitToString()) + "]")
+ m_xAxisLabelText("[" + controller->signal()->xunitAsString() + "]"),
+ m_yAxisLabelText("[" + controller->signal()->yunitAsString() + "]")
{
}
while (it != m_ctrls.end()) {
std::shared_ptr<SignalController> c = it->second;
- QString descriptiveName = QString::fromStdString(c->signal()->descriptiveName());
+ QString descriptiveName = c->signal()->descriptiveName();
QString filename = "ank_" + descriptiveName + ".json";
QFile jsonFile(m_absPath + "/" + filename);