jvconnected.interfaces.tslumd

jvconnected.interfaces.tslumd.umd_io

class jvconnected.interfaces.tslumd.umd_io.UmdIo(*args, **kwargs)[source]

Bases: Interface

Main UMD interface

DictProperty device_maps: Dict[int, DeviceMapping]

A dict of DeviceMapping definitions stored with their device_index as keys

device_maps is a pydispatch.DictProperty object.

DictProperty mapped_devices: Dict[int, MappedDevice]

A dict of MappedDevice stored with the device_index of their map as keys

mapped_devices is a pydispatch.DictProperty object.

Event on_tally_added(tally: Tally)[source]

Fired when a tslumd.tallyobj.Tally instance is added to tallies

on_tally_added is a pydispatch.Event object.

Event on_tally_updated(tally: Tally)[source]

Fired when any tslumd.tallyobj.Tally instance has been updated

on_tally_updated is a pydispatch.Event object.

interface_name: ClassVar[str] = 'tslumd'

Unique name for the interface. Must be defined by subclasses

Property hostaddr: str = '0.0.0.0'

Alias for tslumd.receiver.UmdReceiver.hostaddr

hostaddr is a pydispatch.Property object.

Property hostport: int = 65000

Alias for tslumd.receiver.UmdReceiver.hostport

hostport is a pydispatch.Property object.

property tallies: Dict[int, Tally]

Alias for tslumd.receiver.UmdReceiver.tallies

async set_engine(engine: jvconnected.engine.Engine)[source]

Attach the interface to a running instance of jvconnected.engine.Engine

This will be called automatically by the engine if the class is in the jvconnected.interfaces.registry.

If the engine is running, the interface will start (using the open() method). Otherwise it will automatically start when the engine does.

async open()[source]

Open all communication methods

async close()[source]

Stop communication

async set_bind_address(hostaddr: str, hostport: int)[source]

Set the hostaddr and hostport and restart the server

async set_hostaddr(hostaddr: str)[source]

Set the hostaddr and restart the server

async set_hostport(hostport: int)[source]

Set the hostport and restart the server

async add_device_mapping(device_map: DeviceMapping)[source]

Add a DeviceMapping definition to device_maps and update the config.

An instance of MappedDevice is also created and associated with its Device if found in the engine.

async remove_device_mapping(device_index: int)[source]

Remove a DeviceMapping and its associated MappedDevice by the given device index

update_config(*args, **kwargs)[source]

Update the config with current state

jvconnected.interfaces.tslumd.mapper

class jvconnected.interfaces.tslumd.mapper.TallyMap(screen_index: int = 0, tally_index: int = 0, tally_type: TallyType = TallyType.no_tally)[source]

Bases: object

Map to a single tally type within a specific tslumd.tallyobj.Tally by its index

screen_index: int = 0

The tslumd.tallyobj.Screen.index

tally_index: int = 0

The index

tally_type: TallyType = 0

The TallyType

class jvconnected.interfaces.tslumd.mapper.DeviceMapping(device_index: int, program: ~jvconnected.interfaces.tslumd.mapper.TallyMap = <factory>, preview: ~jvconnected.interfaces.tslumd.mapper.TallyMap = <factory>)[source]

Bases: object

Map the preview and program tallies from UMD to a jvconnected.device.Device

This only defines the mapping, the functionality itself is carried out by MappedDevice.

device_index: int

The device_index to associate with this mapping

program: TallyMap

Definition for program tally

preview: TallyMap

Definition for preview tally

class jvconnected.interfaces.tslumd.mapper.MappedDevice(umd_io: jvconnected.interfaces.tslumd.umd_io.UmdIo, map: DeviceMapping)[source]

Bases: object

Link between Tally objects and a jvconnected.device.Device

umd_io: jvconnected.interfaces.tslumd.umd_io.UmdIo

UmdIo instance

map: DeviceMapping

Mapping definitions for the device

device: Optional[jvconnected.device.Device]

The device instance

program_tally: Optional[TallyMap]

The Tally mapped to jvconnected.device.TallyParams.program

preview_tally: Optional[TallyMap]

The Tally mapped to jvconnected.device.TallyParams.preview

tally_state: TallyState

The current state

async set_device(device: Optional[jvconnected.device.Device])[source]

Set the device and update its tally state

get_tallies() bool[source]

Attempt to find the Tally objects in the umd_io

Returns

True if an update is needed

(a tally object either changed or was found)

Return type

bool

update_tally_state(*args, **kwargs)[source]

Update the tally_state using both program_tally and preview_tally. Since they are mutually exclusive in the device, priority is given to program_tally.

Returns

True if the state changed

Return type

bool

async update_device_tally(*args, **kwargs)[source]

Update the tally state (using update_tally_state()) and send changes to the device