forked from gemini-hlsw/seqexec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gemini-hlsw#49 from tpolecat/static-config
initial static config
- Loading branch information
Showing
23 changed files
with
197 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package gem | ||
package config | ||
|
||
import gem.enum.Instrument | ||
|
||
sealed abstract class StaticConfig { | ||
type I <: Instrument with Singleton | ||
def instrument: I | ||
} | ||
|
||
object StaticConfig { | ||
type Aux[I0] = StaticConfig { type I = I0 } | ||
sealed abstract class Impl[I0 <: Instrument with Singleton](val instrument: I0) extends StaticConfig { | ||
type I = I0 | ||
} | ||
} | ||
|
||
final case class PhoenixStaticConfig() extends StaticConfig.Impl(Instrument.Phoenix) | ||
final case class MichelleStaticConfig() extends StaticConfig.Impl(Instrument.Michelle) | ||
final case class GnirsStaticConfig() extends StaticConfig.Impl(Instrument.Gnirs) | ||
final case class NiriStaticConfig() extends StaticConfig.Impl(Instrument.Niri) | ||
final case class TrecsStaticConfig() extends StaticConfig.Impl(Instrument.Trecs) | ||
final case class NiciStaticConfig() extends StaticConfig.Impl(Instrument.Nici) | ||
final case class NifsStaticConfig() extends StaticConfig.Impl(Instrument.Nifs) | ||
final case class GpiStaticConfig() extends StaticConfig.Impl(Instrument.Gpi) | ||
final case class GsaoiStaticConfig() extends StaticConfig.Impl(Instrument.Gsaoi) | ||
final case class GmosSStaticConfig() extends StaticConfig.Impl(Instrument.GmosS) | ||
final case class AcqCamStaticConfig() extends StaticConfig.Impl(Instrument.AcqCam) | ||
final case class GmosNStaticConfig() extends StaticConfig.Impl(Instrument.GmosN) | ||
final case class BhrosStaticConfig() extends StaticConfig.Impl(Instrument.Bhros) | ||
final case class VisitorStaticConfig() extends StaticConfig.Impl(Instrument.Visitor) | ||
final case class Flamingos2StaticConfig() extends StaticConfig.Impl(Instrument.Flamingos2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package gem | ||
package dao | ||
|
||
// import doobie.imports._ | ||
|
||
import gem.enum.Instrument | ||
import gem.config._ | ||
|
||
|
||
object StaticConfigDao { | ||
|
||
// this is just a placeholder … right now the obs table just contains an instrument tag which we | ||
// use to construct an empty static config | ||
|
||
def forInstrument(i: Instrument): StaticConfig.Aux[i.type] = | ||
(i match { | ||
case Instrument.Phoenix => PhoenixStaticConfig() | ||
case Instrument.Michelle => MichelleStaticConfig() | ||
case Instrument.Gnirs => GnirsStaticConfig() | ||
case Instrument.Niri => NiriStaticConfig() | ||
case Instrument.Trecs => TrecsStaticConfig() | ||
case Instrument.Nici => NiciStaticConfig() | ||
case Instrument.Nifs => NifsStaticConfig() | ||
case Instrument.Gpi => GpiStaticConfig() | ||
case Instrument.Gsaoi => GsaoiStaticConfig() | ||
case Instrument.GmosS => GmosSStaticConfig() | ||
case Instrument.AcqCam => AcqCamStaticConfig() | ||
case Instrument.GmosN => GmosNStaticConfig() | ||
case Instrument.Bhros => BhrosStaticConfig() | ||
case Instrument.Visitor => VisitorStaticConfig() | ||
case Instrument.Flamingos2 => Flamingos2StaticConfig() | ||
}).asInstanceOf[StaticConfig.Aux[i.type]] // Scala isn't smart enough to know this | ||
|
||
|
||
object Statements { | ||
// todo | ||
} | ||
|
||
} |
Oops, something went wrong.