API reference¶
SpikeGLX-remoteCTRL¶
- class spikeGLX_remote.socket_utils.MessageStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enum for message status to be able to change the message easily across the code
- class spikeGLX_remote.socket_utils.MessageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enum for message types to be able to change the message easily across the code
- class spikeGLX_remote.socket_utils.SocketComm(soctype: str = 'server', host: str = 'localhost', port: int = 8800, use_ssl: bool = False)[source]¶
Class to handle socket communication between processes or devices :param soctype: str: type of socket, either ‘client’ or ‘server’ :param host: str: host IP address :param port: int: port number :param use_ssl: bool: use ssl encryption
- Parameters:
acception_thread – threading.Thread: thread to accept connection
ssl_sock – ssl.SSLSocket: ssl socket
sock – socket.socket: socket
_sock – socket.socket: socket
_ssl_sock – ssl.SSLSocket: ssl socket
context – ssl.SSLContext: ssl context
use_ssl – bool: use ssl encryption
connected – bool: connection status
stop_event – threading.Event: event to stop waiting for connection
log – logging.Logger: logger
message_time – float: time of last message
- read_json_message() [<class 'dict'>, None] [source]¶
Reads a json message from the socket until a linebreak is reached then decodes it via json :return: dict, None: message or None if no message is received
- read_json_message_fast() [<class 'dict'>, None] [source]¶
Reads a json message from the socket via a large bulk then decodes it via json :return: dict, None: message or None if no message is received
- read_json_message_fast_linebreak() [<class 'dict'>, None] [source]¶
Reads a json message from the socket until a linebreak is reached then decodes it via json :return: dict, None: message or None if no message is received
- send_json_message(message: dict)[source]¶
Sends a json message over the socket :param message: dict: message to send of SocketMessage type :return:
- class spikeGLX_remote.socket_utils.SocketMessage[source]¶
Class to hold all the messages that can be sent over the socket
- Parameters:
session_path – str: path to the session
fps – float: frames per second
session_id – str: session id
daq_setting_file – str: path to the daq setting file
basler_setting_file – str: path to the basler setting file
pulse_lag – int: pulse lag after DAQ start
start_daq – dict: message to start the daq
stop_daq – dict: message to stop the daq
start_daq_pulses – dict: message to start the daq pulses
stop_daq_pulses – dict: message to stop the daq pulses
start_daq_viewing – dict: message to start the daq viewing
poll_status – dict: message to poll the status
start_video_rec – dict: message to start the video recording
start_video_view – dict: message to start the video viewing
stop_video – dict: message to stop the video
start_video_calibrec – dict: message to start the calibration recording
copy_files – dict: message to copy the files
purge_files – dict: message to purge the files
view_spike_glx – dict: message to view the spike glx
start_spike_glx – dict: message to start the spike glx
stop_spike_glx – dict: message to stop the spike glx