fix(antenna): Retract and Calibrate report the elements moving
An operator reported that retracting a SteppIR shows nothing, while an Ultrabeam visibly does. The cause is not the display: both antennas feed one `moving` flag and the widget renders it the same way. moveCmdAt — the bridge that reports motion from the moment a move is COMMANDED, before the controller's own poll can confirm it — was set only by SetFrequency. Retract and Calibrate write their frame directly and armed nothing, so three things were missing at once: nothing said the elements were moving, the poll stayed on its two-second idle cadence instead of speeding up to 250 ms to watch, and the transmit inhibit was not engaged while the elements travelled. That last one is the reason this is not cosmetic. The Ultrabeam's Retract armed nothing either. It was less visible there because that controller reports element lengths, which count down on screen; a SteppIR reports none at all, so the retract looked inert. The inhibit was equally absent. The window becomes a deadline rather than a timestamp, so the caller can say how long a bridge it needs: three seconds for a tune, ten for a retract or a calibrate. Those are tens of seconds of travel, and a retract drops the controller out of AUTOTRACK where its motor-bit reporting is less predictable. Still bounded — an antenna that never reports motion must not latch the inhibit on for ever — and markMoving only ever extends, so a tune issued just after a retract cannot cut the retract's bridge down to its own. Four tests, including that a command which failed to reach the controller does not claim the antenna is moving.
This commit is contained in:
@@ -894,9 +894,20 @@ func (c *Client) SetDirection(direction int) error {
|
||||
}
|
||||
|
||||
// Retract retracts all elements (command 2)
|
||||
//
|
||||
// Reports motion at once, like a frequency change does: this is the longest
|
||||
// move the antenna makes, and the flag it sets is what inhibits the
|
||||
// transmitter while the elements travel. The element lengths counting down
|
||||
// made the omission less visible here than on a SteppIR, which reports no
|
||||
// lengths at all — but the inhibit was equally missing.
|
||||
func (c *Client) Retract() error {
|
||||
_, err := c.sendCommand(CMD_RETRACT, nil)
|
||||
return err
|
||||
if _, err := c.sendCommand(CMD_RETRACT, nil); err != nil {
|
||||
return err
|
||||
}
|
||||
c.statusMu.Lock()
|
||||
c.moveCmdAt = time.Now()
|
||||
c.statusMu.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
// ModifyElement modifies element length (command 12)
|
||||
|
||||
Reference in New Issue
Block a user