Commit 3b531e567cc26fc76a3b9e6a02db5b5b33a0ab6c

Authored by Erdogan Furkan
1 parent 1b52e70a

Second Kernel modifcations - there will be changes

src/ParamOutputImpl/Plot/PanelPlotOutput.cc
... ... @@ -2071,29 +2071,6 @@ void PanelPlotOutput::drawCurvePlot(CurvePlot &/*curvePlot*/) {
2071 2071 }
2072 2072  
2073 2073 /**
2074   - * @brief write TT/Cat info in context file
2075   - * @author Furkan, AKKA
2076   - */
2077   -
2078   -void TTCatContextWriter(ContextFileWriter &writer, std::string name, int index, int startTime, int stopTime, std::map<std::string, std::vector<std::string>> &data)
2079   -{
2080   - writer.startElement("intervals");
2081   - writer.addAttribute("name", name.c_str());
2082   - writer.addAttribute("id", std::to_string(index).c_str());
2083   - writer.addAttribute("startTime", std::to_string(startTime).c_str());
2084   - writer.addAttribute("stopTime", std::to_string(stopTime).c_str());
2085   - if (data.size() > 0)
2086   - {
2087   - writer.startElement("parameter");
2088   - for (auto i : data)
2089   - {
2090   - writer.addAttribute(i.first.c_str(), i.second[0].c_str());
2091   - }
2092   - writer.endElement();
2093   - }
2094   - writer.endElement();
2095   -}
2096   -/**
2097 2074 * @brief Write plot context
2098 2075 */
2099 2076 void PanelPlotOutput::writeContext(ContextFileWriter &writer, AMDA::Parameters::TimeIntervalList::iterator currentTimeInterval)
... ... @@ -2134,14 +2111,55 @@ void PanelPlotOutput::writeContext(ContextFileWriter &amp;writer, AMDA::Parameters::
2134 2111 inputTTOrCat.read(ttOrCatPath, lReaderType);
2135 2112 for (std::vector<TimeTableCatalog::TimeInterval>::const_iterator it = inputTTOrCat.getIntervals().begin(); it != inputTTOrCat.getIntervals().end(); ++it)
2136 2113 {
2137   - std::map<std::string, std::vector<std::string>> data = it->getAllParameterData();
  2114 + std::map<std::string, std::vector<std::string>> data;
  2115 + bool needTTWriter = false;
  2116 + bool needCatWriter = false;
  2117 + std::string startTime = std::to_string(it->_startTime);
  2118 + std::string stopTime = std::to_string(it->_stopTime);
2138 2119  
2139 2120 if (it->_startTime >= currentTimeInterval->_startTime && it->_stopTime <= currentTimeInterval->_stopTime) // inside the interval
2140   - TTCatContextWriter(writer, inputTTOrCat._name, it->_index, it->_startTime, it->_stopTime, data);
  2121 + {
  2122 + needTTWriter = true;
  2123 + data = it->getAllParameterData();
  2124 + if (data.size() > 0)
  2125 + needCatWriter = true;
  2126 + }
2141 2127 else if (it->_startTime <= currentTimeInterval->_startTime && it->_stopTime <= currentTimeInterval->_stopTime && it->_stopTime >= currentTimeInterval->_startTime) // begins before, ends inside
2142   - TTCatContextWriter(writer, inputTTOrCat._name, it->_index, currentTimeInterval->_startTime, it->_stopTime, data);
  2128 + {
  2129 + needTTWriter = true;
  2130 + startTime = std::to_string(currentTimeInterval->_startTime);
  2131 + data = it->getAllParameterData();
  2132 + if (data.size() > 0)
  2133 + needCatWriter = true;
  2134 + }
2143 2135 else if (it->_startTime >= currentTimeInterval->_startTime && it->_startTime <= currentTimeInterval->_stopTime && it->_stopTime >= currentTimeInterval->_stopTime) // begins inside, ends after
2144   - TTCatContextWriter(writer, inputTTOrCat._name, it->_index, it->_startTime, currentTimeInterval->_stopTime, data);
  2136 + {
  2137 + needTTWriter = true;
  2138 + stopTime = std::to_string(currentTimeInterval->_stopTime);
  2139 + data = it->getAllParameterData();
  2140 + if (data.size() > 0)
  2141 + needCatWriter = true;
  2142 + }
  2143 +
  2144 + if (needTTWriter)
  2145 + {
  2146 + writer.startElement("intervals");
  2147 + writer.addAttribute("name", inputTTOrCat._name.c_str());
  2148 + writer.addAttribute("id", std::to_string(it->_index).c_str());
  2149 + writer.addAttribute("startTime", std::to_string(it->_startTime).c_str());
  2150 + writer.addAttribute("stopTime", std::to_string(it->_stopTime).c_str());
  2151 + }
  2152 +
  2153 + if (needCatWriter)
  2154 + {
  2155 + writer.startElement("parameter");
  2156 + for (auto i : data)
  2157 + {
  2158 + writer.addAttribute(i.first.c_str(), i.second[0].c_str());
  2159 + }
  2160 + writer.endElement();
  2161 + }
  2162 + writer.endElement();
2145 2163 }
2146 2164 }
2147 2165 }
... ...
src/ParamOutputImpl/Plot/PanelPlotOutput.hh
... ... @@ -110,13 +110,6 @@ public:
110 110 */
111 111 void writeContext(ContextFileWriter &writer, AMDA::Parameters::TimeIntervalList::iterator currentTimeInterval);
112 112  
113   - /**
114   - * @brief write TT/Cat info in context file
115   - * @author Furkan, AKKA
116   - */
117   -
118   - void TTCatContextWriter(ContextFileWriter &writer, std::string name, int index, int startTime, int stopTime, std::map<std::string, std::vector<std::string>> &data);
119   -
120 113 /*
121 114 * @brief Set a pointer to the time intervals list
122 115 */
... ...