Browse Source

Merge pull request 'Fix database address from relevant addressing to absolute by use environment variables' (#1) from fix-database-address into add-probes

Reviewed-on: #1
pull/2/head
miladS 1 year ago
parent
commit
a3a411d325
  1. 1
      logic/include/viewModel/MainViewModel.h
  2. 4
      logic/src/viewModel/MainViewModel.cpp

1
logic/include/viewModel/MainViewModel.h

@ -157,6 +157,7 @@ public:
Q_INVOKABLE explicit MainViewModel(QObject* parent = nullptr);
private:
const QString _dbPath = "database/ProbeProperties.db";
signals:
void ledChanged(char value);

4
logic/src/viewModel/MainViewModel.cpp

@ -7,6 +7,7 @@
#include "network/UdpDataSender.h"
#include "model/DatabaseManager.h"
#define US_HOME_PATH "US_HOME"
#define CONNECT_LED(NAME) \
connect(panel, SIGNAL(NAME ## LedChanged(char)), this, SLOT(NAME ## LedHandle(char)));
@ -21,8 +22,7 @@ MainViewModel::MainViewModel(QObject* parent) : ViewModel(parent)
connect(network, &UdpDataSender::dataReady, panel, &Console::newData);
connect(network, &UdpDataSender::probeSlotsDataReady, panel, &Console::newData);
//Read probe ids from the database
QString databasePath = "../../../US_Home/database/ProbeProperties.db";
QString databasePath = QString("%1/%2").arg(qgetenv(US_HOME_PATH), _dbPath);
DatabaseManager manager(databasePath);
QList<QVariant> globalNames = manager.getProbeNames();

Loading…
Cancel
Save