Commit 69dbf815 authored by vertighel's avatar vertighel
Browse files

Selettore modo a tab Bootstrap; subsystem guard granulare per scicam/teccam



Il selettore imaging/spectro/echelle passa da radio btn-group a nav-tabs
Bootstrap (data-bs-toggle="tab"), con le tre section mode-panel-* come
tab-pane; control.js applica solo gli effetti collaterali (viewer combo,
label stazione), lo show/hide dei pannelli lo gestisce Bootstrap.
Tab attiva con sfondo bootstrap -info, le altre solo testo -info
(style.css).

Il subsystem guard (dependency-guard.js) tagga ora scicam e teccam di
ogni stazione con due section separate invece di un unico
data-subsystem sull'intera section di stazione: scicam2 spenta non
deve più spegnere teccam2 (dipendono da rack elettrici diversi). Il
guider resta sempre attivo, non taggato.

Corretto anche un gate mancante in cameras.ini: teccam2/teccam3
dipendono da cab (devices.ini) ma non avevano power_api, quindi non
venivano mai spente nemmeno a telescopio spento. Ora puntano a
/telescope/power, lo stesso endpoint che già riflette lo stato di cab.

Co-Authored-By: default avatarClaude Sonnet 5 <noreply@anthropic.com>
parent 56503992
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ orientation = -60
[teccam2]
role        = tec
station     = 2
power_api   = /telescope/power
fits_path   = fits/teccam2.fits
device      = tec2
has_loop    = true
@@ -83,6 +84,7 @@ orientation = -60
[teccam3]
role        = tec
station     = 3
power_api   = /telescope/power
fits_path   = fits/teccam3.fits
device      = tec3
has_loop    = true
+69 −30
Original line number Diff line number Diff line
@@ -143,9 +143,31 @@
  
  <article class="col-xl-3 col-lg-6">
    
    {{ ctrl.observing_mode_selector() }}
    <nav>
      <ul class="nav nav-tabs" role="tablist" id="mode-selector">
        <li class="nav-item" role="presentation">
          <button class="nav-link active" data-bs-toggle="tab"
                  data-bs-target="#mode-panel-imaging" data-station="station1"
                  type="button" role="tab">IMAGING</button>
        </li>
        <li class="nav-item" role="presentation">
          <button class="nav-link" data-bs-toggle="tab"
                  data-bs-target="#mode-panel-spectro" data-station="station2"
                  type="button" role="tab">SPECTRO</button>
        </li>
        <li class="nav-item" role="presentation">
          <button class="nav-link" data-bs-toggle="tab"
                  data-bs-target="#mode-panel-echelle" data-station="station3"
                  type="button" role="tab">ÉCHELLE</button>
        </li>
      </ul>
    </nav>

    <div class="tab-content">

    <section id="mode-panel-imaging" class="mode-panel" data-subsystem="scicam1">
    <div id="mode-panel-imaging" class="tab-pane fade show active">

      <section data-subsystem="scicam1">

        {{ ctrl.widget_frame("imaging", "scicam1",
           [("Full","full"),("Half","half"),("2'×2'","small")])
@@ -155,10 +177,13 @@

        {{ ctrl.expose_widget("imaging", "scicam1", has_filter=True) }}

      </section>

      <h4 class="mt-2 mb-2">Teccam</h4>

      <section data-subsystem="teccam1">
        {{ ctrl.teccam_panel("imaging", "teccam1", has_gain=False) }}
      </section>

      <h4 class="mt-2 mb-2">Guider</h4>

@@ -172,9 +197,11 @@
                            ("tec1","teccam1","ctrl-combo1-tec")],
                           "scicam1") }}

    </section>
    </div>

    <div id="mode-panel-spectro" class="tab-pane fade">

    <section id="mode-panel-spectro" class="mode-panel d-none" data-subsystem="scicam2">
      <section data-subsystem="scicam2">

        {{ ctrl.widget_frame("spectro", "scicam2",
                            [("Full","full"),("Half","half"),("Stripe","small")],
@@ -184,9 +211,13 @@

        {{ ctrl.expose_widget("spectro", "scicam2", has_filter=False) }}

      </section>

      <h4 class="mt-2 mb-2">Teccam</h4>

      <section data-subsystem="teccam2">
        {{ ctrl.teccam_panel("spectro", "teccam2") }}
      </section>

      <h4 class="mt-2 mb-2">Guider</h4>

@@ -194,9 +225,11 @@
                           [("tec2","teccam2","ctrl-combo2-tec")],
                           "scicam2") }}

    </section>
    </div>

    <div id="mode-panel-echelle" class="tab-pane fade">

    <section id="mode-panel-echelle" class="mode-panel d-none" data-subsystem="scicam3">
      <section data-subsystem="scicam3">

        {{ ctrl.widget_frame("echelle", "scicam3",
                            [("Full","full"),("Half","half"),("2'×2'","small")],
@@ -206,9 +239,13 @@

        {{ ctrl.expose_widget("echelle", "scicam3", has_filter=False) }}

      </section>

      <h4 class="mt-2 mb-2">Teccam</h4>

      <section data-subsystem="teccam3">
        {{ ctrl.teccam_panel("echelle", "teccam3") }}
      </section>

      <h4 class="mt-2 mb-2">Guider</h4>

@@ -216,7 +253,9 @@
                           [("tec3","teccam3","ctrl-combo3-tec")],
                           "scicam3") }}

    </section>
    </div>

    </div>

  </article>

