Fix 8463 (#8464)
This commit is contained in:
@@ -60,7 +60,7 @@ RawSourceRange RawSource::getRange(const ModelData * model, const GeneralSetting
|
|||||||
result.min = -30000 * result.step;
|
result.min = -30000 * result.step;
|
||||||
result.max = +30000 * result.step;
|
result.max = +30000 * result.step;
|
||||||
result.decimals = sensor.prec;
|
result.decimals = sensor.prec;
|
||||||
result.unit = SensorData::unitToString(qr.quot);
|
result.unit = sensor.unitToString();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,9 +75,9 @@ QString SensorData::cellIndexToString() const
|
|||||||
return cellIndexToString(index);
|
return cellIndexToString(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SensorData::unitToString() const
|
QString SensorData::unitToString(bool hideRaw) const
|
||||||
{
|
{
|
||||||
return unitToString(unit);
|
return unitToString(unit, hideRaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SensorData::precToString() const
|
QString SensorData::precToString() const
|
||||||
@@ -342,11 +342,11 @@ QString SensorData::sourceToString(const ModelData * model, const int index, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
QString SensorData::unitToString(const int value)
|
QString SensorData::unitToString(const int value, bool hideRaw)
|
||||||
{
|
{
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case UNIT_RAW:
|
case UNIT_RAW:
|
||||||
return tr("Raw (-)");
|
return hideRaw ? QString() : tr("Raw (-)");
|
||||||
case UNIT_VOLTS:
|
case UNIT_VOLTS:
|
||||||
return tr("V");
|
return tr("V");
|
||||||
case UNIT_AMPS:
|
case UNIT_AMPS:
|
||||||
@@ -496,7 +496,7 @@ AbstractStaticItemModel * SensorData::unitItemModel()
|
|||||||
mdl->setName("sensordata.unit");
|
mdl->setName("sensordata.unit");
|
||||||
|
|
||||||
for (int i = 0; i <= UNIT_MAX; i++) {
|
for (int i = 0; i <= UNIT_MAX; i++) {
|
||||||
QString str = unitToString(i);
|
QString str = unitToString(i, false);
|
||||||
if (str != CPN_STR_UNKNOWN_ITEM)
|
if (str != CPN_STR_UNKNOWN_ITEM)
|
||||||
mdl->appendToItemList(str, i);
|
mdl->appendToItemList(str, i);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class SensorData {
|
|||||||
QString typeToString() const;
|
QString typeToString() const;
|
||||||
QString formulaToString() const;
|
QString formulaToString() const;
|
||||||
QString cellIndexToString() const;
|
QString cellIndexToString() const;
|
||||||
QString unitToString() const;
|
QString unitToString(bool hideRaw = true) const;
|
||||||
QString precToString() const;
|
QString precToString() const;
|
||||||
int getMask() const;
|
int getMask() const;
|
||||||
QString paramsToString(const ModelData * model) const;
|
QString paramsToString(const ModelData * model) const;
|
||||||
@@ -203,7 +203,7 @@ class SensorData {
|
|||||||
static QString typeToString(const int value);
|
static QString typeToString(const int value);
|
||||||
static QString formulaToString(const int value);
|
static QString formulaToString(const int value);
|
||||||
static QString cellIndexToString(const int value);
|
static QString cellIndexToString(const int value);
|
||||||
static QString unitToString(const int value);
|
static QString unitToString(const int value, bool hideRaw = true);
|
||||||
static QString precToString(const int value);
|
static QString precToString(const int value);
|
||||||
static bool isRssiSensorAvailable(const ModelData * model, const int value);
|
static bool isRssiSensorAvailable(const ModelData * model, const int value);
|
||||||
static QString rssiSensorToString(const ModelData * model, const int value);
|
static QString rssiSensorToString(const ModelData * model, const int value);
|
||||||
|
|||||||
Reference in New Issue
Block a user