Commit e436434bb4668dcba900d417b25c8e8181348292

Authored by Benjamin Renard
2 parents 155fb89b bb68eaab
Exists in amdadev and in 1 other branch SpeasyGet

Merge branch 'FER_9629' into amdadev

config/xsd/request/plot.xsd
... ... @@ -1166,6 +1166,9 @@
1166 1166 <xs:element name="firstSymbol" type="SymbolType"
1167 1167 minOccurs="0" maxOccurs="1">
1168 1168 </xs:element>
  1169 + <xs:element name="lastSymbol" type="SymbolType"
  1170 + minOccurs="0" maxOccurs="1">
  1171 + </xs:element>
1169 1172 <xs:element name="font" type="FontType" minOccurs="0"
1170 1173 maxOccurs="1">
1171 1174 </xs:element>
... ... @@ -1181,6 +1184,9 @@
1181 1184 <xs:element name="symbol" type="SymbolType" minOccurs="0"
1182 1185 maxOccurs="1">
1183 1186 </xs:element>
  1187 + <xs:element name="lastSymbol" type="SymbolType"
  1188 + minOccurs="0" maxOccurs="1">
  1189 + </xs:element>
1184 1190 <xs:element name="font" type="FontType" minOccurs="0"
1185 1191 maxOccurs="1">
1186 1192 </xs:element>
... ...
src/ParamOutputImpl/Plot/IntervalTickLastSymbolNode.hh 0 → 100644
... ... @@ -0,0 +1,41 @@
  1 +/**
  2 + * IntervalTickLastSymbolNode.hh
  3 + *
  4 + * Created on: 20 Oct 2024
  5 + * Author: Furkan - AKKODIS
  6 + */
  7 +
  8 +#ifndef INTERVALTICKLASTSYMBOLNODE_HH_
  9 +#define INTERVALTICKLASTSYMBOLNODE_HH_
  10 +
  11 +#include <libxml/tree.h>
  12 +#include <iosfwd>
  13 +
  14 +#include "NodeCfg.hh"
  15 +#include "AbstractSymbolNode.hh"
  16 +
  17 +
  18 +namespace plot {
  19 +
  20 +class IntervalTickLastSymbolNode: public AbstractSymbolNode {
  21 +
  22 +public:
  23 + IntervalTickLastSymbolNode() :
  24 + AbstractSymbolNode() {
  25 + }
  26 + virtual ~IntervalTickLastSymbolNode() {
  27 + }
  28 +
  29 + SymbolProperties & getSymbolProperties (const AMDA::Parameters::CfgContext& context_) {
  30 + DrawingProperties* pProps = context_.get<DrawingProperties*>();
  31 +
  32 + // Return symbol properties relative to the first time tick symbol
  33 + return pProps->getIntervalTickProperties().getLastSymbol();
  34 + }
  35 +
  36 +
  37 +};
  38 +
  39 +} /* namespace plot */
  40 +
  41 +#endif /* INTERVALTICKLASTSYMBOLNODE_HH_ */
... ...
src/ParamOutputImpl/Plot/IntervalTickNode.hh
... ... @@ -16,6 +16,7 @@
16 16 #include "SeriesProperties.hh"
17 17 #include "CommonNode.hh"
18 18 #include "IntervalTickSymbolNode.hh"
  19 +#include "IntervalTickLastSymbolNode.hh"
19 20  
20 21 namespace plot {
21 22  
... ... @@ -32,6 +33,8 @@ public:
32 33 new FontNode<IntervalTickProperties>() );
33 34 getChildList()["symbol"] = AMDA::XMLConfigurator::NodeCfgSPtr(
34 35 new IntervalTickSymbolNode() );
  36 + getChildList()["lastSymbol"] = AMDA::XMLConfigurator::NodeCfgSPtr(
  37 + new IntervalTickLastSymbolNode() );
35 38 };
36 39 virtual ~IntervalTickNode(){};
37 40 void proceed(xmlNodePtr ,const AMDA::Parameters::CfgContext& );
... ...
src/ParamOutputImpl/Plot/IntervalTickProperties.cc
... ... @@ -16,6 +16,7 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out_, const IntervalTickProperties&amp; prop_
16 16 out_ << " color =" << prop_._color << std::endl;
17 17 out_ << " font =" << prop_.getFont() << std::endl;
18 18 out_ << " symbol =" << prop_._symbol << std::endl;
  19 + out_ << " symbol =" << prop_._lastSymbol << std::endl;
