@@ -13,19 +13,19 def amda_make_scalar(var=None): | |||||
13 | if var is None: |
|
13 | if var is None: | |
14 | return ((np.array(), np.array()), DataSeriesType.SCALAR) |
|
14 | return ((np.array(), np.array()), DataSeriesType.SCALAR) | |
15 | else: |
|
15 | else: | |
16 |
return ((var.time |
|
16 | return ((var.time,var.data), DataSeriesType.SCALAR) | |
17 |
|
17 | |||
18 | def amda_make_vector(var=None): |
|
18 | def amda_make_vector(var=None): | |
19 | if var is None: |
|
19 | if var is None: | |
20 | return ((np.array(), np.array()), DataSeriesType.VECTOR) |
|
20 | return ((np.array(), np.array()), DataSeriesType.VECTOR) | |
21 | else: |
|
21 | else: | |
22 |
return ((var.time |
|
22 | return ((var.time,var.data), DataSeriesType.VECTOR) | |
23 |
|
23 | |||
24 | def amda_make_multi_comp(var=None): |
|
24 | def amda_make_multi_comp(var=None): | |
25 | if var is None: |
|
25 | if var is None: | |
26 | return ((np.array(), np.array()), DataSeriesType.MULTICOMPONENT) |
|
26 | return ((np.array(), np.array()), DataSeriesType.MULTICOMPONENT) | |
27 | else: |
|
27 | else: | |
28 |
return ((var.time |
|
28 | return ((var.time,var.data), DataSeriesType.MULTICOMPONENT) | |
29 |
|
29 | |||
30 | def amda_make_spectro(var=None): |
|
30 | def amda_make_spectro(var=None): | |
31 | if var is None: |
|
31 | if var is None: | |
@@ -43,7 +43,7 def amda_make_spectro(var=None): | |||||
43 | y = (max_v + min_v)/2. |
|
43 | y = (max_v + min_v)/2. | |
44 | else: |
|
44 | else: | |
45 | y = np.logspace(1,3,var.data.shape[1])[::-1] |
|
45 | y = np.logspace(1,3,var.data.shape[1])[::-1] | |
46 |
return ((var.time |
|
46 | return ((var.time,var.data), DataSeriesType.SPECTROGRAM) | |
47 | #return pysciqlopcore.SpectrogramTimeSerie(var.time,y,var.data,min_sampling,max_sampling,True) |
|
47 | #return pysciqlopcore.SpectrogramTimeSerie(var.time,y,var.data,min_sampling,max_sampling,True) | |
48 |
|
48 | |||
49 | def amda_get_sample(metadata,start,stop): |
|
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 | #include <DataSource/datasources.h> |
|
5 | #include <DataSource/datasources.h> | |
6 |
|
6 | |||
|
7 | #include <QCompleter> | |||
7 | #include <SqpApplication.h> |
|
8 | #include <SqpApplication.h> | |
8 |
|
9 | |||
|
10 | #include <QAction> | |||
|
11 | ||||
9 |
|
12 | |||
10 | namespace |
|
13 | namespace | |
11 | { |
|
14 | { | |
@@ -19,8 +22,7 const auto TREE_HEADER_LABELS = QStringList { QObject::tr("Name") }; | |||||
19 | } // namespace |
|
22 | } // namespace | |
20 |
|
23 | |||
21 | DataSourceWidget::DataSourceWidget(QWidget* parent) |
|
24 | DataSourceWidget::DataSourceWidget(QWidget* parent) | |
22 | : QWidget { parent } |
|
25 | : QWidget { parent }, ui { new Ui::DataSourceWidget } | |
23 | , ui { new Ui::DataSourceWidget } |
|
|||
24 | { |
|
26 | { | |
25 | ui->setupUi(this); |
|
27 | ui->setupUi(this); | |
26 | m_model_proxy.setSourceModel(&(sqpApp->dataSources())); |
|
28 | m_model_proxy.setSourceModel(&(sqpApp->dataSources())); | |
@@ -30,13 +32,32 DataSourceWidget::DataSourceWidget(QWidget* parent) | |||||
30 | m_model_proxy.setRecursiveFilteringEnabled(true); |
|
32 | m_model_proxy.setRecursiveFilteringEnabled(true); | |
31 |
|
33 | |||
32 | // Connection to filter tree |
|
34 | // Connection to filter tree | |
33 |
connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, |
|
35 | connect(ui->filterLineEdit, &QLineEdit::textChanged, &m_model_proxy, | |
|
36 | static_cast<void (QSortFilterProxyModel::*)(const QString&)>( | |||
34 | &QSortFilterProxyModel::setFilterRegExp)); |
|
37 | &QSortFilterProxyModel::setFilterRegExp)); | |
35 | sqpApp->dataSources().addIcon("satellite",QVariant(QIcon(":/icones/satellite.svg"))); |
|
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 | DataSourceWidget::~DataSourceWidget() noexcept |
|
60 | DataSourceWidget::~DataSourceWidget() noexcept | |
39 | { |
|
61 | { | |
40 | delete ui; |
|
62 | delete ui; | |
41 | } |
|
63 | } | |
42 |
|
@@ -28,6 +28,9 | |||||
28 | <property name="selectionMode"> |
|
28 | <property name="selectionMode"> | |
29 | <enum>QAbstractItemView::ExtendedSelection</enum> |
|
29 | <enum>QAbstractItemView::ExtendedSelection</enum> | |
30 | </property> |
|
30 | </property> | |
|
31 | <attribute name="headerVisible"> | |||
|
32 | <bool>false</bool> | |||
|
33 | </attribute> | |||
31 | </widget> |
|
34 | </widget> | |
32 | </item> |
|
35 | </item> | |
33 | </layout> |
|
36 | </layout> |
General Comments 0
You need to be logged in to leave comments.
Login now