pjlink1

openlp.core.lib.projector.pjlink1 module Provides the necessary functions for connecting to a PJLink-capable projector.

See PJLink Class 1 Specifications for details. http://pjlink.jbmia.or.jp/english/dl.html

Section 5-1 PJLink Specifications

Section 5-5 Guidelines for Input Terminals

NOTE:
Function names follow the following syntax:
def process_CCCC(…):
WHERE:
CCCC = PJLink command being processed.

Bases: PyQt5.QtNetwork.QTcpSocket

Socket service for connecting to a PJLink-capable projector.

changeStatus
change_status(status, msg=None)[source]

Check connection/error status, set status for projector, then emit status change signal for gui to allow changing the icons.

Parameters:
  • status – Status code
  • msg – Optional message
check_login(data=None)[source]

Processes the initial connection and authentication (if needed). Starts poll timer if connection is established.

NOTE: Qt md5 hash function doesn’t work with projector authentication. Use the python md5 hash function.

Parameters:data – Optional data if called from another routine
connect_to_host()[source]

Initiate connection to projector.

disconnect_from_host(abort=False)[source]

Close socket and cleanup.

get_available_inputs()[source]

Send command to retrieve available source inputs.

get_data()[source]

Socket interface to retrieve data.

get_error(err)[source]

Process error from SocketError signal. Remaps system error codes to projector error codes.

Parameters:err – Error code
get_error_status()[source]

Send command to retrieve currently known errors.

get_input_source()[source]

Send command to retrieve currently selected source input.

get_lamp_status()[source]

Send command to return the lap status.

get_manufacturer()[source]

Send command to retrieve manufacturer name.

get_model()[source]

Send command to retrieve the model name.

get_name()[source]

Send command to retrieve name as set by end-user (if set).

get_other_info()[source]

Send command to retrieve extra info set by manufacturer.

get_power_status()[source]

Send command to retrieve power status.

get_shutter_status()[source]

Send command to retrieve shutter status.

poll_loop()[source]

Retrieve information from projector that changes. Normally called by timer().

process_avmt(data)[source]

Process shutter and speaker status. See PJLink specification for format. Update self.mute (audio) and self.shutter (video shutter).

Parameters:data – Shutter and audio status
process_clss(data)[source]

PJLink class that this projector supports. See PJLink specification for format. Updates self.class.

Parameters:data – Class that projector supports.
process_command(cmd, data)[source]

Verifies any return error code. Calls the appropriate command handler.

Parameters:
  • cmd – Command to process
  • data – Data being processed
process_erst(data)[source]

Error status. See PJLink Specifications for format. Updates self.projector_errors

Parameters:data – Error status
process_inf1(data)[source]

Manufacturer name set in projector. Updates self.manufacturer

Parameters:data – Projector manufacturer
process_inf2(data)[source]

Projector Model set in projector. Updates self.model.

Parameters:data – Model name
process_info(data)[source]

Any extra info set in projector. Updates self.other_info.

Parameters:data – Projector other info
process_inpt(data)[source]

Current source input selected. See PJLink specification for format. Update self.source

Parameters:data – Currently selected source
process_inst(data)[source]

Available source inputs. See PJLink specification for format. Updates self.source_available

Parameters:data – Sources list
process_lamp(data)[source]

Lamp(s) status. See PJLink Specifications for format. Data may have more than 1 lamp to process. Update self.lamp dictionary with lamp status.

Parameters:data – Lamp(s) status.
process_name(data)[source]

Projector name set in projector. Updates self.pjlink_name

Parameters:data – Projector name
process_powr(data)[source]

Power status. See PJLink specification for format. Update self.power with status. Update icons if change from previous setting.

Parameters:data – Power status
projectorAuthentication
projectorNetwork
projectorNoAuthentication
projectorReceivedData
projectorStatus
projectorUpdateIcons
receive_data_signal()[source]

Clear any busy flags and send data received signal

reset_information()[source]

Reset projector-specific information to default

send_command(cmd, opts='?', salt=None, queue=False)[source]

Add command to output queue if not already in queue.

Parameters:
  • cmd – Command to send
  • opts – Command option (if any) - defaults to ‘?’ (get information)
  • salt – Optional salt for md5 hash initial authentication
  • queue – Option to force add to queue rather than sending directly
set_input_source(src=None)[source]

Verify input source available as listed in ‘INST’ command, then send the command to select the input source.

Parameters:src – Video source to select in projector
set_power_off()[source]

Send command to turn power to standby.

set_power_on()[source]

Send command to turn power to on.

set_shutter_closed()[source]

Send command to set shutter to closed position.

set_shutter_open()[source]

Send command to set shutter to open position.

socket_abort()[source]

Aborts connection and closes socket in case of brain-dead projectors. Should normally be called by socket_timer().

thread_started()[source]

Connects signals to methods when thread is started.

thread_stopped()[source]

Cleanups when thread is stopped.