Skip to content

Commit

Permalink
Make dayTimeMode optional
Browse files Browse the repository at this point in the history
  • Loading branch information
cquiroz committed Jun 10, 2024
1 parent 3a9e9c7 commit de2befe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ object GuideConfig {
MountGuideOption.MountGuideOff,
M1GuideOff,
M2GuideOff,
false,
None,
None),
None,
)
Expand Down Expand Up @@ -230,7 +230,7 @@ object GuideConfig {
given Encoder[ProbeGuide] = Encoder.forProduct2("from", "to")(x => (x.from, x.to))

given Decoder[TelescopeGuideConfig] =
Decoder.forProduct5[TelescopeGuideConfig, MountGuideOption, M1GuideConfig, M2GuideConfig, Boolean, Option[ProbeGuide]](
Decoder.forProduct5[TelescopeGuideConfig, MountGuideOption, M1GuideConfig, M2GuideConfig, Option[Boolean], Option[ProbeGuide]](
"mountGuideOn",
"m1Guide",
"m2Guide",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ case class TelescopeGuideConfig(
mountGuide: MountGuideOption,
m1Guide: M1GuideConfig,
m2Guide: M2GuideConfig,
dayTimeMode: Boolean,
dayTimeMode: Option[ Boolean ],
probeGuide: Option[ProbeGuide]
) derives Eq

Expand All @@ -28,7 +28,7 @@ object TelescopeGuideConfig {
val m2Guide: Lens[TelescopeGuideConfig, M2GuideConfig] =
Focus[TelescopeGuideConfig](_.m2Guide)

val dayTimeMode: Lens[TelescopeGuideConfig, Boolean] =
val dayTimeMode: Lens[TelescopeGuideConfig, Option[Boolean]] =
Focus[TelescopeGuideConfig](_.dayTimeMode)

val probeGuide: Lens[TelescopeGuideConfig, Option[ProbeGuide]] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ trait ArbTelescopeGuideConfig {
mo <- arbitrary[MountGuideOption]
m1 <- arbitrary[M1GuideConfig]
m2 <- arbitrary[M2GuideConfig]
m <- arbitrary[Boolean]
m <- arbitrary[Option[Boolean]]
pg <- arbitrary[Option[ProbeGuide]]
} yield TelescopeGuideConfig(mo, m1, m2, m, pg)
}

given Cogen[TelescopeGuideConfig] =
Cogen[(Boolean, M1GuideConfig, M2GuideConfig, Boolean, Option[ProbeGuide])]
Cogen[(Boolean, M1GuideConfig, M2GuideConfig, Option[Boolean], Option[ProbeGuide])]
.contramap(x => (x.mountGuide.value, x.m1Guide, x.m2Guide, x.dayTimeMode, x.probeGuide))
}

Expand Down

0 comments on commit de2befe

Please sign in to comment.