read bool param with read_db_bool (#2205)

* read bool param with read_db_bool

* Update selfdrive/loggerd/loggerd.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>

Co-authored-by: Willem Melching <willem.melching@gmail.com>
pull/2216/head
Dean Lee 5 years ago committed by GitHub
parent f55e79e46a
commit 0e5a5efffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      selfdrive/loggerd/loggerd.cc
  2. 5
      selfdrive/ui/qt/settings.cc

@ -113,8 +113,7 @@ void encoder_thread(bool is_streaming, bool raw_clips, int cam_idx) {
if (cam_idx == CAM_IDX_DCAM) {
// TODO: add this back
#ifndef QCOM2
std::vector<char> value = read_db_bytes("RecordFront");
if (value.size() == 0 || value[0] != '1') return;
if (!read_db_bool("RecordFront")) return;
LOGW("recording front camera");
#endif
set_thread_name("FrontCameraEncoder");
@ -461,8 +460,7 @@ kj::Array<capnp::word> gen_init_data() {
init.setGitRemote(capnp::Text::Reader(git_remote.data(), git_remote.size()));
}
std::vector<char> passive = read_db_bytes("Passive");
init.setPassive(passive.size() > 0 && passive[0] == '1');
init.setPassive(read_db_bool("Passive"));
{
// log params
std::map<std::string, std::string> params;

@ -43,10 +43,7 @@ ParamsToggle::ParamsToggle(QString param, QString title, QString description, QS
setLayout(hlayout);
auto p = read_db_bytes(param.toStdString().c_str());
if (p.size()){
checkbox->setChecked(p[0] == '1');
}
checkbox->setChecked(read_db_bool(param.toStdString().c_str()));
setStyleSheet(R"(
QCheckBox { font-size: 70px }

Loading…
Cancel
Save