Skip to content

Commit

Permalink
update web interface grpc call
Browse files Browse the repository at this point in the history
  • Loading branch information
Scretch9 committed Dec 15, 2023
1 parent 3bc70e3 commit b2d091f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/FieldElementSubsystems.Test/Point/PointTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public async Task Test_Timeout()

// Assert
Assert.Equal(GenericPointPosition.NoEndPosition, point.PointState.PointPosition);
mockConnection.Verify(v => v.SendTimeoutMessage(), Times.Once());
}

[Theory]
Expand Down
2 changes: 1 addition & 1 deletion src/Point/rasta-point-web/src/Point.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Point extends Component<{}, PointState> {
<button onClick={async () => {
let request = new SimulatedPositionMessage();
request.setPosition(PreventedPosition.PREVENTTRAILED);
await client.preventEndPosition(request, null);
await client.putIntoUnintendedPosition(request, null);
}}>Set to unintended position</button>
<p></p>
<button onClick={async () => {
Expand Down
43 changes: 43 additions & 0 deletions src/Point/rasta-point-web/src/proto/PointServiceClientPb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,49 @@ export class PointClient {
this.methodDescriptorPreventEndPosition);
}

methodDescriptorPutIntoUnintendedPosition = new grpcWeb.MethodDescriptor(
'/point.Point/PutIntoUnintendedPosition',
grpcWeb.MethodType.UNARY,
point_pb.SimulatedPositionMessage,
google_protobuf_empty_pb.Empty,
(request: point_pb.SimulatedPositionMessage) => {
return request.serializeBinary();
},
google_protobuf_empty_pb.Empty.deserializeBinary
);

putIntoUnintendedPosition(
request: point_pb.SimulatedPositionMessage,
metadata: grpcWeb.Metadata | null): Promise<google_protobuf_empty_pb.Empty>;

putIntoUnintendedPosition(
request: point_pb.SimulatedPositionMessage,
metadata: grpcWeb.Metadata | null,
callback: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void): grpcWeb.ClientReadableStream<google_protobuf_empty_pb.Empty>;

putIntoUnintendedPosition(
request: point_pb.SimulatedPositionMessage,
metadata: grpcWeb.Metadata | null,
callback?: (err: grpcWeb.RpcError,
response: google_protobuf_empty_pb.Empty) => void) {
if (callback !== undefined) {
return this.client_.rpcCall(
this.hostname_ +
'/point.Point/PutIntoUnintendedPosition',
request,
metadata || {},
this.methodDescriptorPutIntoUnintendedPosition,
callback);
}
return this.client_.unaryCall(
this.hostname_ +
'/point.Point/PutIntoUnintendedPosition',
request,
metadata || {},
this.methodDescriptorPutIntoUnintendedPosition);
}

methodDescriptorPutInEndPosition = new grpcWeb.MethodDescriptor(
'/point.Point/PutInEndPosition',
grpcWeb.MethodType.UNARY,
Expand Down

0 comments on commit b2d091f

Please sign in to comment.