Controls - Device Management - Disable Uploads

Turn off all data uploads to comma's servers.
This commit is contained in:
FrogAi 2024-05-10 11:17:55 -07:00
parent ffb1545045
commit c38b11c85f
4 changed files with 42 additions and 3 deletions

View File

@ -0,0 +1,6 @@
<svg width="68" height="68" viewBox="0 0 68 68" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.0004 8.63599C21.8284 8.63599 10.7444 13.26 2.31243 20.808C1.56443 21.488 1.4964 22.644 2.1084 23.392L4.76041 26.452C5.44041 27.2 6.59641 27.268 7.34441 26.588C14.4164 20.196 23.7324 16.32 33.9324 16.32C44.1324 16.32 53.4484 20.196 60.5204 26.588C61.2684 27.268 62.4244 27.2 63.1044 26.452L65.7564 23.392C66.4364 22.644 66.3004 21.488 65.5524 20.808C57.2564 13.26 46.1724 8.63599 34.0004 8.63599Z" fill="#FF0000"/>
<path d="M34.0004 22.032C25.1604 22.032 17.0684 25.432 11.0164 30.94C10.2684 31.62 10.2004 32.708 10.8804 33.456L13.3964 36.38C14.0764 37.196 15.2324 37.196 16.0484 36.516C20.8084 32.164 27.1324 29.512 34.0684 29.512C41.0044 29.512 47.3284 32.164 52.0884 36.516C52.8364 37.196 54.0604 37.196 54.7404 36.38L57.2564 33.456C57.8684 32.708 57.8684 31.552 57.1204 30.94C50.9324 25.364 42.8404 22.032 34.0004 22.032Z" fill="#FF0000"/>
<path d="M34.0007 35.36C28.4247 35.36 23.3927 37.536 19.6527 41.14C18.9727 41.82 18.9047 42.908 19.5847 43.656L21.9647 46.444C22.6447 47.26 23.8687 47.26 24.6167 46.58C27.0647 44.2 30.3287 42.772 34.0007 42.772C37.6727 42.772 40.9367 44.2 43.3847 46.58C44.1327 47.328 45.3567 47.26 46.0367 46.444L48.4167 43.656C49.0287 42.908 49.0287 41.82 48.3487 41.14C44.6087 37.536 39.5767 35.36 34.0007 35.36Z" fill="#FF0000"/>
<path d="M34.0005 48.688C31.7565 48.688 29.7165 49.708 28.3565 51.34C27.7445 52.02 27.7445 53.04 28.3565 53.72L32.6405 58.684C33.3885 59.5 34.6804 59.5 35.4284 58.684L39.7125 53.72C40.3245 53.04 40.3245 52.02 39.7125 51.34C38.2845 49.708 36.2445 48.688 34.0005 48.688Z" fill="#FF0000"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -46,6 +46,10 @@ def allow_logging(started, params, CP: car.CarParams) -> bool:
allow_logging = not (params.get_bool("DeviceManagement") and params.get_bool("NoLogging"))
return allow_logging and logging(started, params, CP)
def allow_uploads(started, params, CP: car.CarParams) -> bool:
allow_uploads = not (params.get_bool("DeviceManagement") and params.get_bool("NoUploads"))
return allow_uploads
procs = [
DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"),
@ -85,7 +89,7 @@ procs = [
PythonProcess("thermald", "selfdrive.thermald.thermald", always_run),
PythonProcess("tombstoned", "selfdrive.tombstoned", always_run, enabled=not PC),
PythonProcess("updated", "selfdrive.updated.updated", always_run, enabled=not PC),
PythonProcess("uploader", "system.loggerd.uploader", always_run),
PythonProcess("uploader", "system.loggerd.uploader", allow_uploads),
PythonProcess("statsd", "selfdrive.statsd", allow_logging),
# debug procs

View File

@ -160,7 +160,7 @@ void TogglesPanel::updateToggles() {
auto disengage_on_accelerator_toggle = toggles["DisengageOnAccelerator"];
disengage_on_accelerator_toggle->setVisible(!params.getBool("AlwaysOnLateral"));
auto driver_camera_toggle = toggles["RecordFront"];
driver_camera_toggle->setVisible(!(params.getBool("DeviceManagement") && params.getBool("NoLogging")));
driver_camera_toggle->setVisible(!(params.getBool("DeviceManagement") && params.getBool("NoLogging") && params.getBool("NoUploads")));
auto experimental_mode_toggle = toggles["ExperimentalMode"];
auto op_long_toggle = toggles["ExperimentalLongitudinalEnabled"];

View File

@ -81,6 +81,34 @@ WiFiPromptWidget::WiFiPromptWidget(QWidget *parent) : QFrame(parent) {
}
stack->addWidget(uploading);
QWidget *notUploading = new QWidget;
QVBoxLayout *not_uploading_layout = new QVBoxLayout(notUploading);
not_uploading_layout->setContentsMargins(64, 56, 64, 56);
not_uploading_layout->setSpacing(36);
{
QHBoxLayout *title_layout = new QHBoxLayout;
{
QLabel *title = new QLabel(tr("Uploading disabled"));
title->setStyleSheet("font-size: 64px; font-weight: 600;");
title->setWordWrap(true);
title->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
title_layout->addWidget(title);
title_layout->addStretch();
QLabel *icon = new QLabel;
QPixmap pixmap("../frogpilot/assets/other_images/icon_wifi_uploading_disabled.svg");
icon->setPixmap(pixmap.scaledToWidth(120, Qt::SmoothTransformation));
title_layout->addWidget(icon);
}
not_uploading_layout->addLayout(title_layout);
QLabel *desc = new QLabel(tr("Toggle off the 'Disable Uploading' toggle to enable uploads."));
desc->setStyleSheet("font-size: 48px; font-weight: 400;");
desc->setWordWrap(true);
not_uploading_layout->addWidget(desc);
}
stack->addWidget(notUploading);
setStyleSheet(R"(
WiFiPromptWidget {
background-color: #333333;
@ -99,5 +127,6 @@ void WiFiPromptWidget::updateState(const UIState &s) {
auto network_type = sm["deviceState"].getDeviceState().getNetworkType();
auto uploading = network_type == cereal::DeviceState::NetworkType::WIFI ||
network_type == cereal::DeviceState::NetworkType::ETHERNET;
stack->setCurrentIndex(uploading ? 1 : 0);
bool uploading_disabled = params.getBool("DeviceManagement") && params.getBool("NoUploads");
stack->setCurrentIndex(uploading_disabled ? 2 : uploading ? 1 : 0);
}