MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / AnalogSignal

Method AnalogSignal

DSView/pv/view/analogsignal.cpp:46–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44const float AnalogSignal::EnvelopeThreshold = 16.0f;
45
46AnalogSignal::AnalogSignal(data::AnalogSnapshot *data, sr_channel *probe) :
47 Signal(probe),
48 _data(data),
49 _rects(NULL),
50 _hover_en(false),
51 _hover_index(0),
52 _hover_point(QPointF(-1, -1)),
53 _hover_value(0)
54{
55 _typeWidth = 5;
56 _colour = SignalColours[probe->index % countof(SignalColours)];
57
58 uint32_t ui32;
59
60 // channel bits
61 bool ret = session->get_device()->get_config_byte(SR_CONF_UNIT_BITS, _bits);
62 if (!ret) {
63 _bits = DefaultBits;
64 dsv_warn("%s%d", "Warning: config_get SR_CONF_UNIT_BITS failed, set to %d(default).", DefaultBits);
65 }
66
67 ret = session->get_device()->get_config_uint32(SR_CONF_REF_MIN, ui32);
68 if (ret)
69 _ref_min = (double)ui32;
70 else
71 _ref_min = 1;
72
73 ret = session->get_device()->get_config_uint32(SR_CONF_REF_MAX, ui32);
74 if (ret)
75 _ref_max = (double)ui32;
76 else
77 _ref_max = ((1 << _bits) - 1);
78
79 // -- vpos
80 ret = session->get_device()->get_config_uint16( SR_CONF_PROBE_OFFSET, _zero_offset, _probe, NULL);
81 if (!ret) {
82 dsv_err("ERROR: config_get SR_CONF_PROBE_OFFSET failed.");
83 }
84}
85
86AnalogSignal::AnalogSignal(view::AnalogSignal *s, pv::data::AnalogSnapshot *data, sr_channel *probe) :
87 Signal(*s, probe),

Callers

nothing calls this directly

Calls 9

get_config_byteMethod · 0.80
get_deviceMethod · 0.80
get_config_uint32Method · 0.80
get_config_uint16Method · 0.80
get_zero_offsetMethod · 0.80
get_bitsMethod · 0.45
get_ref_minMethod · 0.45
get_ref_maxMethod · 0.45
get_scaleMethod · 0.45

Tested by

no test coverage detected