Value

class ntcore.Value

Bases: pybind11_object

A network table entry value. @ingroup ntcore_cpp_api

getBoolean() bool

Get the entry’s boolean value.

Returns:

The boolean value.

getBooleanArray() object

Get the entry’s boolean array value.

Returns:

The boolean array value.

getDouble() float

Get the entry’s double value.

Returns:

The double value.

getDoubleArray() List[float]

Get the entry’s double array value.

Returns:

The double array value.

static getFactoryByType(type: ntcore._ntcore.NetworkTableType) function
getFloat() float

Get the entry’s float value.

Returns:

The float value.

getFloatArray() List[float]

Get the entry’s float array value.

Returns:

The float array value.

getInteger() int

Get the entry’s integer value.

Returns:

The integer value.

getIntegerArray() List[int]

Get the entry’s integer array value.

Returns:

The integer array value.

getRaw() buffer

Get the entry’s raw value.

Returns:

The raw value.

getString() str

Get the entry’s string value.

Returns:

The string value.

getStringArray() List[str]

Get the entry’s string array value.

Returns:

The string array value.

isBoolean() bool

Determine if entry value contains a boolean.

Returns:

True if the entry value is of boolean type.

isBooleanArray() bool

Determine if entry value contains a boolean array.

Returns:

True if the entry value is of boolean array type.

isDouble() bool

Determine if entry value contains a double.

Returns:

True if the entry value is of double type.

isDoubleArray() bool

Determine if entry value contains a double array.

Returns:

True if the entry value is of double array type.

isFloat() bool

Determine if entry value contains a float.

Returns:

True if the entry value is of float type.

isFloatArray() bool

Determine if entry value contains a float array.

Returns:

True if the entry value is of float array type.

isInteger() bool

Determine if entry value contains an integer.

Returns:

True if the entry value is of integer type.

isIntegerArray() bool

Determine if entry value contains an integer array.

Returns:

True if the entry value is of integer array type.

isRaw() bool

Determine if entry value contains a raw.

Returns:

True if the entry value is of raw type.

isString() bool

Determine if entry value contains a string.

Returns:

True if the entry value is of string type.

isStringArray() bool

Determine if entry value contains a string array.

Returns:

True if the entry value is of string array type.

isValid() bool

Determine if entry value contains a value or is unassigned.

Returns:

True if the entry value contains a value.

last_change() int

Get the creation time of the value, in local time.

Returns:

The time, in the units returned by nt::Now().

static makeBoolean(value: bool, time: int = 0) ntcore._ntcore.Value

Creates a boolean entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeBooleanArray(value: List[bool], time: int = 0) ntcore._ntcore.Value

Creates a boolean array entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeDouble(value: float, time: int = 0) ntcore._ntcore.Value

Creates a double entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeDoubleArray(value: List[float], time: int = 0) ntcore._ntcore.Value

Creates a double array entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

@note This function moves the values out of the vector.

static makeFloat(value: float, time: int = 0) ntcore._ntcore.Value

Creates a float entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeFloatArray(value: List[float], time: int = 0) ntcore._ntcore.Value

Creates a float array entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

@note This function moves the values out of the vector.

static makeInteger(value: int, time: int = 0) ntcore._ntcore.Value

Creates an integer entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeIntegerArray(value: List[int], time: int = 0) ntcore._ntcore.Value

Creates an integer array entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

@note This function moves the values out of the vector.

static makeRaw(value: buffer, time: int = 0) ntcore._ntcore.Value

Creates a raw entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeString(value: str, time: int = 0) ntcore._ntcore.Value

Creates a string entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

static makeStringArray(value: List[str], time: int = 0) ntcore._ntcore.Value

Creates a string array entry value.

Parameters:
  • value – the value

  • time – if nonzero, the creation time to use (instead of the current time)

Returns:

The entry value

@note This function moves the values out of the vector.

static makeValue(value: handle) ntcore._ntcore.Value
server_time() int

Get the creation time of the value, in server time.

Returns:

The server time.

setServerTime(time: int) None

Set the creation time of the value, in server time.

Parameters:

time – The server time.

setTime(time: int) None

Set the local creation time of the value.

Parameters:

time – The time.

time() int

Get the creation time of the value, in local time.

Returns:

The time, in the units returned by nt::Now().

type() ntcore._ntcore.NetworkTableType

Get the data type.

Returns:

The type.

value() object

Get the data value stored.

Returns:

The type.