19 20 out_ << "}" << std::endl;
20 21 return out_;
21 22 }
... ... @@ -30,6 +31,7 @@ void IntervalTickProperties::dump(std::ostream&amp; out_, std::string&amp; prefix_) {
30 31 std::string subPrefix = prefix_ + "intervalTick.";
31 32 _font.dump(out_, subPrefix);
32 33 _symbol.dump(out_, subPrefix);
  34 + _lastSymbol.dump(out_, subPrefix);
33 35 }
34 36  
35 37 } /* namespace plot */
... ...
src/ParamOutputImpl/Plot/IntervalTickProperties.hh
... ... @@ -39,13 +39,14 @@ public:
39 39 void dump(std::ostream& out_, std::string& prefix_);
40 40  
41 41 IntervalTickProperties() :
42   - _mode(IntervalTickMode::NONE), _symbol(), _color(), _font("sans-serif", 11)
  42 + _mode(IntervalTickMode::NONE), _symbol(), _lastSymbol(), _color(), _font("sans-serif", 11)
43 43 {
44 44 }
45 45  
46 46 IntervalTickProperties(const IntervalTickProperties& pIntervalTickProperties_) :
47 47 _mode(pIntervalTickProperties_._mode),
48 48 _symbol(pIntervalTickProperties_._symbol),
  49 + _lastSymbol(pIntervalTickProperties_._lastSymbol),
49 50 _color(pIntervalTickProperties_._color),
50 51 _font(pIntervalTickProperties_.getFont())
51 52 {
... ... @@ -54,6 +55,7 @@ public:
54 55 IntervalTickProperties& operator=(const IntervalTickProperties& pIntervalTickProperties_) {
55 56 _mode = pIntervalTickProperties_._mode;
56 57 _symbol = pIntervalTickProperties_._symbol;
  58 + _lastSymbol = pIntervalTickProperties_._lastSymbol;
57 59 _color = pIntervalTickProperties_._color;
58 60 _font = pIntervalTickProperties_.getFont();
59 61 return *this;
... ... @@ -88,6 +90,14 @@ public:
88 90 _symbol = symbol;
89 91 }
90 92  
  93 + SymbolProperties& getLastSymbol() {
  94 + return _lastSymbol;
  95 + }
  96 +
  97 + void setLastSymbol(const SymbolProperties& lastSymbol) {
  98 + _lastSymbol = lastSymbol;
  99 + }
  100 +
91 101 Color& getColor() {
92 102 return _color;
93 103 }
... ... @@ -100,6 +110,7 @@ private:
100 110 IntervalTickMode _mode;
101 111  
102 112 SymbolProperties _symbol;
  113 + SymbolProperties _lastSymbol;
103 114 Color _color;
104 115  
105 116 Font _font;
... ...
src/ParamOutputImpl/Plot/PanelPlotOutput.cc
... ... @@ -1952,7 +1952,24 @@ namespace plot
1952 1952 itProps.getSymbol().getType(),
1953 1953 itProps.getSymbol().getSize(), 1.,
1954 1954 itProps.getSymbol().getColor(),
1955   - 2, (double *)&xData, (double *)&yData, NULL);
  1955 + 1, (double *)&xData, (double *)&yData, NULL);
  1956 +
  1957 + if (itProps.getLastSymbol().getType() == SymbolType::NO) {
  1958 + //Use common symbol properties
  1959 + drawSymbols(
  1960 + itProps.getSymbol().getType(),
  1961 + itProps.getSymbol().getSize(), 1.,
  1962 + itProps.getSymbol().getColor(),
  1963 + 1, &xData[1], &yData[1]);
  1964 + }
  1965 + else {
  1966 + //Use last symbol properties
  1967 + drawSymbols(
  1968 + itProps.getLastSymbol().getType(),
  1969 + itProps.getLastSymbol().getSize(), 1.,
  1970 + itProps.getLastSymbol().getColor(),
  1971 + 1, &xData[1], &yData[1]);
  1972 + }
