mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Enabled DBus with matrix classes, noticed issue with QList Signature (ad, addddd)
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "blackmisc/basestreamstringifier.h"
|
||||
#include "blackmisc/mathvector3dbase.h"
|
||||
#include <QGenericMatrix>
|
||||
#include <QDBusMetaType>
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -49,6 +50,34 @@ protected:
|
||||
*/
|
||||
QString stringForConverter() const;
|
||||
|
||||
/*!
|
||||
* \brief Stream to DBus
|
||||
* \param argument
|
||||
*/
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const {
|
||||
const QList<double> l = this->toList();
|
||||
|
||||
// there is an issue with the signature of QList, so I use
|
||||
// individual values
|
||||
foreach(double v, l) {
|
||||
argument << v;
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Stream from DBus
|
||||
* \param argument
|
||||
*/
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument) {
|
||||
QList<double> list;
|
||||
double v;
|
||||
while(!argument.atEnd()) {
|
||||
argument >> v;
|
||||
list.append(v);
|
||||
}
|
||||
this->fromList(list);
|
||||
}
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
@@ -75,6 +104,18 @@ public:
|
||||
*/
|
||||
virtual ~CMatrixBase() {}
|
||||
|
||||
/*!
|
||||
* \brief List of values
|
||||
* \return
|
||||
*/
|
||||
const QList<double> toList() const;
|
||||
|
||||
/*!
|
||||
* \brief List of values
|
||||
* \return
|
||||
*/
|
||||
void fromList(const QList<double> &list);
|
||||
|
||||
/*!
|
||||
* \brief Equal operator ==
|
||||
* \param otherMatrix
|
||||
@@ -264,6 +305,11 @@ public:
|
||||
*/
|
||||
bool isZero() const;
|
||||
|
||||
/*!
|
||||
* \brief Each cell gets a unique index (used primarily for testing)
|
||||
*/
|
||||
void setCellIndex();
|
||||
|
||||
/*!
|
||||
* \brief Is identity matrix? Epsilon considered.
|
||||
* \return
|
||||
@@ -342,6 +388,11 @@ public:
|
||||
return this->getElement(row, column);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Register metadata
|
||||
*/
|
||||
static void registerMetadata();
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Check range of row / column
|
||||
|
||||
Reference in New Issue
Block a user