Commit a3fdfbae authored by Bruno Colombet's avatar Bruno Colombet

in progress

parent ab0daa8b
This diff is collapsed.
......@@ -27,25 +27,27 @@
#include <QWidget>
#include "ui_AwBIDSGUI.h"
#include "AwBIDSSubject.h"
//#include "AwBIDSSubject.h"
#include <qstandarditemmodel.h>
class AwBIDSManager;
#include "AwBIDSNode.h"
class AwBIDSGUI : public QWidget
{
Q_OBJECT
public:
AwBIDSGUI(AwBIDSManager *bids, const QString& rootDir = QString(), QWidget *parent = Q_NULLPTR);
//AwBIDSGUI(AwBIDSManager *bids, const QString& rootDir = QString(), QWidget *parent = Q_NULLPTR);
AwBIDSGUI(QWidget *parent = Q_NULLPTR);
~AwBIDSGUI();
enum Roles { PathRole = Qt::UserRole + 1, TypeRole = Qt::UserRole + 2};
enum ItemTypes { Subject, Session, ieeg, eeg, meg, DataFile };
enum ItemTypes { Subject, Session, ieeg, eeg, meg, Folder, DataFile };
void refresh();
void clear();
void setRootDir(const QString& path);
public slots:
void changeSourceFolder(int index);
// void clear();
// void setRootDir(const QString& path);
//public slots:
// void changeSourceFolder(int index);
signals:
void dataFileClicked(const QString&);
protected slots:
......@@ -53,11 +55,13 @@ protected slots:
protected:
AwBIDSManager * m_bids;
// keep a copy of models for the TreeView
QMap<int, QStandardItemModel *> m_models;
// QMap<int, QStandardItemModel *> m_models;
QStandardItemModel *m_model;
void initModel(QStandardItemModel *model, const AwBIDSSubjectList& subjects);
// void initModel(QStandardItemModel *model, const AwBIDSSubjectList& subjects);
void initModel(const AwBIDSNodes& subjects, QStandardItem *parent);
private:
Ui::AwBIDSGUIUi m_ui;
QStandardItemModel *m_currentModel;
//QStandardItemModel *m_currentModel;
};
......@@ -53,18 +53,6 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Data location:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QComboBox" name="comboSource"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
......
#include "AwBIDSItem.h"
AwBIDSItem::AwBIDSItem(const QString& text, AwBIDSSubject *sub) : QStandardItem(text)
AwBIDSItem::AwBIDSItem(const QString& text, AwBIDSNode *sub) : QStandardItem(text)
{
m_sub = sub;
}
\ No newline at end of file
......@@ -25,13 +25,14 @@
//////////////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QStandardItem>
#include "AwBIDSSubject.h"
//#include "AwBIDSSubject.h"
#include "AwBIDSNode.h"
class AwBIDSItem : public QStandardItem
{
public:
AwBIDSItem(const QString& text, AwBIDSSubject *sub);
inline AwBIDSSubject * subject() { return m_sub; }
AwBIDSItem(const QString& text, AwBIDSNode *sub);
inline AwBIDSNode * subject() { return m_sub; }
protected:
AwBIDSSubject * m_sub;
AwBIDSNode * m_sub;
};
\ No newline at end of file
This diff is collapsed.
......@@ -66,7 +66,8 @@ public:
inline bool isBIDSActive() { return !m_rootDir.isEmpty(); }
inline bool mustValidateMods() { return !m_modifications.isEmpty(); }
void closeBIDS();
inline AwBIDSSubject *getSubject() { return m_currentSubject; }
// inline AwBIDSSubject *getSubject() { return m_currentSubject; }
AwBIDSNodes& subjects() { return m_nodes; }
void toBIDS(const AwArguments& args);
int SEEGtoBIDS(const AwArguments& args);
......@@ -80,7 +81,7 @@ public:
AwBIDSSubjectList& getSubjectsFromSourceDir(int sourceDir = raw);
/** guess subject from a file. Set the subject as the current subject if success. **/
AwBIDSSubject *guessSubject(const QString& path);
// AwBIDSSubject *guessSubject(const QString& path);
// Access to some tsv files
AwChannelList getMontageFromChannelsTsv(const QString& path);
AwMarkerList getMarkersFromEventsTsv(const QString& path);
......@@ -102,11 +103,11 @@ protected:
//int convert4DNI(const AwArguments& args, AwFileIO *reader, const QString& dataFile);
int convertFile(AwFileIO *reader, AwFileIOPlugin *plugin, const QString& file);
void getSubjects(int sourceDir = raw);
void clearSubjects(int sourceDir = raw);
AwFileItem *parseDir(const QString& fullPath, const QString& path);
void parseSubject(AwBIDSSubject *subject);
AwBIDSSubject *getSubject(const QString& ID, int sourceDir = raw);
//void getSubjects(int sourceDir = raw);
//void clearSubjects(int sourceDir = raw);
//AwFileItem *parseDir(const QString& fullPath, const QString& path);
//void parseSubject(AwBIDSSubject *subject);
//AwBIDSSubject *getSubject(const QString& ID, int sourceDir = raw);
QString getParsingPath();
void modifyUpdateJson(const QStringList& branches);
......@@ -120,5 +121,6 @@ protected:
// keep the subject associated with the current open file in AnyWave
AwBIDSSubject *m_currentSubject;
AwBIDSNodes m_nodes;
QHash<QString, AwBIDSNode *> m_IDToSubject;
bool m_mustValidateModifications;
};
\ No newline at end of file
......@@ -40,6 +40,10 @@ public:
inline QString& fullPath() { return m_fullPath; }
inline int type() { return m_type; }
inline QString& ID() { return m_ID; }
inline QList<AwBIDSNode *>& children() { return m_children; }
inline QStringList& files() { return m_files; }
AwBIDSNode * addChild(AwBIDSNode *node) { m_children.append(node); return node; }
void addFiles(const QStringList& files) { m_files.append(files); }
......
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