Commit f1192d9c authored by vertighel's avatar vertighel
Browse files

feat: guider last_correction telemetry; dependency-guard scicam/teccam subsystems



- guider.py: last_correction [dx,dy] px stored after each step, exposed in status
- control_panel.html: guider_panel aside shows Δx/Δy from guider-last-correction
- dependency-guard.js: scicam1/teccam1 gated by /camera/power (STX);
  scicam2 gated by /camera2/power; teccam2/teccam3/scicam3 null (always available)

Co-Authored-By: default avatarClaude Sonnet 4.6 <noreply@anthropic.com>
parent 7c385fb9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ class Guider:
        self.interval      = 5.0
        self.error           = []
        self.last_offset     = [0.0, 0.0]
        self.last_correction = [0.0, 0.0]
        self._task           = None
        self._stick_target = None

@@ -180,6 +181,7 @@ class Guider:

        dpx = tgt_x - star_x
        dpy = tgt_y - star_y
        self.last_correction = [round(dpx, 1), round(dpy, 1)]

        if self.actuator == "telescope":
            dalt, daz = self._pixel_to_offset(cam, nx, ny, star_x, star_y, tgt_x, tgt_y)
@@ -327,6 +329,7 @@ class Guider:
            "target":        self.target,
            "interval":      self.interval,
            "last_offset":     self.last_offset,
            "last_correction": self.last_correction,
            "ao_pos":          self.ao_pos,
            "ao_offload":    self.ao_offload,
            "ao_calibrated": self._ao_calib is not None,
+4 −0
Original line number Diff line number Diff line
@@ -193,6 +193,10 @@
  <small class="col-6 text-success">guider: <var data-status="guider-active" data-display="pill" data-map="bool_yesno"></var></small>
  <small class="col-6 text-success">cam: <var data-status="{{ camera_prefix }}-snapshot-state" data-display="pill" data-map="camera_state"></var></small>
</aside>
<aside class="row mt-1">
  <small class="col-6 text-success">Δx: <var data-status="guider-last-correction-0" data-display="plain" data-transform="round_1"></var> px</small>
  <small class="col-6 text-success">Δy: <var data-status="guider-last-correction-1" data-display="plain" data-transform="round_1"></var> px</small>
</aside>

{% endmacro %}

+7 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
// State arrives from the server via 'state-diff' WebSocket events (server-side cascade).

// Root endpoint path for each subsystem — the "gate" controlling the whole chain.
// null means the device is always available (no power endpoint); the guard never fires.
const ROOTS = {
    telescope: '/telescope/power',
    dome:      '/dome/connection',
@@ -10,6 +11,12 @@ const ROOTS = {
    camera2:   '/camera2/power',
    stage:     '/stage/connection',
    webcam:    '/webcam/clock',
    scicam1:   '/camera/power',   // STX camera — same gate as camera
    teccam1:   '/camera/power',   // STX guider — depends-on cam, same gate
    scicam2:   '/camera2/power',  // Atik — same gate as camera2
    teccam2:   null,              // Mako111 — depends-on cab only, always available
    scicam3:   null,              // not yet defined
    teccam3:   null,              // Mako115 — depends-on cab only, always available
};

const endpointStates = {};