up
This commit is contained in:
2
cmd/server/web/dist/index.html
vendored
2
cmd/server/web/dist/index.html
vendored
@@ -7,7 +7,7 @@
|
|||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
|
||||||
<script type="module" crossorigin src="/assets/index-ghAyyhf_.js"></script>
|
<script type="module" crossorigin src="/assets/index-DfHlyr4L.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-oYZfaWiS.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-oYZfaWiS.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -335,7 +335,11 @@ func (c *Client) handleStatus(msg string) {
|
|||||||
// Format: S0|interlock ... state=PTT_REQUESTED ...
|
// Format: S0|interlock ... state=PTT_REQUESTED ...
|
||||||
if strings.Contains(msg, "interlock") {
|
if strings.Contains(msg, "interlock") {
|
||||||
if state, ok := statusMap["state"]; ok {
|
if state, ok := statusMap["state"]; ok {
|
||||||
log.Printf("FlexRadio: Interlock state changed to: %s", state)
|
|
||||||
|
// Update status for UI
|
||||||
|
c.statusMu.Lock()
|
||||||
|
c.lastStatus.InterlockState = state
|
||||||
|
c.statusMu.Unlock()
|
||||||
|
|
||||||
if state == "PTT_REQUESTED" {
|
if state == "PTT_REQUESTED" {
|
||||||
// PTT requested - we MUST respond within 500ms!
|
// PTT requested - we MUST respond within 500ms!
|
||||||
@@ -384,14 +388,13 @@ func (c *Client) createInterlock() error {
|
|||||||
// handlePTTRequest is called when FlexRadio sends PTT_REQUESTED
|
// handlePTTRequest is called when FlexRadio sends PTT_REQUESTED
|
||||||
// We MUST respond within 500ms with ready or not_ready
|
// We MUST respond within 500ms with ready or not_ready
|
||||||
func (c *Client) handlePTTRequest() {
|
func (c *Client) handlePTTRequest() {
|
||||||
log.Println("FlexRadio: 🔴 PTT REQUESTED - checking if transmit allowed...")
|
|
||||||
|
|
||||||
c.interlockMu.RLock()
|
c.interlockMu.RLock()
|
||||||
interlockID := c.interlockID
|
interlockID := c.interlockID
|
||||||
c.interlockMu.RUnlock()
|
c.interlockMu.RUnlock()
|
||||||
|
|
||||||
if interlockID == "" {
|
if interlockID == "" {
|
||||||
log.Println("FlexRadio: ⚠️ No interlock ID, cannot respond to PTT request!")
|
log.Println("FlexRadio: No interlock ID, cannot respond to PTT request!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,12 +405,21 @@ func (c *Client) handlePTTRequest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if allowed {
|
if allowed {
|
||||||
log.Println("FlexRadio: ✅ Transmit ALLOWED - sending 'ready'")
|
|
||||||
cmd := fmt.Sprintf("interlock ready %s", interlockID)
|
cmd := fmt.Sprintf("interlock ready %s", interlockID)
|
||||||
c.sendCommand(cmd)
|
c.sendCommand(cmd)
|
||||||
|
|
||||||
|
// Update status immediately for UI
|
||||||
|
c.statusMu.Lock()
|
||||||
|
c.lastStatus.InterlockState = InterlockStateReady
|
||||||
|
c.statusMu.Unlock()
|
||||||
} else {
|
} else {
|
||||||
log.Println("FlexRadio: ❌ Transmit BLOCKED - sending 'not_ready'")
|
log.Println("FlexRadio: Transmit BLOCKED - sending 'not_ready'")
|
||||||
cmd := fmt.Sprintf("interlock not_ready %s", interlockID)
|
cmd := fmt.Sprintf("interlock not_ready %s", interlockID)
|
||||||
c.sendCommand(cmd)
|
c.sendCommand(cmd)
|
||||||
|
|
||||||
|
// Update status immediately for UI
|
||||||
|
c.statusMu.Lock()
|
||||||
|
c.lastStatus.InterlockState = InterlockStateNotReady
|
||||||
|
c.statusMu.Unlock()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@
|
|||||||
<div class="auto-track-controls">
|
<div class="auto-track-controls">
|
||||||
<label class="toggle-label">
|
<label class="toggle-label">
|
||||||
<input type="checkbox" bind:checked={autoTrackEnabled} on:change={updateAutoTrack} />
|
<input type="checkbox" bind:checked={autoTrackEnabled} on:change={updateAutoTrack} />
|
||||||
<span>Enable Auto-Track from Radio</span>
|
<span>Enable Auto-Track from Tuner</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="threshold-group">
|
<div class="threshold-group">
|
||||||
@@ -579,4 +579,4 @@
|
|||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user