Browse Source

Expose units to host environment

Neal Wilson 11 years ago
parent
commit
08a7abcbf3
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      src/typica.w

+ 7
- 1
src/typica.w View File

6477
 }
6477
 }
6478
 
6478
 
6479
 @ As |DAQ| inherits |QObject|, we add the |newChannel()| property after adding
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
 @<Functions for scripting@>=
6484
 @<Functions for scripting@>=
6483
 void setDAQProperties(QScriptValue value, QScriptEngine *engine)
6485
 void setDAQProperties(QScriptValue value, QScriptEngine *engine)
6484
 {
6486
 {
6485
 	setQObjectProperties(value, engine);
6487
 	setQObjectProperties(value, engine);
6486
 	value.setProperty("newChannel", engine->newFunction(DAQ_newChannel));
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
 @ The |newChannel()| method method also requires that two arguments are provided
6495
 @ The |newChannel()| method method also requires that two arguments are provided

Loading…
Cancel
Save