|
@@ -8167,7 +8167,8 @@ void ZoomLog::newMeasurement(Measurement measure, int tempcolumn)
|
8167
|
8167
|
lastMeasurement.value(tempcolumn).time().second())
|
8168
|
8168
|
{
|
8169
|
8169
|
Measurement adjusted = measure;
|
8170
|
|
- adjusted.setTime(QTime(0, measure.time().minute(), measure.time().second(), 0));
|
|
8170
|
+ QTime adjtime(0, measure.time().minute(), measure.time().second(), 0);
|
|
8171
|
+ adjusted.setTime(adjtime);
|
8171
|
8172
|
model_1s->newMeasurement(adjusted, tempcolumn);
|
8172
|
8173
|
if(adjusted.time().second() % 5 == 0)
|
8173
|
8174
|
{
|
|
@@ -8196,7 +8197,7 @@ void ZoomLog::newMeasurement(Measurement measure, int tempcolumn)
|
8196
|
8197
|
{
|
8197
|
8198
|
@<Add the first measurement to every model@>@;
|
8198
|
8199
|
}
|
8199
|
|
- lastMeasurement[tempcolumn] = measure;
|
|
8200
|
+ lastMeasurement.insert(tempcolumn, measure);
|
8200
|
8201
|
}
|
8201
|
8202
|
|
8202
|
8203
|
@ The first measurement in a series should be the epoch measurement. This
|
|
@@ -8227,18 +8228,21 @@ this would match the graphic representation rather than altering it when later
|
8227
|
8228
|
reviewing the batch.
|
8228
|
8229
|
|
8229
|
8230
|
@<Synthesize measurements for slow hardware@>=
|
8230
|
|
-if(lastMeasurement[tempcolumn].time() < measure.time())
|
|
8231
|
+if(lastMeasurement.contains(tempcolumn))
|
8231
|
8232
|
{
|
8232
|
|
- QList<QTime> timelist;
|
8233
|
|
- for(QTime i = lastMeasurement[tempcolumn].time().addSecs(1); i < measure.time(); i = i.addSecs(1))
|
|
8233
|
+ if(lastMeasurement[tempcolumn].time() < measure.time())
|
8234
|
8234
|
{
|
8235
|
|
- timelist.append(i);
|
8236
|
|
- }
|
8237
|
|
- for(int i = 0; i < timelist.size(); i++)
|
8238
|
|
- {
|
8239
|
|
- Measurement synthesized = measure;
|
8240
|
|
- synthesized.setTime(timelist[i]);
|
8241
|
|
- newMeasurement(synthesized, tempcolumn);
|
|
8235
|
+ QList<QTime> timelist;
|
|
8236
|
+ for(QTime i = lastMeasurement.value(tempcolumn).time().addSecs(1); i < measure.time(); i = i.addSecs(1))
|
|
8237
|
+ {
|
|
8238
|
+ timelist.append(i);
|
|
8239
|
+ }
|
|
8240
|
+ for(int i = 0; i < timelist.size(); i++)
|
|
8241
|
+ {
|
|
8242
|
+ Measurement synthesized = measure;
|
|
8243
|
+ synthesized.setTime(timelist[i]);
|
|
8244
|
+ newMeasurement(synthesized, tempcolumn);
|
|
8245
|
+ }
|
8242
|
8246
|
}
|
8243
|
8247
|
}
|
8244
|
8248
|
|
|
@@ -8285,7 +8289,7 @@ if(currentColumnSet.contains(tempcolumn))
|
8285
|
8289
|
if(synthetic.time().second() != lastMeasurement.value(replicationcolumn).time().second())
|
8286
|
8290
|
{
|
8287
|
8291
|
Measurement adjusted = synthetic;
|
8288
|
|
- synthetic.setTime(QTime(0, synthetic.time().minute(), synthetic.time().second(), 0));
|
|
8292
|
+ adjusted.setTime(QTime(0, synthetic.time().minute(), synthetic.time().second(), 0));
|
8289
|
8293
|
model_1s->newMeasurement(adjusted, replicationcolumn);
|
8290
|
8294
|
if(adjusted.time().second() % 5 == 0)
|
8291
|
8295
|
{
|
|
@@ -9400,13 +9404,13 @@ QVariant MeasurementModel::data(const QModelIndex &index, int role) const@/
|
9400
|
9404
|
{
|
9401
|
9405
|
return QVariant();
|
9402
|
9406
|
}
|
|
9407
|
+ MeasurementList *row = entries->at(index.row());
|
9403
|
9408
|
if(role == Qt::UserRole)
|
9404
|
9409
|
{
|
9405
|
|
- return QVariant(row->at(column));
|
|
9410
|
+ return QVariant(row->at(index.column()));
|
9406
|
9411
|
}
|
9407
|
9412
|
if(role == Qt::DisplayRole || role == Qt::EditRole)
|
9408
|
9413
|
{
|
9409
|
|
- MeasurementList *row = entries->at(index.row());
|
9410
|
9414
|
if(index.column() > row->size())
|
9411
|
9415
|
{
|
9412
|
9416
|
return QVariant();
|
|
@@ -9419,14 +9423,14 @@ QVariant MeasurementModel::data(const QModelIndex &index, int role) const@/
|
9419
|
9423
|
}
|
9420
|
9424
|
else if(lastTemperature->contains(index.column()))
|
9421
|
9425
|
{
|
9422
|
|
- if(row->at(index.column()).toString().isEmpty())
|
|
9426
|
+ QVariantMap v = row->at(index.column()).toMap();
|
|
9427
|
+ if(!v.contains("measurement"))
|
9423
|
9428
|
{
|
9424
|
9429
|
return QVariant();
|
9425
|
9430
|
}
|
9426
|
|
- Measurement v = row->at(index.column());
|
9427
|
|
- if(v.scale() == Units::Unitless)
|
|
9431
|
+ if((Units::Unit)(v.value("unit").toInt()) == Units::Unitless)
|
9428
|
9432
|
{
|
9429
|
|
- return QVariant(QString("%1").arg(v.temperature()));
|
|
9433
|
+ return v.value("measurement");
|
9430
|
9434
|
}
|
9431
|
9435
|
else
|
9432
|
9436
|
{
|
|
@@ -9434,10 +9438,10 @@ QVariant MeasurementModel::data(const QModelIndex &index, int role) const@/
|
9434
|
9438
|
{
|
9435
|
9439
|
if(v.value("relative") == true)
|
9436
|
9440
|
{
|
9437
|
|
- return QVariant(QString("%1").arg(Units::convertRelativeTemperature(v.temperature(), v.scale, unit)));
|
|
9441
|
+ return QVariant(QString("%1").arg(Units::convertRelativeTemperature(v.value("measurement").toDouble(), (Units::Unit)(v.value("unit").toInt()), unit)));
|
9438
|
9442
|
}
|
9439
|
9443
|
}
|
9440
|
|
- return QVariant(QString("%1").arg(Units::convertTemperature(v.temperature(), v.scale(), unit)));
|
|
9444
|
+ return QVariant(QString("%1").arg(Units::convertTemperature(v.value("measurement").toDouble(), (Units::Unit)(v.value("unit").toInt()), unit)));
|
9441
|
9445
|
}
|
9442
|
9446
|
}
|
9443
|
9447
|
return QVariant(row->at(index.column()).toString());
|
|
@@ -11418,9 +11422,14 @@ else if(xmlin.name() == "temperature")
|
11418
|
11422
|
column = xmlin.attributes().value("series").toString().isEmpty() ?
|
11419
|
11423
|
firstc : temperatureColumns.value(xmlin.attributes().
|
11420
|
11424
|
value("series").toString());
|
|
11425
|
+ bool relative = false;
|
|
11426
|
+ if(xmlin.attributes().value("relative") == "true")
|
|
11427
|
+ {
|
|
11428
|
+ relative = true;
|
|
11429
|
+ }
|
11421
|
11430
|
tempval = xmlin.readElementText().toDouble();
|
11422
|
11431
|
Measurement measurement(tempval, timeval);
|
11423
|
|
- if(xmlin.attributes().value("relative").toString() == "true")
|
|
11432
|
+ if(relative)
|
11424
|
11433
|
{
|
11425
|
11434
|
measurement.insert("relative", true);
|
11426
|
11435
|
}
|