X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fdata%2Fanalog.cpp;h=51e7f4953b78370af21b5b8401bf01adf682fad6;hb=8e15445ccd6994348eb74b24b5324d26c9be0cce;hp=8245186b97ab21af6b89d8d9f54e4137bbd519a6;hpb=e314eca490a09eec9ee851787f6e8c28805a81fd;p=pulseview.git
diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp
index 8245186..51e7f49 100644
--- a/pv/data/analog.cpp
+++ b/pv/data/analog.cpp
@@ -14,33 +14,69 @@
* 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 "analog.h"
-#include "analogsnapshot.h"
+#include
-using namespace boost;
-using namespace std;
+#include "analog.hpp"
+#include "analogsegment.hpp"
+
+using std::deque;
+using std::max;
+using std::shared_ptr;
+using std::vector;
namespace pv {
namespace data {
-Analog::Analog(const sr_datafeed_meta_analog&,
- uint64_t samplerate) :
- SignalData(samplerate)
+Analog::Analog() :
+ SignalData()
+{
+}
+
+void Analog::push_segment(shared_ptr &segment)
+{
+ segments_.push_front(segment);
+}
+
+const deque< shared_ptr >& Analog::analog_segments() const
+{
+ return segments_;
+}
+
+vector< shared_ptr > Analog::segments() const
+{
+ return vector< shared_ptr >(
+ segments_.begin(), segments_.end());
+}
+
+void Analog::clear()
+{
+ segments_.clear();
+
+ samples_cleared();
+}
+
+uint64_t Analog::max_sample_count() const
{
+ uint64_t l = 0;
+ for (const shared_ptr s : segments_) {
+ assert(s);
+ l = max(l, s->get_sample_count());
+ }
+ return l;
}
-void Analog::push_snapshot(shared_ptr &snapshot)
+void Analog::notify_samples_added(QObject* segment, uint64_t start_sample,
+ uint64_t end_sample)
{
- _snapshots.push_front(snapshot);
+ samples_added(segment, start_sample, end_sample);
}
-deque< shared_ptr >& Analog::get_snapshots()
+void Analog::notify_min_max_changed(float min, float max)
{
- return _snapshots;
+ min_max_changed(min, max);
}
} // namespace data