##// END OF EJS Templates
Product tree features:...
jeandet -
r1497:1e241bda0af5
parent child
Show More
@@ -13,19 +13,19 def amda_make_scalar(var=None):
13 13 if var is None:
14 14 return ((np.array(), np.array()), DataSeriesType.SCALAR)
15 15 else:
16 return ((var.time.copy(),var.data.copy()), DataSeriesType.SCALAR)
16 return ((var.time,var.data), DataSeriesType.SCALAR)
17 17
18 18 def amda_make_vector(var=None):
19 19 if var is None:
20 20 return ((np.array(), np.array()), DataSeriesType.VECTOR)
21 21 else:
22 return ((var.time.copy(),var.data.copy()), DataSeriesType.VECTOR)
22 return ((var.time,var.data), DataSeriesType.VECTOR)
23 23
24 24 def amda_make_multi_comp(var=None):
25 25 if var is None:
26 26 return ((np.array(), np.array()), DataSeriesType.MULTICOMPONENT)
27 27 else:
28 return ((var.time.copy(),var.data.copy()), DataSeriesType.MULTICOMPONENT)
28 return ((var.time,var.data), DataSeriesType.MULTICOMPONENT)
29 29
30 30 def amda_make_spectro(var=None):
31 31 if var is None:
@@ -43,7 +43,7 def amda_make_spectro(var=None):
43 43 y = (max_v + min_v)/2.
44 44 else:
45 45 y = np.logspace(1,3,var.data.shape[1])[::-1]
46 return ((var.time.copy(),var.data.copy()), DataSeriesType.SPECTROGRAM)
46 return ((var.time,var.data), DataSeriesType.SPECTROGRAM)
47 47 #return pysciqlopcore.SpectrogramTimeSerie(var.time,y,var.data,min_sampling,max_sampling,True)
48 48
49 49 def amda_get_sample(metadata,start,stop):
@@ -1,1 +1,1
1 Subproject commit 46467fb43b8d07fe4f4a45df949ec4ae858ccf9d
1 Subproject commit 9f4e10a342eece28498d9b732bf59f8d1908b716
@@ -4,8 +4,11
4 4
5 5 #include <DataSource/datasources.h>
6 6
7 #include <QCompleter>
7 8 #include <SqpApplication.h>
8 9
10 #include <QAction>
11
9 12
10 13 namespace
11 14 {
@@ -19,8 +22,7 const auto TREE_HEADER_LABELS = QStringList { QObject::tr("Name") };
19 22 } // namespace
20 23
21 24 DataSourceWidget::DataSourceWidget(QWidget* parent)
22 : QWidget { parent }
23 , ui { new Ui::DataSourceWidget }
25 : QWidget { parent }, ui { new Ui::DataSourceWidget }
24 26 {
25 27 ui->setupUi(this);
26 28 m_model_proxy.setSourceModel(&(sqpApp->dataSources()));
@@ -30,13 +32,32 DataSourceWidget::DataSourceWidget(QWidget* parent)
30 32 m_model_proxy.setRecursiveFilteringEnabled(true);
31 33
32 34 // Connection to filter tree
33 connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, static_cast<void (QSortFilterProxyModel::*)(const QString&)>(
34 &QSortFilterProxyModel::setFilterRegExp));
35 sqpApp->dataSources().addIcon("satellite",QVariant(QIcon(":/icones/satellite.svg")));
35 connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy,
36 static_cast<void (QSortFilterProxyModel::*)(const QString&)>(
37 &QSortFilterProxyModel::setFilterRegExp));
38 sqpApp->dataSources().addIcon("satellite", QVariant(QIcon(":/icones/satellite.svg")));
39
40 QAction* expandAll = new QAction("Expand all");
41 QAction* collapseAll = new QAction("Collapse all");
42 ui->treeView->addAction(expandAll);
43 ui->treeView->addAction(collapseAll);
44 ui->treeView->setContextMenuPolicy(Qt::ActionsContextMenu);
45 connect(expandAll, &QAction::triggered, [treeView = ui->treeView](bool checked) {
46 (void)checked;
47 treeView->expandAll();
48 });
49 connect(collapseAll, &QAction::triggered, [treeView = ui->treeView](bool checked) {
50 (void)checked;
51 treeView->collapseAll();
52 });
53
54 QCompleter* completer = new QCompleter(this);
55 completer->setModel(sqpApp->dataSources().completionModel());
56 completer->setCaseSensitivity(Qt::CaseInsensitive);
57 ui->filterLineEdit->setCompleter(completer);
36 58 }
37 59
38 60 DataSourceWidget::~DataSourceWidget() noexcept
39 61 {
40 62 delete ui;
41 63 }
42
@@ -28,6 +28,9
28 28 <property name="selectionMode">
29 29 <enum>QAbstractItemView::ExtendedSelection</enum>
30 30 </property>
31 <attribute name="headerVisible">
32 <bool>false</bool>
33 </attribute>
31 34 </widget>
32 35 </item>
33 36 </layout>
General Comments 0
You need to be logged in to leave comments. Login now