Skip to content

Commit

Permalink
add missing extras
Browse files Browse the repository at this point in the history
  • Loading branch information
gloriacai01 committed Sep 4, 2024
1 parent dda9b4e commit bc1bc9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class GantryRPCClient(name: String, channel: Channel) : Gantry(name) {
}

override fun moveToPosition(positions: List<Double>, speeds: List<Double>, extra: Struct) {
val request =MoveToPositionRequest.newBuilder().setName(this.name.name).addAllPositionsMm(positions).addAllSpeedsMmPerSec(speeds).build()
val request =MoveToPositionRequest.newBuilder().setName(this.name.name).setExtra(extra).addAllPositionsMm(positions).addAllSpeedsMmPerSec(speeds).build()
this.client.moveToPosition(request)
}

override fun home(extra: Struct): Boolean {
val request = HomeRequest.newBuilder().setName(this.name.name).build()
val request = HomeRequest.newBuilder().setName(this.name.name).setExtra(extra).build()
val response = this.client.home(request)
return response.homed
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ internal class GantryRPCService(private val manager: ResourceManager) : GantrySe
request: GetPositionRequest, responseObserver: StreamObserver<GetPositionResponse>
) {
val gantry = getResource(Gantry.named(request.name))
val position = gantry.getPosition()
val position = gantry.getPosition(request.extra)
responseObserver.onNext(GetPositionResponse.newBuilder().addAllPositionsMm(position).build())
responseObserver.onCompleted()
}
Expand All @@ -25,28 +25,28 @@ internal class GantryRPCService(private val manager: ResourceManager) : GantrySe
request: MoveToPositionRequest, responseObserver: StreamObserver<MoveToPositionResponse>
) {
val gantry = getResource(Gantry.named(request.name))
gantry.moveToPosition(request.positionsMmList, request.speedsMmPerSecList)
gantry.moveToPosition(request.positionsMmList, request.speedsMmPerSecList, request.extra)
responseObserver.onNext(MoveToPositionResponse.newBuilder().build())
responseObserver.onCompleted()
}

override fun home(request: HomeRequest, responseObserver: StreamObserver<HomeResponse>) {
val gantry = getResource(Gantry.named(request.name))
val homed = gantry.home()
val homed = gantry.home(request.extra)
responseObserver.onNext(HomeResponse.newBuilder().setHomed(homed).build())
responseObserver.onCompleted()
}

override fun getLengths(request: GetLengthsRequest, responseObserver: StreamObserver<GetLengthsResponse>) {
val gantry = getResource(Gantry.named(request.name))
val lengths = gantry.getLengths()
val lengths = gantry.getLengths(request.extra)
responseObserver.onNext(GetLengthsResponse.newBuilder().addAllLengthsMm(lengths).build())
responseObserver.onCompleted()
}

override fun stop(request: StopRequest, responseObserver: StreamObserver<StopResponse>) {
val gantry = getResource(Gantry.named(request.name))
gantry.stop()
gantry.stop(request.extra)
responseObserver.onNext(StopResponse.newBuilder().build())
responseObserver.onCompleted()
}
Expand Down

0 comments on commit bc1bc9a

Please sign in to comment.