Skip to content

Commit

Permalink
Rename probeGuide to probeGuideMode
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Jan 30, 2024
1 parent ba5fbe8 commit 7f12dc5
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import cats.derived.*
import lucuma.ags.GuideProbe

/** Data type for guide config. */
case class ProbeGuide(
case class ProbeGuideMode(
from: GuideProbe,
to: GuideProbe
) derives Eq,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ object TcsEpicsSystem {

override val guideModeCommand: GuideModeCommand[F, TcsCommands[F]] =
new GuideModeCommand[F, TcsCommands[F]] {
override def setMode(pg: Option[ProbeGuide]): TcsCommands[F] =
override def setMode(pg: Option[ProbeGuideMode]): TcsCommands[F] =
pg.fold(
addParam(tcsEpics.guideModeCmd.setParam1(BinaryOnOff.Off))
)(pg =>
Expand Down Expand Up @@ -1540,7 +1540,7 @@ object TcsEpicsSystem {
}

trait GuideModeCommand[F[_], +S] {
def setMode(pg: Option[ProbeGuide]): S
def setMode(pg: Option[ProbeGuideMode]): S
}

trait WfsSignalProcConfigCommand[F[_], +S] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ case class TelescopeGuideConfig(
m1Guide: M1GuideConfig,
m2Guide: M2GuideConfig,
dayTimeMode: Boolean,
probeGuide: Option[ProbeGuide]
probeGuide: Option[ProbeGuideMode]
) derives Eq,
Show
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ class TcsBaseControllerEpicsSuite extends CatsEffectSuite {
m1Guide = M1GuideConfig.M1GuideOn(M1Source.Oiwfs),
m2Guide = M2GuideOn(true, Set(TipTiltSource.Oiwfs)),
dayTimeMode = false,
probeGuide = ProbeGuide(GuideProbe.GmosOiwfs, GuideProbe.GmosOiwfs).some
probeGuide = ProbeGuideMode(GuideProbe.GmosOiwfs, GuideProbe.GmosOiwfs).some
)

for {
Expand All @@ -846,7 +846,7 @@ class TcsBaseControllerEpicsSuite extends CatsEffectSuite {
m1Guide = M1GuideConfig.M1GuideOn(M1Source.Oiwfs),
m2Guide = M2GuideOn(true, Set(TipTiltSource.Oiwfs)),
dayTimeMode = false,
probeGuide = ProbeGuide(GuideProbe.Pwfs1, GuideProbe.Pwfs2).some
probeGuide = ProbeGuideMode(GuideProbe.Pwfs1, GuideProbe.Pwfs2).some
)

for {
Expand Down
4 changes: 2 additions & 2 deletions modules/web/server/src/main/resources/NewTCC.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ input GuideConfigurationInput {
"""Flag for day time tests. It sets all gains to 0"""
daytimeMode: Boolean!
"""Probe names to be used for guiding"""
probeGuide: ProbeGuideInput
probeGuideMode: ProbeGuideModeInput
}

input ProbeGuideInput {
input ProbeGuideModeInput {
from: GuideProbe
to: GuideProbe
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import navigate.server.tcs.M1GuideConfig.M1GuideOn
import navigate.server.tcs.M2GuideConfig
import navigate.server.tcs.Origin
import navigate.server.tcs.ParkStatus
import navigate.server.tcs.ProbeGuide
import navigate.server.tcs.ProbeGuideMode
import navigate.server.tcs.ResetPointing
import navigate.server.tcs.RotatorTrackConfig
import navigate.server.tcs.RotatorTrackingMode
Expand Down Expand Up @@ -650,10 +650,10 @@ object NavigateMappings extends GrackleParsers {
rc <- l.collectFirst { case ("rotator", ObjectValue(v)) => parseRotatorConfig(v) }.flatten
} yield TcsConfig(t, in, oi, rc)

def parseProbeGuide(l: List[(String, Value)]): Option[ProbeGuide] = for {
private def parseProbeGuideMode(l: List[(String, Value)]): Option[ProbeGuideMode] = for {
f <- l.collectFirst { case ("from", EnumValue(v)) => parseEnumerated[GuideProbe](v) }.flatten
t <- l.collectFirst { case ("to", EnumValue(v)) => parseEnumerated[GuideProbe](v) }.flatten
} yield ProbeGuide(f, t)
} yield ProbeGuideMode(f, t)

def parseGuideConfig(l: List[(String, Value)]): Option[TelescopeGuideConfig] = {
val m2: List[TipTiltSource] = l.collectFirst { case ("m2Inputs", ListValue(v)) =>
Expand All @@ -669,7 +669,7 @@ object NavigateMappings extends GrackleParsers {
val dayTimeMode = l.collectFirst { case ("daytimeMode", BooleanValue(v)) => v }.exists(identity)

val probeGuide =
l.collectFirst { case ("probeGuide", ObjectValue(v)) => parseProbeGuide(v) }.flatten
l.collectFirst { case ("probeGuideMode", ObjectValue(v)) => parseProbeGuideMode(v) }.flatten

l.collectFirst { case ("mountOffload", BooleanValue(v)) => v }
.map { mount =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ class NavigateMappingsTest extends CatsEffectSuite {
| m1Input: OIWFS
| mountOffload: true
| daytimeMode: false
| probeGuide: {
| probeGuideMode: {
| from: GMOS_OIWFS
| to: GMOS_OIWFS
| }
Expand Down Expand Up @@ -658,7 +658,7 @@ class NavigateMappingsTest extends CatsEffectSuite {
| m1Input: OIWFS
| mountOffload: true
| daytimeMode: false
| probeGuide: {
| probeGuideMode: {
| from: PWFS_1
| to: PWFS_2
| }
Expand Down

0 comments on commit 7f12dc5

Please sign in to comment.