Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ docs/doxygen/

# DAQ output data
scripts/postprocessing/output/

# Internal review notes (not shared with the team)
daq-server/BACKEND_REVIEW.md
21 changes: 18 additions & 3 deletions daq-server/diablo_server/backend/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,12 @@ function handleCommand(ws: WebSocket, command: CommandPayload): void {
break;
}
case 'extend_fire':
sendToActuatorService('EXTEND_FIRE\n').catch(() => { });
sendToActuatorService('EXTEND_FIRE\n').then(({ ok, reply }) => {
console.log(`[ThinServer] Extend fire: ${ok ? 'OK' : 'FAIL'} (${reply})`);
if (!ok) {
send(ws, { type: MessageType.ERROR, timestamp: Date.now(), payload: { message: `Extend fire failed: ${reply}` } });
}
});
break;
case 'set_countdown_target':
countdownTargetMs = command.data.targetTimeMs ?? null;
Expand Down Expand Up @@ -1002,9 +1007,19 @@ elodin.on('packet', (header: any, payload: Buffer) => {
broadcastCommandedActuatorsForState(currentState);
scheduleActuatorMismatchCheck(currentState);
if (currentState === SystemState.FIRE && prevState !== SystemState.FIRE) {
sendToControllerService('FIRE_START\n').catch(() => { /* non-fatal */ });
sendToControllerService('FIRE_START\n').then(({ ok, reply }) => {
if (!ok) {
console.error(`[ThinServer] FIRE_START not acknowledged by controller_service: ${reply}`);
broadcastNotification({ key: 'fire_start_failed', category: 'error', message: `FIRE_START not acknowledged by controller: ${reply}`, timestampMs: Date.now(), ongoing: false });
}
});
} else if (prevState === SystemState.FIRE && currentState !== SystemState.FIRE) {
sendToControllerService('FIRE_STOP\n').catch(() => { /* non-fatal */ });
sendToControllerService('FIRE_STOP\n').then(({ ok, reply }) => {
if (!ok) {
console.error(`[ThinServer] FIRE_STOP not acknowledged by controller_service: ${reply}`);
broadcastNotification({ key: 'fire_stop_failed', category: 'error', message: `FIRE_STOP not acknowledged by controller: ${reply}`, timestampMs: Date.now(), ongoing: false });
}
});
}
return;
}
Expand Down
1 change: 0 additions & 1 deletion firmware/platformio-common.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
; Per-project platformio.ini files pull this in via:
; [platformio]
; extra_configs = ../../platformio-common.ini ; adjust depth
;
; ...then declare an [env:...] that `extends` one of the base
; sections below, e.g.:
; [env:my_env]
Expand Down
Loading