diff --git a/qgroundcontrol.pri b/qgroundcontrol.pri index 927072e1235900e65545328dc1330794fdc79482..0b8fb287d384104a1d7d255904a350512246f9a7 100644 --- a/qgroundcontrol.pri +++ b/qgroundcontrol.pri @@ -116,10 +116,10 @@ linux-g++ { LIBS += -lm \ #-lflite_cmu_us_rms \ #-lflite_cmu_us_slt \ - -lflite_usenglish \ - -lflite_cmulex \ - -lflite_cmu_us_kal16 \ - -lflite \ + #-lflite_cmu_us_kal16 \ + #-lflite_usenglish \ + #-lflite_cmulex \ + #-lflite \ -lSDL \ -lSDLmain } diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 0fb7fa8211c827ec8f86d00fe4f8a4482680e71d..fd468bcc72c77061ddb6b8990c1ee47d14e31b74 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.cc @@ -91,7 +91,7 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent), voiceIndex(0), emergency(false) { -#ifdef Q_OS_LINUX +#ifdef Q_OS_LINUX2 flite_init(); #endif // Initialize audio output diff --git a/src/GAudioOutput.h b/src/GAudioOutput.h index 896a0166125d77f4eddf4c24b56780075b557f8b..366af9e3395d0cd1f0c388649195bfbecc2121df 100644 --- a/src/GAudioOutput.h +++ b/src/GAudioOutput.h @@ -39,7 +39,7 @@ This file is part of the PIXHAWK project #include #endif #ifdef Q_OS_LINUX -#include +//#include #include #endif #ifdef Q_OS_WIN @@ -52,7 +52,7 @@ This file is part of the PIXHAWK project #endif */ -#ifdef Q_OS_LINUX +#ifdef Q_OS_LINUX2 extern "C" { cst_voice *REGISTER_VOX(const char *voxdir); void UNREGISTER_VOX(cst_voice *vox); diff --git a/src/ui/ParameterInterface.cc b/src/ui/ParameterInterface.cc index cbc161dc9daf959d5995218ab778dc7ff557d175..4dc21b3332ff78c6c1ef667dc11f16220d71ea3a 100644 --- a/src/ui/ParameterInterface.cc +++ b/src/ui/ParameterInterface.cc @@ -17,7 +17,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) : tree = new ParamTreeModel(); treeView = new QTreeView(this); - //treeView->setModel(tree); + treeView->setModel(tree); QStackedWidget* stack = m_ui->stackedWidget; stack->addWidget(treeView); diff --git a/src/ui/param/ParamTreeItem.cc b/src/ui/param/ParamTreeItem.cc index f59055c93af2e1cb79aef62f0274d914138bdb5b..29cd8815bf1d24f433e69ed3b45721dd8939c7a7 100644 --- a/src/ui/param/ParamTreeItem.cc +++ b/src/ui/param/ParamTreeItem.cc @@ -37,6 +37,8 @@ ParamTreeItem::ParamTreeItem(QString name, float value, ParamTreeItem* parent) parentItem = parent; paramName = name; paramValue = value; + // Initialize empty itemData + itemData = QList(); } ParamTreeItem::ParamTreeItem(const QList &data, ParamTreeItem *parent) @@ -82,20 +84,27 @@ float ParamTreeItem::getParamValue() QVariant ParamTreeItem::data(int column) const { - QVariant ret; - switch (column) + if (itemData.empty()) { - case 0: - ret.setValue(paramName); - break; - case 1: - ret.setValue(paramValue); - break; - default: - ret.setValue(QString("")); - break; + QVariant ret; + switch (column) + { + case 0: + ret.setValue(paramName); + break; + case 1: + ret.setValue(paramValue); + break; + default: + ret.setValue(QString("")); + break; + } + return ret; + } + else + { + return itemData.value(column, QVariant(QString(""))); } - //return itemData.value(column); } ParamTreeItem *ParamTreeItem::parent() diff --git a/src/ui/param/ParamTreeModel.cc b/src/ui/param/ParamTreeModel.cc index 797f85cb3170b59165e05f2863df32e0335dd7c7..b3484ff81352527c4a6d8cfe4c64ba89d18671f3 100644 --- a/src/ui/param/ParamTreeModel.cc +++ b/src/ui/param/ParamTreeModel.cc @@ -40,8 +40,9 @@ ParamTreeModel::ParamTreeModel(QObject *parent) QList rootData; rootData << tr("Parameter") << tr("Value"); rootItem = new ParamTreeItem(rootData); - QString data = "IMU\n ROLL_K_I\t1.255\n PITCH_K_P\t0.621\n PITCH_K_I\t2.5545\n"; - setupModelData(data.split(QString("\n")), rootItem); + + //String data = "IMU\n ROLL_K_I\t1.255\n PITCH_K_P\t0.621\n PITCH_K_I\t2.5545\n"; + //setupModelData(data.split(QString("\n")), rootItem); } ParamTreeModel::ParamTreeModel(const QString &data, QObject *parent) @@ -80,12 +81,17 @@ QVariant ParamTreeModel::data(const QModelIndex &index, int role) const return item->data(index.column()); } +bool ParamTreeModel::setData (const QModelIndex & index, const QVariant & value, int role) +{ + +} + Qt::ItemFlags ParamTreeModel::flags(const QModelIndex &index) const { if (!index.isValid()) return 0; - return Qt::ItemIsEnabled | Qt::ItemIsSelectable; + return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable; } QVariant ParamTreeModel::headerData(int section, Qt::Orientation orientation, diff --git a/src/ui/param/ParamTreeModel.h b/src/ui/param/ParamTreeModel.h index b0a190287b3d9329aaa28fb56ab3514828127d7d..1852c16ef5a1af3e3a89785d09b3f2f1d0229607 100644 --- a/src/ui/param/ParamTreeModel.h +++ b/src/ui/param/ParamTreeModel.h @@ -47,6 +47,7 @@ public: ~ParamTreeModel(); QVariant data(const QModelIndex &index, int role) const; + bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); Qt::ItemFlags flags(const QModelIndex &index) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;