diff --git a/logic/include/viewModel/MainViewModel.h b/logic/include/viewModel/MainViewModel.h index 039769a..1c54b8c 100644 --- a/logic/include/viewModel/MainViewModel.h +++ b/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); diff --git a/logic/src/viewModel/MainViewModel.cpp b/logic/src/viewModel/MainViewModel.cpp index b3b1fa4..02faedd 100644 --- a/logic/src/viewModel/MainViewModel.cpp +++ b/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 globalNames = manager.getProbeNames();