feat: dashcamd trip lifecycle, status indicator, CLAUDE.md updates
dashcamd now waits for valid system time + GPS fix + drive gear before starting a trip. Returns to waiting state on 10-min park timeout or ignition off. Publishes DashcamState and per-trip DashcamFrames to memory params. Status window shows stopped/waiting/recording states. Updated CLAUDE.md with current display mode behavior, OmxEncoder port details, speed limit warning thresholds, and dashcam param docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -264,8 +264,8 @@ static StatusWindow::StatusData collectStatus() {
|
||||
d.telemetry = readFile("/data/params/d/TelemetryEnabled");
|
||||
|
||||
// Dashcam
|
||||
QString dashcam_pid = shellCmd("pgrep -x dashcamd");
|
||||
d.dashcam_status = dashcam_pid.isEmpty() ? "stopped" : "recording";
|
||||
d.dashcam_state = readFile("/dev/shm/params/d/DashcamState");
|
||||
if (d.dashcam_state.isEmpty()) d.dashcam_state = "stopped";
|
||||
d.dashcam_frames = readFile("/dev/shm/params/d/DashcamFrames");
|
||||
|
||||
// Panda: checked on UI thread in applyResults() via scene.pandaType
|
||||
@@ -383,11 +383,14 @@ void StatusWindow::applyResults() {
|
||||
telemetry_label->setStyleSheet("color: grey; font-size: 38px;");
|
||||
}
|
||||
|
||||
if (d.dashcam_status == "recording") {
|
||||
if (d.dashcam_state == "recording") {
|
||||
QString text = "Recording";
|
||||
if (!d.dashcam_frames.isEmpty() && d.dashcam_frames != "0") text += " (" + d.dashcam_frames + " frames)";
|
||||
dashcam_label->setText(text);
|
||||
dashcam_label->setStyleSheet("color: #17c44d; font-size: 38px;");
|
||||
} else if (d.dashcam_state == "waiting") {
|
||||
dashcam_label->setText("Waiting");
|
||||
dashcam_label->setStyleSheet("color: #ffaa00; font-size: 38px;");
|
||||
} else {
|
||||
dashcam_label->setText("Stopped");
|
||||
dashcam_label->setStyleSheet("color: #ff4444; font-size: 38px;");
|
||||
|
||||
@@ -20,7 +20,7 @@ public:
|
||||
struct StatusData {
|
||||
QString time, storage, ram, load, temp, fan, ip, wifi;
|
||||
QString vpn_status, vpn_ip, gps, telemetry;
|
||||
QString dashcam_status, dashcam_frames;
|
||||
QString dashcam_state, dashcam_frames;
|
||||
float temp_c = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user