X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=inline;f=pv%2Fview%2Fanalogsignal.cpp;h=3291c1615f4fb253048ae36468fc191a04c3840a;hb=5ccfc97e20bbea19b9bc37905dd4cf63ee1f6303;hp=cd57da06b6073e0143f3f859bad2b70a8120a426;hpb=73a25a6e488f1813c1cd12da085a16e4f91ed4da;p=pulseview.git
diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp
index cd57da0..3291c16 100644
--- a/pv/view/analogsignal.cpp
+++ b/pv/view/analogsignal.cpp
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include
@@ -48,7 +47,8 @@ using std::shared_ptr;
using std::deque;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor AnalogSignal::SignalColours[4] = {
QColor(0xC4, 0xA0, 0x00), // Yellow
@@ -71,10 +71,8 @@ const int AnalogSignal::InfoTextMarginBottom = 5;
AnalogSignal::AnalogSignal(
pv::Session &session,
- shared_ptr base,
- shared_ptr data) :
+ shared_ptr base) :
Signal(session, base),
- data_(data),
scale_index_(4), // 20 per div
scale_index_drag_offset_(0),
div_height_(3 * QFontMetrics(QApplication::font()).height()),
@@ -87,12 +85,24 @@ AnalogSignal::AnalogSignal(
shared_ptr AnalogSignal::data() const
{
- return data_;
+ return base_->analog_data();
}
-shared_ptr AnalogSignal::analog_data() const
+void AnalogSignal::save_settings(QSettings &settings) const
{
- return data_;
+ settings.setValue("vdivs", vdivs_);
+ settings.setValue("scale_index", scale_index_);
+}
+
+void AnalogSignal::restore_settings(QSettings &settings)
+{
+ if (settings.contains("vdivs"))
+ vdivs_ = settings.value("vdivs").toInt();
+
+ if (settings.contains("scale_index")) {
+ scale_index_ = settings.value("scale_index").toInt();
+ update_scale();
+ }
}
std::pair AnalogSignal::v_extents() const
@@ -135,7 +145,7 @@ void AnalogSignal::paint_back(QPainter &p, const ViewItemPaintParams &pp)
void AnalogSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
{
- assert(data_);
+ assert(base_->analog_data());
assert(owner_);
const int y = get_visual_y();
@@ -146,7 +156,7 @@ void AnalogSignal::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
paint_grid(p, y, pp.left(), pp.right());
const deque< shared_ptr > &segments =
- data_->analog_segments();
+ base_->analog_data()->analog_segments();
if (segments.empty())
return;
@@ -375,5 +385,6 @@ void AnalogSignal::on_resolution_changed(int index)
owner_->row_item_appearance_changed(false, true);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv