From b2c081d679bb21cb99ee02210bcc4109266e3527 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Thu, 20 Apr 2023 13:36:38 +0100 Subject: [PATCH 01/10] Next Version 4.15.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d77c2ec8..395d9591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake") find_package( ecbuild 3.4 REQUIRED ) -project( magics VERSION 4.14.0 LANGUAGES CXX ) +project( magics VERSION 4.15.0 LANGUAGES CXX ) # make sure that the header files are installed into include/magics # note that this needs to be done before ecbuild_declare_project() From b678a98be2aba121958c1c03b52ce129d4d0918a Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Wed, 26 Apr 2023 11:32:28 +0100 Subject: [PATCH 02/10] E-Suite ecCharts : eps_control = off will not show the control anymore --- CMakeLists.txt | 5 ++++- src/visualisers/EpsGraph.cc | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 395d9591..06d3c3ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,10 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake") find_package( ecbuild 3.4 REQUIRED ) -project( magics VERSION 4.15.0 LANGUAGES CXX ) + +# In prepaation for hotfix of 4.14.0 +project( magics VERSION 4.14.1 LANGUAGES CXX ) + # make sure that the header files are installed into include/magics # note that this needs to be done before ecbuild_declare_project() diff --git a/src/visualisers/EpsGraph.cc b/src/visualisers/EpsGraph.cc index ddba2ae9..729e1cbb 100644 --- a/src/visualisers/EpsGraph.cc +++ b/src/visualisers/EpsGraph.cc @@ -627,6 +627,8 @@ magics::Polyline* EpsGraph::newForecast() { } void EpsGraph::pushControl(magics::Polyline* control, BasicGraphicsObjectContainer& visitor) { + if ( !control_ ) + return; const Transformation& transformation = visitor.transformation(); if (!control->empty() && whisker_) { transformation(*control, visitor); From ff5194d2f0b2a9c21c33a542b8f73be6439f3575 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Wed, 26 Apr 2023 17:36:13 +0100 Subject: [PATCH 03/10] E-Suite ecCharts : eps_control = off will not show the control anymore --- src/attributes/EpsGraphAttributes.cc | 10 +++++----- src/attributes/EpsGraphAttributes.h | 2 +- src/attributes/EpsGraphWrapper.cc | 4 ++-- src/attributes/EpsWaveAttributes.cc | 9 ++++++++- src/attributes/EpsWaveAttributes.h | 1 + src/attributes/EpsWaveWrapper.cc | 6 ++++++ src/params/EpsGraph.xml | 4 ++-- src/params/EpsWave.xml | 7 +++++++ src/visualisers/EpsGraph.cc | 28 ++++++++++++++++------------ src/visualisers/EpsGraph.h | 7 ++++--- 10 files changed, 52 insertions(+), 26 deletions(-) diff --git a/src/attributes/EpsGraphAttributes.cc b/src/attributes/EpsGraphAttributes.cc index dfb1563b..e6666cc7 100644 --- a/src/attributes/EpsGraphAttributes.cc +++ b/src/attributes/EpsGraphAttributes.cc @@ -45,7 +45,7 @@ EpsGraphAttributes::EpsGraphAttributes(): deterministic_(ParameterManager::getBool("eps_deterministic")), deterministic_thickness_(ParameterManager::getInt("eps_deterministic_line_thickness")), deterministic_legend_(ParameterManager::getString("eps_deterministic_legend_text")), - control_(ParameterManager::getBool("eps_control")), + eps_control_(ParameterManager::getBool("eps_control")), control_thickness_(ParameterManager::getInt("eps_control_line_thickness")), control_legend_(ParameterManager::getString("eps_control_legend_text")), legend_(ParameterManager::getBool("legend")), @@ -99,7 +99,7 @@ void EpsGraphAttributes::set(const std::map& params) setAttribute(prefix, "eps_deterministic", deterministic_, params); setAttribute(prefix, "eps_deterministic_line_thickness", deterministic_thickness_, params); setAttribute(prefix, "eps_deterministic_legend_text", deterministic_legend_, params); - setAttribute(prefix, "eps_control", control_, params); + setAttribute(prefix, "eps_control", eps_control_, params); setAttribute(prefix, "eps_control_line_thickness", control_thickness_, params); setAttribute(prefix, "eps_control_legend_text", control_legend_, params); setAttribute(prefix, "legend", legend_, params); @@ -141,7 +141,7 @@ void EpsGraphAttributes::copy(const EpsGraphAttributes& other) deterministic_ = other.deterministic_; deterministic_thickness_ = other.deterministic_thickness_; deterministic_legend_ = other.deterministic_legend_; - control_ = other.control_; + eps_control_ = other.eps_control_; control_thickness_ = other.control_thickness_; control_legend_ = other.control_legend_; legend_ = other.legend_; @@ -215,7 +215,7 @@ void EpsGraphAttributes::print(ostream& out) const out << " deterministic = " << deterministic_; out << " deterministic_thickness = " << deterministic_thickness_; out << " deterministic_legend = " << deterministic_legend_; - out << " control = " << control_; + out << " eps_control = " << eps_control_; out << " control_thickness = " << control_thickness_; out << " control_legend = " << control_legend_; out << " legend = " << legend_; @@ -279,7 +279,7 @@ void EpsGraphAttributes::toxml(ostream& out) const out << ", \"eps_deterministic_legend_text\":"; niceprint(out,deterministic_legend_); out << ", \"eps_control\":"; - niceprint(out,control_); + niceprint(out,eps_control_); out << ", \"eps_control_line_thickness\":"; niceprint(out,control_thickness_); out << ", \"eps_control_legend_text\":"; diff --git a/src/attributes/EpsGraphAttributes.h b/src/attributes/EpsGraphAttributes.h index 4b5edc5c..c51a4323 100644 --- a/src/attributes/EpsGraphAttributes.h +++ b/src/attributes/EpsGraphAttributes.h @@ -71,7 +71,7 @@ class EpsGraphAttributes bool deterministic_; int deterministic_thickness_; string deterministic_legend_; - bool control_; + bool eps_control_; int control_thickness_; string control_legend_; bool legend_; diff --git a/src/attributes/EpsGraphWrapper.cc b/src/attributes/EpsGraphWrapper.cc index 0d29f71c..f21b51b3 100644 --- a/src/attributes/EpsGraphWrapper.cc +++ b/src/attributes/EpsGraphWrapper.cc @@ -141,9 +141,9 @@ void EpsGraphWrapper::set(const MagRequest& request) epsgraph_->deterministic_legend_ = deterministic_legend_value; } if (request.countValues("EPS_CONTROL") ) { - string control_value = request("EPS_CONTROL"); + string eps_control_value = request("EPS_CONTROL"); - epsgraph_->control_ = MagTranslator()(control_value); + epsgraph_->eps_control_ = MagTranslator()(eps_control_value); } if (request.countValues("EPS_CONTROL_LINE_THICKNESS") ) { diff --git a/src/attributes/EpsWaveAttributes.cc b/src/attributes/EpsWaveAttributes.cc index a8b326ff..77fa2086 100644 --- a/src/attributes/EpsWaveAttributes.cc +++ b/src/attributes/EpsWaveAttributes.cc @@ -25,7 +25,8 @@ using namespace magics; EpsWaveAttributes::EpsWaveAttributes(): - colour_(ParameterManager::getStringArray("eps_rose_wave_colour")) + colour_(ParameterManager::getStringArray("eps_rose_wave_colour")), + eps_control_(ParameterManager::getBool("eps_control")) { @@ -46,6 +47,7 @@ void EpsWaveAttributes::set(const std::map& params) prefix[i++] = "eps_rose_wave"; setAttribute(prefix, "eps_rose_wave_colour", colour_, params); + setAttribute(prefix, "eps_control", eps_control_, params); } @@ -53,6 +55,7 @@ void EpsWaveAttributes::set(const std::map& params) void EpsWaveAttributes::copy(const EpsWaveAttributes& other) { colour_ = other.colour_; + eps_control_ = other.eps_control_; } @@ -92,6 +95,7 @@ void EpsWaveAttributes::print(ostream& out) const { out << "Attributes["; out << " colour = " << colour_; + out << " eps_control = " << eps_control_; out << "]" << "\n"; } @@ -101,7 +105,10 @@ void EpsWaveAttributes::toxml(ostream& out) const out << "\"epswave\""; out << ", \"eps_rose_wave_colour\":"; niceprint(out,colour_); + out << ", \"eps_control\":"; + niceprint(out,eps_control_); } static MagicsParameter eps_rose_wave_colour("eps_rose_wave_colour", stringarray()); +static MagicsParameter eps_control("eps_control", "on"); diff --git a/src/attributes/EpsWaveAttributes.h b/src/attributes/EpsWaveAttributes.h index 2fa412ad..6a63a29a 100644 --- a/src/attributes/EpsWaveAttributes.h +++ b/src/attributes/EpsWaveAttributes.h @@ -51,6 +51,7 @@ class EpsWaveAttributes // -- members: string tag_; stringarray colour_; + bool eps_control_; private: diff --git a/src/attributes/EpsWaveWrapper.cc b/src/attributes/EpsWaveWrapper.cc index c4a145e6..7e14c28d 100644 --- a/src/attributes/EpsWaveWrapper.cc +++ b/src/attributes/EpsWaveWrapper.cc @@ -60,6 +60,12 @@ void EpsWaveWrapper::set(const MagRequest& request) colour_value.push_back((string)request("EPS_ROSE_WAVE_COLOUR", i)); if ( !colour_value.empty() ) epswave_->colour_ = colour_value; + if (request.countValues("EPS_CONTROL") ) { + string eps_control_value = request("EPS_CONTROL"); + + epswave_->eps_control_ = MagTranslator()(eps_control_value); + + } } diff --git a/src/params/EpsGraph.xml b/src/params/EpsGraph.xml index 6388879d..9177b016 100644 --- a/src/params/EpsGraph.xml +++ b/src/params/EpsGraph.xml @@ -187,12 +187,12 @@ does it submit to any jurisdiction. name="eps_deterministic_legend_text"> Text to be used in the legend - - plot the deterministic Forecast + plot the control Forecast Rose wind darker colour + + plot the control Forecast + diff --git a/src/visualisers/EpsGraph.cc b/src/visualisers/EpsGraph.cc index 729e1cbb..44f1c65d 100644 --- a/src/visualisers/EpsGraph.cc +++ b/src/visualisers/EpsGraph.cc @@ -627,8 +627,10 @@ magics::Polyline* EpsGraph::newForecast() { } void EpsGraph::pushControl(magics::Polyline* control, BasicGraphicsObjectContainer& visitor) { - if ( !control_ ) + if ( !eps_control_ ) { + control_ = false; return; + } const Transformation& transformation = visitor.transformation(); if (!control->empty() && whisker_) { transformation(*control, visitor); @@ -1691,17 +1693,19 @@ void EpsWave::operator()(Data& data, BasicGraphicsObjectContainer& visitor) { } // Draw the Control - if (point->find("control") != point->end()) { - magics::Polyline* control = new magics::Polyline(); - control->setColour(Colour("red")); - control->setThickness(2); - control->setLineStyle(LineStyle::DASH); - - double angle = (*point)["control"] - 180.; - - control->push_back(PaperPoint(x, 0)); - control->push_back(PaperPoint(x + (l100 * sin(angle * (3.14 / 180.))), l100 * cos(angle * (3.14 / 180.)))); - visitor.push_back(control); + if (eps_control_) { + if (point->find("control") != point->end()) { + magics::Polyline* control = new magics::Polyline(); + control->setColour(Colour("red")); + control->setThickness(2); + control->setLineStyle(LineStyle::DASH); + + double angle = (*point)["control"] - 180.; + + control->push_back(PaperPoint(x, 0)); + control->push_back(PaperPoint(x + (l100 * sin(angle * (3.14 / 180.))), l100 * cos(angle * (3.14 / 180.)))); + visitor.push_back(control); + } } // Draw the Forecast diff --git a/src/visualisers/EpsGraph.h b/src/visualisers/EpsGraph.h index 849dded9..57db9a44 100644 --- a/src/visualisers/EpsGraph.h +++ b/src/visualisers/EpsGraph.h @@ -34,6 +34,7 @@ #include "EpsPlumeAttributes.h" #include "EpsShadeAttributes.h" #include "EpsWindAttributes.h" +#include "EpsWaveAttributes.h" #include "BasicGraphicsObject.h" @@ -257,13 +258,13 @@ class EpsBar : public Visdef, public EpsCloudAttributes { } }; -class EpsWave : public Visdef { +class EpsWave : public EpsWaveAttributes, public Visdef { public: EpsWave() {} virtual ~EpsWave() override {} // Implements the set method ... - void set(const map&) {} // EpsWindAttributes::set(map); } - void set(const XmlNode&) {} // EpsWindAttributes::set(node); } + void set(const map&) override {} // EpsWindAttributes::set(map); } + void set(const XmlNode&) override {} // EpsWindAttributes::set(node); } virtual void operator()(Data&, BasicGraphicsObjectContainer&) override; virtual void visit(LegendVisitor&) override; From 6c549ff8f6dcde71793a1ffc107de4f474d3ed1e Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Thu, 27 Apr 2023 16:33:04 +0100 Subject: [PATCH 04/10] E-Suite ecCharts : allow a second text "ztext" in a page --- src/basic/XmlMagics.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic/XmlMagics.cc b/src/basic/XmlMagics.cc index 9a452df5..1b1263d6 100644 --- a/src/basic/XmlMagics.cc +++ b/src/basic/XmlMagics.cc @@ -73,6 +73,7 @@ XmlMagics::XmlMagics() : root_(0), gribloop_(0), geographical_(true), driversToS actions_["mgb"] = &XmlMagics::binary; actions_["text"] = &XmlMagics::text; + actions_["ztext"] = &XmlMagics::text; actions_["map"] = &XmlMagics::map; actions_["matrix"] = &XmlMagics::matrix; actions_["cartesian"] = &XmlMagics::cartesian; From b3aec30e417623bd01917e80ed8f4b34b411d326 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Fri, 28 Apr 2023 12:39:03 +0100 Subject: [PATCH 05/10] E-Suite ecCharts : allow a second text "ztext" in a page --- src/attributes/TextVisitorAttributes.cc | 4 ++++ src/params/TextVisitor.xml | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/attributes/TextVisitorAttributes.cc b/src/attributes/TextVisitorAttributes.cc index e1f7aed7..6cf849b2 100644 --- a/src/attributes/TextVisitorAttributes.cc +++ b/src/attributes/TextVisitorAttributes.cc @@ -277,6 +277,8 @@ bool TextVisitorAttributes::accept(const string& node) if ( magCompare(node, "text") ) return true; + if ( magCompare(node, "ztext") ) + return true; return false; } @@ -290,6 +292,8 @@ void TextVisitorAttributes::set(const XmlNode& node) if ( magCompare(node.name(), "text") ) apply = true; + if ( magCompare(node.name(), "ztext") ) + apply = true; if ( apply ) diff --git a/src/params/TextVisitor.xml b/src/params/TextVisitor.xml index 54ee230a..a860b6ae 100644 --- a/src/params/TextVisitor.xml +++ b/src/params/TextVisitor.xml @@ -7,11 +7,12 @@ granted to it by virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. --> - From f3f25d27594bf7bfc7e3cf95f692ac530ee918c0 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Wed, 3 May 2023 11:26:47 +0100 Subject: [PATCH 06/10] E-Suite ecCharts : eps_control = off will not show the control anymore in epswave --- src/visualisers/EpsGraph.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visualisers/EpsGraph.h b/src/visualisers/EpsGraph.h index 57db9a44..0d7854fe 100644 --- a/src/visualisers/EpsGraph.h +++ b/src/visualisers/EpsGraph.h @@ -263,8 +263,8 @@ class EpsWave : public EpsWaveAttributes, public Visdef { EpsWave() {} virtual ~EpsWave() override {} // Implements the set method ... - void set(const map&) override {} // EpsWindAttributes::set(map); } - void set(const XmlNode&) override {} // EpsWindAttributes::set(node); } + void set(const map& map) override { EpsWaveAttributes::set(map); } // EpsWindAttributes::set(map); } + void set(const XmlNode& node) override { EpsWaveAttributes::set(node) ;} // EpsWindAttributes::set(node); } virtual void operator()(Data&, BasicGraphicsObjectContainer&) override; virtual void visit(LegendVisitor&) override; From ed35ba64968e2bf1c9af6d2cbe71d9c11fa2afdc Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Fri, 19 May 2023 13:13:04 +0100 Subject: [PATCH 07/10] e-suite: Improve formatting of eps_heigth --- src/web/WrepJSon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/WrepJSon.cc b/src/web/WrepJSon.cc index e1bd8274..a5db95dd 100644 --- a/src/web/WrepJSon.cc +++ b/src/web/WrepJSon.cc @@ -1938,7 +1938,7 @@ void WrepJSon::visit(TextVisitor& text) { text.update("json", "station_name", station_name_); if (!expver_.empty() && expver_ != "0001") text.update("json", "expver", " [" + expver_ + "] "); - text.update("json", "ens_height", tostring(epsz_)); + text.update("json", "ens_height", maground(epsz_)); } text.update("json", "product_info", product_info_); From cb999256895348309f3aed3454f2767a1b4c757a Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Fri, 19 May 2023 14:19:45 +0100 Subject: [PATCH 08/10] e-suite: Improve formatting of eps_heigth --- src/web/WrepJSon.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/WrepJSon.cc b/src/web/WrepJSon.cc index a5db95dd..3627a34c 100644 --- a/src/web/WrepJSon.cc +++ b/src/web/WrepJSon.cc @@ -1938,7 +1938,7 @@ void WrepJSon::visit(TextVisitor& text) { text.update("json", "station_name", station_name_); if (!expver_.empty() && expver_ != "0001") text.update("json", "expver", " [" + expver_ + "] "); - text.update("json", "ens_height", maground(epsz_)); + text.update("json", "ens_height", tostring(maground(epsz_))); } text.update("json", "product_info", product_info_); From 9de980008707eb4d5fa185fa568bf60734f9fa85 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Mon, 5 Jun 2023 18:03:43 +0100 Subject: [PATCH 09/10] Magics : contour_shade_max/min_level wher used evne idf contour_shade was off . [SD-79687] --- src/visualisers/IsoPlot.cc | 2 +- src/visualisers/IsoShading.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/visualisers/IsoPlot.cc b/src/visualisers/IsoPlot.cc index bca07225..016f728d 100644 --- a/src/visualisers/IsoPlot.cc +++ b/src/visualisers/IsoPlot.cc @@ -1342,7 +1342,7 @@ bool IsoPlot::prepare(MatrixHandler& data) { double min = data.min(); double max = data.max(); (*levelSelection_).clear(); - (*levelSelection_).calculate(min, max, true); + (*levelSelection_).calculate(min, max, shading_->isShading()); bool need_isolines = (*shading_)(*levelSelection_); shading_->reset(); (*label_).prepare(*levelSelection_, (*colour_).name()); diff --git a/src/visualisers/IsoShading.h b/src/visualisers/IsoShading.h index 64931e41..641c2afd 100644 --- a/src/visualisers/IsoShading.h +++ b/src/visualisers/IsoShading.h @@ -76,6 +76,7 @@ class NoIsoShading { virtual bool needClipping() { return false; } virtual bool method(ContourMethod*) { return false; } virtual void reset() {} + virtual bool isShading() { return false; } protected: //! Method to print string about this class on to a stream of type ostream (virtual). @@ -109,6 +110,8 @@ class IsoShading : public NoIsoShading, public IsoShadingAttributes { object->copy(*this); return object; } + + bool isShading() override { return true; } CellArray* array(MatrixHandler& matrix, IntervalMap& range, const Transformation& transformation, int width, int height, float resolution, const string& technique) override { From e77d55bf7fb1c69c7af7679ded86a56185882d82 Mon Sep 17 00:00:00 2001 From: Sylvie Lamy-Thepaut Date: Tue, 6 Jun 2023 17:35:55 +0100 Subject: [PATCH 10/10] VERSION 4.14.1 --- CMakeLists.txt | 2 +- VERSION | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/CMakeLists.txt b/CMakeLists.txt index 06d3c3ff..ab110b0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ find_package( ecbuild 3.4 REQUIRED ) # In prepaation for hotfix of 4.14.0 -project( magics VERSION 4.14.1 LANGUAGES CXX ) +project( magics LANGUAGES CXX ) # make sure that the header files are installed into include/magics diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..5704b893 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.14.1 \ No newline at end of file