diff --git a/core b/core index 70eb884..54e194b 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 70eb884a0ee3f19fb2a7dc91d2f25f6348d4167d +Subproject commit 54e194b00c35fb5f769eda61234c1b4dd6de3a43 diff --git a/plugins/mockplugin/src/CosinusProvider.cpp b/plugins/mockplugin/src/CosinusProvider.cpp index cbe36c8..3cd94f1 100644 --- a/plugins/mockplugin/src/CosinusProvider.cpp +++ b/plugins/mockplugin/src/CosinusProvider.cpp @@ -84,16 +84,18 @@ struct SpectrogramCosinus : public ICosinusType { double value; - if (SPECTROGRAM_ZERO_BANDS.find(y) != SPECTROGRAM_ZERO_BANDS.end()) { - value = 0.; - } - else if (SPECTROGRAM_NAN_BANDS.find(y) != SPECTROGRAM_NAN_BANDS.end()) { - value = std::numeric_limits::quiet_NaN(); - } - else { +// if (SPECTROGRAM_ZERO_BANDS.find(y) != SPECTROGRAM_ZERO_BANDS.end()) { +// value = 0.; +// } +// else if (SPECTROGRAM_NAN_BANDS.find(y) != SPECTROGRAM_NAN_BANDS.end()) { +// value = std::numeric_limits::quiet_NaN(); +// } +// else + { // Generates value for non NaN/zero bands - auto r = 3 * std::sqrt(x * x + y * y) + 1e-2; - value = 2 * x * (std::cos(r + 2) / r - std::sin(r + 2) / r); + //auto r = 3 * std::sqrt(x * x + y * y) + 1e-2; + //value = 2 * x * (std::cos(r + 2) / r - std::sin(r + 2) / r); + value = x + 10*y; } values[componentCount * dataIndex + i] = value; @@ -136,8 +138,11 @@ std::unique_ptr cosinusType(const QString &type) noexcept else if (type.compare(QStringLiteral("spectrogram"), Qt::CaseInsensitive) == 0) { // Generates default y-axis data for spectrogram [0., 1., 2., ...] std::vector yAxisData(SPECTROGRAM_NUMBER_BANDS); - std::iota(yAxisData.begin(), yAxisData.end(), 0.); - + std::iota(yAxisData.begin(), yAxisData.end(), 1.); + for (auto & v:yAxisData) + { + v = std::pow(2,v); + } return std::make_unique(std::move(yAxisData), Unit{"eV"}, Unit{"eV/(cm^2-s-sr-eV)"}); } diff --git a/plugins/mockplugin/tests/PyTestMockPluginWrapper.cpp b/plugins/mockplugin/tests/PyTestMockPluginWrapper.cpp index a35f4ac..4819bd5 100644 --- a/plugins/mockplugin/tests/PyTestMockPluginWrapper.cpp +++ b/plugins/mockplugin/tests/PyTestMockPluginWrapper.cpp @@ -70,7 +70,7 @@ PYBIND11_MODULE(pytestmockplugin, m){ py::class_(m, "VariableController2").def_static("createVariable",[](const QString &name, std::shared_ptr provider, const DateTimeRange& range){ - return sqpApp->variableController().createVariable(name, {{"cosinusType", "spectrogram"}, {"cosinusFrequency", "1.0"}}, provider, range); + return sqpApp->variableController().createVariable(name, {{"cosinusType", "spectrogram"}, {"cosinusFrequency", "0.1"}}, provider, range); }); py::class_(m,"TimeController")