Compare commits
12 Commits
dean/expor
...
dean/pool-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8655cb75fc | ||
|
|
87d40eb990 | ||
| 2f9dc86ad9 | |||
| e2fe6cadda | |||
| aafdab5d4d | |||
| adf05e3c28 | |||
| 64bc5c723a | |||
| 5391466e90 | |||
| 4ff2db1ef4 | |||
| 257dcdc31a | |||
| 8111042936 | |||
| d6fd68c1f6 |
2067
src/index.tsx
2067
src/index.tsx
File diff suppressed because it is too large
Load Diff
152
src/operations/pool_hall.gql
Normal file
152
src/operations/pool_hall.gql
Normal file
@@ -0,0 +1,152 @@
|
||||
fragment PoolHallFields on PoolHall {
|
||||
id
|
||||
name
|
||||
address
|
||||
latitude
|
||||
longitude
|
||||
timezone
|
||||
status
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
|
||||
fragment PoolHallCameraFields on PoolHallCamera {
|
||||
id
|
||||
poolHallId
|
||||
name
|
||||
tableLabel
|
||||
streamPath
|
||||
status
|
||||
lastPublishedAt
|
||||
lastUnpublishedAt
|
||||
createdAt
|
||||
updatedAt
|
||||
}
|
||||
|
||||
fragment PoolHallCameraWithHallFields on PoolHallCamera {
|
||||
...PoolHallCameraFields
|
||||
poolHall {
|
||||
...PoolHallFields
|
||||
}
|
||||
}
|
||||
|
||||
fragment PoolHallCameraStreamCredentialsFields on PoolHallCameraStreamCredentials {
|
||||
streamKey
|
||||
rtmpPath
|
||||
camera {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
fragment CameraClaimSessionFields on CameraClaimSession {
|
||||
id
|
||||
cameraId
|
||||
userId
|
||||
challengeCode
|
||||
status
|
||||
expiresAt
|
||||
detectedAt
|
||||
failedAt
|
||||
failureReason
|
||||
createdAt
|
||||
updatedAt
|
||||
camera {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
fragment CameraLeaseFields on CameraLease {
|
||||
id
|
||||
cameraId
|
||||
claimSessionId
|
||||
userId
|
||||
videoId
|
||||
status
|
||||
startedAt
|
||||
endedAt
|
||||
expiresAt
|
||||
endReason
|
||||
createdAt
|
||||
updatedAt
|
||||
camera {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetPoolHalls {
|
||||
poolHalls {
|
||||
...PoolHallFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetClaimablePoolHalls {
|
||||
claimablePoolHalls {
|
||||
...PoolHallFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetPoolHallCameras($poolHallId: ID!) {
|
||||
poolHallCameras(poolHallId: $poolHallId) {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetClaimableCameras($poolHallId: ID!) {
|
||||
claimableCameras(poolHallId: $poolHallId) {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetCameraClaimSession($id: ID!) {
|
||||
cameraClaimSession(id: $id) {
|
||||
...CameraClaimSessionFields
|
||||
}
|
||||
}
|
||||
|
||||
query GetActiveCameraLease {
|
||||
activeCameraLease {
|
||||
...CameraLeaseFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation CreatePoolHall($input: CreatePoolHallInput!) {
|
||||
createPoolHall(input: $input) {
|
||||
...PoolHallFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation UpdatePoolHall($input: UpdatePoolHallInput!) {
|
||||
updatePoolHall(input: $input) {
|
||||
...PoolHallFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation CreatePoolHallCamera($input: CreatePoolHallCameraInput!) {
|
||||
createPoolHallCamera(input: $input) {
|
||||
...PoolHallCameraStreamCredentialsFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation UpdatePoolHallCamera($input: UpdatePoolHallCameraInput!) {
|
||||
updatePoolHallCamera(input: $input) {
|
||||
...PoolHallCameraWithHallFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation RotatePoolHallCameraStreamKey($cameraId: ID!) {
|
||||
rotatePoolHallCameraStreamKey(cameraId: $cameraId) {
|
||||
...PoolHallCameraStreamCredentialsFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation CreateCameraClaimSession($cameraId: ID!) {
|
||||
createCameraClaimSession(cameraId: $cameraId) {
|
||||
...CameraClaimSessionFields
|
||||
}
|
||||
}
|
||||
|
||||
mutation CancelCameraClaimSession($claimSessionId: ID!) {
|
||||
cancelCameraClaimSession(claimSessionId: $claimSessionId) {
|
||||
...CameraClaimSessionFields
|
||||
}
|
||||
}
|
||||
57
src/operations/shot_simulation.gql
Normal file
57
src/operations/shot_simulation.gql
Normal file
@@ -0,0 +1,57 @@
|
||||
query GetTableState(
|
||||
$b64Image: String!
|
||||
$tableSize: Float
|
||||
$useHomography: HomographyInputGQL
|
||||
) {
|
||||
getTableState(
|
||||
b64Image: $b64Image
|
||||
tableSize: $tableSize
|
||||
useHomography: $useHomography
|
||||
) {
|
||||
identifierToPosition
|
||||
}
|
||||
}
|
||||
|
||||
query SimulateShot($simulationInput: SimulateShotInputGQL!) {
|
||||
simulateShot(simulationInput: $simulationInput) {
|
||||
trajectories {
|
||||
ballId
|
||||
points {
|
||||
time
|
||||
position
|
||||
}
|
||||
}
|
||||
events {
|
||||
eventType
|
||||
time
|
||||
ballIds
|
||||
position
|
||||
}
|
||||
finalState {
|
||||
ballId
|
||||
position
|
||||
}
|
||||
pottedBallIds
|
||||
}
|
||||
}
|
||||
|
||||
query ComputePotAim(
|
||||
$simulationInput: SimulateShotInputGQL!
|
||||
$targetBallId: Int!
|
||||
$pocket: PocketIdentifier!
|
||||
) {
|
||||
computePotAim(
|
||||
simulationInput: $simulationInput
|
||||
targetBallId: $targetBallId
|
||||
pocket: $pocket
|
||||
) {
|
||||
phi
|
||||
geometricPhi
|
||||
cutAngle
|
||||
requiredPrecision
|
||||
feasible
|
||||
potted
|
||||
converged
|
||||
occludingBallIds
|
||||
}
|
||||
}
|
||||
187
src/schema.gql
187
src/schema.gql
@@ -52,6 +52,12 @@ type Query {
|
||||
filters: NotificationFilters = null
|
||||
): NotificationConnection!
|
||||
unreadNotificationCount: Int!
|
||||
poolHalls: [PoolHall!]!
|
||||
claimablePoolHalls: [PoolHall!]!
|
||||
poolHallCameras(poolHallId: ID!): [PoolHallCamera!]!
|
||||
claimableCameras(poolHallId: ID!): [PoolHallCamera!]!
|
||||
cameraClaimSession(id: ID!): CameraClaimSession
|
||||
activeCameraLease: CameraLease
|
||||
getRuns(
|
||||
filterInput: RunFilterInput!
|
||||
runIds: [Int!] = null
|
||||
@@ -66,6 +72,12 @@ type Query {
|
||||
tableSize: Float = 100
|
||||
useHomography: HomographyInputGQL = null
|
||||
): TableStateGQL!
|
||||
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
||||
computePotAim(
|
||||
simulationInput: SimulateShotInputGQL!
|
||||
targetBallId: Int!
|
||||
pocket: PocketIdentifier!
|
||||
): PotAimGQL!
|
||||
getOrderedShots(
|
||||
filterInput: FilterInput!
|
||||
ids: [Int!] = null
|
||||
@@ -715,6 +727,7 @@ type DeployedConfigGQL {
|
||||
subscriptionGatingEnabled: Boolean!
|
||||
quotaEnforcementEnabled: Boolean!
|
||||
storageLimitEnforcementEnabled: Boolean!
|
||||
capabilityEnforcementEnabled: Boolean!
|
||||
bannerMessages: [BannerGQL!]!
|
||||
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
||||
bucketUrl: String!
|
||||
@@ -875,6 +888,63 @@ input NotificationFilters {
|
||||
notificationTypes: [NotificationTypeEnum!] = null
|
||||
}
|
||||
|
||||
type PoolHall {
|
||||
id: ID!
|
||||
name: String!
|
||||
address: String
|
||||
latitude: Float
|
||||
longitude: Float
|
||||
timezone: String
|
||||
status: String!
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
}
|
||||
|
||||
type PoolHallCamera {
|
||||
id: ID!
|
||||
poolHallId: ID!
|
||||
name: String!
|
||||
tableLabel: String
|
||||
streamPath: String!
|
||||
status: String!
|
||||
lastPublishedAt: DateTime
|
||||
lastUnpublishedAt: DateTime
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
poolHall: PoolHall!
|
||||
}
|
||||
|
||||
type CameraClaimSession {
|
||||
id: ID!
|
||||
cameraId: ID!
|
||||
userId: ID!
|
||||
challengeCode: String!
|
||||
status: String!
|
||||
expiresAt: DateTime!
|
||||
detectedAt: DateTime
|
||||
failedAt: DateTime
|
||||
failureReason: String
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
camera: PoolHallCamera!
|
||||
}
|
||||
|
||||
type CameraLease {
|
||||
id: ID!
|
||||
cameraId: ID!
|
||||
claimSessionId: ID
|
||||
userId: ID!
|
||||
videoId: ID
|
||||
status: String!
|
||||
startedAt: DateTime!
|
||||
endedAt: DateTime
|
||||
expiresAt: DateTime
|
||||
endReason: String
|
||||
createdAt: DateTime!
|
||||
updatedAt: DateTime!
|
||||
camera: PoolHallCamera!
|
||||
}
|
||||
|
||||
type GetRunsResult {
|
||||
runs: [RunGQL!]!
|
||||
count: Int
|
||||
@@ -970,6 +1040,76 @@ input IntPoint2DInput {
|
||||
y: Int!
|
||||
}
|
||||
|
||||
type ShotProjectionGQL {
|
||||
trajectories: [BallTrajectoryGQL!]!
|
||||
events: [SimulationEventGQL!]!
|
||||
finalState: [SimulationBallStateGQL!]!
|
||||
pottedBallIds: [Int!]!
|
||||
}
|
||||
|
||||
type BallTrajectoryGQL {
|
||||
ballId: Int!
|
||||
points: [TrajectoryPointGQL!]!
|
||||
}
|
||||
|
||||
type TrajectoryPointGQL {
|
||||
time: Float!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
type SimulationEventGQL {
|
||||
eventType: SimulationEventType!
|
||||
time: Float!
|
||||
ballIds: [Int!]!
|
||||
position: [Float!]
|
||||
}
|
||||
|
||||
enum SimulationEventType {
|
||||
STICK_BALL
|
||||
BALL_BALL
|
||||
BALL_CUSHION
|
||||
BALL_POCKET
|
||||
BALL_STOP
|
||||
}
|
||||
|
||||
type SimulationBallStateGQL {
|
||||
ballId: Int!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
input SimulateShotInputGQL {
|
||||
cueBallId: Int!
|
||||
strike: CueStrikeInputGQL!
|
||||
balls: [SimulationBallStateInputGQL!] = null
|
||||
b64Image: String = null
|
||||
useHomography: HomographyInputGQL = null
|
||||
tableSize: Float = null
|
||||
}
|
||||
|
||||
input CueStrikeInputGQL {
|
||||
v0: Float!
|
||||
phi: Float!
|
||||
theta: Float! = 0
|
||||
a: Float! = 0
|
||||
b: Float! = 0
|
||||
}
|
||||
|
||||
input SimulationBallStateInputGQL {
|
||||
ballId: Int!
|
||||
position: [Float!]!
|
||||
}
|
||||
|
||||
type PotAimGQL {
|
||||
phi: Float!
|
||||
geometricPhi: Float!
|
||||
cutAngle: Float!
|
||||
requiredPrecision: Float!
|
||||
feasible: Boolean!
|
||||
potted: Boolean!
|
||||
converged: Boolean!
|
||||
occludingBallIds: [Int!]!
|
||||
}
|
||||
|
||||
type GetShotsResult {
|
||||
shots: [ShotGQL!]!
|
||||
count: Int
|
||||
@@ -1254,6 +1394,15 @@ type Mutation {
|
||||
markAllNotificationsAsRead: Boolean!
|
||||
markNotificationsAsRead(notificationIds: [Int!]!): Boolean!
|
||||
deleteNotification(notificationId: Int!): Boolean!
|
||||
createPoolHall(input: CreatePoolHallInput!): PoolHall!
|
||||
updatePoolHall(input: UpdatePoolHallInput!): PoolHall!
|
||||
createPoolHallCamera(
|
||||
input: CreatePoolHallCameraInput!
|
||||
): PoolHallCameraStreamCredentials!
|
||||
updatePoolHallCamera(input: UpdatePoolHallCameraInput!): PoolHallCamera!
|
||||
rotatePoolHallCameraStreamKey(cameraId: ID!): PoolHallCameraStreamCredentials!
|
||||
createCameraClaimSession(cameraId: ID!): CameraClaimSession!
|
||||
cancelCameraClaimSession(claimSessionId: ID!): CameraClaimSession!
|
||||
finalizePlayerAssignments(
|
||||
input: FinalizePlayerAssignmentsInput!
|
||||
): [PlayerClusterGQL!]!
|
||||
@@ -1333,6 +1482,44 @@ enum ReportReasonEnum {
|
||||
OTHER
|
||||
}
|
||||
|
||||
input CreatePoolHallInput {
|
||||
name: String!
|
||||
address: String = null
|
||||
latitude: Float = null
|
||||
longitude: Float = null
|
||||
timezone: String = null
|
||||
}
|
||||
|
||||
input UpdatePoolHallInput {
|
||||
id: ID!
|
||||
name: String = null
|
||||
address: String = null
|
||||
latitude: Float = null
|
||||
longitude: Float = null
|
||||
timezone: String = null
|
||||
status: String = null
|
||||
}
|
||||
|
||||
type PoolHallCameraStreamCredentials {
|
||||
camera: PoolHallCamera!
|
||||
streamKey: String!
|
||||
rtmpPath: String!
|
||||
}
|
||||
|
||||
input CreatePoolHallCameraInput {
|
||||
poolHallId: ID!
|
||||
name: String!
|
||||
tableLabel: String = null
|
||||
streamPath: String = null
|
||||
}
|
||||
|
||||
input UpdatePoolHallCameraInput {
|
||||
id: ID!
|
||||
name: String = null
|
||||
tableLabel: String = null
|
||||
status: String = null
|
||||
}
|
||||
|
||||
input FinalizePlayerAssignmentsInput {
|
||||
videoId: Int!
|
||||
clusterAssignments: [ClusterAssignmentInput!]! = []
|
||||
|
||||
Reference in New Issue
Block a user