This composite component contains 3 mcNumber fields and provides all the standard UI features associated with those components.
Using
<div class="mcUITabPanel" id="mcUITemperature" ></div> |
Just set the callback property to make this fully functional.
To provide multiple instances, just give each container a unique id and pass that name to the constructor.
TmcUITemperature supports the following properties | ||
---|---|---|
Property | Default | |
Temp_K Temp_C Temp_F | 20°C | The current values
Read only, writes have no effect |
callback | Define your function as
function xyz(Temp_K, Temp_C, Temp_F) | |
Allow_Callback | true | Set this to false to stop a callback when setting values via code. |
UIPanel | This points to the container. |
TmcUITemperature supports the following methods | |
---|---|
Method | |
xx = new TmcUITemperature(container); | Constructor
The container may be either the id of a component (ie, a string), or a reference. If missing, the default container is "mcUITemperature". |
Set_Kmin(minK) Set_Kmax(maxK) | These set the minimum and maximum kelvin values for the component |
Set_Temp_K(value) Set_Temp_C(value) Set_Temp_F(value) | Sets the associated value, updates the other 2, and (optionally) executed the callback.
If an invalid value is supplied, all the values are set to undefined. |
Set_Temp_K_no_callback(value) | Sets the Kelvin value without triggering a callback
Resets Allow_Callback to true |
Set_Title | Simply sets the frame title |
Global functions provided by mcUITemperature.js | |
---|---|
Function | |
mcK_to_C(Temp_K) mcK_to_F(Temp_K) | Just basic conversion functions |
mcGetHint_K(Temp_K) | Used to create a hint string for when only one value is displayed |