##// END OF EJS Templates
[WIP] new generic WS plugin and few other fixes...
jeandet -
r1352:fb8f470a1906
parent child
Show More
@@ -0,0 +1,25
1 include_directories(include)
2 FILE (GLOB_RECURSE genericWS_SRCS
3 include/*.h
4 src/*.cpp
5 resources/*.qrc
6 )
7
8 add_definitions(-DQT_PLUGIN)
9 add_definitions(-DSCIQLOP_PLUGIN_JSON_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/resources/genericWS.json")
10 if(NOT BUILD_SHARED_LIBS)
11 add_definitions(-DQT_STATICPLUGIN)
12 endif()
13
14 add_library(generic_ws ${genericWS_SRCS})
15 SET_TARGET_PROPERTIES(generic_ws PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
16
17 target_link_libraries(generic_ws PUBLIC sciqlopgui)
18
19 install(TARGETS generic_ws
20 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
21 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop
22 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
23
24 include(sciqlop_tests)
25
@@ -0,0 +1,26
1 #ifndef GENERICWSENGINE_H
2 #define GENERICWSENGINE_H
3 #include <Data/IDataProvider.h>
4 #include <Data/DataProviderParameters.h>
5
6 class GenericWSEngine: public IDataProvider
7 {
8 public:
9 virtual std::shared_ptr<IDataProvider> clone() const override
10 {
11 return std::make_shared<GenericWSEngine>();
12 }
13
14 virtual IDataSeries* getData(const DataProviderParameters &parameters) override
15 {
16 auto range = parameters.m_Range;
17 auto metadata = parameters.m_Data;
18 auto WS = metadata["WS"].toString();
19 auto parameter = metadata["WS"].toString();
20 return nullptr;
21 }
22
23
24 };
25
26 #endif
@@ -0,0 +1,24
1 #ifndef GENERICWSPLUGIN_H
2 #define GENERICWSPLUGIN_H
3
4 #include <Plugin/IPlugin.h>
5
6
7 #include <memory>
8
9 #ifndef SCIQLOP_PLUGIN_JSON_FILE_PATH
10 #define SCIQLOP_PLUGIN_JSON_FILE_PATH "genericWS.json"
11 #endif
12
13 class DataSourceItem;
14
15 class GenericWS : public QObject, public IPlugin {
16 Q_OBJECT
17 Q_INTERFACES(IPlugin)
18 Q_PLUGIN_METADATA(IID "sciqlop.plugin.IPlugin" FILE SCIQLOP_PLUGIN_JSON_FILE_PATH)
19 public:
20 /// @sa IPlugin::initialize()
21 void initialize() override;
22 };
23
24 #endif // GENERICWSPLUGIN_H
@@ -0,0 +1,3
1 {
2 "name" : "GenericWS"
3 }
@@ -0,0 +1,1
1 #include "GenericWSEngine.h"
@@ -0,0 +1,1
1 #include "GenericWSEngine.h"
@@ -0,0 +1,1
1 Subproject commit f2fa281306099e7136a288dd70fd97d0e33afa15
@@ -7,5 +7,6 core/include/Version.h
7 7 subprojects/CatalogueAPI/
8 8 subprojects/QxOrm/
9 9 documentation/*
10 .idea/*
10 **/.idea/*
11 11 **/__pycache__/*
12 *.srctrl*
@@ -47,10 +47,13 ENDIF(IWYU)
47 47
48 48 enable_testing()
49 49
50 find_package(core CONFIG QUIET)
51 if (NOT sciqlopcore_FOUND)
52 execute_process(COMMAND git submodule init core WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
53 execute_process(COMMAND git submodule update core WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
50 find_package(SciQLOPCore CONFIG QUIET)
51 if (NOT SciQLOPCore_FOUND)
52 if(NOT IS_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/core)
53 message("Init submodule Core")
54 execute_process(COMMAND git submodule init core WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
55 execute_process(COMMAND git submodule update core WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
56 endif()
54 57 add_subdirectory(core)
55 58 endif()
56 59
@@ -1,1 +1,1
1 Subproject commit a05b0ab234936e28b6ba79535ccaee297d83a1e8
1 Subproject commit 6b6270b07547ddc94a57ecd2cdb54784412c1081
@@ -6,6 +6,7
6 6
7 7 #include <QLoggingCategory>
8 8 #include <QWidget>
9 #include <QUuid>
9 10
10 11 #include <memory>
11 12
@@ -152,6 +153,8 private slots:
152 153 void onDataCacheVariableUpdated();
153 154
154 155 void onUpdateVarDisplaying(std::shared_ptr<Variable> variable, const DateTimeRange &range);
156
157 void variableUpdated(QUuid id);
155 158 };
156 159
157 160 #endif // SCIQLOP_VISUALIZATIONGRAPHWIDGET_H
@@ -172,12 +172,9 VariableInspectorWidget::~VariableInspectorWidget()
172 172 void VariableInspectorWidget::onTableMenuRequested(const QPoint &pos) noexcept
173 173 {
174 174 auto selectedRows = ui->tableView->selectionModel()->selectedRows();
175
176 // Gets the model to retrieve the underlying selected variables
177 auto& vc = sqpApp->variableController();
178 175 auto selectedVariables = QVector<std::shared_ptr<Variable> >{};
179 176 for (const auto &selectedRow : qAsConst(selectedRows)) {
180 if (auto selectedVariable = vc[selectedRow.row()]) {
177 if (auto selectedVariable = this->m_model->variables()[selectedRow.row()]) {
181 178 selectedVariables.push_back(selectedVariable);
182 179 }
183 180 }
@@ -312,11 +312,9 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable, D
312 312 setGraphRange(range);
313 313 this->setFlags(GraphFlag::EnableAll);
314 314 }
315 connect(variable.get(),&Variable::updated,
316 [variable=variable,this]()
317 {
318 QMetaObject::invokeMethod(this,[variable=variable,this](){this->onUpdateVarDisplaying(variable,this->graphRange());});
319 });
315 //@TODO this is bad! when variable is moved to another graph it still fires
316 // even if this has been deleted
317 connect(variable.get(),&Variable::updated,this, &VisualizationGraphWidget::variableUpdated);
320 318 this->onUpdateVarDisplaying(variable,range);//My bullshit
321 319 emit variableAdded(variable);
322 320 }
@@ -1040,3 +1038,14 void VisualizationGraphWidget::onUpdateVarDisplaying(std::shared_ptr<Variable> v
1040 1038 impl->updateData(it->second, variable, range);
1041 1039 }
1042 1040 }
1041
1042 void VisualizationGraphWidget::variableUpdated(QUuid id)
1043 {
1044 for(auto& [var,plotables]:impl->m_VariableToPlotMultiMap)
1045 {
1046 if(var->ID()==id)
1047 {
1048 impl->updateData(plotables,var,this->graphRange());
1049 }
1050 }
1051 }
@@ -1,2 +1,3
1 1 add_subdirectory(mockplugin)
2 2 add_subdirectory(amda)
3 add_subdirectory(generic_ws)
@@ -67,7 +67,7 std::shared_ptr<IDataProvider> AmdaProvider::clone() const
67 67
68 68 IDataSeries* AmdaProvider::getData(const DataProviderParameters &parameters)
69 69 {
70 auto range = parameters.m_Times.front();
70 auto range = parameters.m_Range;
71 71 auto metaData = parameters.m_Data;
72 72 auto productId = metaData.value(AMDA_XML_ID_KEY).toString();
73 73 auto productValueType
@@ -10,7 +10,7 namespace {
10 10 const auto AMDA_DEFAULT_SERVER_URL = QStringLiteral("amda.irap.omp.eu");
11 11
12 12 /// URL of the AMDA test server
13 const auto AMDA_TEST_SERVER_URL = QStringLiteral("amdatest.irap.omp.eu");
13 const auto AMDA_TEST_SERVER_URL = QStringLiteral("amdadev.irap.omp.eu/");
14 14
15 15 /// Port used for local server
16 16 const auto AMDA_LOCAL_SERVER_PORT = 6543;
@@ -194,6 +194,6 IDataSeries *CosinusProvider::_generate(const DateTimeRange &range, const QVaria
194 194
195 195 IDataSeries* CosinusProvider::getData(const DataProviderParameters &parameters)
196 196 {
197 return _generate(parameters.m_Times.front(),parameters.m_Data);
197 return _generate(parameters.m_Range, parameters.m_Data);
198 198 }
199 199
General Comments 0
You need to be logged in to leave comments. Login now