Procházet zdrojové kódy

Fix relative measurement graphing

Neal Wilson před 11 roky
rodič
revize
0b7af53835
2 změnil soubory, kde provedl 13 přidání a 5 odebrání
  1. 1
    1
      config/Windows/productionroaster.xml
  2. 12
    4
      src/typica.w

+ 1
- 1
config/Windows/productionroaster.xml Zobrazit soubor

@@ -492,7 +492,7 @@
492 492
 			emitter.measurement.connect(graph.newMeasurement);
493 493
 		}
494 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 496
 			rateoffsets.push(offset);
497 497
 			rateCalculators[i - channels.length].measurement.connect(offset.newMeasurement);
498 498
 			var adapter = new MeasurementAdapter(i + 1);

+ 12
- 4
src/typica.w Zobrazit soubor

@@ -7706,7 +7706,8 @@ GraphView::GraphView(QWidget *parent) : QGraphicsView(parent),
7706 7706
 	gridLinesF(new QList<QGraphicsItem *>),
7707 7707
 	gridLinesC(new QList<QGraphicsItem *>),
7708 7708
 	relativeGridLines(new QList<QGraphicsItem *>),
7709
-	relativeEnabled(false)@/
7709
+	relativeEnabled(false),
7710
+	relativeAdjuster(new LinearSplineInterpolator)@/
7710 7711
 {
7711 7712
 	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
7712 7713
 	setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
@@ -7802,11 +7803,11 @@ if(settings.contains("settings/graph/relative/enable"))
7802 7803
 				relativeGridLines->append(label);
7803 7804
 				if(unit == "F")
7804 7805
 				{
7805
-					relativeAdjuster->add_pair(key, y);
7806
+					relativeAdjuster->add_pair(key, -y);
7806 7807
 				}
7807 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 7812
 				y -= skip;
7812 7813
 			}
@@ -7889,7 +7890,14 @@ void GraphView::newMeasurement(Measurement measure, int tempcolumn)@/
7889 7890
 	{
7890 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 7903
 	if(translations->contains(tempcolumn))

Loading…
Zrušit
Uložit