migrated to new settings
This commit is contained in:
parent
9b811c10c1
commit
3d18b72eaf
3 changed files with 6 additions and 5 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
#include "ScStw.hpp"
|
#include "ScStw.hpp"
|
||||||
|
#include "scstwsettings.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* This class is used to connect and talk to the ScStw basestation.
|
* This class is used to connect and talk to the ScStw basestation.
|
||||||
|
@ -139,14 +140,14 @@ public slots:
|
||||||
* \param value the value to write to
|
* \param value the value to write to
|
||||||
* \return the status code returned by the command
|
* \return the status code returned by the command
|
||||||
*/
|
*/
|
||||||
ScStw::StatusCode writeRemoteSetting(ScStw::BaseStationSetting key, QString value);
|
ScStw::StatusCode writeRemoteSetting(ScStwSettings::BaseStationSetting key, QString value);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Function to read a setting on the base station
|
* \brief Function to read a setting on the base station
|
||||||
* \param key the key to read from
|
* \param key the key to read from
|
||||||
* \return the value of the key or "false" if the key is not found or an error occured
|
* \return the value of the key or "false" if the key is not found or an error occured
|
||||||
*/
|
*/
|
||||||
QString readRemoteSetting(ScStw::BaseStationSetting key);
|
QString readRemoteSetting(ScStwSettings::BaseStationSetting key);
|
||||||
|
|
||||||
/*! Getter fuctions */
|
/*! Getter fuctions */
|
||||||
|
|
||||||
|
|
|
@ -392,14 +392,14 @@ void ScStwClient::handleSignal(QVariantMap data) {
|
||||||
// --- helper functions ---
|
// --- helper functions ---
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
||||||
ScStw::StatusCode ScStwClient::writeRemoteSetting(ScStw::BaseStationSetting key, QString value) {
|
ScStw::StatusCode ScStwClient::writeRemoteSetting(ScStwSettings::BaseStationSetting key, QString value) {
|
||||||
QJsonArray requestData;
|
QJsonArray requestData;
|
||||||
requestData.append(key);
|
requestData.append(key);
|
||||||
requestData.append(value);
|
requestData.append(value);
|
||||||
return ScStw::StatusCode(this->sendCommand(3000, requestData)["status"].toInt());
|
return ScStw::StatusCode(this->sendCommand(3000, requestData)["status"].toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ScStwClient::readRemoteSetting(ScStw::BaseStationSetting key) {
|
QString ScStwClient::readRemoteSetting(ScStwSettings::BaseStationSetting key) {
|
||||||
QVariantMap reply = this->sendCommand(3001, key);
|
QVariantMap reply = this->sendCommand(3001, key);
|
||||||
if(reply["status"] != 200){
|
if(reply["status"] != 200){
|
||||||
return "false";
|
return "false";
|
||||||
|
|
|
@ -26,7 +26,7 @@ ScStwLibraries::ScStwLibraries(QObject *parent) : QObject(parent)
|
||||||
void ScStwLibraries::init() {
|
void ScStwLibraries::init() {
|
||||||
#ifdef ScStwLibraries_QML
|
#ifdef ScStwLibraries_QML
|
||||||
qmlRegisterType<ScStw>("de.itsblue.ScStw", 2, 0, "ScStw");
|
qmlRegisterType<ScStw>("de.itsblue.ScStw", 2, 0, "ScStw");
|
||||||
qRegisterMetaType<ScStw::BaseStationSetting>("ScStw::BaseStationSetting");
|
qRegisterMetaType<ScStwSettings::BaseStationSetting>("ScStw::BaseStationSetting");
|
||||||
qRegisterMetaType<ScStw::SocketCommand>("ScStw::SocketCommand");
|
qRegisterMetaType<ScStw::SocketCommand>("ScStw::SocketCommand");
|
||||||
|
|
||||||
qmlRegisterType<ScStwRace>("de.itsblue.ScStw", 2, 0, "ScStwRace");
|
qmlRegisterType<ScStwRace>("de.itsblue.ScStw", 2, 0, "ScStwRace");
|
||||||
|
|
Reference in a new issue