Class DeviceController

Class Documentation

class DeviceController

Public Types

enum DeviceType

Values:

Serial
TCP

Public Functions

DeviceController()
DeviceController(const QString &port_name)

Constructor.

Parameters
  • port_name: The full path name to the device.

bool connect()

Connects to the device.

Return

True if a connection was established.

bool disconnect()

Disconnects the device.

Return

True if the disconnection was successful.

int get_capacity() const
QIODevice *get_device() const

Returns the actual device object.

Return

Device.

QString get_error() const
bool get_open() const

Returns whether the device is connected and writeable.

Return

True if the device is connected.

QString get_port_name() const

Returns the device’s port.

Return

Device port.

bool get_autoconnect() const

Returns whether autoconnect is enabled.

Return

True if enabled.

bool get_real_time_refresh_enabled() const

Returns whether real-time refreshing is enabled for this device.

Return

True if enabled.

void flush()

Writes any buffered data to the device.

void set_autoconnect(const bool autoconnect)

Sets whether to automatically connect to the device on startup.

Parameters
  • autoconnect: If true, autoconnect to the device.

void set_capacity(const int capacity)
void set_port_name(const QString &port_name)

Sets the device’s address.

Parameters
  • port_name: The URI of the device (can be a port name or IP address).

void set_real_time_update(const bool enabled)

Sets whether real-time refreshing is enabled for this device. Real-time refresh sends Cues to this device as they’re performed.

Parameters
  • enabled: Whether real-time refresh is enabled.

void write(const QByteArray &array)

Public Members

SectionMapModel *section_map_model = nullptr

Custom mapping of local Sections to remote Sections. Made public because of weird pointer issues. Fix later.

Public Static Attributes

const uint16_t TIMEOUT = 10000

Default connect/disconnect timeout to 10 seconds.

const uint16_t PORT_NUM = 8077