mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-18 07:35:47 -05:00
Added microsecond epoch as unique id to channel instances
This commit is contained in:
parent
b91ad7c4b7
commit
d0572a6f84
@ -80,6 +80,7 @@ DSDDemod::DSDDemod(DeviceSourceAPI *deviceAPI) :
|
|||||||
m_channelizer = new DownChannelizer(this);
|
m_channelizer = new DownChannelizer(this);
|
||||||
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||||
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
m_deviceAPI->addThreadedSink(m_threadedChannelizer);
|
||||||
|
m_deviceAPI->addChannelAPI(this);
|
||||||
|
|
||||||
applySettings(m_settings, true);
|
applySettings(m_settings, true);
|
||||||
}
|
}
|
||||||
@ -91,6 +92,7 @@ DSDDemod::~DSDDemod()
|
|||||||
DSPEngine::instance()->removeAudioSink(&m_audioFifo2);
|
DSPEngine::instance()->removeAudioSink(&m_audioFifo2);
|
||||||
delete m_udpBufferAudio;
|
delete m_udpBufferAudio;
|
||||||
|
|
||||||
|
m_deviceAPI->removeChannelAPI(this);
|
||||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||||
delete m_threadedChannelizer;
|
delete m_threadedChannelizer;
|
||||||
delete m_channelizer;
|
delete m_channelizer;
|
||||||
|
@ -18,10 +18,12 @@
|
|||||||
#ifndef INCLUDE_DSDDEMOD_H
|
#ifndef INCLUDE_DSDDEMOD_H
|
||||||
#define INCLUDE_DSDDEMOD_H
|
#define INCLUDE_DSDDEMOD_H
|
||||||
|
|
||||||
#include <dsp/basebandsamplesink.h>
|
|
||||||
#include <dsp/phasediscri.h>
|
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "dsp/basebandsamplesink.h"
|
||||||
|
#include "channel/channelsinkapi.h"
|
||||||
|
#include "dsp/phasediscri.h"
|
||||||
#include "dsp/nco.h"
|
#include "dsp/nco.h"
|
||||||
#include "dsp/interpolator.h"
|
#include "dsp/interpolator.h"
|
||||||
#include "dsp/lowpass.h"
|
#include "dsp/lowpass.h"
|
||||||
@ -40,7 +42,7 @@ class DeviceSourceAPI;
|
|||||||
class ThreadedBasebandSampleSink;
|
class ThreadedBasebandSampleSink;
|
||||||
class DownChannelizer;
|
class DownChannelizer;
|
||||||
|
|
||||||
class DSDDemod : public BasebandSampleSink {
|
class DSDDemod : public BasebandSampleSink, public ChannelSinkAPI {
|
||||||
public:
|
public:
|
||||||
class MsgConfigureDSDDemod : public Message {
|
class MsgConfigureDSDDemod : public Message {
|
||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
@ -99,6 +101,10 @@ public:
|
|||||||
virtual void stop();
|
virtual void stop();
|
||||||
virtual bool handleMessage(const Message& cmd);
|
virtual bool handleMessage(const Message& cmd);
|
||||||
|
|
||||||
|
virtual int getDeltaFrequency() const { return m_settings.m_inputFrequencyOffset; }
|
||||||
|
virtual void getIdentifier(QString& id) { id = objectName(); }
|
||||||
|
virtual void getTitle(QString& title) { title = m_settings.m_title; }
|
||||||
|
|
||||||
double getMagSq() { return m_magsq; }
|
double getMagSq() { return m_magsq; }
|
||||||
bool getSquelchOpen() const { return m_squelchOpen; }
|
bool getSquelchOpen() const { return m_squelchOpen; }
|
||||||
|
|
||||||
|
@ -232,8 +232,9 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p)
|
|||||||
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
m_settings.m_udpAddress = m_channelMarker.getUDPAddress(),
|
||||||
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
m_settings.m_udpPort = m_channelMarker.getUDPSendPort(),
|
||||||
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
m_settings.m_rgbColor = m_channelMarker.getColor().rgb();
|
||||||
|
m_settings.m_title = m_channelMarker.getTitle();
|
||||||
|
|
||||||
setWindowTitle(m_channelMarker.getTitle());
|
setWindowTitle(m_settings.m_title);
|
||||||
setTitleColor(m_settings.m_rgbColor);
|
setTitleColor(m_settings.m_rgbColor);
|
||||||
displayUDPAddress();
|
displayUDPAddress();
|
||||||
|
|
||||||
@ -338,6 +339,7 @@ void DSDDemodGUI::displaySettings()
|
|||||||
m_channelMarker.blockSignals(true);
|
m_channelMarker.blockSignals(true);
|
||||||
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
|
||||||
m_channelMarker.setColor(m_settings.m_rgbColor);
|
m_channelMarker.setColor(m_settings.m_rgbColor);
|
||||||
|
m_channelMarker.setTitle(m_settings.m_title);
|
||||||
m_channelMarker.blockSignals(false);
|
m_channelMarker.blockSignals(false);
|
||||||
setTitleColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
setTitleColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@ void DSDDemodSettings::resetToDefaults()
|
|||||||
m_udpAddress = "127.0.0.1";
|
m_udpAddress = "127.0.0.1";
|
||||||
m_udpPort = 9999;
|
m_udpPort = 9999;
|
||||||
m_rgbColor = QColor(0, 255, 255).rgb();
|
m_rgbColor = QColor(0, 255, 255).rgb();
|
||||||
|
m_title = "DSD Demodulator";
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray DSDDemodSettings::serialize() const
|
QByteArray DSDDemodSettings::serialize() const
|
||||||
@ -81,6 +82,8 @@ QByteArray DSDDemodSettings::serialize() const
|
|||||||
s.writeBlob(17, m_channelMarker->serialize());
|
s.writeBlob(17, m_channelMarker->serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.writeString(18, m_title);
|
||||||
|
|
||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +135,7 @@ bool DSDDemodSettings::deserialize(const QByteArray& data)
|
|||||||
d.readBool(14, &m_slot1On, false);
|
d.readBool(14, &m_slot1On, false);
|
||||||
d.readBool(15, &m_slot2On, false);
|
d.readBool(15, &m_slot2On, false);
|
||||||
d.readBool(16, &m_tdmaStereo, false);
|
d.readBool(16, &m_tdmaStereo, false);
|
||||||
|
d.readString(18, &m_title, "DSD Demodulator");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,7 @@ struct DSDDemodSettings
|
|||||||
QString m_udpAddress;
|
QString m_udpAddress;
|
||||||
quint16 m_udpPort;
|
quint16 m_udpPort;
|
||||||
quint32 m_rgbColor;
|
quint32 m_rgbColor;
|
||||||
|
QString m_title;
|
||||||
|
|
||||||
Serializable *m_channelMarker;
|
Serializable *m_channelMarker;
|
||||||
Serializable *m_scopeGUI;
|
Serializable *m_scopeGUI;
|
||||||
|
@ -63,6 +63,7 @@ set(sdrbase_SOURCES
|
|||||||
util/samplesourceserializer.cpp
|
util/samplesourceserializer.cpp
|
||||||
util/simpleserializer.cpp
|
util/simpleserializer.cpp
|
||||||
#util/spinlock.cpp
|
#util/spinlock.cpp
|
||||||
|
util/uid.cpp
|
||||||
|
|
||||||
plugin/plugininterface.cpp
|
plugin/plugininterface.cpp
|
||||||
plugin/pluginapi.cpp
|
plugin/pluginapi.cpp
|
||||||
@ -162,6 +163,7 @@ set(sdrbase_HEADERS
|
|||||||
util/samplesourceserializer.h
|
util/samplesourceserializer.h
|
||||||
util/simpleserializer.h
|
util/simpleserializer.h
|
||||||
#util/spinlock.h
|
#util/spinlock.h
|
||||||
|
util/uid.h
|
||||||
|
|
||||||
webapi/webapiadapterinterface.h
|
webapi/webapiadapterinterface.h
|
||||||
webapi/webapirequestmapper.h
|
webapi/webapirequestmapper.h
|
||||||
|
@ -16,8 +16,11 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "util/uid.h"
|
||||||
#include "channelsinkapi.h"
|
#include "channelsinkapi.h"
|
||||||
|
|
||||||
ChannelSinkAPI::ChannelSinkAPI() :
|
ChannelSinkAPI::ChannelSinkAPI() :
|
||||||
m_indexInDeviceSet(-1)
|
m_indexInDeviceSet(-1),
|
||||||
{ }
|
m_uid(UidCalculator::getNewObjectId())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#define SDRBASE_CHANNEL_CHANNELSINKAPI_H_
|
#define SDRBASE_CHANNEL_CHANNELSINKAPI_H_
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
|
|
||||||
class SDRANGEL_API ChannelSinkAPI {
|
class SDRANGEL_API ChannelSinkAPI {
|
||||||
@ -33,9 +35,11 @@ public:
|
|||||||
|
|
||||||
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
||||||
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
||||||
|
uint64_t getUID() const { return m_uid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_indexInDeviceSet;
|
int m_indexInDeviceSet;
|
||||||
|
uint64_t m_uid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,9 +16,11 @@
|
|||||||
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "util/uid.h"
|
||||||
#include "channelsourceapi.h"
|
#include "channelsourceapi.h"
|
||||||
|
|
||||||
ChannelSourceAPI::ChannelSourceAPI() :
|
ChannelSourceAPI::ChannelSourceAPI() :
|
||||||
m_indexInDeviceSet(-1)
|
m_indexInDeviceSet(-1),
|
||||||
|
m_uid(UidCalculator::getNewObjectId())
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#define SDRBASE_CHANNEL_CHANNELSOURCEAPI_H_
|
#define SDRBASE_CHANNEL_CHANNELSOURCEAPI_H_
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "util/export.h"
|
#include "util/export.h"
|
||||||
|
|
||||||
class SDRANGEL_API ChannelSourceAPI {
|
class SDRANGEL_API ChannelSourceAPI {
|
||||||
@ -33,9 +35,11 @@ public:
|
|||||||
|
|
||||||
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
int getIndexInDeviceSet() const { return m_indexInDeviceSet; }
|
||||||
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
void setIndexInDeviceSet(int indexInDeviceSet) { m_indexInDeviceSet = indexInDeviceSet; }
|
||||||
|
uint64_t getUID() const { return m_uid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_indexInDeviceSet;
|
int m_indexInDeviceSet;
|
||||||
|
uint64_t m_uid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ SOURCES += audio/audiodeviceinfo.cpp\
|
|||||||
util/syncmessenger.cpp\
|
util/syncmessenger.cpp\
|
||||||
util/samplesourceserializer.cpp\
|
util/samplesourceserializer.cpp\
|
||||||
util/simpleserializer.cpp\
|
util/simpleserializer.cpp\
|
||||||
|
util/uid.cpp\
|
||||||
plugin/plugininterface.cpp\
|
plugin/plugininterface.cpp\
|
||||||
plugin/pluginapi.cpp\
|
plugin/pluginapi.cpp\
|
||||||
plugin/pluginmanager.cpp\
|
plugin/pluginmanager.cpp\
|
||||||
@ -189,6 +190,7 @@ HEADERS += audio/audiodeviceinfo.h\
|
|||||||
util/syncmessenger.h\
|
util/syncmessenger.h\
|
||||||
util/samplesourceserializer.h\
|
util/samplesourceserializer.h\
|
||||||
util/simpleserializer.h\
|
util/simpleserializer.h\
|
||||||
|
util/uid.h\
|
||||||
webapi/webapiadapterinterface.h\
|
webapi/webapiadapterinterface.h\
|
||||||
webapi/webapirequestmapper.h\
|
webapi/webapirequestmapper.h\
|
||||||
webapi/webapiserver.h\
|
webapi/webapiserver.h\
|
||||||
|
88
sdrbase/util/uid.cpp
Normal file
88
sdrbase/util/uid.cpp
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2017 F4EXB //
|
||||||
|
// written by Edouard Griffiths //
|
||||||
|
// //
|
||||||
|
// Object unique id calculator loosely inspired by MongoDB object id //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QTime>
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QHostInfo>
|
||||||
|
#include <QCryptographicHash>
|
||||||
|
|
||||||
|
#ifdef _WIN32_
|
||||||
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "uid.h"
|
||||||
|
|
||||||
|
uint64_t UidCalculator::getNewObjectId()
|
||||||
|
{
|
||||||
|
QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||||
|
uint64_t uid = currentDateTime.toTime_t();
|
||||||
|
uid *= 1000000UL; // make room for microseconds
|
||||||
|
|
||||||
|
// Fallback to milliseconds:
|
||||||
|
// QTime timeNow = QTime::currentTime();
|
||||||
|
// uint64_t usecs = timeNow.msec() * 1000UL;
|
||||||
|
// uid += usecs;
|
||||||
|
uid += getCurrentMiroseconds();
|
||||||
|
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t UidCalculator::getNewInstanceId()
|
||||||
|
{
|
||||||
|
uint32_t uid = (QCoreApplication::applicationPid() % (1<<16));
|
||||||
|
|
||||||
|
QString hostname = QHostInfo::localHostName();
|
||||||
|
QByteArray hashKey = QCryptographicHash::hash(hostname.toUtf8(), QCryptographicHash::Sha1);
|
||||||
|
uint32_t hashHost = 0;
|
||||||
|
|
||||||
|
for (int i = 0; i < hashKey.size(); i++) {
|
||||||
|
char c = hashKey.at(i);
|
||||||
|
hashHost += (uint32_t) c;
|
||||||
|
}
|
||||||
|
|
||||||
|
hashHost %= (1<<16);
|
||||||
|
uid += (hashHost<<16);
|
||||||
|
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t UidCalculator::getCurrentMiroseconds()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32_
|
||||||
|
LARGE_INTEGER tickPerSecond;
|
||||||
|
LARGE_INTEGER tick; // a point in time
|
||||||
|
|
||||||
|
// get the high resolution counter's accuracy
|
||||||
|
QueryPerformanceFrequency(&tickPerSecond);
|
||||||
|
|
||||||
|
// what time is it ?
|
||||||
|
QueryPerformanceCounter(&tick);
|
||||||
|
|
||||||
|
// and here we get the current microsecond! \o/
|
||||||
|
return (tick.QuadPart % tickPerSecond.QuadPart);
|
||||||
|
#else
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, 0);
|
||||||
|
return tv.tv_usec;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
45
sdrbase/util/uid.h
Normal file
45
sdrbase/util/uid.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Copyright (C) 2017 F4EXB //
|
||||||
|
// written by Edouard Griffiths //
|
||||||
|
// //
|
||||||
|
// Object unique id calculator loosely inspired by MongoDB object id //
|
||||||
|
// //
|
||||||
|
// This program is free software; you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation as version 3 of the License, or //
|
||||||
|
// //
|
||||||
|
// This program is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License V3 for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
#ifndef SDRBASE_UTIL_UID_H_
|
||||||
|
#define SDRBASE_UTIL_UID_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
class UidCalculator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Get a new object unique Id. It is the addition of:
|
||||||
|
* - 6 digit microseconds in current second
|
||||||
|
* - 4 byte Unix epoch multiplied by 1000000
|
||||||
|
*/
|
||||||
|
static uint64_t getNewObjectId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a new instance unique Id. It is made of from LSB to MSB:
|
||||||
|
* - 2 byte process id
|
||||||
|
* - 2 byte hashed host name
|
||||||
|
*/
|
||||||
|
static uint32_t getNewInstanceId();
|
||||||
|
|
||||||
|
private:
|
||||||
|
static uint64_t getCurrentMiroseconds();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* SDRBASE_UTIL_UID_H_ */
|
@ -97,6 +97,7 @@ int WebAPIAdapterGUI::instanceSummary(
|
|||||||
ChannelSourceAPI *channel = (*it)->m_deviceSinkAPI->getChanelAPIAt(i);
|
ChannelSourceAPI *channel = (*it)->m_deviceSinkAPI->getChanelAPIAt(i);
|
||||||
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
|
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
|
||||||
channels->back()->setIndex(channel->getIndexInDeviceSet());
|
channels->back()->setIndex(channel->getIndexInDeviceSet());
|
||||||
|
channels->back()->setUid(channel->getUID());
|
||||||
channel->getIdentifier(*channels->back()->getId());
|
channel->getIdentifier(*channels->back()->getId());
|
||||||
channel->getTitle(*channels->back()->getTitle());
|
channel->getTitle(*channels->back()->getTitle());
|
||||||
}
|
}
|
||||||
@ -126,6 +127,7 @@ int WebAPIAdapterGUI::instanceSummary(
|
|||||||
ChannelSinkAPI *channel = (*it)->m_deviceSourceAPI->getChanelAPIAt(i);
|
ChannelSinkAPI *channel = (*it)->m_deviceSourceAPI->getChanelAPIAt(i);
|
||||||
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
|
channels->back()->setDeltaFrequency(channel->getDeltaFrequency());
|
||||||
channels->back()->setIndex(channel->getIndexInDeviceSet());
|
channels->back()->setIndex(channel->getIndexInDeviceSet());
|
||||||
|
channels->back()->setUid(channel->getUID());
|
||||||
channel->getIdentifier(*channels->back()->getId());
|
channel->getIdentifier(*channels->back()->getId());
|
||||||
channel->getTitle(*channels->back()->getTitle());
|
channel->getTitle(*channels->back()->getTitle());
|
||||||
}
|
}
|
||||||
|
@ -599,6 +599,7 @@ definitions:
|
|||||||
required:
|
required:
|
||||||
- index
|
- index
|
||||||
- id
|
- id
|
||||||
|
- uid
|
||||||
- title
|
- title
|
||||||
- deltaFrequency
|
- deltaFrequency
|
||||||
properties:
|
properties:
|
||||||
@ -608,6 +609,10 @@ definitions:
|
|||||||
id:
|
id:
|
||||||
description: "Key to identify the type of channel"
|
description: "Key to identify the type of channel"
|
||||||
type: string
|
type: string
|
||||||
|
uid:
|
||||||
|
description: "Channel instance unique id"
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
title:
|
title:
|
||||||
description: "Freeform title of the channel"
|
description: "Freeform title of the channel"
|
||||||
type: string
|
type: string
|
||||||
|
@ -737,7 +737,7 @@ margin-bottom: 20px;
|
|||||||
"description" : "Audio devices selected"
|
"description" : "Audio devices selected"
|
||||||
};
|
};
|
||||||
defs.Channel = {
|
defs.Channel = {
|
||||||
"required" : [ "deltaFrequency", "id", "index", "title" ],
|
"required" : [ "deltaFrequency", "id", "index", "title", "uid" ],
|
||||||
"properties" : {
|
"properties" : {
|
||||||
"index" : {
|
"index" : {
|
||||||
"type" : "integer",
|
"type" : "integer",
|
||||||
@ -747,6 +747,11 @@ margin-bottom: 20px;
|
|||||||
"type" : "string",
|
"type" : "string",
|
||||||
"description" : "Key to identify the type of channel"
|
"description" : "Key to identify the type of channel"
|
||||||
},
|
},
|
||||||
|
"uid" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"format" : "int64",
|
||||||
|
"description" : "Channel instance unique id"
|
||||||
|
},
|
||||||
"title" : {
|
"title" : {
|
||||||
"type" : "string",
|
"type" : "string",
|
||||||
"description" : "Freeform title of the channel"
|
"description" : "Freeform title of the channel"
|
||||||
@ -7297,7 +7302,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2017-11-19T03:28:56.995+01:00
|
Generated 2017-11-19T10:38:58.684+01:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -39,6 +39,7 @@ void
|
|||||||
SWGChannel::init() {
|
SWGChannel::init() {
|
||||||
index = 0;
|
index = 0;
|
||||||
id = new QString("");
|
id = new QString("");
|
||||||
|
uid = 0L;
|
||||||
title = new QString("");
|
title = new QString("");
|
||||||
delta_frequency = 0;
|
delta_frequency = 0;
|
||||||
}
|
}
|
||||||
@ -51,6 +52,7 @@ SWGChannel::cleanup() {
|
|||||||
delete id;
|
delete id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(title != nullptr) {
|
if(title != nullptr) {
|
||||||
delete title;
|
delete title;
|
||||||
}
|
}
|
||||||
@ -70,6 +72,7 @@ void
|
|||||||
SWGChannel::fromJsonObject(QJsonObject &pJson) {
|
SWGChannel::fromJsonObject(QJsonObject &pJson) {
|
||||||
::Swagger::setValue(&index, pJson["index"], "qint32", "");
|
::Swagger::setValue(&index, pJson["index"], "qint32", "");
|
||||||
::Swagger::setValue(&id, pJson["id"], "QString", "QString");
|
::Swagger::setValue(&id, pJson["id"], "QString", "QString");
|
||||||
|
::Swagger::setValue(&uid, pJson["uid"], "qint64", "");
|
||||||
::Swagger::setValue(&title, pJson["title"], "QString", "QString");
|
::Swagger::setValue(&title, pJson["title"], "QString", "QString");
|
||||||
::Swagger::setValue(&delta_frequency, pJson["deltaFrequency"], "qint32", "");
|
::Swagger::setValue(&delta_frequency, pJson["deltaFrequency"], "qint32", "");
|
||||||
}
|
}
|
||||||
@ -92,6 +95,8 @@ SWGChannel::asJsonObject() {
|
|||||||
|
|
||||||
toJsonValue(QString("id"), id, obj, QString("QString"));
|
toJsonValue(QString("id"), id, obj, QString("QString"));
|
||||||
|
|
||||||
|
obj->insert("uid", QJsonValue(uid));
|
||||||
|
|
||||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||||
|
|
||||||
obj->insert("deltaFrequency", QJsonValue(delta_frequency));
|
obj->insert("deltaFrequency", QJsonValue(delta_frequency));
|
||||||
@ -117,6 +122,15 @@ SWGChannel::setId(QString* id) {
|
|||||||
this->id = id;
|
this->id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qint64
|
||||||
|
SWGChannel::getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGChannel::setUid(qint64 uid) {
|
||||||
|
this->uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
QString*
|
QString*
|
||||||
SWGChannel::getTitle() {
|
SWGChannel::getTitle() {
|
||||||
return title;
|
return title;
|
||||||
|
@ -48,6 +48,9 @@ public:
|
|||||||
QString* getId();
|
QString* getId();
|
||||||
void setId(QString* id);
|
void setId(QString* id);
|
||||||
|
|
||||||
|
qint64 getUid();
|
||||||
|
void setUid(qint64 uid);
|
||||||
|
|
||||||
QString* getTitle();
|
QString* getTitle();
|
||||||
void setTitle(QString* title);
|
void setTitle(QString* title);
|
||||||
|
|
||||||
@ -58,6 +61,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
qint32 index;
|
qint32 index;
|
||||||
QString* id;
|
QString* id;
|
||||||
|
qint64 uid;
|
||||||
QString* title;
|
QString* title;
|
||||||
qint32 delta_frequency;
|
qint32 delta_frequency;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user