Migrates Pacemaker to CorePortType and plain generated members
This commit is contained in:
1 parent
35bfe2be39
commit
15a961182a
2 files changed
+11
-11
No files matched your search
@@ -15,7 +15,7 @@ namespace Core
|
||||
{
|
||||
Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector)
|
||||
: QObject(nullptr)
|
||||
, m_logger(NGL::INGLLoggerBootstrap::getNGLLogger("Core.Pacemaker"))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Core.Pacemaker"))
|
||||
{
|
||||
init(ddsConnector);
|
||||
}
|
||||
@@ -40,11 +40,11 @@ void Pacemaker::setNewState(Core::RunningState newState, const QString& errorStr
|
||||
|
||||
void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString)
|
||||
{
|
||||
m_state.runningState(newState);
|
||||
m_state.runningState = newState;
|
||||
if (errorString.isEmpty())
|
||||
m_state.errorString().reset();
|
||||
m_state.errorString.reset();
|
||||
else
|
||||
m_state.errorString(errorString.toStdString());
|
||||
m_state.errorString = errorString.toStdString();
|
||||
publishState();
|
||||
}
|
||||
|
||||
@@ -59,9 +59,9 @@ void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, cons
|
||||
|
||||
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
|
||||
{
|
||||
if (!m_state.ports().is_set())
|
||||
m_state.ports() = std::vector<Core::PortInformation>();
|
||||
m_state.ports().get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
if (!m_state.ports.is_set())
|
||||
m_state.ports = std::vector<Core::PortInformation>();
|
||||
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||
|
||||
publishState();
|
||||
}
|
||||
@@ -81,8 +81,8 @@ void Pacemaker::init(DDSConnector::DdsConnector* ddsConnector)
|
||||
WARNING_LOG(m_logger) << "Can not initialize DTS::CurrentRunningState!";
|
||||
return;
|
||||
}
|
||||
m_state.pid(QCoreApplication::applicationPid());
|
||||
m_state.runningState(Core::RunningState::Starting);
|
||||
m_state.pid = QCoreApplication::applicationPid();
|
||||
m_state.runningState = Core::RunningState::Starting;
|
||||
|
||||
m_paceThread = new QThread;
|
||||
this->moveToThread(m_paceThread);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
public Q_SLOTS:
|
||||
void setNewState(Core::RunningState newState, const QString &errorString = QString());
|
||||
void addPort(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
|
||||
void addPort(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
|
||||
|
||||
// only public for special purposes, not needed to call explicitly by default
|
||||
void publishState();
|
||||
@@ -48,7 +48,7 @@ public Q_SLOTS:
|
||||
private:
|
||||
void init(DDSConnector::DdsConnector *ddsConnector);
|
||||
void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString());
|
||||
void addPortInternal(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
|
||||
void addPortInternal(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
|
||||
private:
|
||||
static constexpr const int m_publishTimerDelay = 3000;
|
||||
|
||||
|
||||
Reference in new issue
Block a user