WRP Connector¶
The class WRPConnector is implemented in file wrp_connector.py and has this methods:
-
class
wrpclient.wrp_connector.WRPConnector¶ Finite-state machine that implements WRP and works like a middleman between cameras and driver.
-
close_camera(camera_serial_number, timeout)¶ Moves from state CAMERA_SELECTED to state CONNECTED if the server sends response on the request within the timeout.
Params
- camera_serial_number: str
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
close_camera_async(camera_serial_number)¶ Asynchronously moves from state CAMERA_SELECTED to state CONNECTED.
Params
- camera_serial_number: str
Return
None
-
connect(ip_address, port, timeout)¶ Moves from state IDLE to state CONNECTED if the connection with the server is established within the timeout.
Params
- ip_address: str, IP address of the WRP server
- port: int, port of the WRP server
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
connect_async(ip_address, port)¶ Asynchronously moves from state IDLE to state CONNECTED.
Params
- ip_address: str, IP address of the WRP server
- port: int, port of the WRP server
Return
None
-
disconnect(timeout)¶ Moves from state CONNECTED to state IDLE if the server confirms the request within the timeout.
Params
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
disconnect_async()¶ Asynchronously moves from state CONNECTED to state IDLE. Params
None
Return
None
-
get_cameras(timeout)¶ Moves from state CONNECTED to state WAITING_FOR_CAMERA_LIST and back if the server sends response on the request within the timeout.
Params
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
get_cameras_async()¶ Asynchronously moves from state CONNECTED to state WAITING_FOR_CAMERA_LIST and back.
Params
None
Return
None
-
get_frame(camera_serial_number, timeout)¶ Moves from state CAMERA_SELECTED to state WAITING_FOR_FRAME and back if the server sends response on the request within the timeout.
Params
- camera_serial_number: str
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
get_frame_async(camera_serial_number)¶ Asynchronously moves from state CAMERA_SELECTED to state WAITING_FOR_FRAME and back.
Params
- camera_serial_number: str
Return
None
-
is_camera_open(camera_serial_number)¶ Check if the camera with a given serial number is open.
Params
- camera_serial_number: str
Return
bool
-
is_connected()¶ Check if connection was established
Params
None
Return
bool
-
open_camera(camera_serial_number, timeout)¶ Moves from state CONNECTED to state CAMERA_SELECTED if the server sends response on the request within the timeout.
Params
- camera_serial_number: str
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
open_camera_async(camera_serial_number)¶ Asynchronously moves from state CONNECTED to state CAMERA_SELECTED.
Params
- camera_serial_number: str
Return
None
-
start_continuous_shot(camera_serial_number, callback, timeout)¶ Moves from state CAMERA_SELECTED to state CONTINUOUS_GRABBING if the server sends response on the request within the timeout.
Params
- camera_serial_number: str
- callback: callable
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
start_continuous_shot_async(camera_serial_number)¶ Asynchronously moves from state CAMERA_SELECTED to state CONTINUOUS_GRABBING.
Params
- camera_serial_number: str
Return
None
-
stop_continuous_shot(camera_serial_number, timeout)¶ Moves from state CONTINUOUS_GRABBING to state CAMERA_SELECTED if the server sends response on the request within the timeout.
Params
- camera_serial_number: str
- timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised
Return
None
-
stop_continuous_shot_async(camera_serial_number)¶ Asynchronously moves from state CONTINUOUS_GRABBING to state CAMERA_SELECTED.
Params
- camera_serial_number: str
Return
None
-