Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename start/stop service to connect/disconnect #19

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py/examples/camera_client/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def main(address: str, port: int, stream_every_n: int) -> None:
response_stream = client.stream_frames(every_n=stream_every_n)

# start the streaming service
await client.start_service()
await client.connect_to_service()

while True:
# query the service state
Expand Down
2 changes: 1 addition & 1 deletion py/examples/camera_client_gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def stream_camera(self, client: OakCameraClient) -> None:
while True:
if client.state.value != oak_pb2.OakServiceState.RUNNING:
# start the streaming service
await client.start_service()
await client.connect_to_service()
await asyncio.sleep(0.01)
continue
elif response_stream is None:
Expand Down
2 changes: 1 addition & 1 deletion py/examples/camera_pipeline/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def forward(self):

async def main():
cam = AmigaCamera("oak1")
await cam.client.start_service()
await cam.client.connect_to_service()

viz1 = OpencvWindow("viz_raw")
viz2 = OpencvWindow("viz_img")
Expand Down
4 changes: 2 additions & 2 deletions py/farm_ng/canbus/canbus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ async def get_state(self) -> CanbusServiceState:
self.logger.debug("CanbusServiceStub: port -> %i state is: %s", self.config.port, state.name)
return state

async def start_service(self) -> None:
async def connect_to_service(self) -> None:
state: CanbusServiceState = await self.get_state()
if state.value == canbus_pb2.CanbusServiceState.UNAVAILABLE:
return
await self.stub.startService(canbus_pb2.StartServiceRequest())

async def stop_service(self) -> None:
async def disconnect_from_service(self) -> None:
state: CanbusServiceState = await self.get_state()
if state.value == canbus_pb2.CanbusServiceState.UNAVAILABLE:
return
Expand Down
4 changes: 2 additions & 2 deletions py/farm_ng/controller/controller_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ async def get_state(self) -> ControllerServiceState:
self.logger.debug("ControllerServiceStub: port -> %i state is: %s", self.config.port, state)
return state

async def start_service(self) -> None:
async def connect_to_service(self) -> None:
state: ControllerServiceState = await self.get_state()
if state.value == controller_pb2.ControllerServiceState.UNAVAILABLE:
return
await self.stub.startService(controller_pb2.StartServiceRequest())

async def stop_service(self) -> None:
async def disconnect_from_service(self) -> None:
state: controller_pb2.ControllerServiceState = await self.get_state()
if state.value == controller_pb2.ControllerServiceState.UNAVAILABLE:
return
Expand Down
2 changes: 1 addition & 1 deletion py/farm_ng/oak/camera_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ async def get_state(self) -> OakCameraServiceState:
self.logger.debug("OakServiceStub: port -> %i state is: %s", self.config.port, state.name)
return state

async def start_service(self) -> None:
async def connect_to_service(self) -> None:
"""Start the camera streaming.

The service state will go from `IDLE` to `RUNNING`.
Expand Down
4 changes: 2 additions & 2 deletions py/farm_ng/state_estimator/state_estimator_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ async def get_state(self) -> StateEstimatorServiceState:
self.logger.debug("StateEstimatorServiceStub: port -> %i state is: %s", self.config.port, state)
return state

async def start_service(self) -> None:
async def connect_to_service(self) -> None:
state: StateEstimatorServiceState = await self.get_state()
if state.value == state_estimator_pb2.StateEstimatorServiceState.UNAVAILABLE:
return
await self.stub.startService(state_estimator_pb2.StartServiceRequest())

async def stop_service(self) -> None:
async def disconnect_from_service(self) -> None:
state: StateEstimatorServiceState = await self.get_state()
if state.value == state_estimator_pb2.StateEstimatorServiceState.UNAVAILABLE:
return
Expand Down