Skip to content

Commit

Permalink
Merge pull request #497 from jluhrs/guide_target_changes
Browse files Browse the repository at this point in the history
Removed target id from oiwfs target in schema.
  • Loading branch information
jluhrs authored Dec 22, 2023
2 parents 69b2754 + bada069 commit 0c169b8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ class TcsBaseControllerEpics[F[_]: Async: Parallel](
)
.compose(tcsConfig.sourceATarget.wavelength.map(setSourceAWalength).getOrElse(identity))
.compose(setSlewOptions(slewOptions))
.compose(setRotatorIaa(tcsConfig.instrumentSpecifics.iaa))
.compose(setFocusOffset(tcsConfig.instrumentSpecifics.focusOffset))
.compose(setOrigin(tcsConfig.instrumentSpecifics.origin))
.compose(setInstrumentSpecifics(tcsConfig.instrumentSpecifics))
.compose(
tcsConfig.oiwfs
.map(o =>
Expand Down
8 changes: 7 additions & 1 deletion modules/web/server/src/main/resources/NewTCC.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ input TargetPropertiesInput {
wavelength: WavelengthInput
}

input GuideTargetPropertiesInput {
name: NonEmptyString!
sidereal: SiderealInput
nonsidereal: NonsiderealInput
}

type Distance {
micrometers: Long!
millimeters: BigDecimal!
Expand Down Expand Up @@ -78,7 +84,7 @@ type TelescopeStatus {
}

input GuiderConfig{
target: TargetPropertiesInput!
target: GuideTargetPropertiesInput!
tracking: ProbeTrackingInput!
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,16 @@ object NavigateMappings extends GrackleParsers {
)
} yield bt

def parseGuideTargetInput(l: List[(String, Value)]): Option[Target] = for {
nm <- l.collectFirst { case ("name", StringValue(v)) => v }
bt <- l.collectFirst { case ("sidereal", ObjectValue(v)) => v }
.flatMap[Target](parseSiderealTarget(nm, None, _))
.orElse(
l.collectFirst { case ("nonsidereal", ObjectValue(v)) => v }
.flatMap(parseNonSiderealTarget(nm, None, _))
)
} yield bt

def parseTrackingInput(l: List[(String, Value)]): Option[TrackingConfig] = for {
aa <- l.collectFirst { case ("nodAchopA", BooleanValue(v)) => v }
ab <- l.collectFirst { case ("nodAchopB", BooleanValue(v)) => v }
Expand All @@ -611,7 +621,7 @@ object NavigateMappings extends GrackleParsers {
)

def parseGuiderConfig(l: List[(String, Value)]): Option[GuiderConfig] = for {
target <- l.collectFirst { case ("target", ObjectValue(v)) => parseTargetInput(v) }.flatten
target <- l.collectFirst { case ("target", ObjectValue(v)) => parseGuideTargetInput(v) }.flatten
tracking <- l.collectFirst { case ("tracking", ObjectValue(v)) =>
parseTrackingInput(v)
}.flatten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class NavigateMappingsTest extends CatsEffectSuite {
| }
| oiwfs: {
| target: {
| id: "T0002"
| name: "OiwfsDummy"
| sidereal: {
| ra: {
Expand Down Expand Up @@ -232,7 +231,6 @@ class NavigateMappingsTest extends CatsEffectSuite {
| }
| oiwfs: {
| target: {
| id: "T0002"
| name: "OiwfsDummy"
| sidereal: {
| ra: {
Expand Down
4 changes: 2 additions & 2 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ object Settings {
// Lucuma
val lucumaCore = "0.91.0"
val lucumaUI = "0.66.0"
val lucumaSchemas = "0.67.0"
val lucumaSchemas = "0.68.0"

val grackle = "0.18.0"

val graphQLRoutes = "0.8.6"

val clue = "0.24.1"
val clue = "0.35.0"

val sttp = "3.9.1"

Expand Down

0 comments on commit 0c169b8

Please sign in to comment.