Commit f64f15df authored by pixhawk's avatar pixhawk

Temporarily removed flite, fixed crash caused by tree view

parent 7b42cbd7
...@@ -116,10 +116,10 @@ linux-g++ { ...@@ -116,10 +116,10 @@ linux-g++ {
LIBS += -lm \ LIBS += -lm \
#-lflite_cmu_us_rms \ #-lflite_cmu_us_rms \
#-lflite_cmu_us_slt \ #-lflite_cmu_us_slt \
-lflite_usenglish \ #-lflite_cmu_us_kal16 \
-lflite_cmulex \ #-lflite_usenglish \
-lflite_cmu_us_kal16 \ #-lflite_cmulex \
-lflite \ #-lflite \
-lSDL \ -lSDL \
-lSDLmain -lSDLmain
} }
......
...@@ -91,7 +91,7 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent), ...@@ -91,7 +91,7 @@ GAudioOutput::GAudioOutput(QObject* parent) : QObject(parent),
voiceIndex(0), voiceIndex(0),
emergency(false) emergency(false)
{ {
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX2
flite_init(); flite_init();
#endif #endif
// Initialize audio output // Initialize audio output
......
...@@ -39,7 +39,7 @@ This file is part of the PIXHAWK project ...@@ -39,7 +39,7 @@ This file is part of the PIXHAWK project
#include <Phonon> #include <Phonon>
#endif #endif
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
#include <flite/flite.h> //#include <flite/flite.h>
#include <phonon> #include <phonon>
#endif #endif
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
...@@ -52,7 +52,7 @@ This file is part of the PIXHAWK project ...@@ -52,7 +52,7 @@ This file is part of the PIXHAWK project
#endif #endif
*/ */
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX2
extern "C" { extern "C" {
cst_voice *REGISTER_VOX(const char *voxdir); cst_voice *REGISTER_VOX(const char *voxdir);
void UNREGISTER_VOX(cst_voice *vox); void UNREGISTER_VOX(cst_voice *vox);
......
...@@ -17,7 +17,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) : ...@@ -17,7 +17,7 @@ ParameterInterface::ParameterInterface(QWidget *parent) :
tree = new ParamTreeModel(); tree = new ParamTreeModel();
treeView = new QTreeView(this); treeView = new QTreeView(this);
//treeView->setModel(tree); treeView->setModel(tree);
QStackedWidget* stack = m_ui->stackedWidget; QStackedWidget* stack = m_ui->stackedWidget;
stack->addWidget(treeView); stack->addWidget(treeView);
......
...@@ -37,6 +37,8 @@ ParamTreeItem::ParamTreeItem(QString name, float value, ParamTreeItem* parent) ...@@ -37,6 +37,8 @@ ParamTreeItem::ParamTreeItem(QString name, float value, ParamTreeItem* parent)
parentItem = parent; parentItem = parent;
paramName = name; paramName = name;
paramValue = value; paramValue = value;
// Initialize empty itemData
itemData = QList<QVariant>();
} }
ParamTreeItem::ParamTreeItem(const QList<QVariant> &data, ParamTreeItem *parent) ParamTreeItem::ParamTreeItem(const QList<QVariant> &data, ParamTreeItem *parent)
...@@ -82,6 +84,8 @@ float ParamTreeItem::getParamValue() ...@@ -82,6 +84,8 @@ float ParamTreeItem::getParamValue()
QVariant ParamTreeItem::data(int column) const QVariant ParamTreeItem::data(int column) const
{ {
if (itemData.empty())
{
QVariant ret; QVariant ret;
switch (column) switch (column)
{ {
...@@ -95,7 +99,12 @@ QVariant ParamTreeItem::data(int column) const ...@@ -95,7 +99,12 @@ QVariant ParamTreeItem::data(int column) const
ret.setValue(QString("")); ret.setValue(QString(""));
break; break;
} }
//return itemData.value(column); return ret;
}
else
{
return itemData.value(column, QVariant(QString("")));
}
} }
ParamTreeItem *ParamTreeItem::parent() ParamTreeItem *ParamTreeItem::parent()
......
...@@ -40,8 +40,9 @@ ParamTreeModel::ParamTreeModel(QObject *parent) ...@@ -40,8 +40,9 @@ ParamTreeModel::ParamTreeModel(QObject *parent)
QList<QVariant> rootData; QList<QVariant> rootData;
rootData << tr("Parameter") << tr("Value"); rootData << tr("Parameter") << tr("Value");
rootItem = new ParamTreeItem(rootData); 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) ParamTreeModel::ParamTreeModel(const QString &data, QObject *parent)
...@@ -80,12 +81,17 @@ QVariant ParamTreeModel::data(const QModelIndex &index, int role) const ...@@ -80,12 +81,17 @@ QVariant ParamTreeModel::data(const QModelIndex &index, int role) const
return item->data(index.column()); return item->data(index.column());
} }
bool ParamTreeModel::setData (const QModelIndex & index, const QVariant & value, int role)
{
}
Qt::ItemFlags ParamTreeModel::flags(const QModelIndex &index) const Qt::ItemFlags ParamTreeModel::flags(const QModelIndex &index) const
{ {
if (!index.isValid()) if (!index.isValid())
return 0; return 0;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
} }
QVariant ParamTreeModel::headerData(int section, Qt::Orientation orientation, QVariant ParamTreeModel::headerData(int section, Qt::Orientation orientation,
......
...@@ -47,6 +47,7 @@ public: ...@@ -47,6 +47,7 @@ public:
~ParamTreeModel(); ~ParamTreeModel();
QVariant data(const QModelIndex &index, int role) const; 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; Qt::ItemFlags flags(const QModelIndex &index) const;
QVariant headerData(int section, Qt::Orientation orientation, QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const; int role = Qt::DisplayRole) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment