Skip to content

Commit 81e88a1

Browse files
committed
cleanup
1 parent bae7c17 commit 81e88a1

File tree

2 files changed

+32
-16
lines changed

2 files changed

+32
-16
lines changed

modules/schema/src/main/resources/lucuma/odb/graphql/OdbSchema.graphql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,13 @@ input OffsetInput {
36563656
q: OffsetComponentInput!
36573657
}
36583658

3659+
"""
3660+
An offset generator produces a series of offsets according to generator-specific
3661+
parameters. Only (at most) one of `enumerated`, `grid`, `random` or `spiral`
3662+
will be defined. All others will be `null`. The `generatorType` corresponds to
3663+
the entry (if any) that is defined. If the generator type of `NONE`, then none
3664+
of the entries will be defined.
3665+
"""
36593666
type OffsetGenerator {
36603667
generatorType: OffsetGeneratorType!
36613668

@@ -3665,6 +3672,11 @@ type OffsetGenerator {
36653672
spiral: SpiralOffsetGenerator
36663673
}
36673674

3675+
"""
3676+
An offset generator is specified by defining one of the `enumerated`, `grid`,
3677+
`random` or `spiral` options. If none are defined, the generator type will be
3678+
`NONE`.
3679+
"""
36683680
input OffsetGeneratorInput {
36693681
enumerated: EnumeratedOffsetGeneratorInput
36703682
grid: GridOffsetGeneratorInput
@@ -3701,6 +3713,10 @@ type GridOffsetGenerator {
37013713
cornerB: Offset!
37023714
}
37033715

3716+
"""
3717+
Defines the region over which the grid pattern of offsets will be distributed.
3718+
The number of points is determined by integration time calculator results.
3719+
"""
37043720
input GridOffsetGeneratorInput {
37053721
cornerA: OffsetInput!
37063722
cornerB: OffsetInput!

modules/service/src/main/scala/lucuma/odb/graphql/mapping/TelescopeConfigMapping.scala

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ trait TelescopeConfigMapping[F[_]] extends EnumeratedOffsetView[F] with StepReco
1414
private def telescopeConfigMappingAtPath(
1515
path: Path,
1616
guidingColumn: ColumnRef,
17-
idColumns: ColumnRef*
17+
idColumns: (String, ColumnRef)*
1818
): ObjectMapping =
1919
ObjectMapping(path)(
2020
(
21-
idColumns.toList.map: ref =>
22-
SqlField(ref.column, ref, key = true, hidden = true)
21+
idColumns.toList.map: (name, ref) =>
22+
SqlField(name, ref, key = true, hidden = true)
2323
) ++ List(
2424
SqlObject("offset"),
2525
SqlField("guiding", guidingColumn)
2626
)*
2727
)
2828

29-
private def enumeratedTelescopeConfigMapping: ObjectMapping =
30-
ObjectMapping(TelescopeConfigType)(
31-
SqlField("observationId", EnumeratedOffsetView.ObservationId, key = true, hidden = true),
32-
SqlField("role", EnumeratedOffsetView.OffsetGeneratorRole, key = true, hidden = true),
33-
SqlField("index", EnumeratedOffsetView.Index, key = true, hidden = true),
34-
SqlObject("offset"),
35-
SqlField("guiding", EnumeratedOffsetView.GuideState)
36-
)
37-
38-
3929
lazy val TelescopeConfigMappings: List[ObjectMapping] =
4030
List(
41-
// telescopeConfigMappingAtPath(EnumeratedOffsetGeneratorType / "values", EnumeratedOffsetTable.GuideState, EnumeratedOffsetTable.ObservationId, EnumeratedOffsetTable.OffsetGeneratorRole, EnumeratedOffsetTable.Index),
42-
enumeratedTelescopeConfigMapping,
43-
telescopeConfigMappingAtPath(StepRecordType / "telescopeConfig", StepRecordView.GuideState, StepRecordView.Id)
31+
telescopeConfigMappingAtPath(
32+
EnumeratedOffsetGeneratorType / "values",
33+
EnumeratedOffsetView.GuideState,
34+
"observationId" -> EnumeratedOffsetView.ObservationId,
35+
"role" -> EnumeratedOffsetView.OffsetGeneratorRole,
36+
"index" -> EnumeratedOffsetView.Index
37+
),
38+
39+
telescopeConfigMappingAtPath(
40+
StepRecordType / "telescopeConfig",
41+
StepRecordView.GuideState,
42+
"id" -> StepRecordView.Id
43+
)
4444
)

0 commit comments

Comments
 (0)