Browse Source

Preserve scale in ZeroEmitter

Neal Wilson 11 years ago
parent
commit
02ca92c040
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/typica.w

+ 5
- 2
src/typica.w View File

7460
 class ZeroEmitter : public QObject@/
7460
 class ZeroEmitter : public QObject@/
7461
 {@t\1@>@/
7461
 {@t\1@>@/
7462
 	Q_OBJECT@;
7462
 	Q_OBJECT@;
7463
+	Q_PROPERTY(int column READ column WRITE setColumn)
7463
 	int col;
7464
 	int col;
7464
 	double temp;
7465
 	double temp;
7466
+	Units::Unit scale;
7465
 	public:@/
7467
 	public:@/
7466
-		ZeroEmitter(int tempcolumn);
7468
+		ZeroEmitter(int tempcolumn = 1);
7467
 		int column();
7469
 		int column();
7468
 		double lastTemperature();@/
7470
 		double lastTemperature();@/
7469
 	@t\4@>public slots@t\kern-3pt@>:@;
7471
 	@t\4@>public slots@t\kern-3pt@>:@;
7496
 void ZeroEmitter::newMeasurement(Measurement measure)
7498
 void ZeroEmitter::newMeasurement(Measurement measure)
7497
 {
7499
 {
7498
 	temp = measure.temperature();
7500
 	temp = measure.temperature();
7501
+	scale = measure.scale();
7499
 }
7502
 }
7500
 
7503
 
7501
 void ZeroEmitter::setColumn(int column)
7504
 void ZeroEmitter::setColumn(int column)
7505
 
7508
 
7506
 void ZeroEmitter::emitZero()
7509
 void ZeroEmitter::emitZero()
7507
 {
7510
 {
7508
-	emit measurement(Measurement(temp, QTime(0, 0, 0, 0)), col);
7511
+	emit measurement(Measurement(temp, QTime(0, 0, 0, 0), scale), col);
7509
 }
7512
 }
7510
 
7513
 
7511
 @ Making this class available to scripts requires only two functions.
7514
 @ Making this class available to scripts requires only two functions.

Loading…
Cancel
Save