Commit db4a6b56e11566c5d00efb1241c201895dbe06aa
1 parent
fa4b7852
Exists in
master
and in
100 other branches
Get the possibility to use a TimeTable for an epoch plot request
Showing
2 changed files
with
17 additions
and
18 deletions
Show diff stats
src/ParamOutputImpl/Plot/Epoch/EpochPlot.cc
... | ... | @@ -111,18 +111,23 @@ void EpochPlot::configureSeriesAxis() { |
111 | 111 | while (crtTimeInterval != _timeIntervalListPtr->end()) |
112 | 112 | { |
113 | 113 | //get center time data for this interval |
114 | + double leftDeltaTime = 0.; | |
115 | + double rightDeltaTime = 0.; | |
116 | + | |
114 | 117 | std::vector<std::string>& crtCenterTimeData = _parameterManager.getInputIntervalDataList(crtTimeInterval->_index, _centerTimeId); |
115 | 118 | if (crtCenterTimeData.empty()) |
116 | 119 | { |
117 | - std::stringstream lError; | |
118 | - lError << "EpochPlot::configureSeriesAxis: Cannot get center time data for interval with index: " << crtTimeInterval->_index; | |
119 | - BOOST_THROW_EXCEPTION(PanelPlotOutputException() << AMDA::ex_msg(lError.str())); | |
120 | + leftDeltaTime = (crtTimeInterval->_stopTime-crtTimeInterval->_startTime) / 2.; | |
121 | + rightDeltaTime = leftDeltaTime; | |
122 | + } | |
123 | + else | |
124 | + { | |
125 | + //compute left and right delta times (relative to the center time) | |
126 | + double crtCenterTime = AMDA::TimeUtil::readTimeInIso((char*)crtCenterTimeData[0].c_str()); | |
127 | + leftDeltaTime = crtCenterTime-crtTimeInterval->_startTime; | |
128 | + rightDeltaTime = crtTimeInterval->_stopTime-crtCenterTime; | |
120 | 129 | } |
121 | 130 | |
122 | - //compute left and right delta times (relative to the center time) | |
123 | - double crtCenterTime = AMDA::TimeUtil::readTimeInIso((char*)crtCenterTimeData[0].c_str()); | |
124 | - double leftDeltaTime = crtCenterTime-crtTimeInterval->_startTime; | |
125 | - double rightDeltaTime = crtTimeInterval->_stopTime-crtCenterTime; | |
126 | 131 | if ((leftDeltaTime < 0) || (rightDeltaTime < 0)) |
127 | 132 | { |
128 | 133 | LOG4CXX_WARN(gLogger, "EpochPlot::configureSeriesAxis - centerTime not contained in the interval for the interval with index : " << crtTimeInterval->_index << " => skip this interval"); |
... | ... | @@ -286,13 +291,12 @@ void EpochPlot::drawSeries(double startDate, double stopDate, int intervalIndex, |
286 | 291 | |
287 | 292 | //get center time data for this interval |
288 | 293 | std::vector<std::string>& crtCenterTimeData = _parameterManager.getInputIntervalDataList(intervalIndex, _centerTimeId); |
294 | + | |
295 | + double crtCenterTime = 0.; | |
289 | 296 | if (crtCenterTimeData.empty()) |
290 | - { | |
291 | - std::stringstream lError; | |
292 | - lError << "EpochPlot::configureSeriesAxis: Cannot get center time data for interval with index: " << intervalIndex; | |
293 | - BOOST_THROW_EXCEPTION(PanelPlotOutputException() << AMDA::ex_msg(lError.str())); | |
294 | - } | |
295 | - double crtCenterTime = AMDA::TimeUtil::readTimeInIso((char*)crtCenterTimeData[0].c_str()); | |
297 | + crtCenterTime = startDate + (stopDate - startDate) / 2.; | |
298 | + else | |
299 | + crtCenterTime = AMDA::TimeUtil::readTimeInIso((char*)crtCenterTimeData[0].c_str()); | |
296 | 300 | |
297 | 301 | //set the current center time to the epoch axis |
298 | 302 | epochAxis->setCrtCenterTime(crtCenterTime); | ... | ... |
src/ParamOutputImpl/Plot/Epoch/EpochPlotNode.cc
... | ... | @@ -55,11 +55,6 @@ boost::shared_ptr<PanelPlotOutput> EpochPlotNode::proceed(xmlNodePtr pNode_, Plo |
55 | 55 | plot->setCenterTimeId(std::string((const char*) value)); |
56 | 56 | xmlFree(value); |
57 | 57 | } |
58 | - else | |
59 | - { | |
60 | - LOG4CXX_ERROR(gLogger, "EpochPlotNode::proceed - centerTimeId not defined"); | |
61 | - BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_ERROR_UNKNOWN) << AMDA::ex_msg("centerTimeId not defined for epochPlot")); | |
62 | - } | |
63 | 58 | |
64 | 59 | // Copy default pages values for the panel if not already specified |
65 | 60 | if (panel_->_leftMargin == -1) | ... | ... |