Browse Source

Fix relative measurement graphing

Neal Wilson 11 years ago
parent
commit
0b7af53835
2 changed files with 13 additions and 5 deletions
  1. 1
    1
      config/Windows/productionroaster.xml
  2. 12
    4
      src/typica.w

+ 1
- 1
config/Windows/productionroaster.xml View File

492
 			emitter.measurement.connect(graph.newMeasurement);
492
 			emitter.measurement.connect(graph.newMeasurement);
493
 		}
493
 		}
494
 		for(var i = channels.length; i < channels.length + rateCalculators.length; i++) {
494
 		for(var i = channels.length; i < channels.length + rateCalculators.length; i++) {
495
-			var offset - new MeasurementTimeOffset(epoch);
495
+			var offset = new MeasurementTimeOffset(epoch);
496
 			rateoffsets.push(offset);
496
 			rateoffsets.push(offset);
497
 			rateCalculators[i - channels.length].measurement.connect(offset.newMeasurement);
497
 			rateCalculators[i - channels.length].measurement.connect(offset.newMeasurement);
498
 			var adapter = new MeasurementAdapter(i + 1);
498
 			var adapter = new MeasurementAdapter(i + 1);

+ 12
- 4
src/typica.w View File

7706
 	gridLinesF(new QList<QGraphicsItem *>),
7706
 	gridLinesF(new QList<QGraphicsItem *>),
7707
 	gridLinesC(new QList<QGraphicsItem *>),
7707
 	gridLinesC(new QList<QGraphicsItem *>),
7708
 	relativeGridLines(new QList<QGraphicsItem *>),
7708
 	relativeGridLines(new QList<QGraphicsItem *>),
7709
-	relativeEnabled(false)@/
7709
+	relativeEnabled(false),
7710
+	relativeAdjuster(new LinearSplineInterpolator)@/
7710
 {
7711
 {
7711
 	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
7712
 	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
7712
 	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
7713
 	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
7802
 				relativeGridLines->append(label);
7803
 				relativeGridLines->append(label);
7803
 				if(unit == "F")
7804
 				if(unit == "F")
7804
 				{
7805
 				{
7805
-					relativeAdjuster->add_pair(key, y);
7806
+					relativeAdjuster->add_pair(key, -y);
7806
 				}
7807
 				}
7807
 				else
7808
 				else
7808
 				{
7809
 				{
7809
-					relativeAdjuster->add_pair(key * (9.0/5.0), y);
7810
+					relativeAdjuster->add_pair(key * (9.0/5.0), -y);
7810
 				}
7811
 				}
7811
 				y -= skip;
7812
 				y -= skip;
7812
 			}
7813
 			}
7889
 	{
7890
 	{
7890
 		if(measure.value("relative").toBool())
7891
 		if(measure.value("relative").toBool())
7891
 		{
7892
 		{
7892
-			measure.setTemperature(relativeAdjuster->newMeasurement(measure).temperature());
7893
+			if(relativeEnabled)
7894
+			{
7895
+				measure.setTemperature(relativeAdjuster->newMeasurement(measure).temperature());
7896
+			}
7897
+			else
7898
+			{
7899
+				return;
7900
+			}
7893
 		}
7901
 		}
7894
 	}
7902
 	}
7895
 	if(translations->contains(tempcolumn))
7903
 	if(translations->contains(tempcolumn))

Loading…
Cancel
Save