1956 1973  
1957 1974 if (itProps.getMode() == IntervalTickMode::SYMBOL_ONLY)
1958 1975 return;
... ...
src/ParamOutputImpl/Plot/Scatter/XYPlot.cc
... ... @@ -571,17 +571,49 @@ void XYPlot::drawTimeTicks(SeriesProperties&amp; pSeries, AMDA::Common::ParameterInd
571 571 _pls->wind(std::get<0>(lPlWindow), std::get<1>(lPlWindow), std::get<2>(lPlWindow), std::get<3>(lPlWindow));
572 572  
573 573 if (nbTotMajor != 0) {
574   - drawSymbols(
575   - ttProps.getFirstSymbol().getType(),
576   - ttProps.getFirstSymbol().getSize(), 1.,
577   - ttProps.getFirstSymbol().getColor(),
578   - 1, majorX, majorY);
579   -
580   - drawSymbols(
581   - ttProps.getSymbol().getType(),
582   - ttProps.getSymbol().getSize(), 1.,
583   - ttProps.getSymbol().getColor(),
584   - nbTotMajor-1, &majorX[1], &majorY[1]);
  574 + if (ttProps.getFirstSymbol().getType() == SymbolType::NO) {
  575 + //Use common symbol properties
  576 + drawSymbols(
  577 + ttProps.getSymbol().getType(),
  578 + ttProps.getSymbol().getSize(), 1.,
  579 + ttProps.getSymbol().getColor(),
  580 + 1, majorX, majorY);
  581 + }
  582 + else {
  583 + //Use first symbol properties
  584 + drawSymbols(
  585 + ttProps.getFirstSymbol().getType(),
  586 + ttProps.getFirstSymbol().getSize(), 1.,
  587 + ttProps.getFirstSymbol().getColor(),
  588 + 1, majorX, majorY);
  589 + }
  590 +
  591 +
  592 + if (nbTotMajor > 2) {
  593 + drawSymbols(
  594 + ttProps.getSymbol().getType(),
  595 + ttProps.getSymbol().getSize(), 1.,
  596 + ttProps.getSymbol().getColor(),
  597 + nbTotMajor-2, &majorX[1], &majorY[1]);
  598 + }
  599 +
  600 + if (ttProps.getLastSymbol().getType() == SymbolType::NO) {
  601 + //Use common symbol properties
  602 + drawSymbols(
  603 + ttProps.getSymbol().getType(),
  604 + ttProps.getSymbol().getSize(), 1.,
  605 + ttProps.getSymbol().getColor(),
  606 + 1, &majorX[nbTotMajor-1], &majorY[nbTotMajor-1]);
  607 + }
  608 + else {
  609 + //Use last symbol properties
  610 + drawSymbols(
  611 + ttProps.getLastSymbol().getType(),
  612 + ttProps.getLastSymbol().getSize(), 1.,
  613 + ttProps.getLastSymbol().getColor(),
  614 + 1, &majorX[nbTotMajor-1], &majorY[nbTotMajor-1]);
  615 + }
  616 +
585 617 }
586 618  
587 619 if (nbTotMinor != 0) {
... ...
src/ParamOutputImpl/Plot/SymbolProperties.hh
... ... @@ -102,7 +102,7 @@ public:
102 102 void dump(std::ostream& out_, std::string& prefix_);
103 103  
104 104 SymbolProperties() :
105   - _type(SymbolType::DOT), _size(4), _color() {
  105 + _type(SymbolType::NO), _size(4), _color() {
106 106 }
107 107 SymbolProperties(const SymbolProperties& pSymbolProperties_) :
108 108 _type(pSymbolProperties_._type), _size(pSymbolProperties_._size), _color(
... ...
src/ParamOutputImpl/Plot/TimeTickLastSymbolNode.hh 0 → 100644
... ... @@ -0,0 +1,41 @@
  1 +/**
  2 + * TimeTickLastSymbolNode.hh
  3 + *
  4 + * Created on: 20 Oct 2024
  5 + * Author: Furkan - AKKODIS
  6 + */
  7 +
  8 +#ifndef TIMETICKLASTSYMBOLNODE_HH_
  9 +#define TIMETICKLASTSYMBOLNODE_HH_
  10 +
  11 +#include <libxml/tree.h>
  12 +#include <iosfwd>
  13 +
  14 +#include "NodeCfg.hh"
  15 +#include "AbstractSymbolNode.hh"
  16 +
  17 +
  18 +namespace plot {
  19 +
  20 +class TimeTickLastSymbolNode: public AbstractSymbolNode {
  21 +
  22 +public:
  23 + TimeTickLastSymbolNode() :
  24 + AbstractSymbolNode() {
  25 + }
  26 + virtual ~TimeTickLastSymbolNode() {
  27 + }
  28 +
  29 + SymbolProperties & getSymbolProperties (const AMDA::Parameters::CfgContext& context_) {
  30 + DrawingProperties* pProps = context_.get<DrawingProperties*>();
  31 +
  32 + // Return symbol properties relative to the first time tick symbol
  33 + return pProps->getTimeTickProperties().getLastSymbol();
  34 + }
  35 +
  36 +
  37 +};
  38 +
  39 +} /* namespace plot */
  40 +
  41 +#endif /* TIMETICKLASTSYMBOLNODE_HH_ */
... ...
src/ParamOutputImpl/Plot/TimeTickNode.hh
... ... @@ -17,6 +17,7 @@
17 17 #include "CommonNode.hh"
18 18 #include "TimeTickSymbolNode.hh"
19 19 #include "TimeTickFirstSymbolNode.hh"
  20 +#include "TimeTickLastSymbolNode.hh"
20 21  
21 22 namespace plot {
22 23  
... ... @@ -35,6 +36,8 @@ public:
35 36 new TimeTickSymbolNode() );
36 37 getChildList()["firstSymbol"] = AMDA::XMLConfigurator::NodeCfgSPtr(
37 38 new TimeTickFirstSymbolNode() );
  39 + getChildList()["lastSymbol"] = AMDA::XMLConfigurator::NodeCfgSPtr(
  40 + new TimeTickLastSymbolNode() );
38 41 };
39 42 virtual ~TimeTickNode(){};
40 43 void proceed(xmlNodePtr ,const AMDA::Parameters::CfgContext& );
... ...
src/ParamOutputImpl/Plot/TimeTickProperties.cc
... ... @@ -18,6 +18,7 @@ std::ostream&amp; operator&lt;&lt;(std::ostream&amp; out_, const TimeTickProperties&amp; prop_) {
18 18 out_ << " color =" << prop_._color << std::endl;
19 19 out_ << " " << prop_.getFont() << std::endl;
20 20 out_ << " " << prop_._firstSymbol << std::endl;
  21 + out_ << " " << prop_._lastSymbol << std::endl;
21 22 out_ << " " << prop_._symbol << std::endl;
22 23 out_ << "}" << std::endl;
23 24 return out_;
... ... @@ -35,6 +36,7 @@ void TimeTickProperties::dump(std::ostream&amp; out_, std::string&amp; prefix_) {
35 36 std::string subPrefix = prefix_ + "timeTick.";
36 37 _font.dump(out_, subPrefix);
37 38 _firstSymbol.dump(out_, subPrefix);
  39 + _lastSymbol.dump(out_, subPrefix);
38 40 _symbol.dump(out_, subPrefix);
39 41 }
40 42  
... ...
src/ParamOutputImpl/Plot/TimeTickProperties.hh
... ... @@ -31,7 +31,7 @@ public:
31 31 void dump(std::ostream& out_, std::string& prefix_);
32 32  
33 33 TimeTickProperties() :
34   - _step("0"), _number(0), _minor(0), _firstSymbol(), _symbol(), _color(), _font("sans-serif", 11)
  34 + _step("0"), _number(0), _minor(0), _firstSymbol(), _lastSymbol(), _symbol(), _color(), _font("sans-serif", 11)
35 35 {
36 36 }
37 37 TimeTickProperties(const TimeTickProperties& pTimeTickProperties_) :
... ... @@ -39,6 +39,7 @@ public:
39 39 _number(pTimeTickProperties_._number),
40 40 _minor(pTimeTickProperties_._minor),
41 41 _firstSymbol(pTimeTickProperties_._firstSymbol),
  42 + _lastSymbol(pTimeTickProperties_._lastSymbol),
42 43 _symbol(pTimeTickProperties_._symbol),
43 44 _color(pTimeTickProperties_._color),
44 45 _font(pTimeTickProperties_._font)
... ... @@ -50,6 +51,7 @@ public:
50 51 _number = pTimeTickProperties_._number;
51 52 _minor = pTimeTickProperties_._minor;
52 53 _firstSymbol = pTimeTickProperties_._firstSymbol;
  54 + _lastSymbol = pTimeTickProperties_._lastSymbol;
53 55 _symbol = pTimeTickProperties_._symbol;
54 56 _color = pTimeTickProperties_._color;
55 57 _font = pTimeTickProperties_._font;
... ... @@ -67,6 +69,14 @@ public:
67 69 _firstSymbol = firstSymbol;
68 70 }
69 71  
  72 + SymbolProperties& getLastSymbol() {
  73 + return _lastSymbol;
  74 + }
  75 +
  76 + void setLastSymbol(const SymbolProperties& lastSymbol) {
  77 + _lastSymbol = lastSymbol;
  78 + }
  79 +
70 80 const Font& getFont() const {
71 81 return _font;
72 82 }
... ... @@ -122,6 +132,7 @@ private:
122 132 int _minor;
123 133  
124 134 SymbolProperties _firstSymbol;
  135 + SymbolProperties _lastSymbol;
125 136 SymbolProperties _symbol;
126 137 Color _color;
127 138  
... ...