---
title: "Thermometer (Basic)"
canonical: "https://docs.cuesystem.com/space/CVCGC/402325540/Thermometer%20(Basic)"
format: markdown
---
> Macro (toc)

---

# Description

This object simulates a classic liquid thermometer. It allows to display of temperature values using Celsius or Fahrenheit scale.

Five flood colors can be simply selected using the appropriate property. Background and digital value on the top can be switched on or off.

The thermometer is smoothly resizable in the vertical direction. It has 2 different discrete widths 75 and 100 pixels. If another width is set, it is automatically rounded to the nearest lower value (or minimum). If the height of the thermometer is smaller than displayable, it is automatically resized to the smallest displayable height.

![image](media://7d41fefd-0938-4c7f-a537-f0a3fb8fb227)

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| Behavior |
| DefaultValue | Double | Any | (Maximum + Minimum) / 2 | Initial value of thermometer flood after reset |
| Appearance |
| FloodColor | Long | 1 = blue   
2 = green  
3 = yellow   
4 = orange  
5 = purple | 1 | Color of flood |
| ShowBackground | Boolean | Yes   
No | Yes | Specifies whether the background is shown. |
| ShowTextValue | Boolean | Yes   
No | Yes | Specifies whether the TextValue is shown. |
| Units | Long | 1 = Celsius   
2 = Fahrenheit | Celsius | Specifies thermometer units Celsius or Fahrenheit. |
| Scale |
| DivisionInterval | Long |  | 10 | Interval between two scale divisions |
| Maximum | Long |  | 40 | Value of top end of thermometer scale |
| Minimum | Long |  | 0 | Value of bottom end of thermometer scale |
| SignificantValue | Double | In interval between Minimum and Maximum | (Minimum + Maximum) / 2 | It is highlighted significant value, for example requested temperature. |
| ShowSignificantValue | Boolean | Yes  
No | Yes | Highlight of SignificantValue |
| SubdivisionsCount | Long | >=1 | 10 | Number of subdivisions between two divisions |

# Functions

## SetDivisionInterval

This function sets interval between two scale divisions. The function returns True on success. It returns False if an error occurs (parameter is too small). In this case DivisionInterval is set internally to reasonable small value (the value depends on display resolution and display size).

#### Syntax

```visualbasic
Function SetDivisionInterval(newdivisioninterval As Double) As Boolean
```

## GetDivisionInterval

This function returns interval between two divisions.

#### Syntax

```visualbasic
Function GetDivisionInterval() As Double
```

## SetFloodColor

This function sets color of bargraph flood to newfloodcolor. 

#### Syntax

```visualbasic
Function SetFloodColor(newfloodcolor As Long) As Boolean
```

Possible values are:

- 1 = blue
- 2 = green
- 3 = yellow
- 4 = orange
- 5 = purple

The function returns True on success or False if an error occurs (parameter is out of limits).

## GetFloodColor

This function returns current flood color of bargraph. For possible values see command SetFloodColor.

#### Syntax

```visualbasic
Function GetFloodColor() As Long
```

## SetMaximum

This function sets Maximum of thermometer scale to newmaximum. It returns True, if newmaximum is not equal to current Minimum. Otherwise it returns False, thermometer scale disappears and flood is set to full flood or no flood. In both cases newmaximum is stored in object memory.

#### Syntax

```visualbasic
Function SetMaximum(newmaximum As Double) As Boolean
```

## GetMaximum

This function returns value of top end of thermometer scale.

#### Syntax

```visualbasic
Function GetMaximum() As Long
```

## SetMinimum

This function sets Minimum of thermometer scale to newminimum. It returns True, if newminimum is not equal to current Maximum. Otherwise it returns False, thermometer scale disappears and flood is set to full flood or no flood. In both cases newminimum is stored in object memory.

#### Syntax

```visualbasic
Function SetMinimum(newminimum As Double) As Boolean
```

## GetMinimum

This function returns value of bottom end of thermometer scale.

#### Syntax

```visualbasic
Function GetMinimum() As Long
```

## SetScaleCelsius

This function sets all parameters of scale for Celsius units (newminimum, newmaximum, newsignificantvalue, newdivisioninterval, newsubdivisionscount) in one command. If optional parameters (newdivisioninterval, newsubdivisionscount) are not used in this function, these parameters are not changed. The function returns True on success or False if an error occurs (parameter is out of limits). In both cases parameters are stored in object memory. For valid value of specific parameters see functions above.

#### Syntax

```visualbasic
Function SetScaleCelsius(
  newminimum As Long, 
  newmaximum As Long, 
  newsignificantvalue As Double, 
  Optional newdivisioninterval As Long := &H7FFFFFFF, 
  Optional newsubdivisionscount As Long := &H7FFFFFFF)
As Boolean
```

## SetScaleFahrenheit

This function sets all parameters of scale for Fahrenheit units (newminimum, newmaximum, newsignificantvalue, newdivisioninterval, newsubdivisionscount) in one command. If optional parameters (newdivisioninterval, newsubdivisionscount) are not used in this function, these parameters are not changed. The function returns True on success or False if an error occurs (parameter is out of limits). In both cases parameters are stored in object memory. For valid value of specific parameters see functions above.

#### Syntax

```visualbasic
Function SetScaleFahrenheit(
  newminimum As Long, 
  newmaximum As Long, 
  newsignificantvalue As Double, 
  Optional newdivisioninterval As Long := &H7FFFFFFF, 
  Optional newsubdivision- scount As Long := &H7FFFFFFF) 
As Boolean
```

## SetShowBackground

This function sets whether background is visible or not.

#### Syntax

```visualbasic
Function SetShowBackground(newshowbackground As Boolean) As Boolean
```

## GetShowBackground

This function returns whether background is visible or not.

#### Syntax

```visualbasic
Function GetShowBackground() As Boolean
```

## SetShowSignificantValue

This function sets whether SignificantValue is highlighted or not.

#### Syntax

```visualbasic
Function SetShowSignificantValue(newshowsignificantvalue As Boolean) As Boolean
```

## GetShowSignificantValue

This function returns whether SignificantValue is highlighted or not.

#### Syntax

```visualbasic
Function GetShowSignificantValue() As Boolean
```

## SetShowTextValue

This function sets whether TextValue is visible or not.

#### Syntax

```visualbasic
Function SetShowTextValue(newshowtextvalue As Boolean)
```

## GetShowTextValue

This function returns whether TextValue is visible or not.

#### Syntax

```visualbasic
Function GetShowTextValue() As Boolean
```

## SetSignificantValue

This function sets SignificantValue to newsignificantvalue. It returns True, if newsignificantvalue is in range between current Minimum and Maximum. Otherwise it returns False. In both cases newsignificantvalue is stored in object memory.

#### Syntax

```visualbasic
Function SetSignificantValue(newsignificantvalue As Double) As Boolean
```

## GetSignificantValue

This function returns current SignificantValue.

#### Syntax

```visualbasic
Function GetSignificantValue() As Double
```

## SetSubdivisionsCount

This function sets number of subdivisions between two divisions. The function returns True on success. It returns False if an error occurs (parameter is less then 1). In this case SubdivisionCount is set to 1 internally.

#### Syntax

```visualbasic
Function SetSubdivisionsCount(newsubdivisionscount As Long) As Boolean
```

## GetSubdivisionsCount

This function returns current SubdivisionsCount.

#### Syntax

```visualbasic
Function GetSubdivisionsCount() As Long
```

## SetUnits

This function sets units to newunits value, where 1 = Celsius, 2 = Fahrenheit.

#### Syntax

```visualbasic
Function SetUnits(newunits As Long) As Boolean
```

## GetUnits

This function returns current units. Return value 1 = Celsius, 2 = Fahrenheit.

#### Syntax

```visualbasic
Function GetUnits() As Long
```

## SetValueCelsius

This function sets thermometer value to newvaluecelsius. If units are set to Fahrenheit the value is recalculated.

#### Syntax

```visualbasic
Function SetValueCelsius(newvaluecelsius As Double) As Boolean
```

## GetValueCelsius

This function returns current value of thermometer in Celsius units. If units are sets to Fahrenheit the value is recalculated.

#### Syntax

```visualbasic
Function GetValueCelsius() As Double
```

## SetValueFahrenheit

This function sets thermometer value to newvaluefahrenheit. If units are set to Celsius the value is recalculated.

#### Syntax

```visualbasic
Function SetValueFahrenheit(newvaluefahrenheit As Double) As Boolean
```

## GetValueFahrenheit

This function returns current value of thermometer in Fahrenheit units. If units are sets to Celsius the value is recalculated.

#### Syntax

```visualbasic
Function GetValueFahrenheit() As Double
```