Enabled DBus with matrix classes, noticed issue with QList Signature (ad, addddd)

This commit is contained in:
Klaus Basan
2013-07-25 00:10:50 +02:00
parent 9b2cb3b517
commit 2fc08a0376
17 changed files with 225 additions and 15 deletions

View File

@@ -22,5 +22,13 @@
<arg name="altitude" type="(didb(s)(s)b)" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="BlackMisc::Aviation::CAltitude"/>
</method>
<method name="receiveMatrix">
<arg name="matrix" type="(ad)" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="BlackMisc::Math::CMatrix3x3"/>
</method>
<method name="receiveList">
<arg name="list" type="ad" direction="in"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QList&lt;double&gt;"/>
</method>
</interface>
</node>

View File

@@ -7,6 +7,7 @@
#include <QtDBus/qdbusabstractinterface.h>
#include <QtDBus/qdbusconnection.h>
#include <QCoreApplication>
#include <QList>
#include "testservice.h"
#include "testservice_adaptor.h"
@@ -15,6 +16,7 @@
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::Math;
using namespace BlackMiscTest;
/*!
@@ -88,12 +90,19 @@ int main(int argc, char *argv[])
if (connection.send(m)) {
qDebug() << "Send via low level method" << m;
}
TestserviceTool::sleep(2500);
// same as interface message
testserviceInterface.receiveStringMessage(msg);
qDebug() << "Send string via interface" << msg;
TestserviceTool::sleep(2500);
// a list
QList<double> list;
list << 1.0 << 2.0 << 3.0;
testserviceInterface.receiveList(list);
qDebug() << "Send list via interface" << list;
qDebug() << "Key .......";
getchar();
// PQs
CSpeed speed(speedValue++, BlackMisc::PhysicalQuantities::CSpeedUnit::km_h());
@@ -115,8 +124,17 @@ int main(int argc, char *argv[])
testserviceInterface.receiveVariant(qv);
testserviceInterface.receiveAltitude(al);
qDebug() << "Send altitude via interface" << al;
TestserviceTool::sleep(2500);
// Math
CMatrix3x3 m33;
m33.setCellIndex();
testserviceInterface.receiveMatrix(m33);
qDebug() << "Send matrix" << m33;
// next round?
qDebug() << "Key .......";
getchar();
}
}

View File

@@ -1,5 +1,4 @@
QT += core dbus
QT -= gui
TARGET = sample_quantities_avionics_dbus
TEMPLATE = app

View File

@@ -54,12 +54,27 @@ void Testservice::receiveComUnit(const BlackMisc::Aviation::CComSystem &comUnit)
}
/*
* Receivealtitude
* Receive altitude
*/
void Testservice::receiveAltitude(const BlackMisc::Aviation::CAltitude &altitude)
{
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received altitude:" << altitude;
}
/*
* Receive matrix
*/
void Testservice::receiveMatrix(const BlackMisc::Math::CMatrix3x3 &matrix)
{
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received matrix:" << matrix;
}
/*
*
*/
void Testservice::receiveList(const QList<double> &list)
{
qDebug() << "Pid:" << TestserviceTool::getPid() << "Received list:" << list;
}
} // namespace

View File

@@ -76,6 +76,17 @@ public slots:
*/
void receiveAltitude(const BlackMisc::Aviation::CAltitude &altitude);
/*!
* \brief Receive matrix
* \param matrix
*/
void receiveMatrix(const BlackMisc::Math::CMatrix3x3 &matrix);
/*!
* \brief Receive list
* \param list
*/
void receiveList(const QList<double> &list);
public:
static const QString ServiceName;