diff --git a/app/PySide2-bindings/plugins/SPWC-Amda.py b/app/PySide2-bindings/plugins/SPWC-Amda.py index 3077b18..d084c60 100644 --- a/app/PySide2-bindings/plugins/SPWC-Amda.py +++ b/app/PySide2-bindings/plugins/SPWC-Amda.py @@ -13,19 +13,19 @@ def amda_make_scalar(var=None): if var is None: return ((np.array(), np.array()), DataSeriesType.SCALAR) else: - return ((var.time.copy(),var.data.copy()), DataSeriesType.SCALAR) + return ((var.time,var.data), DataSeriesType.SCALAR) def amda_make_vector(var=None): if var is None: return ((np.array(), np.array()), DataSeriesType.VECTOR) else: - return ((var.time.copy(),var.data.copy()), DataSeriesType.VECTOR) + return ((var.time,var.data), DataSeriesType.VECTOR) def amda_make_multi_comp(var=None): if var is None: return ((np.array(), np.array()), DataSeriesType.MULTICOMPONENT) else: - return ((var.time.copy(),var.data.copy()), DataSeriesType.MULTICOMPONENT) + return ((var.time,var.data), DataSeriesType.MULTICOMPONENT) def amda_make_spectro(var=None): if var is None: @@ -43,7 +43,7 @@ def amda_make_spectro(var=None): y = (max_v + min_v)/2. else: y = np.logspace(1,3,var.data.shape[1])[::-1] - return ((var.time.copy(),var.data.copy()), DataSeriesType.SPECTROGRAM) + return ((var.time,var.data), DataSeriesType.SPECTROGRAM) #return pysciqlopcore.SpectrogramTimeSerie(var.time,y,var.data,min_sampling,max_sampling,True) def amda_get_sample(metadata,start,stop): diff --git a/core b/core index 46467fb..9f4e10a 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 46467fb43b8d07fe4f4a45df949ec4ae858ccf9d +Subproject commit 9f4e10a342eece28498d9b732bf59f8d1908b716 diff --git a/gui/src/DataSource/DataSourceWidget.cpp b/gui/src/DataSource/DataSourceWidget.cpp index 65488d4..60861c5 100644 --- a/gui/src/DataSource/DataSourceWidget.cpp +++ b/gui/src/DataSource/DataSourceWidget.cpp @@ -4,8 +4,11 @@ #include +#include #include +#include + namespace { @@ -19,8 +22,7 @@ const auto TREE_HEADER_LABELS = QStringList { QObject::tr("Name") }; } // namespace DataSourceWidget::DataSourceWidget(QWidget* parent) - : QWidget { parent } - , ui { new Ui::DataSourceWidget } + : QWidget { parent }, ui { new Ui::DataSourceWidget } { ui->setupUi(this); m_model_proxy.setSourceModel(&(sqpApp->dataSources())); @@ -30,13 +32,32 @@ DataSourceWidget::DataSourceWidget(QWidget* parent) m_model_proxy.setRecursiveFilteringEnabled(true); // Connection to filter tree - connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, static_cast( - &QSortFilterProxyModel::setFilterRegExp)); - sqpApp->dataSources().addIcon("satellite",QVariant(QIcon(":/icones/satellite.svg"))); + connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, + static_cast( + &QSortFilterProxyModel::setFilterRegExp)); + sqpApp->dataSources().addIcon("satellite", QVariant(QIcon(":/icones/satellite.svg"))); + + QAction* expandAll = new QAction("Expand all"); + QAction* collapseAll = new QAction("Collapse all"); + ui->treeView->addAction(expandAll); + ui->treeView->addAction(collapseAll); + ui->treeView->setContextMenuPolicy(Qt::ActionsContextMenu); + connect(expandAll, &QAction::triggered, [treeView = ui->treeView](bool checked) { + (void)checked; + treeView->expandAll(); + }); + connect(collapseAll, &QAction::triggered, [treeView = ui->treeView](bool checked) { + (void)checked; + treeView->collapseAll(); + }); + + QCompleter* completer = new QCompleter(this); + completer->setModel(sqpApp->dataSources().completionModel()); + completer->setCaseSensitivity(Qt::CaseInsensitive); + ui->filterLineEdit->setCompleter(completer); } DataSourceWidget::~DataSourceWidget() noexcept { delete ui; } - diff --git a/gui/ui/DataSource/DataSourceWidget.ui b/gui/ui/DataSource/DataSourceWidget.ui index 6750846..bd5fcdf 100644 --- a/gui/ui/DataSource/DataSourceWidget.ui +++ b/gui/ui/DataSource/DataSourceWidget.ui @@ -28,6 +28,9 @@ QAbstractItemView::ExtendedSelection + + false +