Add live transmitter position (status) alongside logged points
devices/<serial>/log messages now carry a "type": "log" or "status". "log" persists a LocatePoint as before; "status" carries the same position + telemetry shape but is broadcast live over the job's realtime channel without touching locate_points — it's a current- position update, not a recorded point. The job map renders the latest status as a blue "you are here" marker (with a soft accuracy-radius halo) that moves in place as new updates arrive, separate from the colored polyline of logged points. Clicking it shows the same detail readout as a logged point. The simulator gained a message-type toggle (Log point / Status update) so both paths can be exercised from /sim. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
IsArray,
|
||||
IsDateString,
|
||||
IsEnum,
|
||||
IsIn,
|
||||
IsInt,
|
||||
IsNotEmpty,
|
||||
IsNumber,
|
||||
@@ -139,10 +140,18 @@ export class MqttPointsMessageDto {
|
||||
points: MqttPointDto[];
|
||||
}
|
||||
|
||||
// Single-reading log entry for a locator that publishes directly (or is
|
||||
// relayed) to devices/<serial>/log — the serial comes from the topic itself,
|
||||
// so identity is job-anchored rather than publisher-credential-anchored.
|
||||
export const MQTT_LOG_MESSAGE_TYPES = ['log', 'status'] as const;
|
||||
export type MqttLogMessageType = (typeof MQTT_LOG_MESSAGE_TYPES)[number];
|
||||
|
||||
// Single reading for a locator that publishes directly (or is relayed) to
|
||||
// devices/<serial>/log — the serial comes from the topic itself, so identity
|
||||
// is job-anchored rather than publisher-credential-anchored. `type` decides
|
||||
// what happens to it: "log" persists a LocatePoint; "status" is an ephemeral
|
||||
// current-position update, broadcast live but never written to the DB.
|
||||
export class MqttLogMessageDto extends MqttPointDto {
|
||||
@IsIn(MQTT_LOG_MESSAGE_TYPES)
|
||||
type: MqttLogMessageType;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
jobId: string;
|
||||
|
||||
Reference in New Issue
Block a user