+1 −1
Original line number Diff line number Diff line
@@ -141,7 +141,7 @@
    <article class="col-xl-3 col-lg-6">

        <section>
            <h4 class="p-2">Mirror Stage</h4>
            <h4 class="mt-2 mb-2">Mirror Stage</h4>

            {#
            {{ w.widget_standard({
+7 −23
Original line number Diff line number Diff line

{% macro observing_mode_selector() %}
<fielsdet class="row mt-2 mb-4">
  <div class="btn-group w-100" role="group" id="mode-selector">
    <input type="radio" class="btn-check"
           name="obs-mode" id="mode-imaging" value="station1" checked>
    <label class="btn btn-outline-info btn-sm" for="mode-imaging">IMAGING</label>
    
    <input type="radio" class="btn-check"
           name="obs-mode" id="mode-spectroscopy" value="station2">
    <label class="btn btn-outline-info btn-sm" for="mode-spectroscopy">SPECTRO</label>

    <input type="radio" class="btn-check"
           name="obs-mode" id="mode-echelle" value="station3">
    <label class="btn btn-outline-info btn-sm" for="mode-echelle">ÉCHELLE</label>
  </div>
</fieldset>
{% endmacro %}


{% macro mount_pointing() %}
<div>
@@ -164,22 +146,24 @@
    </div>
  </div>

  <div class="col-md-auto">
  <div class="col-md-2">
    <small class="text-success">state: <var data-status="{{ cam_id }}-snapshot-state" data-display="pill" data-map="camera_state"></var></small>
  </div>
  
  {% if has_gain %}
  <label class="col-md-2 col-form-label">Gain</label>
  <div class="col-md">
    <div class="input-group input-group-sm">
      <input type="number" class="form-control bg-black"
             id="teccam-gain-val-{{ panel_id }}"
             placeholder="1" step="1" min="0" max="24"
             data-load-from-storage="{{ cam_id }}-gain">
             data-load-from-storage="{{ cam_id }}-gain"
             {% if has_gain %}
             disabled
             {% endif %}
             >
      <span class="input-group-text">dB</span>
    </div>
  </div>
  {% endif %}

</fieldset>

@@ -327,7 +311,7 @@

{% macro echelle_panel() %}
<form id="form-echelle" autocomplete="off">
  <fieldset class="row g-2">
  <fieldset class="row mt-1 align-items-center">
    <label class="col-md-2 col-form-label">Type</label>
    <div class="col-md">
      <select class="form-select form-select-sm bg-black" name="imagetype"
+16 −0
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@
 * 3. Widget styling
 * 4. Telemetry monitor (status page)
 * 5. Log terminal
 * 6. Subsystem guard
 * 7. Disabled field styling
 * 8. Mode selector tabs
 */


@@ -144,3 +147,16 @@ label:has(~ div :disabled) {
.form-select:disabled {
    color: var(--bs-secondary-color);
}


/* ── 8. Mode selector tabs ──────────────────────────────────────────────── */

#mode-selector .nav-link {
    color: var(--bs-info);
}

#mode-selector .nav-link.active {
    color: #000;
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}
Loading