Procházet zdrojové kódy

Expose units to host environment

Neal Wilson před 11 roky
rodič
revize
08a7abcbf3
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7
    1
      src/typica.w

+ 7
- 1
src/typica.w Zobrazit soubor

@@ -6477,13 +6477,19 @@ QScriptValue constructDAQ(QScriptContext *context, QScriptEngine *engine)
6477 6477
 }
6478 6478
 
6479 6479
 @ As |DAQ| inherits |QObject|, we add the |newChannel()| property after adding
6480
-any |QObject| properties.
6480
+any |QObject| properties. We also add the values from |Units::Unit| as this was
6481
+widely used in configurations before this enumeration was removed from the
6482
+|DAQ| class.
6481 6483
 
6482 6484
 @<Functions for scripting@>=
6483 6485
 void setDAQProperties(QScriptValue value, QScriptEngine *engine)
6484 6486
 {
6485 6487
 	setQObjectProperties(value, engine);
6486 6488
 	value.setProperty("newChannel", engine->newFunction(DAQ_newChannel));
6489
+	value.setProperty("Fahrenheit", Units::Fahrenheit);
6490
+	value.setProperty("Celsius", Units::Celsius);
6491
+	value.setProperty("Kelvin", Units::Kelvin);
6492
+	value.setProperty("Rankine", Units::Rankine);
6487 6493
 }
6488 6494
 
6489 6495
 @ The |newChannel()| method method also requires that two arguments are provided

Loading…
Zrušit
Uložit