Compare commits
10 Commits
shot-simul
...
dean/pool-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa14becc12 | ||
| fea506af1b | |||
| 2f9dc86ad9 | |||
| e2fe6cadda | |||
| aafdab5d4d | |||
| adf05e3c28 | |||
| 5391466e90 | |||
| 257dcdc31a | |||
|
|
b41365e99e | ||
|
|
0e8233a5d5 |
2072
src/index.tsx
2072
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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,8 @@ fragment VideoExportJobFields on VideoExportJobGQL {
|
|||||||
videoId
|
videoId
|
||||||
mode
|
mode
|
||||||
status
|
status
|
||||||
|
videoName
|
||||||
|
videoThumbnailUri
|
||||||
shotIds
|
shotIds
|
||||||
runId
|
runId
|
||||||
downloadUrl
|
downloadUrl
|
||||||
@@ -17,6 +19,10 @@ mutation RequestVideoExport($input: RequestVideoExportInput!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mutation DismissVideoExport($jobId: Int!) {
|
||||||
|
dismissVideoExport(jobId: $jobId)
|
||||||
|
}
|
||||||
|
|
||||||
query VideoExportJob($jobId: Int!) {
|
query VideoExportJob($jobId: Int!) {
|
||||||
videoExportJob(jobId: $jobId) {
|
videoExportJob(jobId: $jobId) {
|
||||||
...VideoExportJobFields
|
...VideoExportJobFields
|
||||||
|
|||||||
130
src/schema.gql
130
src/schema.gql
@@ -52,6 +52,12 @@ type Query {
|
|||||||
filters: NotificationFilters = null
|
filters: NotificationFilters = null
|
||||||
): NotificationConnection!
|
): NotificationConnection!
|
||||||
unreadNotificationCount: Int!
|
unreadNotificationCount: Int!
|
||||||
|
poolHalls: [PoolHall!]!
|
||||||
|
claimablePoolHalls: [PoolHall!]!
|
||||||
|
poolHallCameras(poolHallId: ID!): [PoolHallCamera!]!
|
||||||
|
claimableCameras(poolHallId: ID!): [PoolHallCamera!]!
|
||||||
|
cameraClaimSession(id: ID!): CameraClaimSession
|
||||||
|
activeCameraLease: CameraLease
|
||||||
getRuns(
|
getRuns(
|
||||||
filterInput: RunFilterInput!
|
filterInput: RunFilterInput!
|
||||||
runIds: [Int!] = null
|
runIds: [Int!] = null
|
||||||
@@ -67,6 +73,11 @@ type Query {
|
|||||||
useHomography: HomographyInputGQL = null
|
useHomography: HomographyInputGQL = null
|
||||||
): TableStateGQL!
|
): TableStateGQL!
|
||||||
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
simulateShot(simulationInput: SimulateShotInputGQL!): ShotProjectionGQL!
|
||||||
|
computePotAim(
|
||||||
|
simulationInput: SimulateShotInputGQL!
|
||||||
|
targetBallId: Int!
|
||||||
|
pocket: PocketIdentifier!
|
||||||
|
): PotAimGQL!
|
||||||
getOrderedShots(
|
getOrderedShots(
|
||||||
filterInput: FilterInput!
|
filterInput: FilterInput!
|
||||||
ids: [Int!] = null
|
ids: [Int!] = null
|
||||||
@@ -716,6 +727,7 @@ type DeployedConfigGQL {
|
|||||||
subscriptionGatingEnabled: Boolean!
|
subscriptionGatingEnabled: Boolean!
|
||||||
quotaEnforcementEnabled: Boolean!
|
quotaEnforcementEnabled: Boolean!
|
||||||
storageLimitEnforcementEnabled: Boolean!
|
storageLimitEnforcementEnabled: Boolean!
|
||||||
|
capabilityEnforcementEnabled: Boolean!
|
||||||
bannerMessages: [BannerGQL!]!
|
bannerMessages: [BannerGQL!]!
|
||||||
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
defaultAndroidRecordingFormat: StreamSegmentTypeEnum!
|
||||||
bucketUrl: String!
|
bucketUrl: String!
|
||||||
@@ -876,6 +888,63 @@ input NotificationFilters {
|
|||||||
notificationTypes: [NotificationTypeEnum!] = null
|
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 {
|
type GetRunsResult {
|
||||||
runs: [RunGQL!]!
|
runs: [RunGQL!]!
|
||||||
count: Int
|
count: Int
|
||||||
@@ -1030,6 +1099,17 @@ input SimulationBallStateInputGQL {
|
|||||||
position: [Float!]!
|
position: [Float!]!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PotAimGQL {
|
||||||
|
phi: Float!
|
||||||
|
geometricPhi: Float!
|
||||||
|
cutAngle: Float!
|
||||||
|
requiredPrecision: Float!
|
||||||
|
feasible: Boolean!
|
||||||
|
potted: Boolean!
|
||||||
|
converged: Boolean!
|
||||||
|
occludingBallIds: [Int!]!
|
||||||
|
}
|
||||||
|
|
||||||
type GetShotsResult {
|
type GetShotsResult {
|
||||||
shots: [ShotGQL!]!
|
shots: [ShotGQL!]!
|
||||||
count: Int
|
count: Int
|
||||||
@@ -1233,6 +1313,8 @@ type VideoExportJobGQL {
|
|||||||
videoId: Int!
|
videoId: Int!
|
||||||
mode: VideoExportModeEnum!
|
mode: VideoExportModeEnum!
|
||||||
status: VideoExportStatusEnum!
|
status: VideoExportStatusEnum!
|
||||||
|
videoName: String
|
||||||
|
videoThumbnailUri: String
|
||||||
shotIds: [Int!]
|
shotIds: [Int!]
|
||||||
runId: Int
|
runId: Int
|
||||||
downloadUrl: String
|
downloadUrl: String
|
||||||
@@ -1312,6 +1394,15 @@ type Mutation {
|
|||||||
markAllNotificationsAsRead: Boolean!
|
markAllNotificationsAsRead: Boolean!
|
||||||
markNotificationsAsRead(notificationIds: [Int!]!): Boolean!
|
markNotificationsAsRead(notificationIds: [Int!]!): Boolean!
|
||||||
deleteNotification(notificationId: 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(
|
finalizePlayerAssignments(
|
||||||
input: FinalizePlayerAssignmentsInput!
|
input: FinalizePlayerAssignmentsInput!
|
||||||
): [PlayerClusterGQL!]!
|
): [PlayerClusterGQL!]!
|
||||||
@@ -1358,6 +1449,7 @@ type Mutation {
|
|||||||
metadata: CancellationFeedbackMetadataInput = null
|
metadata: CancellationFeedbackMetadataInput = null
|
||||||
): Boolean!
|
): Boolean!
|
||||||
requestVideoExport(input: RequestVideoExportInput!): VideoExportJobGQL!
|
requestVideoExport(input: RequestVideoExportInput!): VideoExportJobGQL!
|
||||||
|
dismissVideoExport(jobId: Int!): Boolean!
|
||||||
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
|
findPrerecordTableLayout(b64Image: String!, videoId: Int!): HomographyInfoGQL
|
||||||
createUploadStream(
|
createUploadStream(
|
||||||
videoMetadata: VideoMetadataInput!
|
videoMetadata: VideoMetadataInput!
|
||||||
@@ -1390,6 +1482,44 @@ enum ReportReasonEnum {
|
|||||||
OTHER
|
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 {
|
input FinalizePlayerAssignmentsInput {
|
||||||
videoId: Int!
|
videoId: Int!
|
||||||
clusterAssignments: [ClusterAssignmentInput!]! = []
|
clusterAssignments: [ClusterAssignmentInput!]! = []
|
||||||
|
|||||||
Reference in New Issue
Block a user