mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
FrogPilot features - Check for new networks once a second
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
#include <QScrollBar>
|
||||
#include <QStyle>
|
||||
|
||||
#include "selfdrive/ui/ui.h"
|
||||
#include "selfdrive/ui/qt/qt_window.h"
|
||||
#include "selfdrive/ui/qt/util.h"
|
||||
#include "selfdrive/ui/qt/widgets/controls.h"
|
||||
@@ -290,6 +289,15 @@ WifiUI::WifiUI(QWidget *parent, WifiManager* wifi) : QWidget(parent), wifi(wifi)
|
||||
color: #696969;
|
||||
}
|
||||
)");
|
||||
|
||||
// FrogPilot variables
|
||||
QObject::connect(uiState(), &UIState::uiUpdate, this, &WifiUI::updateState);
|
||||
}
|
||||
|
||||
void WifiUI::updateState(const UIState &s) {
|
||||
if (!isVisible() || s.sm->frame % UI_FREQ != 0) return;
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
void WifiUI::refresh() {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "selfdrive/ui/qt/widgets/input.h"
|
||||
#include "selfdrive/ui/qt/widgets/ssh_keys.h"
|
||||
#include "selfdrive/ui/qt/widgets/toggle.h"
|
||||
#include "selfdrive/ui/ui.h"
|
||||
|
||||
class WifiItem : public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -45,6 +46,9 @@ private:
|
||||
ListWidget *wifi_list_widget = nullptr;
|
||||
std::vector<WifiItem*> wifi_items;
|
||||
|
||||
// FrogPilot widgets
|
||||
void updateState(const UIState &s);
|
||||
|
||||
signals:
|
||||
void connectToNetwork(const Network n);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user