From bada069a017903c6af0df78837a012dc1cc20db1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=BChrs?= Date: Fri, 22 Dec 2023 09:36:46 -0300 Subject: [PATCH] Removed target id from oiwfs target in schema. --- .../navigate/server/tcs/TcsBaseControllerEpics.scala | 4 +--- modules/web/server/src/main/resources/NewTCC.graphql | 8 +++++++- .../web/server/http4s/NavigateMappings.scala | 12 +++++++++++- .../web/server/http4s/NavigateMappingsTest.scala | 2 -- project/Settings.scala | 4 ++-- 5 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/server/src/main/scala/navigate/server/tcs/TcsBaseControllerEpics.scala b/modules/server/src/main/scala/navigate/server/tcs/TcsBaseControllerEpics.scala index 56f7e120..7212dd4e 100644 --- a/modules/server/src/main/scala/navigate/server/tcs/TcsBaseControllerEpics.scala +++ b/modules/server/src/main/scala/navigate/server/tcs/TcsBaseControllerEpics.scala @@ -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 => diff --git a/modules/web/server/src/main/resources/NewTCC.graphql b/modules/web/server/src/main/resources/NewTCC.graphql index b0626403..eb1f9e94 100644 --- a/modules/web/server/src/main/resources/NewTCC.graphql +++ b/modules/web/server/src/main/resources/NewTCC.graphql @@ -11,6 +11,12 @@ input TargetPropertiesInput { wavelength: WavelengthInput } +input GuideTargetPropertiesInput { + name: NonEmptyString! + sidereal: SiderealInput + nonsidereal: NonsiderealInput +} + type Distance { micrometers: Long! millimeters: BigDecimal! @@ -78,7 +84,7 @@ type TelescopeStatus { } input GuiderConfig{ - target: TargetPropertiesInput! + target: GuideTargetPropertiesInput! tracking: ProbeTrackingInput! } diff --git a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala index 8a32066e..ee36252c 100644 --- a/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala +++ b/modules/web/server/src/main/scala/navigate/web/server/http4s/NavigateMappings.scala @@ -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 } @@ -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 diff --git a/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala b/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala index 281de90e..23e138f3 100644 --- a/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala +++ b/modules/web/server/src/test/scala/navigate/web/server/http4s/NavigateMappingsTest.scala @@ -152,7 +152,6 @@ class NavigateMappingsTest extends CatsEffectSuite { | } | oiwfs: { | target: { - | id: "T0002" | name: "OiwfsDummy" | sidereal: { | ra: { @@ -232,7 +231,6 @@ class NavigateMappingsTest extends CatsEffectSuite { | } | oiwfs: { | target: { - | id: "T0002" | name: "OiwfsDummy" | sidereal: { | ra: { diff --git a/project/Settings.scala b/project/Settings.scala index 2824886b..d3309c58 100644 --- a/project/Settings.scala +++ b/project/Settings.scala @@ -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"