Skip to content

Commit

Permalink
Implement feature #269
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Apr 24, 2020
1 parent 9c383a3 commit 6aa0bf6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions plotter_gui/plotwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,16 @@ QDomElement PlotWidget::xmlSaveState( QDomDocument &doc) const
}
plot_el.appendChild(limitY_el);

if( _curve_style == QwtPlotCurve::Lines ) {
plot_el.setAttribute("style", "Lines");
}
else if( _curve_style == QwtPlotCurve::LinesAndDots ) {
plot_el.setAttribute("style", "LinesAndDots");
}
else if( _curve_style == QwtPlotCurve::Dots ) {
plot_el.setAttribute("style", "Dots");
}

for(auto& it: _curve_list)
{
auto& name = it.first;
Expand All @@ -772,6 +782,7 @@ QDomElement PlotWidget::xmlSaveState( QDomDocument &doc) const
curve_el.setAttribute( "G", curve->pen().color().green());
curve_el.setAttribute( "B", curve->pen().color().blue());
curve_el.setAttribute( "custom_transform", _curves_transform.at(name) );
curve_el.setAttribute( "custom_transform", _curves_transform.at(name) );

plot_el.appendChild(curve_el);

Expand Down Expand Up @@ -962,6 +973,25 @@ bool PlotWidget::xmlLoadState(QDomElement &plot_widget)
this->setZoomRectangle( rect, false);
}

if( plot_widget.hasAttribute("style"))
{
QString style = plot_widget.attribute("style");
if( style == "Lines") {
_curve_style = QwtPlotCurve::Lines;
}
else if( style == "LinesAndDots") {
_curve_style = QwtPlotCurve::LinesAndDots;
}
else if( style == "Dots") {
_curve_style = QwtPlotCurve::Dots;
}

for(auto& it: _curve_list){
auto& curve = it.second;
curve->setStyle( _curve_style );
}
}

replot();
return true;
}
Expand Down

0 comments on commit 6aa0bf6

Please sign in to comment.