Skip to content

Commit

Permalink
query obs and seq from odb, login
Browse files Browse the repository at this point in the history
  • Loading branch information
rpiaggio committed Aug 3, 2023
1 parent 42c1932 commit 5b37d23
Show file tree
Hide file tree
Showing 30 changed files with 1,547 additions and 1,277 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ lazy val new_model = crossProject(JVMPlatform, JSPlatform)
libraryDependencies ++= Seq(
Cats.value,
Kittens.value,
CatsTime.value
CatsTime.value,
LucumaSchemas.value
) ++ MUnit.value ++ Monocle.value ++ LucumaCore.value ++ Circe.value
)
.jvmSettings(
Expand Down Expand Up @@ -217,8 +218,7 @@ lazy val observe_web_client = project
ClueJs.value,
Crystal.value,
Fs2.value,
LucumaUI.value,
LucumaSchemas.value
LucumaUI.value
) ++ ScalaJSReactIO.value ++ LucumaReact.value ++ Monocle.value ++ LucumaCore.value ++ Log4CatsLogLevel.value,
// TODO Remove this, only used for prototype:
libraryDependencies += ("org.scala-js" %%% "scalajs-java-securerandom" % "1.0.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object StepState {

case object Pending extends StepState
case object Completed extends StepState
case object Skipped extends StepState
// case object Skipped extends StepState
case object Aborted extends StepState
final case class Failed(msg: String) extends StepState
case object Running extends StepState
Expand All @@ -22,7 +22,7 @@ object StepState {
Eq.instance {
case (Pending, Pending) => true
case (Completed, Completed) => true
case (Skipped, Skipped) => true
// case (Skipped, Skipped) => true
case (Failed(a), Failed(b)) => a === b
case (Running, Running) => true
case (Paused, Paused) => true
Expand All @@ -32,7 +32,7 @@ object StepState {

extension (s: StepState) {
def canSetBreakpoint: Boolean = s match {
case StepState.Pending | StepState.Skipped | StepState.Paused | StepState.Running |
case StepState.Pending | /*StepState.Skipped |*/ StepState.Paused | StepState.Running |
StepState.Aborted =>
true
case _ => false
Expand All @@ -59,11 +59,11 @@ object StepState {
}

def isFinished: Boolean = s match {
case StepState.Completed | StepState.Skipped => true
case _ => false
case StepState.Completed /*| StepState.Skipped */ => true
case _ => false
}

def wasSkipped: Boolean = s === StepState.Skipped
// def wasSkipped: Boolean = s === StepState.Skipped

def canConfigure: Boolean = s match {
case StepState.Pending | StepState.Paused | StepState.Failed(_) | StepState.Aborted => true
Expand Down

This file was deleted.

86 changes: 43 additions & 43 deletions modules/new_model/shared/src/main/scala/observe/model/Offset.scala
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package observe.model
// package observe.model

import lucuma.core.math.Axis
import observe.model.enums.SystemName
// import lucuma.core.math.Axis
// import observe.model.enums.SystemName

object OffsetType:
type Telescope
type NSNodA
type NSNodB
// object OffsetType:
// type Telescope
// type NSNodA
// type NSNodB

sealed trait OffsetFormat[A]:
val format: String
// sealed trait OffsetFormat[A]:
// val format: String

object OffsetFormat:
given OffsetFormat[OffsetType.NSNodA] = new OffsetFormat[OffsetType.NSNodA]:
override val format = "A"
// object OffsetFormat:
// given OffsetFormat[OffsetType.NSNodA] = new OffsetFormat[OffsetType.NSNodA]:
// override val format = "A"

given OffsetFormat[OffsetType.NSNodB] = new OffsetFormat[OffsetType.NSNodB]:
override val format = "B"
// given OffsetFormat[OffsetType.NSNodB] = new OffsetFormat[OffsetType.NSNodB]:
// override val format = "B"

given OffsetFormat[Axis.P] = new OffsetFormat[Axis.P]:
override val format = "p"
// given OffsetFormat[Axis.P] = new OffsetFormat[Axis.P]:
// override val format = "p"

given OffsetFormat[Axis.Q] = new OffsetFormat[Axis.Q]:
override val format = "q"
// given OffsetFormat[Axis.Q] = new OffsetFormat[Axis.Q]:
// override val format = "q"

sealed trait OffsetConfigResolver[T, A]:
val systemName: SystemName
val configItem: ParamName
// sealed trait OffsetConfigResolver[T, A]:
// val systemName: SystemName
// val configItem: ParamName

object OffsetConfigResolver:
sealed trait TelescopeOffsetConfigResolver[A]
extends OffsetConfigResolver[OffsetType.Telescope, A]:
val systemName = SystemName.Telescope
// object OffsetConfigResolver:
// sealed trait TelescopeOffsetConfigResolver[A]
// extends OffsetConfigResolver[OffsetType.Telescope, A]:
// val systemName = SystemName.Telescope

given OffsetConfigResolver[OffsetType.Telescope, Axis.P] =
new TelescopeOffsetConfigResolver[Axis.P]:
val configItem = ParamName("p")
// given OffsetConfigResolver[OffsetType.Telescope, Axis.P] =
// new TelescopeOffsetConfigResolver[Axis.P]:
// val configItem = ParamName("p")

given OffsetConfigResolver[OffsetType.Telescope, Axis.Q] =
new TelescopeOffsetConfigResolver[Axis.Q]:
val configItem = ParamName("q")
// given OffsetConfigResolver[OffsetType.Telescope, Axis.Q] =
// new TelescopeOffsetConfigResolver[Axis.Q]:
// val configItem = ParamName("q")

sealed trait NSOffsetConfigResolver[T, A] extends OffsetConfigResolver[T, A]:
val systemName = SystemName.Instrument
// sealed trait NSOffsetConfigResolver[T, A] extends OffsetConfigResolver[T, A]:
// val systemName = SystemName.Instrument

sealed trait NSOffsetConfigResolverA[A] extends NSOffsetConfigResolver[OffsetType.NSNodA, A]
// sealed trait NSOffsetConfigResolverA[A] extends NSOffsetConfigResolver[OffsetType.NSNodA, A]

given OffsetConfigResolver[OffsetType.NSNodA, Axis.P] = new NSOffsetConfigResolverA[Axis.P]:
val configItem = ParamName("nsBeamA-p")
// given OffsetConfigResolver[OffsetType.NSNodA, Axis.P] = new NSOffsetConfigResolverA[Axis.P]:
// val configItem = ParamName("nsBeamA-p")

given OffsetConfigResolver[OffsetType.NSNodA, Axis.Q] = new NSOffsetConfigResolverA[Axis.Q]:
val configItem = ParamName("nsBeamA-q")
// given OffsetConfigResolver[OffsetType.NSNodA, Axis.Q] = new NSOffsetConfigResolverA[Axis.Q]:
// val configItem = ParamName("nsBeamA-q")

sealed trait NSOffsetConfigResolverB[A] extends NSOffsetConfigResolver[OffsetType.NSNodB, A]
// sealed trait NSOffsetConfigResolverB[A] extends NSOffsetConfigResolver[OffsetType.NSNodB, A]

given OffsetConfigResolver[OffsetType.NSNodB, Axis.P] = new NSOffsetConfigResolverB[Axis.P]:
val configItem = ParamName("nsBeamB-p")
// given OffsetConfigResolver[OffsetType.NSNodB, Axis.P] = new NSOffsetConfigResolverB[Axis.P]:
// val configItem = ParamName("nsBeamB-p")

given OffsetConfigResolver[OffsetType.NSNodB, Axis.Q] = new NSOffsetConfigResolverB[Axis.Q]:
val configItem = ParamName("nsBeamB-q")
// given OffsetConfigResolver[OffsetType.NSNodB, Axis.Q] = new NSOffsetConfigResolverB[Axis.Q]:
// val configItem = ParamName("nsBeamB-q")
Loading

0 comments on commit 5b37d23

Please sign in to comment.