# This list includes only QObject derived class headers.
set(pulseview_HEADERS
- pv/mainwindow.h
- pv/sigsession.h
- pv/storesession.h
- pv/dialogs/about.h
- pv/dialogs/connect.h
- pv/dialogs/storeprogress.h
- pv/popups/channels.h
- pv/popups/deviceoptions.h
- pv/prop/bool.h
- pv/prop/double.h
- pv/prop/enum.h
- pv/prop/int.h
- pv/prop/property.h
- pv/prop/string.h
- pv/prop/binding/deviceoptions.h
- pv/toolbars/samplingbar.h
- pv/view/cursor.h
- pv/view/cursorheader.h
- pv/view/header.h
- pv/view/logicsignal.h
- pv/view/marginwidget.h
- pv/view/rowitem.h
- pv/view/ruler.h
- pv/view/selectableitem.h
- pv/view/signal.h
- pv/view/timemarker.h
- pv/view/trace.h
- pv/view/tracegroup.h
- pv/view/view.h
- pv/view/viewport.h
- pv/widgets/colourbutton.h
- pv/widgets/colourpopup.h
- pv/widgets/popup.h
- pv/widgets/popuptoolbutton.h
- pv/widgets/sweeptimingwidget.h
- pv/widgets/wellarray.h
+ pv/mainwindow.hpp
+ pv/sigsession.hpp
+ pv/storesession.hpp
+ pv/dialogs/about.hpp
+ pv/dialogs/connect.hpp
+ pv/dialogs/storeprogress.hpp
+ pv/popups/channels.hpp
+ pv/popups/deviceoptions.hpp
+ pv/prop/bool.hpp
+ pv/prop/double.hpp
+ pv/prop/enum.hpp
+ pv/prop/int.hpp
+ pv/prop/property.hpp
+ pv/prop/string.hpp
+ pv/prop/binding/deviceoptions.hpp
+ pv/toolbars/samplingbar.hpp
+ pv/view/cursor.hpp
+ pv/view/cursorheader.hpp
+ pv/view/header.hpp
+ pv/view/logicsignal.hpp
+ pv/view/marginwidget.hpp
+ pv/view/rowitem.hpp
+ pv/view/ruler.hpp
+ pv/view/selectableitem.hpp
+ pv/view/signal.hpp
+ pv/view/timemarker.hpp
+ pv/view/trace.hpp
+ pv/view/tracegroup.hpp
+ pv/view/view.hpp
+ pv/view/viewport.hpp
+ pv/widgets/colourbutton.hpp
+ pv/widgets/colourpopup.hpp
+ pv/widgets/popup.hpp
+ pv/widgets/popuptoolbutton.hpp
+ pv/widgets/sweeptimingwidget.hpp
+ pv/widgets/wellarray.hpp
)
set(pulseview_FORMS
if(ENABLE_SIGNALS)
list(APPEND pulseview_SOURCES signalhandler.cpp)
- list(APPEND pulseview_HEADERS signalhandler.h)
+ list(APPEND pulseview_HEADERS signalhandler.hpp)
endif()
if(ENABLE_DECODE)
)
list(APPEND pulseview_HEADERS
- pv/data/decoderstack.h
- pv/view/decodetrace.h
- pv/widgets/decodergroupbox.h
- pv/widgets/decodermenu.h
+ pv/data/decoderstack.hpp
+ pv/view/decodetrace.hpp
+ pv/widgets/decodergroupbox.hpp
+ pv/widgets/decodermenu.hpp
)
endif()
#include <stdint.h>
#include <libsigrok/libsigrok.h>
-#include "android/loghandler.h"
+#include "android/loghandler.hpp"
namespace pv {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Marcus Comstedt <marcus@mc.pp.se>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PULSEVIEW_ANDROID_LOGHANDLER_H
-#define PULSEVIEW_ANDROID_LOGHANDLER_H
-
-#include <stdarg.h>
-
-namespace pv {
-
-class AndroidLogHandler
-{
-private:
- static int sr_callback(void *cb_data, int loglevel, const char *format, va_list args);
- static int srd_callback(void *cb_data, int loglevel, const char *format, va_list args);
-
-public:
- static void install_callbacks();
-};
-
-} // namespace pv
-
-#endif // PULSEVIEW_ANDROID_LOGHANDLER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Marcus Comstedt <marcus@mc.pp.se>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PULSEVIEW_ANDROID_LOGHANDLER_H
+#define PULSEVIEW_ANDROID_LOGHANDLER_H
+
+#include <stdarg.h>
+
+namespace pv {
+
+class AndroidLogHandler
+{
+private:
+ static int sr_callback(void *cb_data, int loglevel, const char *format, va_list args);
+ static int srd_callback(void *cb_data, int loglevel, const char *format, va_list args);
+
+public:
+ static void install_callbacks();
+};
+
+} // namespace pv
+
+#endif // PULSEVIEW_ANDROID_LOGHANDLER_H
#include <QDebug>
#ifdef ENABLE_SIGNALS
-#include "signalhandler.h"
+#include "signalhandler.hpp"
#endif
-#include "pv/application.h"
-#include "pv/devicemanager.h"
-#include "pv/mainwindow.h"
+#include "pv/application.hpp"
+#include "pv/devicemanager.hpp"
+#include "pv/mainwindow.hpp"
#ifdef ANDROID
#include <libsigrokandroidutils/libsigrokandroidutils.h>
-#include "android/loghandler.h"
+#include "android/loghandler.hpp"
#endif
#include "config.h"
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "application.h"
+#include "application.hpp"
#include "config.h"
#include <iostream>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Martin Ling <martin-sigrok@earth.li>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_APPLICATION_H
-#define PULSEVIEW_PV_APPLICATION_H
-
-#include <QApplication>
-
-class Application : public QApplication
-{
-public:
- Application(int &argc, char* argv[]);
-private:
- bool notify(QObject *receiver, QEvent *event);
-};
-
-#endif // PULSEVIEW_PV_APPLICATION_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Martin Ling <martin-sigrok@earth.li>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_APPLICATION_H
+#define PULSEVIEW_PV_APPLICATION_H
+
+#include <QApplication>
+
+class Application : public QApplication
+{
+public:
+ Application(int &argc, char* argv[]);
+private:
+ bool notify(QObject *receiver, QEvent *event);
+};
+
+#endif // PULSEVIEW_PV_APPLICATION_H
#include <cassert>
-#include "analog.h"
-#include "analogsnapshot.h"
+#include "analog.hpp"
+#include "analogsnapshot.hpp"
using std::deque;
using std::max;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_ANALOG_H
-#define PULSEVIEW_PV_DATA_ANALOG_H
-
-#include "signaldata.h"
-
-#include <deque>
-#include <memory>
-
-namespace pv {
-namespace data {
-
-class AnalogSnapshot;
-
-class Analog : public SignalData
-{
-public:
- Analog();
-
- void push_snapshot(
- std::shared_ptr<AnalogSnapshot> &snapshot);
-
- std::deque< std::shared_ptr<AnalogSnapshot> >&
- get_snapshots();
-
- void clear();
-
- uint64_t get_max_sample_count() const;
-
-private:
- std::deque< std::shared_ptr<AnalogSnapshot> > snapshots_;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_ANALOG_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_ANALOG_H
+#define PULSEVIEW_PV_DATA_ANALOG_H
+
+#include "signaldata.hpp"
+
+#include <deque>
+#include <memory>
+
+namespace pv {
+namespace data {
+
+class AnalogSnapshot;
+
+class Analog : public SignalData
+{
+public:
+ Analog();
+
+ void push_snapshot(
+ std::shared_ptr<AnalogSnapshot> &snapshot);
+
+ std::deque< std::shared_ptr<AnalogSnapshot> >&
+ get_snapshots();
+
+ void clear();
+
+ uint64_t get_max_sample_count() const;
+
+private:
+ std::deque< std::shared_ptr<AnalogSnapshot> > snapshots_;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_ANALOG_H
#include <algorithm>
-#include "analogsnapshot.h"
+#include "analogsnapshot.hpp"
using std::lock_guard;
using std::recursive_mutex;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
-#define PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
-
-#include "snapshot.h"
-
-#include <utility>
-#include <vector>
-
-namespace AnalogSnapshotTest {
-struct Basic;
-}
-
-namespace pv {
-namespace data {
-
-class AnalogSnapshot : public Snapshot
-{
-public:
- struct EnvelopeSample
- {
- float min;
- float max;
- };
-
- struct EnvelopeSection
- {
- uint64_t start;
- unsigned int scale;
- uint64_t length;
- EnvelopeSample *samples;
- };
-
-private:
- struct Envelope
- {
- uint64_t length;
- uint64_t data_length;
- EnvelopeSample *samples;
- };
-
-private:
- static const unsigned int ScaleStepCount = 10;
- static const int EnvelopeScalePower;
- static const int EnvelopeScaleFactor;
- static const float LogEnvelopeScaleFactor;
- static const uint64_t EnvelopeDataUnit;
-
-public:
- AnalogSnapshot(uint64_t expected_num_samples = 0);
-
- virtual ~AnalogSnapshot();
-
- void append_interleaved_samples(const float *data,
- size_t sample_count, size_t stride);
-
- const float* get_samples(int64_t start_sample,
- int64_t end_sample) const;
-
- void get_envelope_section(EnvelopeSection &s,
- uint64_t start, uint64_t end, float min_length) const;
-
-private:
- void reallocate_envelope(Envelope &l);
-
- void append_payload_to_envelope_levels();
-
-private:
- struct Envelope envelope_levels_[ScaleStepCount];
-
- friend struct AnalogSnapshotTest::Basic;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
+#define PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
+
+#include "snapshot.hpp"
+
+#include <utility>
+#include <vector>
+
+namespace AnalogSnapshotTest {
+struct Basic;
+}
+
+namespace pv {
+namespace data {
+
+class AnalogSnapshot : public Snapshot
+{
+public:
+ struct EnvelopeSample
+ {
+ float min;
+ float max;
+ };
+
+ struct EnvelopeSection
+ {
+ uint64_t start;
+ unsigned int scale;
+ uint64_t length;
+ EnvelopeSample *samples;
+ };
+
+private:
+ struct Envelope
+ {
+ uint64_t length;
+ uint64_t data_length;
+ EnvelopeSample *samples;
+ };
+
+private:
+ static const unsigned int ScaleStepCount = 10;
+ static const int EnvelopeScalePower;
+ static const int EnvelopeScaleFactor;
+ static const float LogEnvelopeScaleFactor;
+ static const uint64_t EnvelopeDataUnit;
+
+public:
+ AnalogSnapshot(uint64_t expected_num_samples = 0);
+
+ virtual ~AnalogSnapshot();
+
+ void append_interleaved_samples(const float *data,
+ size_t sample_count, size_t stride);
+
+ const float* get_samples(int64_t start_sample,
+ int64_t end_sample) const;
+
+ void get_envelope_section(EnvelopeSection &s,
+ uint64_t start, uint64_t end, float min_length) const;
+
+private:
+ void reallocate_envelope(Envelope &l);
+
+ void append_payload_to_envelope_levels();
+
+private:
+ struct Envelope envelope_levels_[ScaleStepCount];
+
+ friend struct AnalogSnapshotTest::Basic;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_ANALOGSNAPSHOT_H
#include <cassert>
#include <vector>
-#include "annotation.h"
+#include "annotation.hpp"
namespace pv {
namespace data {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
-#define PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
-
-#include <stdint.h>
-
-#include <QString>
-
-struct srd_proto_data;
-
-namespace pv {
-namespace data {
-namespace decode {
-
-class Annotation
-{
-public:
- Annotation(const srd_proto_data *const pdata);
-
- uint64_t start_sample() const;
- uint64_t end_sample() const;
- int format() const;
- const std::vector<QString>& annotations() const;
-
-private:
- uint64_t start_sample_;
- uint64_t end_sample_;
- int format_;
- std::vector<QString> annotations_;
-};
-
-} // namespace decode
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
+#define PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
+
+#include <stdint.h>
+
+#include <QString>
+
+struct srd_proto_data;
+
+namespace pv {
+namespace data {
+namespace decode {
+
+class Annotation
+{
+public:
+ Annotation(const srd_proto_data *const pdata);
+
+ uint64_t start_sample() const;
+ uint64_t end_sample() const;
+ int format() const;
+ const std::vector<QString>& annotations() const;
+
+private:
+ uint64_t start_sample_;
+ uint64_t end_sample_;
+ int format_;
+ std::vector<QString> annotations_;
+};
+
+} // namespace decode
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_H
#include <libsigrok/libsigrok.hpp>
#include <libsigrokdecode/libsigrokdecode.h>
-#include "decoder.h"
+#include "decoder.hpp"
-#include <pv/view/logicsignal.h>
+#include <pv/view/logicsignal.hpp>
using std::set;
using std::map;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_DECODE_DECODER_H
-#define PULSEVIEW_PV_DATA_DECODE_DECODER_H
-
-#include <map>
-#include <memory>
-#include <set>
-
-#include <glib.h>
-
-struct srd_decoder;
-struct srd_decoder_inst;
-struct srd_channel;
-struct srd_session;
-
-namespace pv {
-
-namespace view {
-class LogicSignal;
-}
-
-namespace data {
-
-class Logic;
-
-namespace decode {
-
-class Decoder
-{
-public:
- Decoder(const srd_decoder *const decoder);
-
- virtual ~Decoder();
-
- const srd_decoder* decoder() const;
-
- bool shown() const;
- void show(bool show = true);
-
- const std::map<const srd_channel*,
- std::shared_ptr<view::LogicSignal> >& channels() const;
- void set_channels(std::map<const srd_channel*,
- std::shared_ptr<view::LogicSignal> > channels);
-
- const std::map<std::string, GVariant*>& options() const;
-
- void set_option(const char *id, GVariant *value);
-
- bool have_required_channels() const;
-
- srd_decoder_inst* create_decoder_inst(
- srd_session *session, int unit_size) const;
-
- std::set< std::shared_ptr<pv::data::Logic> > get_data();
-
-private:
- const srd_decoder *const decoder_;
-
- bool shown_;
-
- std::map<const srd_channel*, std::shared_ptr<pv::view::LogicSignal> >
- channels_;
- std::map<std::string, GVariant*> options_;
-};
-
-} // namespace decode
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_DECODE_DECODER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_DECODE_DECODER_H
+#define PULSEVIEW_PV_DATA_DECODE_DECODER_H
+
+#include <map>
+#include <memory>
+#include <set>
+
+#include <glib.h>
+
+struct srd_decoder;
+struct srd_decoder_inst;
+struct srd_channel;
+struct srd_session;
+
+namespace pv {
+
+namespace view {
+class LogicSignal;
+}
+
+namespace data {
+
+class Logic;
+
+namespace decode {
+
+class Decoder
+{
+public:
+ Decoder(const srd_decoder *const decoder);
+
+ virtual ~Decoder();
+
+ const srd_decoder* decoder() const;
+
+ bool shown() const;
+ void show(bool show = true);
+
+ const std::map<const srd_channel*,
+ std::shared_ptr<view::LogicSignal> >& channels() const;
+ void set_channels(std::map<const srd_channel*,
+ std::shared_ptr<view::LogicSignal> > channels);
+
+ const std::map<std::string, GVariant*>& options() const;
+
+ void set_option(const char *id, GVariant *value);
+
+ bool have_required_channels() const;
+
+ srd_decoder_inst* create_decoder_inst(
+ srd_session *session, int unit_size) const;
+
+ std::set< std::shared_ptr<pv::data::Logic> > get_data();
+
+private:
+ const srd_decoder *const decoder_;
+
+ bool shown_;
+
+ std::map<const srd_channel*, std::shared_ptr<pv::view::LogicSignal> >
+ channels_;
+ std::map<std::string, GVariant*> options_;
+};
+
+} // namespace decode
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_DECODE_DECODER_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "row.h"
+#include "row.hpp"
#include <libsigrokdecode/libsigrokdecode.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_DECODE_ROW_H
-#define PULSEVIEW_PV_DATA_DECODE_ROW_H
-
-#include <vector>
-
-#include "annotation.h"
-
-struct srd_decoder;
-struct srd_decoder_annotation_row;
-
-namespace pv {
-namespace data {
-namespace decode {
-
-class Row
-{
-public:
- Row();
-
- Row(const srd_decoder *decoder,
- const srd_decoder_annotation_row *row = NULL);
-
- const srd_decoder* decoder() const;
- const srd_decoder_annotation_row* row() const;
-
- const QString title() const;
-
- bool operator<(const Row &other) const;
-
-private:
- const srd_decoder *decoder_;
- const srd_decoder_annotation_row *row_;
-};
-
-} // decode
-} // data
-} // pv
-
-#endif // PULSEVIEW_PV_DATA_DECODE_ROW_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_DECODE_ROW_H
+#define PULSEVIEW_PV_DATA_DECODE_ROW_H
+
+#include <vector>
+
+#include "annotation.hpp"
+
+struct srd_decoder;
+struct srd_decoder_annotation_row;
+
+namespace pv {
+namespace data {
+namespace decode {
+
+class Row
+{
+public:
+ Row();
+
+ Row(const srd_decoder *decoder,
+ const srd_decoder_annotation_row *row = NULL);
+
+ const srd_decoder* decoder() const;
+ const srd_decoder_annotation_row* row() const;
+
+ const QString title() const;
+
+ bool operator<(const Row &other) const;
+
+private:
+ const srd_decoder *decoder_;
+ const srd_decoder_annotation_row *row_;
+};
+
+} // decode
+} // data
+} // pv
+
+#endif // PULSEVIEW_PV_DATA_DECODE_ROW_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "rowdata.h"
+#include "rowdata.hpp"
using std::vector;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
-#define PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
-
-#include <vector>
-
-#include "annotation.h"
-
-namespace pv {
-namespace data {
-namespace decode {
-
-class RowData
-{
-public:
- RowData();
-
-public:
- uint64_t get_max_sample() const;
-
- /**
- * Extracts sorted annotations between two period into a vector.
- */
- void get_annotation_subset(
- std::vector<pv::data::decode::Annotation> &dest,
- uint64_t start_sample, uint64_t end_sample) const;
-
- void push_annotation(const Annotation &a);
-
-private:
- std::vector<Annotation> annotations_;
-};
-
-}
-} // data
-} // pv
-
-#endif // PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
+#define PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
+
+#include <vector>
+
+#include "annotation.hpp"
+
+namespace pv {
+namespace data {
+namespace decode {
+
+class RowData
+{
+public:
+ RowData();
+
+public:
+ uint64_t get_max_sample() const;
+
+ /**
+ * Extracts sorted annotations between two period into a vector.
+ */
+ void get_annotation_subset(
+ std::vector<pv::data::decode::Annotation> &dest,
+ uint64_t start_sample, uint64_t end_sample) const;
+
+ void push_annotation(const Annotation &a);
+
+private:
+ std::vector<Annotation> annotations_;
+};
+
+}
+} // data
+} // pv
+
+#endif // PULSEVIEW_PV_DATA_DECODE_ROWDATA_H
#include <QDebug>
-#include "decoderstack.h"
-
-#include <pv/data/logic.h>
-#include <pv/data/logicsnapshot.h>
-#include <pv/data/decode/decoder.h>
-#include <pv/data/decode/annotation.h>
-#include <pv/sigsession.h>
-#include <pv/view/logicsignal.h>
+#include "decoderstack.hpp"
+
+#include <pv/data/logic.hpp>
+#include <pv/data/logicsnapshot.hpp>
+#include <pv/data/decode/decoder.hpp>
+#include <pv/data/decode/annotation.hpp>
+#include <pv/sigsession.hpp>
+#include <pv/view/logicsignal.hpp>
using std::lock_guard;
using std::mutex;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_DECODERSTACK_H
-#define PULSEVIEW_PV_DATA_DECODERSTACK_H
-
-#include "signaldata.h"
-
-#include <atomic>
-#include <condition_variable>
-#include <list>
-#include <map>
-#include <memory>
-#include <thread>
-
-#include <boost/optional.hpp>
-
-#include <QObject>
-#include <QString>
-
-#include <pv/data/decode/row.h>
-#include <pv/data/decode/rowdata.h>
-
-struct srd_decoder;
-struct srd_decoder_annotation_row;
-struct srd_channel;
-struct srd_proto_data;
-struct srd_session;
-
-namespace DecoderStackTest {
-struct TwoDecoderStack;
-}
-
-namespace pv {
-
-class SigSession;
-
-namespace view {
-class LogicSignal;
-}
-
-namespace data {
-
-class LogicSnapshot;
-
-namespace decode {
-class Annotation;
-class Decoder;
-}
-
-class Logic;
-
-class DecoderStack : public QObject, public SignalData
-{
- Q_OBJECT
-
-private:
- static const double DecodeMargin;
- static const double DecodeThreshold;
- static const int64_t DecodeChunkLength;
- static const unsigned int DecodeNotifyPeriod;
-
-public:
- DecoderStack(pv::SigSession &session_,
- const srd_decoder *const decoder);
-
- virtual ~DecoderStack();
-
- const std::list< std::shared_ptr<decode::Decoder> >& stack() const;
- void push(std::shared_ptr<decode::Decoder> decoder);
- void remove(int index);
-
- int64_t samples_decoded() const;
-
- std::vector<decode::Row> get_visible_rows() const;
-
- /**
- * Extracts sorted annotations between two period into a vector.
- */
- void get_annotation_subset(
- std::vector<pv::data::decode::Annotation> &dest,
- const decode::Row &row, uint64_t start_sample,
- uint64_t end_sample) const;
-
- QString error_message();
-
- void clear();
-
- uint64_t get_max_sample_count() const;
-
- void begin_decode();
-
-private:
- boost::optional<int64_t> wait_for_data() const;
-
- void decode_data(const int64_t sample_count,
- const unsigned int unit_size, srd_session *const session);
-
- void decode_proc();
-
- static void annotation_callback(srd_proto_data *pdata,
- void *decoder);
-
-private Q_SLOTS:
- void on_new_frame();
-
- void on_data_received();
-
- void on_frame_ended();
-
-Q_SIGNALS:
- void new_decode_data();
-
-private:
- pv::SigSession &session_;
-
- /**
- * This mutex prevents more than one decode operation occuring
- * concurrently.
- * @todo A proper solution should be implemented to allow multiple
- * decode operations.
- */
- static std::mutex global_decode_mutex_;
-
- std::list< std::shared_ptr<decode::Decoder> > stack_;
-
- std::shared_ptr<pv::data::LogicSnapshot> snapshot_;
-
- mutable std::mutex input_mutex_;
- mutable std::condition_variable input_cond_;
- int64_t sample_count_;
- bool frame_complete_;
-
- mutable std::mutex output_mutex_;
- int64_t samples_decoded_;
-
- std::map<const decode::Row, decode::RowData> rows_;
-
- std::map<std::pair<const srd_decoder*, int>, decode::Row> class_rows_;
-
- QString error_message_;
-
- std::thread decode_thread_;
- std::atomic<bool> interrupt_;
-
- friend struct DecoderStackTest::TwoDecoderStack;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_DECODERSTACK_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_DECODERSTACK_H
+#define PULSEVIEW_PV_DATA_DECODERSTACK_H
+
+#include "signaldata.hpp"
+
+#include <atomic>
+#include <condition_variable>
+#include <list>
+#include <map>
+#include <memory>
+#include <thread>
+
+#include <boost/optional.hpp>
+
+#include <QObject>
+#include <QString>
+
+#include <pv/data/decode/row.hpp>
+#include <pv/data/decode/rowdata.hpp>
+
+struct srd_decoder;
+struct srd_decoder_annotation_row;
+struct srd_channel;
+struct srd_proto_data;
+struct srd_session;
+
+namespace DecoderStackTest {
+struct TwoDecoderStack;
+}
+
+namespace pv {
+
+class SigSession;
+
+namespace view {
+class LogicSignal;
+}
+
+namespace data {
+
+class LogicSnapshot;
+
+namespace decode {
+class Annotation;
+class Decoder;
+}
+
+class Logic;
+
+class DecoderStack : public QObject, public SignalData
+{
+ Q_OBJECT
+
+private:
+ static const double DecodeMargin;
+ static const double DecodeThreshold;
+ static const int64_t DecodeChunkLength;
+ static const unsigned int DecodeNotifyPeriod;
+
+public:
+ DecoderStack(pv::SigSession &session_,
+ const srd_decoder *const decoder);
+
+ virtual ~DecoderStack();
+
+ const std::list< std::shared_ptr<decode::Decoder> >& stack() const;
+ void push(std::shared_ptr<decode::Decoder> decoder);
+ void remove(int index);
+
+ int64_t samples_decoded() const;
+
+ std::vector<decode::Row> get_visible_rows() const;
+
+ /**
+ * Extracts sorted annotations between two period into a vector.
+ */
+ void get_annotation_subset(
+ std::vector<pv::data::decode::Annotation> &dest,
+ const decode::Row &row, uint64_t start_sample,
+ uint64_t end_sample) const;
+
+ QString error_message();
+
+ void clear();
+
+ uint64_t get_max_sample_count() const;
+
+ void begin_decode();
+
+private:
+ boost::optional<int64_t> wait_for_data() const;
+
+ void decode_data(const int64_t sample_count,
+ const unsigned int unit_size, srd_session *const session);
+
+ void decode_proc();
+
+ static void annotation_callback(srd_proto_data *pdata,
+ void *decoder);
+
+private Q_SLOTS:
+ void on_new_frame();
+
+ void on_data_received();
+
+ void on_frame_ended();
+
+Q_SIGNALS:
+ void new_decode_data();
+
+private:
+ pv::SigSession &session_;
+
+ /**
+ * This mutex prevents more than one decode operation occuring
+ * concurrently.
+ * @todo A proper solution should be implemented to allow multiple
+ * decode operations.
+ */
+ static std::mutex global_decode_mutex_;
+
+ std::list< std::shared_ptr<decode::Decoder> > stack_;
+
+ std::shared_ptr<pv::data::LogicSnapshot> snapshot_;
+
+ mutable std::mutex input_mutex_;
+ mutable std::condition_variable input_cond_;
+ int64_t sample_count_;
+ bool frame_complete_;
+
+ mutable std::mutex output_mutex_;
+ int64_t samples_decoded_;
+
+ std::map<const decode::Row, decode::RowData> rows_;
+
+ std::map<std::pair<const srd_decoder*, int>, decode::Row> class_rows_;
+
+ QString error_message_;
+
+ std::thread decode_thread_;
+ std::atomic<bool> interrupt_;
+
+ friend struct DecoderStackTest::TwoDecoderStack;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_DECODERSTACK_H
#include <cassert>
-#include "logic.h"
-#include "logicsnapshot.h"
+#include "logic.hpp"
+#include "logicsnapshot.hpp"
using std::deque;
using std::max;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_LOGIC_H
-#define PULSEVIEW_PV_DATA_LOGIC_H
-
-#include "signaldata.h"
-
-#include <deque>
-#include <memory>
-
-namespace pv {
-namespace data {
-
-class LogicSnapshot;
-
-class Logic : public SignalData
-{
-public:
- Logic(unsigned int num_channels);
-
- int get_num_channels() const;
-
- void push_snapshot(
- std::shared_ptr<LogicSnapshot> &snapshot);
-
- std::deque< std::shared_ptr<LogicSnapshot> >&
- get_snapshots();
-
- void clear();
-
- uint64_t get_max_sample_count() const;
-
-private:
- const unsigned int num_channels_;
- std::deque< std::shared_ptr<LogicSnapshot> > snapshots_;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_LOGIC_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_LOGIC_H
+#define PULSEVIEW_PV_DATA_LOGIC_H
+
+#include "signaldata.hpp"
+
+#include <deque>
+#include <memory>
+
+namespace pv {
+namespace data {
+
+class LogicSnapshot;
+
+class Logic : public SignalData
+{
+public:
+ Logic(unsigned int num_channels);
+
+ int get_num_channels() const;
+
+ void push_snapshot(
+ std::shared_ptr<LogicSnapshot> &snapshot);
+
+ std::deque< std::shared_ptr<LogicSnapshot> >&
+ get_snapshots();
+
+ void clear();
+
+ uint64_t get_max_sample_count() const;
+
+private:
+ const unsigned int num_channels_;
+ std::deque< std::shared_ptr<LogicSnapshot> > snapshots_;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_LOGIC_H
#include <stdlib.h>
#include <math.h>
-#include "config.h"
-#include "logicsnapshot.h"
+#include "logicsnapshot.hpp"
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
-#define PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
-
-#include "snapshot.h"
-
-#include <utility>
-#include <vector>
-
-namespace sigrok {
- class Logic;
-}
-
-namespace LogicSnapshotTest {
-struct Pow2;
-struct Basic;
-struct LargeData;
-struct Pulses;
-struct LongPulses;
-}
-
-namespace pv {
-namespace data {
-
-class LogicSnapshot : public Snapshot
-{
-private:
- struct MipMapLevel
- {
- uint64_t length;
- uint64_t data_length;
- void *data;
- };
-
-private:
- static const unsigned int ScaleStepCount = 10;
- static const int MipMapScalePower;
- static const int MipMapScaleFactor;
- static const float LogMipMapScaleFactor;
- static const uint64_t MipMapDataUnit;
-
-public:
- typedef std::pair<int64_t, bool> EdgePair;
-
-public:
- LogicSnapshot(std::shared_ptr<sigrok::Logic> logic,
- uint64_t expected_num_samples = 0);
-
- virtual ~LogicSnapshot();
-
- void append_payload(std::shared_ptr<sigrok::Logic> logic);
-
- void get_samples(uint8_t *const data,
- int64_t start_sample, int64_t end_sample) const;
-
-private:
- uint64_t unpack_sample(const uint8_t *ptr) const;
- void pack_sample(uint8_t *ptr, uint64_t value);
-
- void reallocate_mipmap_level(MipMapLevel &m);
-
- void append_payload_to_mipmap();
-
- uint64_t get_sample(uint64_t index) const;
-
-public:
- /**
- * Parses a logic data snapshot to generate a list of transitions
- * in a time interval to a given level of detail.
- * @param[out] edges The vector to place the edges into.
- * @param[in] start The start sample index.
- * @param[in] end The end sample index.
- * @param[in] min_length The minimum number of samples that
- * can be resolved at this level of detail.
- * @param[in] sig_index The index of the signal.
- **/
- void get_subsampled_edges(std::vector<EdgePair> &edges,
- uint64_t start, uint64_t end,
- float min_length, int sig_index);
-
-private:
- uint64_t get_subsample(int level, uint64_t offset) const;
-
- static uint64_t pow2_ceil(uint64_t x, unsigned int power);
-
-private:
- struct MipMapLevel mip_map_[ScaleStepCount];
- uint64_t last_append_sample_;
-
- friend struct LogicSnapshotTest::Pow2;
- friend struct LogicSnapshotTest::Basic;
- friend struct LogicSnapshotTest::LargeData;
- friend struct LogicSnapshotTest::Pulses;
- friend struct LogicSnapshotTest::LongPulses;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
+#define PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
+
+#include "snapshot.hpp"
+
+#include <utility>
+#include <vector>
+
+namespace sigrok {
+ class Logic;
+}
+
+namespace LogicSnapshotTest {
+struct Pow2;
+struct Basic;
+struct LargeData;
+struct Pulses;
+struct LongPulses;
+}
+
+namespace pv {
+namespace data {
+
+class LogicSnapshot : public Snapshot
+{
+private:
+ struct MipMapLevel
+ {
+ uint64_t length;
+ uint64_t data_length;
+ void *data;
+ };
+
+private:
+ static const unsigned int ScaleStepCount = 10;
+ static const int MipMapScalePower;
+ static const int MipMapScaleFactor;
+ static const float LogMipMapScaleFactor;
+ static const uint64_t MipMapDataUnit;
+
+public:
+ typedef std::pair<int64_t, bool> EdgePair;
+
+public:
+ LogicSnapshot(std::shared_ptr<sigrok::Logic> logic,
+ uint64_t expected_num_samples = 0);
+
+ virtual ~LogicSnapshot();
+
+ void append_payload(std::shared_ptr<sigrok::Logic> logic);
+
+ void get_samples(uint8_t *const data,
+ int64_t start_sample, int64_t end_sample) const;
+
+private:
+ uint64_t unpack_sample(const uint8_t *ptr) const;
+ void pack_sample(uint8_t *ptr, uint64_t value);
+
+ void reallocate_mipmap_level(MipMapLevel &m);
+
+ void append_payload_to_mipmap();
+
+ uint64_t get_sample(uint64_t index) const;
+
+public:
+ /**
+ * Parses a logic data snapshot to generate a list of transitions
+ * in a time interval to a given level of detail.
+ * @param[out] edges The vector to place the edges into.
+ * @param[in] start The start sample index.
+ * @param[in] end The end sample index.
+ * @param[in] min_length The minimum number of samples that
+ * can be resolved at this level of detail.
+ * @param[in] sig_index The index of the signal.
+ **/
+ void get_subsampled_edges(std::vector<EdgePair> &edges,
+ uint64_t start, uint64_t end,
+ float min_length, int sig_index);
+
+private:
+ uint64_t get_subsample(int level, uint64_t offset) const;
+
+ static uint64_t pow2_ceil(uint64_t x, unsigned int power);
+
+private:
+ struct MipMapLevel mip_map_[ScaleStepCount];
+ uint64_t last_append_sample_;
+
+ friend struct LogicSnapshotTest::Pow2;
+ friend struct LogicSnapshotTest::Basic;
+ friend struct LogicSnapshotTest::LargeData;
+ friend struct LogicSnapshotTest::Pulses;
+ friend struct LogicSnapshotTest::LongPulses;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_LOGICSNAPSHOT_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "signaldata.h"
+#include "signaldata.hpp"
namespace pv {
namespace data {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_SIGNALDATA_H
-#define PULSEVIEW_PV_DATA_SIGNALDATA_H
-
-#include <stdint.h>
-
-namespace pv {
-namespace data {
-
-class SignalData
-{
-public:
- SignalData();
- virtual ~SignalData() {}
-
-public:
- double samplerate() const;
- void set_samplerate(double samplerate);
-
- double get_start_time() const;
-
- virtual void clear() = 0;
-
- virtual uint64_t get_max_sample_count() const = 0;
-
-protected:
- double start_time_;
- double samplerate_;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_SIGNALDATA_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_SIGNALDATA_H
+#define PULSEVIEW_PV_DATA_SIGNALDATA_H
+
+#include <stdint.h>
+
+namespace pv {
+namespace data {
+
+class SignalData
+{
+public:
+ SignalData();
+ virtual ~SignalData() {}
+
+public:
+ double samplerate() const;
+ void set_samplerate(double samplerate);
+
+ double get_start_time() const;
+
+ virtual void clear() = 0;
+
+ virtual uint64_t get_max_sample_count() const = 0;
+
+protected:
+ double start_time_;
+ double samplerate_;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_SIGNALDATA_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "snapshot.h"
+#include "snapshot.hpp"
#include <assert.h>
#include <stdlib.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DATA_SNAPSHOT_H
-#define PULSEVIEW_PV_DATA_SNAPSHOT_H
-
-#include <thread>
-#include <mutex>
-#include <vector>
-
-namespace pv {
-namespace data {
-
-class Snapshot
-{
-public:
- Snapshot(unsigned int unit_size);
-
- virtual ~Snapshot();
-
- uint64_t get_sample_count() const;
-
- unsigned int unit_size() const;
-
- /**
- * @brief Increase the capacity of the snapshot.
- *
- * Increasing the capacity allows samples to be appended without needing
- * to reallocate memory.
- *
- * For the best efficiency @c set_capacity() should be called once before
- * @c append_data() is called to set up the snapshot with the expected number
- * of samples that will be appended in total.
- *
- * @note The capacity will automatically be increased when @c append_data()
- * is called if there is not enough capacity in the buffer to store the samples.
- *
- * @param[in] new_capacity The new capacity of the snapshot. If this value is
- * smaller or equal than the current capacity then the method has no effect.
- */
- void set_capacity(uint64_t new_capacity);
-
- /**
- * @brief Get the current capacity of the snapshot.
- *
- * The capacity can be increased by calling @c set_capacity().
- *
- * @return The current capacity of the snapshot.
- */
- uint64_t capacity() const;
-
-protected:
- void append_data(void *data, uint64_t samples);
-
-protected:
- mutable std::recursive_mutex mutex_;
- std::vector<uint8_t> data_;
- uint64_t sample_count_;
- uint64_t capacity_;
- unsigned int unit_size_;
-};
-
-} // namespace data
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DATA_SNAPSHOT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DATA_SNAPSHOT_H
+#define PULSEVIEW_PV_DATA_SNAPSHOT_H
+
+#include <thread>
+#include <mutex>
+#include <vector>
+
+namespace pv {
+namespace data {
+
+class Snapshot
+{
+public:
+ Snapshot(unsigned int unit_size);
+
+ virtual ~Snapshot();
+
+ uint64_t get_sample_count() const;
+
+ unsigned int unit_size() const;
+
+ /**
+ * @brief Increase the capacity of the snapshot.
+ *
+ * Increasing the capacity allows samples to be appended without needing
+ * to reallocate memory.
+ *
+ * For the best efficiency @c set_capacity() should be called once before
+ * @c append_data() is called to set up the snapshot with the expected number
+ * of samples that will be appended in total.
+ *
+ * @note The capacity will automatically be increased when @c append_data()
+ * is called if there is not enough capacity in the buffer to store the samples.
+ *
+ * @param[in] new_capacity The new capacity of the snapshot. If this value is
+ * smaller or equal than the current capacity then the method has no effect.
+ */
+ void set_capacity(uint64_t new_capacity);
+
+ /**
+ * @brief Get the current capacity of the snapshot.
+ *
+ * The capacity can be increased by calling @c set_capacity().
+ *
+ * @return The current capacity of the snapshot.
+ */
+ uint64_t capacity() const;
+
+protected:
+ void append_data(void *data, uint64_t samples);
+
+protected:
+ mutable std::recursive_mutex mutex_;
+ std::vector<uint8_t> data_;
+ uint64_t sample_count_;
+ uint64_t capacity_;
+ unsigned int unit_size_;
+};
+
+} // namespace data
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DATA_SNAPSHOT_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "devicemanager.h"
-#include "sigsession.h"
+#include "devicemanager.hpp"
+#include "sigsession.hpp"
#include <cassert>
#include <stdexcept>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DEVICEMANAGER_H
-#define PULSEVIEW_PV_DEVICEMANAGER_H
-
-#include <list>
-#include <map>
-#include <memory>
-#include <string>
-
-namespace Glib {
- class VariantBase;
-}
-
-namespace sigrok {
- class ConfigKey;
- class Context;
- class Driver;
- class Device;
- class HardwareDevice;
-}
-
-namespace pv {
-
-class SigSession;
-
-class DeviceManager
-{
-public:
- DeviceManager(std::shared_ptr<sigrok::Context> context);
-
- ~DeviceManager();
-
- std::shared_ptr<sigrok::Context> context();
-
- const std::list< std::shared_ptr<sigrok::HardwareDevice> >&
- devices() const;
-
- std::list< std::shared_ptr<sigrok::HardwareDevice> > driver_scan(
- std::shared_ptr<sigrok::Driver> driver,
- std::map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
-
- const std::map<std::string, std::string> get_device_info(
- const std::shared_ptr<sigrok::Device> device);
-
- const std::shared_ptr<sigrok::HardwareDevice> find_device_from_info(
- const std::map<std::string, std::string> search_info);
-
- const std::string build_display_name(std::shared_ptr<sigrok::Device> device);
-
- const std::string get_display_name(std::shared_ptr<sigrok::Device> dev);
-
- void update_display_name(std::shared_ptr<sigrok::Device> dev);
-
-private:
- bool compare_devices(std::shared_ptr<sigrok::Device> a,
- std::shared_ptr<sigrok::Device> b);
-
-protected:
- std::shared_ptr<sigrok::Context> context_;
- std::list< std::shared_ptr<sigrok::HardwareDevice> > devices_;
- std::map< std::shared_ptr<sigrok::Device>, std::string > display_names_;
-};
-
-} // namespace pv
-
-#endif // PULSEVIEW_PV_DEVICEMANAGER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DEVICEMANAGER_H
+#define PULSEVIEW_PV_DEVICEMANAGER_H
+
+#include <list>
+#include <map>
+#include <memory>
+#include <string>
+
+namespace Glib {
+ class VariantBase;
+}
+
+namespace sigrok {
+ class ConfigKey;
+ class Context;
+ class Driver;
+ class Device;
+ class HardwareDevice;
+}
+
+namespace pv {
+
+class SigSession;
+
+class DeviceManager
+{
+public:
+ DeviceManager(std::shared_ptr<sigrok::Context> context);
+
+ ~DeviceManager();
+
+ std::shared_ptr<sigrok::Context> context();
+
+ const std::list< std::shared_ptr<sigrok::HardwareDevice> >&
+ devices() const;
+
+ std::list< std::shared_ptr<sigrok::HardwareDevice> > driver_scan(
+ std::shared_ptr<sigrok::Driver> driver,
+ std::map<const sigrok::ConfigKey *, Glib::VariantBase> drvopts);
+
+ const std::map<std::string, std::string> get_device_info(
+ const std::shared_ptr<sigrok::Device> device);
+
+ const std::shared_ptr<sigrok::HardwareDevice> find_device_from_info(
+ const std::map<std::string, std::string> search_info);
+
+ const std::string build_display_name(std::shared_ptr<sigrok::Device> device);
+
+ const std::string get_display_name(std::shared_ptr<sigrok::Device> dev);
+
+ void update_display_name(std::shared_ptr<sigrok::Device> dev);
+
+private:
+ bool compare_devices(std::shared_ptr<sigrok::Device> a,
+ std::shared_ptr<sigrok::Device> b);
+
+protected:
+ std::shared_ptr<sigrok::Context> context_;
+ std::list< std::shared_ptr<sigrok::HardwareDevice> > devices_;
+ std::map< std::shared_ptr<sigrok::Device>, std::string > display_names_;
+};
+
+} // namespace pv
+
+#endif // PULSEVIEW_PV_DEVICEMANAGER_H
#include <QTextDocument>
-#include "about.h"
+#include "about.hpp"
#include <ui_about.h>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_ABOUT_H
-#define PULSEVIEW_PV_ABOUT_H
-
-#include <QDialog>
-
-#include <memory>
-
-class QTextDocument;
-
-namespace sigrok {
- class Context;
-}
-
-namespace Ui {
-class About;
-}
-
-namespace pv {
-namespace dialogs {
-
-class About : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit About(std::shared_ptr<sigrok::Context> context, QWidget *parent = 0);
- ~About();
-
-private:
- Ui::About *ui;
- std::auto_ptr<QTextDocument> supportedDoc;
-};
-
-} // namespace dialogs
-} // namespace pv
-
-#endif // PULSEVIEW_PV_ABOUT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_ABOUT_H
+#define PULSEVIEW_PV_ABOUT_H
+
+#include <QDialog>
+
+#include <memory>
+
+class QTextDocument;
+
+namespace sigrok {
+ class Context;
+}
+
+namespace Ui {
+class About;
+}
+
+namespace pv {
+namespace dialogs {
+
+class About : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit About(std::shared_ptr<sigrok::Context> context, QWidget *parent = 0);
+ ~About();
+
+private:
+ Ui::About *ui;
+ std::auto_ptr<QTextDocument> supportedDoc;
+};
+
+} // namespace dialogs
+} // namespace pv
+
+#endif // PULSEVIEW_PV_ABOUT_H
#include <libsigrok/libsigrok.hpp>
-#include "connect.h"
+#include "connect.hpp"
-#include "pv/devicemanager.h"
+#include "pv/devicemanager.hpp"
using std::list;
using std::map;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012-2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_CONNECT_H
-#define PULSEVIEW_PV_CONNECT_H
-
-#include <memory>
-
-#include <QComboBox>
-#include <QDialog>
-#include <QDialogButtonBox>
-#include <QFormLayout>
-#include <QLineEdit>
-#include <QListWidget>
-#include <QPushButton>
-#include <QVBoxLayout>
-
-namespace sigrok {
- class Driver;
- class HardwareDevice;
-}
-
-Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>);
-Q_DECLARE_METATYPE(std::shared_ptr<sigrok::HardwareDevice>);
-
-namespace pv {
-
-class DeviceManager;
-
-namespace dialogs {
-
-class Connect : public QDialog
-{
- Q_OBJECT
-
-public:
- Connect(QWidget *parent, pv::DeviceManager &device_manager);
-
- std::shared_ptr<sigrok::HardwareDevice> get_selected_device() const;
-
-private:
- void populate_drivers();
-
- void unset_connection();
-
- void set_serial_connection();
-
-private Q_SLOTS:
- void device_selected(int index);
-
- void scan_pressed();
-
-private:
- pv::DeviceManager &device_manager_;
-
- QVBoxLayout layout_;
-
- QWidget form_;
- QFormLayout form_layout_;
-
- QComboBox drivers_;
-
- QLineEdit serial_device_;
-
- QPushButton scan_button_;
- QListWidget device_list_;
-
- QDialogButtonBox button_box_;
-};
-
-} // namespace dialogs
-} // namespace pv
-
-#endif // PULSEVIEW_PV_CONNECT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012-2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_CONNECT_H
+#define PULSEVIEW_PV_CONNECT_H
+
+#include <memory>
+
+#include <QComboBox>
+#include <QDialog>
+#include <QDialogButtonBox>
+#include <QFormLayout>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QPushButton>
+#include <QVBoxLayout>
+
+namespace sigrok {
+ class Driver;
+ class HardwareDevice;
+}
+
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>);
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::HardwareDevice>);
+
+namespace pv {
+
+class DeviceManager;
+
+namespace dialogs {
+
+class Connect : public QDialog
+{
+ Q_OBJECT
+
+public:
+ Connect(QWidget *parent, pv::DeviceManager &device_manager);
+
+ std::shared_ptr<sigrok::HardwareDevice> get_selected_device() const;
+
+private:
+ void populate_drivers();
+
+ void unset_connection();
+
+ void set_serial_connection();
+
+private Q_SLOTS:
+ void device_selected(int index);
+
+ void scan_pressed();
+
+private:
+ pv::DeviceManager &device_manager_;
+
+ QVBoxLayout layout_;
+
+ QWidget form_;
+ QFormLayout form_layout_;
+
+ QComboBox drivers_;
+
+ QLineEdit serial_device_;
+
+ QPushButton scan_button_;
+ QListWidget device_list_;
+
+ QDialogButtonBox button_box_;
+};
+
+} // namespace dialogs
+} // namespace pv
+
+#endif // PULSEVIEW_PV_CONNECT_H
#include <QMessageBox>
-#include "storeprogress.h"
+#include "storeprogress.hpp"
namespace pv {
namespace dialogs {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
-#define PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
-
-#include <memory>
-#include <set>
-
-#include <QProgressDialog>
-
-#include <pv/storesession.h>
-
-namespace pv {
-
-class SigSession;
-
-namespace dialogs {
-
-class StoreProgress : public QProgressDialog
-{
- Q_OBJECT
-
-public:
- StoreProgress(const QString &file_name, const SigSession &session,
- QWidget *parent = 0);
-
- virtual ~StoreProgress();
-
- void run();
-
-private:
- void show_error();
-
- void closeEvent(QCloseEvent*);
-
-private Q_SLOTS:
- void on_progress_updated();
-
-private:
- pv::StoreSession session_;
-};
-
-} // dialogs
-} // pv
-
-#endif // PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
+#define PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
+
+#include <memory>
+#include <set>
+
+#include <QProgressDialog>
+
+#include <pv/storesession.hpp>
+
+namespace pv {
+
+class SigSession;
+
+namespace dialogs {
+
+class StoreProgress : public QProgressDialog
+{
+ Q_OBJECT
+
+public:
+ StoreProgress(const QString &file_name, const SigSession &session,
+ QWidget *parent = 0);
+
+ virtual ~StoreProgress();
+
+ void run();
+
+private:
+ void show_error();
+
+ void closeEvent(QCloseEvent*);
+
+private Q_SLOTS:
+ void on_progress_updated();
+
+private:
+ pv::StoreSession session_;
+};
+
+} // dialogs
+} // pv
+
+#endif // PULSEVIEW_PV_DIALOGS_SAVEPROGRESS_H
#include <QVBoxLayout>
#include <QWidget>
-#include "mainwindow.h"
-
-#include "devicemanager.h"
-#include "dialogs/about.h"
-#include "dialogs/connect.h"
-#include "dialogs/storeprogress.h"
-#include "toolbars/samplingbar.h"
-#include "view/logicsignal.h"
-#include "view/view.h"
+#include "mainwindow.hpp"
+
+#include "devicemanager.hpp"
+#include "dialogs/about.hpp"
+#include "dialogs/connect.hpp"
+#include "dialogs/storeprogress.hpp"
+#include "toolbars/samplingbar.hpp"
+#include "view/logicsignal.hpp"
+#include "view/view.hpp"
#ifdef ENABLE_DECODE
-#include "widgets/decodermenu.h"
+#include "widgets/decodermenu.hpp"
#endif
#include <inttypes.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_MAINWINDOW_H
-#define PULSEVIEW_PV_MAINWINDOW_H
-
-#include <list>
-#include <memory>
-
-#include <QMainWindow>
-
-#include "sigsession.h"
-
-struct srd_decoder;
-
-class QVBoxLayout;
-
-namespace pv {
-
-class DeviceManager;
-
-namespace toolbars {
-class ContextBar;
-class SamplingBar;
-}
-
-namespace view {
-class View;
-}
-
-namespace widgets {
-class DecoderMenu;
-}
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- explicit MainWindow(DeviceManager &device_manager,
- const char *open_file_name = NULL,
- QWidget *parent = 0);
-
-private:
- void setup_ui();
-
- void save_ui_settings();
-
- void restore_ui_settings();
-
- void session_error(const QString text, const QString info_text);
-
- /**
- * Updates the device list in the sampling bar
- */
- void update_device_list();
-
- void closeEvent(QCloseEvent *event);
-
-private Q_SLOTS:
- void load_file(QString file_name);
-
- void show_session_error(
- const QString text, const QString info_text);
-
- void on_actionOpen_triggered();
- void on_actionSaveAs_triggered();
- void on_actionQuit_triggered();
-
- void on_actionConnect_triggered();
-
- void on_actionViewZoomIn_triggered();
-
- void on_actionViewZoomOut_triggered();
-
- void on_actionViewZoomFit_triggered();
-
- void on_actionViewZoomOneToOne_triggered();
-
- void on_actionViewShowCursors_triggered();
-
- void on_actionAbout_triggered();
-
- void add_decoder(srd_decoder *decoder);
-
- void run_stop();
-
- void capture_state_changed(int state);
-
-private:
- /**
- * Name of the setting used to remember the directory
- * containing the last file that was opened.
- */
- static const char *SettingOpenDirectory;
-
- /**
- * Name of the setting used to remember the directory
- * containing the last file that was saved.
- */
- static const char *SettingSaveDirectory;
-
- DeviceManager &device_manager_;
-
- SigSession session_;
-
- pv::view::View *view_;
-
- QWidget *central_widget_;
- QVBoxLayout *vertical_layout_;
-
- toolbars::SamplingBar *sampling_bar_;
-};
-
-} // namespace pv
-
-#endif // PULSEVIEW_PV_MAINWINDOW_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_MAINWINDOW_H
+#define PULSEVIEW_PV_MAINWINDOW_H
+
+#include <list>
+#include <memory>
+
+#include <QMainWindow>
+
+#include "sigsession.hpp"
+
+struct srd_decoder;
+
+class QVBoxLayout;
+
+namespace pv {
+
+class DeviceManager;
+
+namespace toolbars {
+class ContextBar;
+class SamplingBar;
+}
+
+namespace view {
+class View;
+}
+
+namespace widgets {
+class DecoderMenu;
+}
+
+class MainWindow : public QMainWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(DeviceManager &device_manager,
+ const char *open_file_name = NULL,
+ QWidget *parent = 0);
+
+private:
+ void setup_ui();
+
+ void save_ui_settings();
+
+ void restore_ui_settings();
+
+ void session_error(const QString text, const QString info_text);
+
+ /**
+ * Updates the device list in the sampling bar
+ */
+ void update_device_list();
+
+ void closeEvent(QCloseEvent *event);
+
+private Q_SLOTS:
+ void load_file(QString file_name);
+
+ void show_session_error(
+ const QString text, const QString info_text);
+
+ void on_actionOpen_triggered();
+ void on_actionSaveAs_triggered();
+ void on_actionQuit_triggered();
+
+ void on_actionConnect_triggered();
+
+ void on_actionViewZoomIn_triggered();
+
+ void on_actionViewZoomOut_triggered();
+
+ void on_actionViewZoomFit_triggered();
+
+ void on_actionViewZoomOneToOne_triggered();
+
+ void on_actionViewShowCursors_triggered();
+
+ void on_actionAbout_triggered();
+
+ void add_decoder(srd_decoder *decoder);
+
+ void run_stop();
+
+ void capture_state_changed(int state);
+
+private:
+ /**
+ * Name of the setting used to remember the directory
+ * containing the last file that was opened.
+ */
+ static const char *SettingOpenDirectory;
+
+ /**
+ * Name of the setting used to remember the directory
+ * containing the last file that was saved.
+ */
+ static const char *SettingSaveDirectory;
+
+ DeviceManager &device_manager_;
+
+ SigSession session_;
+
+ pv::view::View *view_;
+
+ QWidget *central_widget_;
+ QVBoxLayout *vertical_layout_;
+
+ toolbars::SamplingBar *sampling_bar_;
+};
+
+} // namespace pv
+
+#endif // PULSEVIEW_PV_MAINWINDOW_H
#include <QGridLayout>
#include <QLabel>
-#include "channels.h"
+#include "channels.hpp"
-#include <pv/prop/binding/deviceoptions.h>
-#include <pv/sigsession.h>
-#include <pv/view/signal.h>
+#include <pv/prop/binding/deviceoptions.hpp>
+#include <pv/sigsession.hpp>
+#include <pv/view/signal.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_POPUPS_CHANNELS_H
-#define PULSEVIEW_PV_POPUPS_CHANNELS_H
-
-#include <map>
-#include <memory>
-#include <vector>
-
-#include <QFormLayout>
-#include <QHBoxLayout>
-#include <QPushButton>
-#include <QSignalMapper>
-
-#include <pv/widgets/popup.h>
-
-class QCheckBox;
-class QGridLayout;
-
-namespace sigrok {
- class ChannelGroup;
-}
-
-namespace pv {
-
-class SigSession;
-
-namespace prop {
-namespace binding {
-class DeviceOptions;
-}
-}
-
-namespace view {
-class Signal;
-}
-
-namespace popups {
-
-class Channels : public pv::widgets::Popup
-{
- Q_OBJECT
-
-public:
- Channels(SigSession &session_, QWidget *parent);
-
-private:
- void set_all_channels(bool set);
-
- void populate_group(std::shared_ptr<sigrok::ChannelGroup> group,
- const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
-
- QGridLayout* create_channel_group_grid(
- const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
-
-private:
- void showEvent(QShowEvent *e);
-
-private Q_SLOTS:
- void on_channel_checked(QWidget *widget);
-
- void enable_all_channels();
- void disable_all_channels();
-
-private:
- pv::SigSession &session_;
-
- QFormLayout layout_;
-
- bool updating_channels_;
-
- std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> >
- group_bindings_;
- std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
- check_box_signal_map_;
-
- QHBoxLayout buttons_bar_;
- QPushButton enable_all_channels_;
- QPushButton disable_all_channels_;
-
- QSignalMapper check_box_mapper_;
-};
-
-} // popups
-} // pv
-
-#endif // PULSEVIEW_PV_POPUPS_CHANNELS_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_POPUPS_CHANNELS_H
+#define PULSEVIEW_PV_POPUPS_CHANNELS_H
+
+#include <map>
+#include <memory>
+#include <vector>
+
+#include <QFormLayout>
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QSignalMapper>
+
+#include <pv/widgets/popup.hpp>
+
+class QCheckBox;
+class QGridLayout;
+
+namespace sigrok {
+ class ChannelGroup;
+}
+
+namespace pv {
+
+class SigSession;
+
+namespace prop {
+namespace binding {
+class DeviceOptions;
+}
+}
+
+namespace view {
+class Signal;
+}
+
+namespace popups {
+
+class Channels : public pv::widgets::Popup
+{
+ Q_OBJECT
+
+public:
+ Channels(SigSession &session_, QWidget *parent);
+
+private:
+ void set_all_channels(bool set);
+
+ void populate_group(std::shared_ptr<sigrok::ChannelGroup> group,
+ const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
+
+ QGridLayout* create_channel_group_grid(
+ const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
+
+private:
+ void showEvent(QShowEvent *e);
+
+private Q_SLOTS:
+ void on_channel_checked(QWidget *widget);
+
+ void enable_all_channels();
+ void disable_all_channels();
+
+private:
+ pv::SigSession &session_;
+
+ QFormLayout layout_;
+
+ bool updating_channels_;
+
+ std::vector< std::shared_ptr<pv::prop::binding::DeviceOptions> >
+ group_bindings_;
+ std::map< QCheckBox*, std::shared_ptr<pv::view::Signal> >
+ check_box_signal_map_;
+
+ QHBoxLayout buttons_bar_;
+ QPushButton enable_all_channels_;
+ QPushButton disable_all_channels_;
+
+ QSignalMapper check_box_mapper_;
+};
+
+} // popups
+} // pv
+
+#endif // PULSEVIEW_PV_POPUPS_CHANNELS_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "deviceoptions.h"
+#include "deviceoptions.hpp"
#include <QFormLayout>
#include <QListWidget>
-#include <pv/prop/property.h>
+#include <pv/prop/property.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
-#define PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
-
-#include <QGroupBox>
-#include <QVBoxLayout>
-
-#include <pv/prop/binding/deviceoptions.h>
-#include <pv/widgets/popup.h>
-
-namespace sigrok {
- class Device;
-}
-
-namespace pv {
-namespace popups {
-
-class DeviceOptions : public pv::widgets::Popup
-{
- Q_OBJECT
-
-public:
- DeviceOptions(std::shared_ptr<sigrok::Device> device,
- QWidget *parent);
-
- pv::prop::binding::DeviceOptions& binding();
-
-private:
- std::shared_ptr<sigrok::Device> device_;
-
- QVBoxLayout layout_;
-
- pv::prop::binding::DeviceOptions binding_;
-};
-
-} // namespace popups
-} // namespace pv
-
-#endif // PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
+#define PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
+
+#include <QGroupBox>
+#include <QVBoxLayout>
+
+#include <pv/prop/binding/deviceoptions.hpp>
+#include <pv/widgets/popup.hpp>
+
+namespace sigrok {
+ class Device;
+}
+
+namespace pv {
+namespace popups {
+
+class DeviceOptions : public pv::widgets::Popup
+{
+ Q_OBJECT
+
+public:
+ DeviceOptions(std::shared_ptr<sigrok::Device> device,
+ QWidget *parent);
+
+ pv::prop::binding::DeviceOptions& binding();
+
+private:
+ std::shared_ptr<sigrok::Device> device_;
+
+ QVBoxLayout layout_;
+
+ pv::prop::binding::DeviceOptions binding_;
+};
+
+} // namespace popups
+} // namespace pv
+
+#endif // PULSEVIEW_PV_POPUPS_DEVICEOPTIONS_H
#include <QFormLayout>
-#include <pv/prop/property.h>
+#include <pv/prop/property.hpp>
-#include "binding.h"
+#include "binding.hpp"
using std::shared_ptr;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_BINDING_BINDING_H
-#define PULSEVIEW_PV_PROP_BINDING_BINDING_H
-
-#include <glibmm-2.4/glibmm.h>
-
-#include <vector>
-#include <memory>
-
-#include <QString>
-
-class QFormLayout;
-class QWidget;
-
-namespace pv {
-namespace prop {
-
-class Property;
-
-namespace binding {
-
-class Binding
-{
-public:
- const std::vector< std::shared_ptr<Property> >& properties();
-
- void commit();
-
- void add_properties_to_form(QFormLayout *layout,
- bool auto_commit = false) const;
-
- QWidget* get_property_form(QWidget *parent,
- bool auto_commit = false) const;
-
- static QString print_gvariant(Glib::VariantBase gvar);
-
-protected:
- std::vector< std::shared_ptr<Property> > properties_;
-};
-
-} // binding
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_BINDING_BINDING_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_BINDING_BINDING_H
+#define PULSEVIEW_PV_PROP_BINDING_BINDING_H
+
+#include <glibmm-2.4/glibmm.h>
+
+#include <vector>
+#include <memory>
+
+#include <QString>
+
+class QFormLayout;
+class QWidget;
+
+namespace pv {
+namespace prop {
+
+class Property;
+
+namespace binding {
+
+class Binding
+{
+public:
+ const std::vector< std::shared_ptr<Property> >& properties();
+
+ void commit();
+
+ void add_properties_to_form(QFormLayout *layout,
+ bool auto_commit = false) const;
+
+ QWidget* get_property_form(QWidget *parent,
+ bool auto_commit = false) const;
+
+ static QString print_gvariant(Glib::VariantBase gvar);
+
+protected:
+ std::vector< std::shared_ptr<Property> > properties_;
+};
+
+} // binding
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_BINDING_BINDING_H
#include <libsigrokdecode/libsigrokdecode.h>
-#include "decoderoptions.h"
+#include "decoderoptions.hpp"
#include <boost/none_t.hpp>
-#include <pv/data/decoderstack.h>
-#include <pv/data/decode/decoder.h>
-#include <pv/prop/double.h>
-#include <pv/prop/enum.h>
-#include <pv/prop/int.h>
-#include <pv/prop/string.h>
+#include <pv/data/decoderstack.hpp>
+#include <pv/data/decode/decoder.hpp>
+#include <pv/prop/double.hpp>
+#include <pv/prop/enum.hpp>
+#include <pv/prop/int.hpp>
+#include <pv/prop/string.hpp>
using boost::none;
using std::make_pair;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
-#define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
-
-#include "binding.h"
-
-#include <pv/prop/property.h>
-
-struct srd_decoder_option;
-
-namespace pv {
-
-namespace data {
-class DecoderStack;
-namespace decode {
-class Decoder;
-}
-}
-
-namespace prop {
-namespace binding {
-
-class DecoderOptions : public Binding
-{
-public:
- DecoderOptions(std::shared_ptr<pv::data::DecoderStack> decoder_stack,
- std::shared_ptr<pv::data::decode::Decoder> decoder);
-
-private:
- static std::shared_ptr<Property> bind_enum(const QString &name,
- const srd_decoder_option *option,
- Property::Getter getter, Property::Setter setter);
-
- Glib::VariantBase getter(const char *id);
-
- void setter(const char *id, Glib::VariantBase value);
-
-private:
- std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
- std::shared_ptr<pv::data::decode::Decoder> decoder_;
-};
-
-} // binding
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
+#define PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
+
+#include "binding.hpp"
+
+#include <pv/prop/property.hpp>
+
+struct srd_decoder_option;
+
+namespace pv {
+
+namespace data {
+class DecoderStack;
+namespace decode {
+class Decoder;
+}
+}
+
+namespace prop {
+namespace binding {
+
+class DecoderOptions : public Binding
+{
+public:
+ DecoderOptions(std::shared_ptr<pv::data::DecoderStack> decoder_stack,
+ std::shared_ptr<pv::data::decode::Decoder> decoder);
+
+private:
+ static std::shared_ptr<Property> bind_enum(const QString &name,
+ const srd_decoder_option *option,
+ Property::Getter getter, Property::Setter setter);
+
+ Glib::VariantBase getter(const char *id);
+
+ void setter(const char *id, Glib::VariantBase value);
+
+private:
+ std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
+ std::shared_ptr<pv::data::decode::Decoder> decoder_;
+};
+
+} // binding
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_BINDING_DECODEROPTIONS_H
#include <QDebug>
-#include "deviceoptions.h"
+#include "deviceoptions.hpp"
-#include <pv/prop/bool.h>
-#include <pv/prop/double.h>
-#include <pv/prop/enum.h>
-#include <pv/prop/int.h>
+#include <pv/prop/bool.hpp>
+#include <pv/prop/double.hpp>
+#include <pv/prop/enum.hpp>
+#include <pv/prop/int.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
-#define PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
-
-#include <boost/optional.hpp>
-
-#include <QObject>
-#include <QString>
-
-#include "binding.h"
-
-#include <pv/prop/property.h>
-
-namespace sigrok {
- class Configurable;
-}
-
-namespace pv {
-
-namespace prop {
-namespace binding {
-
-class DeviceOptions : public QObject, public Binding
-{
- Q_OBJECT
-
-public:
- DeviceOptions(std::shared_ptr<sigrok::Configurable> configurable);
-
-Q_SIGNALS:
- void config_changed();
-
-private:
- void bind_bool(const QString &name,
- Property::Getter getter, Property::Setter setter);
- void bind_enum(const QString &name, Glib::VariantContainerBase gvar_list,
- Property::Getter getter, Property::Setter setter,
- std::function<QString (Glib::VariantBase)> printer = print_gvariant);
- void bind_int(const QString &name, QString suffix,
- boost::optional< std::pair<int64_t, int64_t> > range,
- Property::Getter getter, Property::Setter setter);
-
- static QString print_timebase(Glib::VariantBase gvar);
- static QString print_vdiv(Glib::VariantBase gvar);
- static QString print_voltage_threshold(Glib::VariantBase gvar);
-
-protected:
- std::shared_ptr<sigrok::Configurable> configurable_;
-};
-
-} // binding
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
+#define PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
+
+#include <boost/optional.hpp>
+
+#include <QObject>
+#include <QString>
+
+#include "binding.hpp"
+
+#include <pv/prop/property.hpp>
+
+namespace sigrok {
+ class Configurable;
+}
+
+namespace pv {
+
+namespace prop {
+namespace binding {
+
+class DeviceOptions : public QObject, public Binding
+{
+ Q_OBJECT
+
+public:
+ DeviceOptions(std::shared_ptr<sigrok::Configurable> configurable);
+
+Q_SIGNALS:
+ void config_changed();
+
+private:
+ void bind_bool(const QString &name,
+ Property::Getter getter, Property::Setter setter);
+ void bind_enum(const QString &name, Glib::VariantContainerBase gvar_list,
+ Property::Getter getter, Property::Setter setter,
+ std::function<QString (Glib::VariantBase)> printer = print_gvariant);
+ void bind_int(const QString &name, QString suffix,
+ boost::optional< std::pair<int64_t, int64_t> > range,
+ Property::Getter getter, Property::Setter setter);
+
+ static QString print_timebase(Glib::VariantBase gvar);
+ static QString print_vdiv(Glib::VariantBase gvar);
+ static QString print_voltage_threshold(Glib::VariantBase gvar);
+
+protected:
+ std::shared_ptr<sigrok::Configurable> configurable_;
+};
+
+} // binding
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_BINDING_DEVICEOPTIONS_H
#include <QCheckBox>
-#include "bool.h"
+#include "bool.hpp"
namespace pv {
namespace prop {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_BOOL_H
-#define PULSEVIEW_PV_PROP_BOOL_H
-
-#include "property.h"
-
-class QCheckBox;
-
-namespace pv {
-namespace prop {
-
-class Bool : public Property
-{
- Q_OBJECT;
-
-public:
- Bool(QString name, Getter getter, Setter setter);
-
- virtual ~Bool();
-
- QWidget* get_widget(QWidget *parent, bool auto_commit);
- bool labeled_widget() const;
-
- void commit();
-
-private Q_SLOTS:
- void on_state_changed(int);
-
-private:
- QCheckBox *check_box_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_BOOL_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_BOOL_H
+#define PULSEVIEW_PV_PROP_BOOL_H
+
+#include "property.hpp"
+
+class QCheckBox;
+
+namespace pv {
+namespace prop {
+
+class Bool : public Property
+{
+ Q_OBJECT;
+
+public:
+ Bool(QString name, Getter getter, Setter setter);
+
+ virtual ~Bool();
+
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
+ bool labeled_widget() const;
+
+ void commit();
+
+private Q_SLOTS:
+ void on_state_changed(int);
+
+private:
+ QCheckBox *check_box_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_BOOL_H
#include <QDoubleSpinBox>
-#include "double.h"
+#include "double.hpp"
using boost::optional;
using std::pair;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_DOUBLE_H
-#define PULSEVIEW_PV_PROP_DOUBLE_H
-
-#include <utility>
-
-#include <boost/optional.hpp>
-
-#include "property.h"
-
-class QDoubleSpinBox;
-
-namespace pv {
-namespace prop {
-
-class Double : public Property
-{
- Q_OBJECT
-
-public:
- Double(QString name, int decimals, QString suffix,
- boost::optional< std::pair<double, double> > range,
- boost::optional<double> step,
- Getter getter,
- Setter setter);
-
- virtual ~Double();
-
- QWidget* get_widget(QWidget *parent, bool auto_commit);
-
- void commit();
-
-private Q_SLOTS:
- void on_value_changed(double);
-
-private:
- const int decimals_;
- const QString suffix_;
- const boost::optional< std::pair<double, double> > range_;
- const boost::optional<double> step_;
-
- QDoubleSpinBox *spin_box_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_DOUBLE_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_DOUBLE_H
+#define PULSEVIEW_PV_PROP_DOUBLE_H
+
+#include <utility>
+
+#include <boost/optional.hpp>
+
+#include "property.hpp"
+
+class QDoubleSpinBox;
+
+namespace pv {
+namespace prop {
+
+class Double : public Property
+{
+ Q_OBJECT
+
+public:
+ Double(QString name, int decimals, QString suffix,
+ boost::optional< std::pair<double, double> > range,
+ boost::optional<double> step,
+ Getter getter,
+ Setter setter);
+
+ virtual ~Double();
+
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
+
+ void commit();
+
+private Q_SLOTS:
+ void on_value_changed(double);
+
+private:
+ const int decimals_;
+ const QString suffix_;
+ const boost::optional< std::pair<double, double> > range_;
+ const boost::optional<double> step_;
+
+ QDoubleSpinBox *spin_box_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_DOUBLE_H
#include <QComboBox>
-#include "enum.h"
+#include "enum.hpp"
using std::pair;
using std::vector;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_ENUM_H
-#define PULSEVIEW_PV_PROP_ENUM_H
-
-#include <utility>
-#include <vector>
-
-#include "property.h"
-
-#include <QMetaType>
-
-Q_DECLARE_METATYPE(Glib::VariantBase);
-
-class QComboBox;
-
-namespace pv {
-namespace prop {
-
-class Enum : public Property
-{
- Q_OBJECT;
-
-public:
- Enum(QString name, std::vector<std::pair<Glib::VariantBase, QString> > values,
- Getter getter, Setter setter);
-
- virtual ~Enum();
-
- QWidget* get_widget(QWidget *parent, bool auto_commit);
-
- void commit();
-
-private Q_SLOTS:
- void on_current_item_changed(int);
-
-private:
- const std::vector< std::pair<Glib::VariantBase, QString> > values_;
-
- QComboBox *selector_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_ENUM_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_ENUM_H
+#define PULSEVIEW_PV_PROP_ENUM_H
+
+#include <utility>
+#include <vector>
+
+#include "property.hpp"
+
+#include <QMetaType>
+
+Q_DECLARE_METATYPE(Glib::VariantBase);
+
+class QComboBox;
+
+namespace pv {
+namespace prop {
+
+class Enum : public Property
+{
+ Q_OBJECT;
+
+public:
+ Enum(QString name, std::vector<std::pair<Glib::VariantBase, QString> > values,
+ Getter getter, Setter setter);
+
+ virtual ~Enum();
+
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
+
+ void commit();
+
+private Q_SLOTS:
+ void on_current_item_changed(int);
+
+private:
+ const std::vector< std::pair<Glib::VariantBase, QString> > values_;
+
+ QComboBox *selector_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_ENUM_H
#include <QSpinBox>
-#include "int.h"
+#include "int.hpp"
using boost::optional;
using std::max;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_INT_H
-#define PULSEVIEW_PV_PROP_INT_H
-
-#include <utility>
-
-#include <boost/optional.hpp>
-
-#include "property.h"
-
-class QSpinBox;
-
-namespace pv {
-namespace prop {
-
-class Int : public Property
-{
- Q_OBJECT;
-
-public:
- Int(QString name, QString suffix,
- boost::optional< std::pair<int64_t, int64_t> > range,
- Getter getter, Setter setter);
-
- virtual ~Int();
-
- QWidget* get_widget(QWidget *parent, bool auto_commit);
-
- void commit();
-
-private Q_SLOTS:
- void on_value_changed(int);
-
-private:
- const QString suffix_;
- const boost::optional< std::pair<int64_t, int64_t> > range_;
-
- Glib::VariantBase value_;
- QSpinBox *spin_box_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_INT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_INT_H
+#define PULSEVIEW_PV_PROP_INT_H
+
+#include <utility>
+
+#include <boost/optional.hpp>
+
+#include "property.hpp"
+
+class QSpinBox;
+
+namespace pv {
+namespace prop {
+
+class Int : public Property
+{
+ Q_OBJECT;
+
+public:
+ Int(QString name, QString suffix,
+ boost::optional< std::pair<int64_t, int64_t> > range,
+ Getter getter, Setter setter);
+
+ virtual ~Int();
+
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
+
+ void commit();
+
+private Q_SLOTS:
+ void on_value_changed(int);
+
+private:
+ const QString suffix_;
+ const boost::optional< std::pair<int64_t, int64_t> > range_;
+
+ Glib::VariantBase value_;
+ QSpinBox *spin_box_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_INT_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "property.h"
+#include "property.hpp"
namespace pv {
namespace prop {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_PROPERTY_H
-#define PULSEVIEW_PV_PROP_PROPERTY_H
-
-#include <glibmm-2.4/glibmm.h>
-
-#include <functional>
-#include <QString>
-#include <QWidget>
-
-class QWidget;
-
-namespace pv {
-namespace prop {
-
-class Property : public QObject
-{
- Q_OBJECT;
-
-public:
- typedef std::function<Glib::VariantBase ()> Getter;
- typedef std::function<void (Glib::VariantBase)> Setter;
-
-protected:
- Property(QString name, Getter getter, Setter setter);
-
-public:
- const QString& name() const;
-
- virtual QWidget* get_widget(QWidget *parent,
- bool auto_commit = false) = 0;
- virtual bool labeled_widget() const;
-
- virtual void commit() = 0;
-
-protected:
- const Getter getter_;
- const Setter setter_;
-
-private:
- QString name_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_PROPERTY_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_PROPERTY_H
+#define PULSEVIEW_PV_PROP_PROPERTY_H
+
+#include <glibmm-2.4/glibmm.h>
+
+#include <functional>
+#include <QString>
+#include <QWidget>
+
+class QWidget;
+
+namespace pv {
+namespace prop {
+
+class Property : public QObject
+{
+ Q_OBJECT;
+
+public:
+ typedef std::function<Glib::VariantBase ()> Getter;
+ typedef std::function<void (Glib::VariantBase)> Setter;
+
+protected:
+ Property(QString name, Getter getter, Setter setter);
+
+public:
+ const QString& name() const;
+
+ virtual QWidget* get_widget(QWidget *parent,
+ bool auto_commit = false) = 0;
+ virtual bool labeled_widget() const;
+
+ virtual void commit() = 0;
+
+protected:
+ const Getter getter_;
+ const Setter setter_;
+
+private:
+ QString name_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_PROPERTY_H
#include <QLineEdit>
#include <QSpinBox>
-#include "string.h"
+#include "string.hpp"
using std::string;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_PROP_STRING_H
-#define PULSEVIEW_PV_PROP_STRING_H
-
-#include "property.h"
-
-class QLineEdit;
-
-namespace pv {
-namespace prop {
-
-class String : public Property
-{
- Q_OBJECT;
-
-public:
- String(QString name, Getter getter, Setter setter);
-
- QWidget* get_widget(QWidget *parent, bool auto_commit);
-
- void commit();
-
-private Q_SLOTS:
- void on_text_edited(const QString&);
-
-private:
- QLineEdit *line_edit_;
-};
-
-} // prop
-} // pv
-
-#endif // PULSEVIEW_PV_PROP_STRING_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_PROP_STRING_H
+#define PULSEVIEW_PV_PROP_STRING_H
+
+#include "property.hpp"
+
+class QLineEdit;
+
+namespace pv {
+namespace prop {
+
+class String : public Property
+{
+ Q_OBJECT;
+
+public:
+ String(QString name, Getter getter, Setter setter);
+
+ QWidget* get_widget(QWidget *parent, bool auto_commit);
+
+ void commit();
+
+private Q_SLOTS:
+ void on_text_edited(const QString&);
+
+private:
+ QLineEdit *line_edit_;
+};
+
+} // prop
+} // pv
+
+#endif // PULSEVIEW_PV_PROP_STRING_H
#include <libsigrokdecode/libsigrokdecode.h>
#endif
-#include "sigsession.h"
+#include "sigsession.hpp"
-#include "devicemanager.h"
+#include "devicemanager.hpp"
-#include "data/analog.h"
-#include "data/analogsnapshot.h"
-#include "data/decoderstack.h"
-#include "data/logic.h"
-#include "data/logicsnapshot.h"
-#include "data/decode/decoder.h"
+#include "data/analog.hpp"
+#include "data/analogsnapshot.hpp"
+#include "data/decoderstack.hpp"
+#include "data/logic.hpp"
+#include "data/logicsnapshot.hpp"
+#include "data/decode/decoder.hpp"
-#include "view/analogsignal.h"
-#include "view/decodetrace.h"
-#include "view/logicsignal.h"
+#include "view/analogsignal.hpp"
+#include "view/decodetrace.hpp"
+#include "view/logicsignal.hpp"
#include <cassert>
#include <mutex>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012-14 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_SIGSESSION_H
-#define PULSEVIEW_PV_SIGSESSION_H
-
-#include <map>
-#include <memory>
-#include <mutex>
-#include <set>
-#include <string>
-#include <thread>
-#include <vector>
-
-#include <boost/thread.hpp>
-
-#include <QObject>
-#include <QString>
-
-struct srd_decoder;
-struct srd_channel;
-
-namespace sigrok {
- class Analog;
- class Channel;
- class Device;
- class Logic;
- class Meta;
- class Packet;
- class Session;
-}
-
-namespace pv {
-
-class DeviceManager;
-
-namespace data {
-class Analog;
-class AnalogSnapshot;
-class Logic;
-class LogicSnapshot;
-class SignalData;
-}
-
-namespace view {
-class DecodeTrace;
-class LogicSignal;
-class Signal;
-}
-
-class SigSession : public QObject
-{
- Q_OBJECT
-
-public:
- enum capture_state {
- Stopped,
- AwaitingTrigger,
- Running
- };
-
-public:
- SigSession(DeviceManager &device_manager);
-
- ~SigSession();
-
- DeviceManager& device_manager();
-
- const DeviceManager& device_manager() const;
-
- const std::shared_ptr<sigrok::Session>& session() const;
-
- std::shared_ptr<sigrok::Device> device() const;
-
- /**
- * Sets device instance that will be used in the next capture session.
- */
- void set_device(std::shared_ptr<sigrok::Device> device);
-
- void set_file(const std::string &name);
-
- void set_default_device();
-
- capture_state get_capture_state() const;
-
- void start_capture(std::function<void (const QString)> error_handler);
-
- void stop_capture();
-
- std::set< std::shared_ptr<data::SignalData> > get_data() const;
-
- boost::shared_mutex& signals_mutex() const;
-
- const std::vector< std::shared_ptr<view::Signal> >& signals() const;
-
-#ifdef ENABLE_DECODE
- bool add_decoder(srd_decoder *const dec);
-
- std::vector< std::shared_ptr<view::DecodeTrace> >
- get_decode_signals() const;
-
- void remove_decode_signal(view::DecodeTrace *signal);
-#endif
-
-private:
- void set_capture_state(capture_state state);
-
- void update_signals(std::shared_ptr<sigrok::Device> device);
-
- std::shared_ptr<view::Signal> signal_from_channel(
- std::shared_ptr<sigrok::Channel> channel) const;
-
- void read_sample_rate(std::shared_ptr<sigrok::Device>);
-
-private:
- void sample_thread_proc(std::shared_ptr<sigrok::Device> device,
- std::function<void (const QString)> error_handler);
-
- void feed_in_header(std::shared_ptr<sigrok::Device> device);
-
- void feed_in_meta(std::shared_ptr<sigrok::Device> device,
- std::shared_ptr<sigrok::Meta> meta);
-
- void feed_in_frame_begin();
-
- void feed_in_logic(std::shared_ptr<sigrok::Logic> logic);
-
- void feed_in_analog(std::shared_ptr<sigrok::Analog> analog);
-
- void data_feed_in(std::shared_ptr<sigrok::Device> device,
- std::shared_ptr<sigrok::Packet> packet);
-
-private:
- DeviceManager &device_manager_;
- std::shared_ptr<sigrok::Session> session_;
-
- /**
- * The device instance that will be used in the next capture session.
- */
- std::shared_ptr<sigrok::Device> device_;
-
- std::vector< std::shared_ptr<view::DecodeTrace> > decode_traces_;
-
- mutable std::mutex sampling_mutex_;
- capture_state capture_state_;
-
- mutable boost::shared_mutex signals_mutex_;
- std::vector< std::shared_ptr<view::Signal> > signals_;
-
- mutable std::mutex data_mutex_;
- std::shared_ptr<data::Logic> logic_data_;
- std::shared_ptr<data::LogicSnapshot> cur_logic_snapshot_;
- std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSnapshot> >
- cur_analog_snapshots_;
-
- std::thread sampling_thread_;
-
-Q_SIGNALS:
- void capture_state_changed(int state);
-
- void signals_changed();
-
- void frame_began();
-
- void data_received();
-
- void frame_ended();
-};
-
-} // namespace pv
-
-#endif // PULSEVIEW_PV_SIGSESSION_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012-14 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_SIGSESSION_H
+#define PULSEVIEW_PV_SIGSESSION_H
+
+#include <map>
+#include <memory>
+#include <mutex>
+#include <set>
+#include <string>
+#include <thread>
+#include <vector>
+
+#include <boost/thread.hpp>
+
+#include <QObject>
+#include <QString>
+
+struct srd_decoder;
+struct srd_channel;
+
+namespace sigrok {
+ class Analog;
+ class Channel;
+ class Device;
+ class Logic;
+ class Meta;
+ class Packet;
+ class Session;
+}
+
+namespace pv {
+
+class DeviceManager;
+
+namespace data {
+class Analog;
+class AnalogSnapshot;
+class Logic;
+class LogicSnapshot;
+class SignalData;
+}
+
+namespace view {
+class DecodeTrace;
+class LogicSignal;
+class Signal;
+}
+
+class SigSession : public QObject
+{
+ Q_OBJECT
+
+public:
+ enum capture_state {
+ Stopped,
+ AwaitingTrigger,
+ Running
+ };
+
+public:
+ SigSession(DeviceManager &device_manager);
+
+ ~SigSession();
+
+ DeviceManager& device_manager();
+
+ const DeviceManager& device_manager() const;
+
+ const std::shared_ptr<sigrok::Session>& session() const;
+
+ std::shared_ptr<sigrok::Device> device() const;
+
+ /**
+ * Sets device instance that will be used in the next capture session.
+ */
+ void set_device(std::shared_ptr<sigrok::Device> device);
+
+ void set_file(const std::string &name);
+
+ void set_default_device();
+
+ capture_state get_capture_state() const;
+
+ void start_capture(std::function<void (const QString)> error_handler);
+
+ void stop_capture();
+
+ std::set< std::shared_ptr<data::SignalData> > get_data() const;
+
+ boost::shared_mutex& signals_mutex() const;
+
+ const std::vector< std::shared_ptr<view::Signal> >& signals() const;
+
+#ifdef ENABLE_DECODE
+ bool add_decoder(srd_decoder *const dec);
+
+ std::vector< std::shared_ptr<view::DecodeTrace> >
+ get_decode_signals() const;
+
+ void remove_decode_signal(view::DecodeTrace *signal);
+#endif
+
+private:
+ void set_capture_state(capture_state state);
+
+ void update_signals(std::shared_ptr<sigrok::Device> device);
+
+ std::shared_ptr<view::Signal> signal_from_channel(
+ std::shared_ptr<sigrok::Channel> channel) const;
+
+ void read_sample_rate(std::shared_ptr<sigrok::Device>);
+
+private:
+ void sample_thread_proc(std::shared_ptr<sigrok::Device> device,
+ std::function<void (const QString)> error_handler);
+
+ void feed_in_header(std::shared_ptr<sigrok::Device> device);
+
+ void feed_in_meta(std::shared_ptr<sigrok::Device> device,
+ std::shared_ptr<sigrok::Meta> meta);
+
+ void feed_in_frame_begin();
+
+ void feed_in_logic(std::shared_ptr<sigrok::Logic> logic);
+
+ void feed_in_analog(std::shared_ptr<sigrok::Analog> analog);
+
+ void data_feed_in(std::shared_ptr<sigrok::Device> device,
+ std::shared_ptr<sigrok::Packet> packet);
+
+private:
+ DeviceManager &device_manager_;
+ std::shared_ptr<sigrok::Session> session_;
+
+ /**
+ * The device instance that will be used in the next capture session.
+ */
+ std::shared_ptr<sigrok::Device> device_;
+
+ std::vector< std::shared_ptr<view::DecodeTrace> > decode_traces_;
+
+ mutable std::mutex sampling_mutex_;
+ capture_state capture_state_;
+
+ mutable boost::shared_mutex signals_mutex_;
+ std::vector< std::shared_ptr<view::Signal> > signals_;
+
+ mutable std::mutex data_mutex_;
+ std::shared_ptr<data::Logic> logic_data_;
+ std::shared_ptr<data::LogicSnapshot> cur_logic_snapshot_;
+ std::map< std::shared_ptr<sigrok::Channel>, std::shared_ptr<data::AnalogSnapshot> >
+ cur_analog_snapshots_;
+
+ std::thread sampling_thread_;
+
+Q_SIGNALS:
+ void capture_state_changed(int state);
+
+ void signals_changed();
+
+ void frame_began();
+
+ void data_received();
+
+ void frame_ended();
+};
+
+} // namespace pv
+
+#endif // PULSEVIEW_PV_SIGSESSION_H
#include <cassert>
-#include "storesession.h"
+#include "storesession.hpp"
-#include <pv/sigsession.h>
-#include <pv/data/logic.h>
-#include <pv/data/logicsnapshot.h>
-#include <pv/view/signal.h>
+#include <pv/sigsession.hpp>
+#include <pv/data/logic.hpp>
+#include <pv/data/logicsnapshot.hpp>
+#include <pv/view/signal.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_STORESESSION_H
-#define PULSEVIEW_PV_STORESESSION_H
-
-#include <stdint.h>
-
-#include <atomic>
-#include <mutex>
-#include <string>
-#include <thread>
-
-#include <QObject>
-
-namespace sigrok {
-class Output;
-}
-
-namespace pv {
-
-class SigSession;
-
-namespace data {
-class LogicSnapshot;
-}
-
-class StoreSession : public QObject
-{
- Q_OBJECT
-
-private:
- static const size_t BlockSize;
-
-public:
- StoreSession(const std::string &file_name,
- const SigSession &session);
-
- ~StoreSession();
-
- std::pair<int, int> progress() const;
-
- const QString& error() const;
-
- bool start();
-
- void wait();
-
- void cancel();
-
-private:
- void store_proc(std::shared_ptr<pv::data::LogicSnapshot> snapshot);
-
-Q_SIGNALS:
- void progress_updated();
-
-private:
- const std::string file_name_;
- const SigSession &session_;
-
- std::shared_ptr<sigrok::Output> output_;
-
- std::thread thread_;
-
- std::atomic<bool> interrupt_;
-
- std::atomic<int> units_stored_, unit_count_;
-
- mutable std::mutex mutex_;
- QString error_;
-};
-
-} // pv
-
-#endif // PULSEVIEW_PV_STORESESSION_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_STORESESSION_H
+#define PULSEVIEW_PV_STORESESSION_H
+
+#include <stdint.h>
+
+#include <atomic>
+#include <mutex>
+#include <string>
+#include <thread>
+
+#include <QObject>
+
+namespace sigrok {
+class Output;
+}
+
+namespace pv {
+
+class SigSession;
+
+namespace data {
+class LogicSnapshot;
+}
+
+class StoreSession : public QObject
+{
+ Q_OBJECT
+
+private:
+ static const size_t BlockSize;
+
+public:
+ StoreSession(const std::string &file_name,
+ const SigSession &session);
+
+ ~StoreSession();
+
+ std::pair<int, int> progress() const;
+
+ const QString& error() const;
+
+ bool start();
+
+ void wait();
+
+ void cancel();
+
+private:
+ void store_proc(std::shared_ptr<pv::data::LogicSnapshot> snapshot);
+
+Q_SIGNALS:
+ void progress_updated();
+
+private:
+ const std::string file_name_;
+ const SigSession &session_;
+
+ std::shared_ptr<sigrok::Output> output_;
+
+ std::thread thread_;
+
+ std::atomic<bool> interrupt_;
+
+ std::atomic<int> units_stored_, unit_count_;
+
+ mutable std::mutex mutex_;
+ QString error_;
+};
+
+} // pv
+
+#endif // PULSEVIEW_PV_STORESESSION_H
#include <QHelpEvent>
#include <QToolTip>
-#include "samplingbar.h"
+#include "samplingbar.hpp"
-#include <pv/devicemanager.h>
-#include <pv/popups/deviceoptions.h>
-#include <pv/popups/channels.h>
-#include <pv/util.h>
+#include <pv/devicemanager.hpp>
+#include <pv/popups/deviceoptions.hpp>
+#include <pv/popups/channels.hpp>
+#include <pv/util.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
-#define PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
-
-#include <stdint.h>
-
-#include <list>
-#include <memory>
-
-#include <QComboBox>
-#include <QDoubleSpinBox>
-#include <QToolBar>
-#include <QToolButton>
-
-#include <pv/sigsession.h>
-#include <pv/widgets/popuptoolbutton.h>
-#include <pv/widgets/sweeptimingwidget.h>
-
-namespace sigrok {
- class Device;
-}
-
-Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Device>)
-
-class QAction;
-
-namespace pv {
-
-class SigSession;
-
-namespace toolbars {
-
-class SamplingBar : public QToolBar
-{
- Q_OBJECT
-
-private:
- static const uint64_t MinSampleCount;
- static const uint64_t MaxSampleCount;
- static const uint64_t DefaultSampleCount;
-
-public:
- SamplingBar(SigSession &session, QWidget *parent);
-
- void set_device_list(
- const std::list< std::pair<std::shared_ptr<sigrok::Device>, std::string> > &devices,
- std::shared_ptr<sigrok::Device> selected);
-
- std::shared_ptr<sigrok::Device> get_selected_device() const;
-
- void set_capture_state(pv::SigSession::capture_state state);
-
-Q_SIGNALS:
- void run_stop();
-
-private:
- void update_sample_rate_selector();
- void update_sample_rate_selector_value();
- void update_sample_count_selector();
- void update_device_config_widgets();
- void commit_sample_rate();
- void commit_sample_count();
-
-private Q_SLOTS:
- void on_device_selected();
- void on_sample_count_changed();
- void on_sample_rate_changed();
- void on_run_stop();
-
- void on_config_changed();
-
-protected:
- bool eventFilter(QObject *watched, QEvent *event);
-
-private:
- SigSession &session_;
-
- QComboBox device_selector_;
- bool updating_device_selector_;
-
- pv::widgets::PopupToolButton configure_button_;
- QAction *configure_button_action_;
-
- pv::widgets::PopupToolButton channels_button_;
-
- pv::widgets::SweepTimingWidget sample_count_;
- pv::widgets::SweepTimingWidget sample_rate_;
- bool updating_sample_rate_;
- bool updating_sample_count_;
-
- bool sample_count_supported_;
-
- QIcon icon_red_;
- QIcon icon_green_;
- QIcon icon_grey_;
- QToolButton run_stop_button_;
-};
-
-} // namespace toolbars
-} // namespace pv
-
-#endif // PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
+#define PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
+
+#include <stdint.h>
+
+#include <list>
+#include <memory>
+
+#include <QComboBox>
+#include <QDoubleSpinBox>
+#include <QToolBar>
+#include <QToolButton>
+
+#include <pv/sigsession.hpp>
+#include <pv/widgets/popuptoolbutton.hpp>
+#include <pv/widgets/sweeptimingwidget.hpp>
+
+namespace sigrok {
+ class Device;
+}
+
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Device>)
+
+class QAction;
+
+namespace pv {
+
+class SigSession;
+
+namespace toolbars {
+
+class SamplingBar : public QToolBar
+{
+ Q_OBJECT
+
+private:
+ static const uint64_t MinSampleCount;
+ static const uint64_t MaxSampleCount;
+ static const uint64_t DefaultSampleCount;
+
+public:
+ SamplingBar(SigSession &session, QWidget *parent);
+
+ void set_device_list(
+ const std::list< std::pair<std::shared_ptr<sigrok::Device>, std::string> > &devices,
+ std::shared_ptr<sigrok::Device> selected);
+
+ std::shared_ptr<sigrok::Device> get_selected_device() const;
+
+ void set_capture_state(pv::SigSession::capture_state state);
+
+Q_SIGNALS:
+ void run_stop();
+
+private:
+ void update_sample_rate_selector();
+ void update_sample_rate_selector_value();
+ void update_sample_count_selector();
+ void update_device_config_widgets();
+ void commit_sample_rate();
+ void commit_sample_count();
+
+private Q_SLOTS:
+ void on_device_selected();
+ void on_sample_count_changed();
+ void on_sample_rate_changed();
+ void on_run_stop();
+
+ void on_config_changed();
+
+protected:
+ bool eventFilter(QObject *watched, QEvent *event);
+
+private:
+ SigSession &session_;
+
+ QComboBox device_selector_;
+ bool updating_device_selector_;
+
+ pv::widgets::PopupToolButton configure_button_;
+ QAction *configure_button_action_;
+
+ pv::widgets::PopupToolButton channels_button_;
+
+ pv::widgets::SweepTimingWidget sample_count_;
+ pv::widgets::SweepTimingWidget sample_rate_;
+ bool updating_sample_rate_;
+ bool updating_sample_count_;
+
+ bool sample_count_supported_;
+
+ QIcon icon_red_;
+ QIcon icon_green_;
+ QIcon icon_grey_;
+ QToolButton run_stop_button_;
+};
+
+} // namespace toolbars
+} // namespace pv
+
+#endif // PULSEVIEW_PV_TOOLBARS_SAMPLINGBAR_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "util.h"
+#include "util.hpp"
#include <extdef.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_UTIL_H
-#define PULSEVIEW_UTIL_H
-
-#include <math.h>
-
-#include <QString>
-
-namespace pv {
-namespace util {
-
-extern const int FirstSIPrefixPower;
-
-/**
- * Formats a given time value with the specified SI prefix.
- * @param t The time value in seconds to format.
- * @param prefix The number of the prefix, from 0 for 'femto' up to
- * 8 for 'giga'.
- * @parma precision The number of digits after the decimal separator.
- * @param sign Whether or not to add a sign also for positive numbers.
- *
- * @return The formated value.
- */
-QString format_time(
- double t, unsigned int prefix,
- unsigned precision = 0, bool sign = true);
-
-/**
- * Formats a given time value with a SI prefix so that the
- * value is between 1 and 999.
- * @param second The time value in seconds to format.
- *
- * @return The formated value.
- */
-QString format_second(double second);
-
-} // namespace util
-} // namespace pv
-
-#endif // PULSEVIEW_UTIL_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_UTIL_H
+#define PULSEVIEW_UTIL_H
+
+#include <math.h>
+
+#include <QString>
+
+namespace pv {
+namespace util {
+
+extern const int FirstSIPrefixPower;
+
+/**
+ * Formats a given time value with the specified SI prefix.
+ * @param t The time value in seconds to format.
+ * @param prefix The number of the prefix, from 0 for 'femto' up to
+ * 8 for 'giga'.
+ * @parma precision The number of digits after the decimal separator.
+ * @param sign Whether or not to add a sign also for positive numbers.
+ *
+ * @return The formated value.
+ */
+QString format_time(
+ double t, unsigned int prefix,
+ unsigned precision = 0, bool sign = true);
+
+/**
+ * Formats a given time value with a SI prefix so that the
+ * value is between 1 and 999.
+ * @param second The time value in seconds to format.
+ *
+ * @return The formated value.
+ */
+QString format_second(double second);
+
+} // namespace util
+} // namespace pv
+
+#endif // PULSEVIEW_UTIL_H
#include <cassert>
#include <cmath>
-#include "analogsignal.h"
-#include "pv/data/analog.h"
-#include "pv/data/analogsnapshot.h"
-#include "pv/view/view.h"
+#include "analogsignal.hpp"
+#include "pv/data/analog.hpp"
+#include "pv/data/analogsnapshot.hpp"
+#include "pv/view/view.hpp"
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
-#define PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
-
-#include "signal.h"
-
-#include <memory>
-
-namespace pv {
-
-namespace data {
-class Analog;
-class AnalogSnapshot;
-}
-
-namespace view {
-
-class AnalogSignal : public Signal
-{
-private:
- static const int NominalHeight;
- static const QColor SignalColours[4];
-
- static const float EnvelopeThreshold;
-
-public:
- AnalogSignal(pv::SigSession &session,
- std::shared_ptr<sigrok::Channel> channel,
- std::shared_ptr<pv::data::Analog> data);
-
- virtual ~AnalogSignal();
-
- std::shared_ptr<pv::data::SignalData> data() const;
-
- std::shared_ptr<pv::data::Analog> analog_data() const;
-
- void set_scale(float scale);
-
- /**
- * Computes the vertical extents of the contents of this row item.
- * @return A pair containing the minimum and maximum y-values.
- */
- std::pair<int, int> v_extents() const;
-
- /**
- * Paints the background layer of the signal with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal.
- * @param right the x-coordinate of the right edge of the signal.
- **/
- void paint_back(QPainter &p, int left, int right);
-
- /**
- * Paints the mid-layer of the signal with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal.
- * @param right the x-coordinate of the right edge of the signal.
- **/
- void paint_mid(QPainter &p, int left, int right);
-
-private:
- void paint_trace(QPainter &p,
- const std::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
- int y, int left, const int64_t start, const int64_t end,
- const double pixels_offset, const double samples_per_pixel);
-
- void paint_envelope(QPainter &p,
- const std::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
- int y, int left, const int64_t start, const int64_t end,
- const double pixels_offset, const double samples_per_pixel);
-
-private:
- std::shared_ptr<pv::data::Analog> data_;
- float scale_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
+#define PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
+
+#include "signal.hpp"
+
+#include <memory>
+
+namespace pv {
+
+namespace data {
+class Analog;
+class AnalogSnapshot;
+}
+
+namespace view {
+
+class AnalogSignal : public Signal
+{
+private:
+ static const int NominalHeight;
+ static const QColor SignalColours[4];
+
+ static const float EnvelopeThreshold;
+
+public:
+ AnalogSignal(pv::SigSession &session,
+ std::shared_ptr<sigrok::Channel> channel,
+ std::shared_ptr<pv::data::Analog> data);
+
+ virtual ~AnalogSignal();
+
+ std::shared_ptr<pv::data::SignalData> data() const;
+
+ std::shared_ptr<pv::data::Analog> analog_data() const;
+
+ void set_scale(float scale);
+
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
+ /**
+ * Paints the background layer of the signal with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal.
+ * @param right the x-coordinate of the right edge of the signal.
+ **/
+ void paint_back(QPainter &p, int left, int right);
+
+ /**
+ * Paints the mid-layer of the signal with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal.
+ * @param right the x-coordinate of the right edge of the signal.
+ **/
+ void paint_mid(QPainter &p, int left, int right);
+
+private:
+ void paint_trace(QPainter &p,
+ const std::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
+ int y, int left, const int64_t start, const int64_t end,
+ const double pixels_offset, const double samples_per_pixel);
+
+ void paint_envelope(QPainter &p,
+ const std::shared_ptr<pv::data::AnalogSnapshot> &snapshot,
+ int y, int left, const int64_t start, const int64_t end,
+ const double pixels_offset, const double samples_per_pixel);
+
+private:
+ std::shared_ptr<pv::data::Analog> data_;
+ float scale_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_ANALOGSIGNAL_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "cursor.h"
+#include "cursor.hpp"
-#include "view.h"
-#include "pv/util.h"
+#include "view.hpp"
+#include "pv/util.hpp"
#include <QBrush>
#include <QPainter>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_CURSOR_H
-#define PULSEVIEW_PV_VIEW_CURSOR_H
-
-#include "timemarker.h"
-
-#include <memory>
-
-#include <QSizeF>
-
-class QPainter;
-
-namespace pv {
-namespace view {
-
-class Cursor : public TimeMarker
-{
- Q_OBJECT
-
-public:
- static const QColor LineColour;
- static const QColor FillColour;
- static const QColor HighlightColour;
- static const QColor TextColour;
-
- static const int Offset;
-
- static const int ArrowSize;
-
-public:
- /**
- * Constructor.
- * @param view A reference to the view that owns this cursor pair.
- * @param time The time to set the flag to.
- */
- Cursor(View &view, double time);
-
-public:
- /**
- * Gets the marker label rectangle.
- * @param rect The rectangle of the ruler client area.
- * @return Returns the label rectangle.
- */
- QRectF get_label_rect(const QRect &rect) const;
-
- /**
- * Paints the cursor's label to the ruler.
- * @param p The painter to draw with.
- * @param rect The rectangle of the ruler client area.
- * @param prefix The index of the SI prefix to use.
- */
- void paint_label(QPainter &p, const QRect &rect,
- unsigned int prefix);
-
-private:
- void compute_text_size(QPainter &p, unsigned int prefix);
-
- std::shared_ptr<Cursor> get_other_cursor() const;
-
-private:
- QSizeF text_size_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_CURSOR_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_CURSOR_H
+#define PULSEVIEW_PV_VIEW_CURSOR_H
+
+#include "timemarker.hpp"
+
+#include <memory>
+
+#include <QSizeF>
+
+class QPainter;
+
+namespace pv {
+namespace view {
+
+class Cursor : public TimeMarker
+{
+ Q_OBJECT
+
+public:
+ static const QColor LineColour;
+ static const QColor FillColour;
+ static const QColor HighlightColour;
+ static const QColor TextColour;
+
+ static const int Offset;
+
+ static const int ArrowSize;
+
+public:
+ /**
+ * Constructor.
+ * @param view A reference to the view that owns this cursor pair.
+ * @param time The time to set the flag to.
+ */
+ Cursor(View &view, double time);
+
+public:
+ /**
+ * Gets the marker label rectangle.
+ * @param rect The rectangle of the ruler client area.
+ * @return Returns the label rectangle.
+ */
+ QRectF get_label_rect(const QRect &rect) const;
+
+ /**
+ * Paints the cursor's label to the ruler.
+ * @param p The painter to draw with.
+ * @param rect The rectangle of the ruler client area.
+ * @param prefix The index of the SI prefix to use.
+ */
+ void paint_label(QPainter &p, const QRect &rect,
+ unsigned int prefix);
+
+private:
+ void compute_text_size(QPainter &p, unsigned int prefix);
+
+ std::shared_ptr<Cursor> get_other_cursor() const;
+
+private:
+ QSizeF text_size_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_CURSOR_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "cursorheader.h"
+#include "cursorheader.hpp"
-#include "ruler.h"
-#include "view.h"
+#include "ruler.hpp"
+#include "view.hpp"
#include <QApplication>
#include <QFontMetrics>
#include <QMouseEvent>
-#include <pv/widgets/popup.h>
+#include <pv/widgets/popup.hpp>
using std::shared_ptr;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_CURSORHEADER_H
-#define PULSEVIEW_PV_VIEW_CURSORHEADER_H
-
-#include <memory>
-
-#include "marginwidget.h"
-
-namespace pv {
-namespace view {
-
-class TimeMarker;
-
-/**
- * Widget to hold the labels over the cursors.
- */
-class CursorHeader : public MarginWidget
-{
- Q_OBJECT
-
- static const int Padding;
-
- /**
- * The vertical offset, relative to the bottom line of the widget,
- * where the arrows of the cursor labels end.
- */
- static const int BaselineOffset;
-
-public:
- CursorHeader(View &parent);
-
- QSize sizeHint() const;
-
- void clear_selection();
-
-private:
- void paintEvent(QPaintEvent *event);
-
- void mouseMoveEvent(QMouseEvent *e);
- void mousePressEvent(QMouseEvent *e);
- void mouseReleaseEvent(QMouseEvent *);
-
- int calculateTextHeight();
-
- std::weak_ptr<TimeMarker> grabbed_marker_;
- QPoint mouse_down_point_;
- bool dragging_;
- const int textHeight_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_CURSORHEADER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_CURSORHEADER_H
+#define PULSEVIEW_PV_VIEW_CURSORHEADER_H
+
+#include <memory>
+
+#include "marginwidget.hpp"
+
+namespace pv {
+namespace view {
+
+class TimeMarker;
+
+/**
+ * Widget to hold the labels over the cursors.
+ */
+class CursorHeader : public MarginWidget
+{
+ Q_OBJECT
+
+ static const int Padding;
+
+ /**
+ * The vertical offset, relative to the bottom line of the widget,
+ * where the arrows of the cursor labels end.
+ */
+ static const int BaselineOffset;
+
+public:
+ CursorHeader(View &parent);
+
+ QSize sizeHint() const;
+
+ void clear_selection();
+
+private:
+ void paintEvent(QPaintEvent *event);
+
+ void mouseMoveEvent(QMouseEvent *e);
+ void mousePressEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *);
+
+ int calculateTextHeight();
+
+ std::weak_ptr<TimeMarker> grabbed_marker_;
+ QPoint mouse_down_point_;
+ bool dragging_;
+ const int textHeight_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_CURSORHEADER_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "cursorpair.h"
+#include "cursorpair.hpp"
-#include "view.h"
-#include "pv/util.h"
+#include "view.hpp"
+#include "pv/util.hpp"
#include <cassert>
#include <algorithm>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_CURSORPAIR_H
-#define PULSEVIEW_PV_VIEW_CURSORPAIR_H
-
-#include "cursor.h"
-
-#include <memory>
-
-#include <QPainter>
-
-class QPainter;
-
-namespace pv {
-namespace view {
-
-class CursorPair
-{
-private:
- static const int DeltaPadding;
-
-public:
- /**
- * Constructor.
- * @param view A reference to the view that owns this cursor pair.
- */
- CursorPair(View &view);
-
- /**
- * Returns a pointer to the first cursor.
- */
- std::shared_ptr<Cursor> first() const;
-
- /**
- * Returns a pointer to the second cursor.
- */
- std::shared_ptr<Cursor> second() const;
-
-public:
- QRectF get_label_rect(const QRect &rect) const;
-
- void draw_markers(QPainter &p,
- const QRect &rect, unsigned int prefix);
-
- void draw_viewport_background(QPainter &p, const QRect &rect);
-
- void draw_viewport_foreground(QPainter &p, const QRect &rect);
-
- void compute_text_size(QPainter &p, unsigned int prefix);
-
- std::pair<float, float> get_cursor_offsets() const;
-
-private:
- std::shared_ptr<Cursor> first_, second_;
- const View &view_;
-
- QSizeF text_size_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_CURSORPAIR_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_CURSORPAIR_H
+#define PULSEVIEW_PV_VIEW_CURSORPAIR_H
+
+#include "cursor.hpp"
+
+#include <memory>
+
+#include <QPainter>
+
+class QPainter;
+
+namespace pv {
+namespace view {
+
+class CursorPair
+{
+private:
+ static const int DeltaPadding;
+
+public:
+ /**
+ * Constructor.
+ * @param view A reference to the view that owns this cursor pair.
+ */
+ CursorPair(View &view);
+
+ /**
+ * Returns a pointer to the first cursor.
+ */
+ std::shared_ptr<Cursor> first() const;
+
+ /**
+ * Returns a pointer to the second cursor.
+ */
+ std::shared_ptr<Cursor> second() const;
+
+public:
+ QRectF get_label_rect(const QRect &rect) const;
+
+ void draw_markers(QPainter &p,
+ const QRect &rect, unsigned int prefix);
+
+ void draw_viewport_background(QPainter &p, const QRect &rect);
+
+ void draw_viewport_foreground(QPainter &p, const QRect &rect);
+
+ void compute_text_size(QPainter &p, unsigned int prefix);
+
+ std::pair<float, float> get_cursor_offsets() const;
+
+private:
+ std::shared_ptr<Cursor> first_, second_;
+ const View &view_;
+
+ QSizeF text_size_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_CURSORPAIR_H
#include <QPushButton>
#include <QToolTip>
-#include "decodetrace.h"
-
-#include <pv/sigsession.h>
-#include <pv/data/decoderstack.h>
-#include <pv/data/decode/decoder.h>
-#include <pv/data/logic.h>
-#include <pv/data/logicsnapshot.h>
-#include <pv/data/decode/annotation.h>
-#include <pv/view/logicsignal.h>
-#include <pv/view/view.h>
-#include <pv/view/viewport.h>
-#include <pv/widgets/decodergroupbox.h>
-#include <pv/widgets/decodermenu.h>
+#include "decodetrace.hpp"
+
+#include <pv/sigsession.hpp>
+#include <pv/data/decoderstack.hpp>
+#include <pv/data/decode/decoder.hpp>
+#include <pv/data/logic.hpp>
+#include <pv/data/logicsnapshot.hpp>
+#include <pv/data/decode/annotation.hpp>
+#include <pv/view/logicsignal.hpp>
+#include <pv/view/view.hpp>
+#include <pv/view/viewport.hpp>
+#include <pv/widgets/decodergroupbox.hpp>
+#include <pv/widgets/decodermenu.hpp>
using boost::shared_lock;
using boost::shared_mutex;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_DECODETRACE_H
-#define PULSEVIEW_PV_VIEW_DECODETRACE_H
-
-#include "trace.h"
-
-#include <list>
-#include <map>
-#include <memory>
-
-#include <QSignalMapper>
-
-#include <pv/prop/binding/decoderoptions.h>
-#include <pv/data/decode/row.h>
-
-struct srd_channel;
-struct srd_decoder;
-
-class QComboBox;
-
-namespace pv {
-
-class SigSession;
-
-namespace data {
-class DecoderStack;
-
-namespace decode {
-class Annotation;
-class Decoder;
-class Row;
-}
-}
-
-namespace widgets {
-class DecoderGroupBox;
-}
-
-namespace view {
-
-class DecodeTrace : public Trace
-{
- Q_OBJECT
-
-private:
- struct ChannelSelector
- {
- const QComboBox *combo_;
- const std::shared_ptr<pv::data::decode::Decoder> decoder_;
- const srd_channel *pdch_;
- };
-
-private:
- static const QColor DecodeColours[4];
- static const QColor ErrorBgColour;
- static const QColor NoDecodeColour;
-
- static const int ArrowSize;
- static const double EndCapWidth;
- static const int DrawPadding;
-
- static const QColor Colours[16];
- static const QColor OutlineColours[16];
-
-public:
- DecodeTrace(pv::SigSession &session,
- std::shared_ptr<pv::data::DecoderStack> decoder_stack,
- int index);
-
- bool enabled() const;
-
- const std::shared_ptr<pv::data::DecoderStack>& decoder() const;
-
- /**
- * Computes the vertical extents of the contents of this row item.
- * @return A pair containing the minimum and maximum y-values.
- */
- std::pair<int, int> v_extents() const;
-
- /**
- * Paints the background layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal.
- * @param right the x-coordinate of the right edge of the signal.
- **/
- void paint_back(QPainter &p, int left, int right);
-
- /**
- * Paints the mid-layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal
- * @param right the x-coordinate of the right edge of the signal
- **/
- void paint_mid(QPainter &p, int left, int right);
-
- /**
- * Paints the foreground layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal
- * @param right the x-coordinate of the right edge of the signal
- **/
- void paint_fore(QPainter &p, int left, int right);
-
- void populate_popup_form(QWidget *parent, QFormLayout *form);
-
- QMenu* create_context_menu(QWidget *parent);
-
- void delete_pressed();
-
-private:
- void draw_annotation(const pv::data::decode::Annotation &a, QPainter &p,
- QColor text_colour, int text_height, int left, int right, int y,
- size_t base_colour) const;
-
- void draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
- QColor fill, QColor outline, QColor text_color, int h, double x,
- int y) const;
-
- void draw_range(const pv::data::decode::Annotation &a, QPainter &p,
- QColor fill, QColor outline, QColor text_color, int h, double start,
- double end, int y) const;
-
- void draw_error(QPainter &p, const QString &message,
- int left, int right);
-
- void draw_unresolved_period(QPainter &p, int h, int left,
- int right) const;
-
- std::pair<double, double> get_pixels_offset_samples_per_pixel() const;
-
- /**
- * Determines the start and end sample for a given pixel range.
- * @param x_start the X coordinate of the start sample in the view
- * @param x_end the X coordinate of the end sample in the view
- * @return Returns a pair containing the start sample and the end
- * sample that correspond to the start and end coordinates.
- */
- std::pair<uint64_t, uint64_t> get_sample_range(int x_start, int x_end) const;
-
- int get_row_at_point(const QPoint &point);
-
- const QString get_annotation_at_point(const QPoint &point);
-
- void hide_hover_annotation();
-
- void create_decoder_form(int index,
- std::shared_ptr<pv::data::decode::Decoder> &dec,
- QWidget *parent, QFormLayout *form);
-
- QComboBox* create_channel_selector(QWidget *parent,
- const std::shared_ptr<pv::data::decode::Decoder> &dec,
- const srd_channel *const pdch);
-
- void commit_decoder_channels(
- std::shared_ptr<data::decode::Decoder> &dec);
-
- void commit_channels();
-
-public:
- void hover_point_changed();
-
-private Q_SLOTS:
- void on_new_decode_data();
-
- void on_delete();
-
- void on_channel_selected(int);
-
- void on_stack_decoder(srd_decoder *decoder);
-
- void on_delete_decoder(int index);
-
- void on_show_hide_decoder(int index);
-
-private:
- pv::SigSession &session_;
- std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
-
- uint64_t decode_start_, decode_end_;
-
- std::list< std::shared_ptr<pv::prop::binding::DecoderOptions> >
- bindings_;
-
- std::list<ChannelSelector> channel_selectors_;
- std::vector<pv::widgets::DecoderGroupBox*> decoder_forms_;
-
- std::vector<data::decode::Row> visible_rows_;
- int text_height_, row_height_;
-
- QSignalMapper delete_mapper_, show_hide_mapper_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_DECODETRACE_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_DECODETRACE_H
+#define PULSEVIEW_PV_VIEW_DECODETRACE_H
+
+#include "trace.hpp"
+
+#include <list>
+#include <map>
+#include <memory>
+
+#include <QSignalMapper>
+
+#include <pv/prop/binding/decoderoptions.hpp>
+#include <pv/data/decode/row.hpp>
+
+struct srd_channel;
+struct srd_decoder;
+
+class QComboBox;
+
+namespace pv {
+
+class SigSession;
+
+namespace data {
+class DecoderStack;
+
+namespace decode {
+class Annotation;
+class Decoder;
+class Row;
+}
+}
+
+namespace widgets {
+class DecoderGroupBox;
+}
+
+namespace view {
+
+class DecodeTrace : public Trace
+{
+ Q_OBJECT
+
+private:
+ struct ChannelSelector
+ {
+ const QComboBox *combo_;
+ const std::shared_ptr<pv::data::decode::Decoder> decoder_;
+ const srd_channel *pdch_;
+ };
+
+private:
+ static const QColor DecodeColours[4];
+ static const QColor ErrorBgColour;
+ static const QColor NoDecodeColour;
+
+ static const int ArrowSize;
+ static const double EndCapWidth;
+ static const int DrawPadding;
+
+ static const QColor Colours[16];
+ static const QColor OutlineColours[16];
+
+public:
+ DecodeTrace(pv::SigSession &session,
+ std::shared_ptr<pv::data::DecoderStack> decoder_stack,
+ int index);
+
+ bool enabled() const;
+
+ const std::shared_ptr<pv::data::DecoderStack>& decoder() const;
+
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
+ /**
+ * Paints the background layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal.
+ * @param right the x-coordinate of the right edge of the signal.
+ **/
+ void paint_back(QPainter &p, int left, int right);
+
+ /**
+ * Paints the mid-layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal
+ * @param right the x-coordinate of the right edge of the signal
+ **/
+ void paint_mid(QPainter &p, int left, int right);
+
+ /**
+ * Paints the foreground layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal
+ * @param right the x-coordinate of the right edge of the signal
+ **/
+ void paint_fore(QPainter &p, int left, int right);
+
+ void populate_popup_form(QWidget *parent, QFormLayout *form);
+
+ QMenu* create_context_menu(QWidget *parent);
+
+ void delete_pressed();
+
+private:
+ void draw_annotation(const pv::data::decode::Annotation &a, QPainter &p,
+ QColor text_colour, int text_height, int left, int right, int y,
+ size_t base_colour) const;
+
+ void draw_instant(const pv::data::decode::Annotation &a, QPainter &p,
+ QColor fill, QColor outline, QColor text_color, int h, double x,
+ int y) const;
+
+ void draw_range(const pv::data::decode::Annotation &a, QPainter &p,
+ QColor fill, QColor outline, QColor text_color, int h, double start,
+ double end, int y) const;
+
+ void draw_error(QPainter &p, const QString &message,
+ int left, int right);
+
+ void draw_unresolved_period(QPainter &p, int h, int left,
+ int right) const;
+
+ std::pair<double, double> get_pixels_offset_samples_per_pixel() const;
+
+ /**
+ * Determines the start and end sample for a given pixel range.
+ * @param x_start the X coordinate of the start sample in the view
+ * @param x_end the X coordinate of the end sample in the view
+ * @return Returns a pair containing the start sample and the end
+ * sample that correspond to the start and end coordinates.
+ */
+ std::pair<uint64_t, uint64_t> get_sample_range(int x_start, int x_end) const;
+
+ int get_row_at_point(const QPoint &point);
+
+ const QString get_annotation_at_point(const QPoint &point);
+
+ void hide_hover_annotation();
+
+ void create_decoder_form(int index,
+ std::shared_ptr<pv::data::decode::Decoder> &dec,
+ QWidget *parent, QFormLayout *form);
+
+ QComboBox* create_channel_selector(QWidget *parent,
+ const std::shared_ptr<pv::data::decode::Decoder> &dec,
+ const srd_channel *const pdch);
+
+ void commit_decoder_channels(
+ std::shared_ptr<data::decode::Decoder> &dec);
+
+ void commit_channels();
+
+public:
+ void hover_point_changed();
+
+private Q_SLOTS:
+ void on_new_decode_data();
+
+ void on_delete();
+
+ void on_channel_selected(int);
+
+ void on_stack_decoder(srd_decoder *decoder);
+
+ void on_delete_decoder(int index);
+
+ void on_show_hide_decoder(int index);
+
+private:
+ pv::SigSession &session_;
+ std::shared_ptr<pv::data::DecoderStack> decoder_stack_;
+
+ uint64_t decode_start_, decode_end_;
+
+ std::list< std::shared_ptr<pv::prop::binding::DecoderOptions> >
+ bindings_;
+
+ std::list<ChannelSelector> channel_selectors_;
+ std::vector<pv::widgets::DecoderGroupBox*> decoder_forms_;
+
+ std::vector<data::decode::Row> visible_rows_;
+ int text_height_, row_height_;
+
+ QSignalMapper delete_mapper_, show_hide_mapper_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_DECODETRACE_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "header.h"
-#include "view.h"
+#include "header.hpp"
+#include "view.hpp"
-#include "signal.h"
-#include "tracegroup.h"
-#include "../sigsession.h"
+#include "signal.hpp"
+#include "tracegroup.hpp"
#include <cassert>
#include <algorithm>
#include <QPainter>
#include <QRect>
-#include <pv/widgets/popup.h>
+#include <pv/sigsession.hpp>
+#include <pv/widgets/popup.hpp>
using boost::make_filter_iterator;
using std::dynamic_pointer_cast;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_HEADER_H
-#define PULSEVIEW_PV_VIEW_HEADER_H
-
-#include <list>
-#include <memory>
-#include <utility>
-
-#include "marginwidget.h"
-
-namespace pv {
-namespace view {
-
-class RowItem;
-class View;
-
-class Header : public MarginWidget
-{
- Q_OBJECT
-
-private:
- static const int Padding;
-
-public:
- Header(View &parent);
-
- QSize sizeHint() const;
-
- /**
- * The horizontal offset, relative to the left edge of the widget,
- * where the arrows of the trace labels end.
- */
- static const int BaselineOffset;
-
-private:
- std::shared_ptr<pv::view::RowItem> get_mouse_over_row_item(
- const QPoint &pt);
-
- void clear_selection();
-
- void show_popup(const std::shared_ptr<RowItem> &item);
-
-private:
- void paintEvent(QPaintEvent *event);
-
-private:
- void mouseLeftPressEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent * event);
-
- void mouseLeftReleaseEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
-
- void mouseMoveEvent(QMouseEvent *event);
-
- void leaveEvent(QEvent *event);
-
- void contextMenuEvent(QContextMenuEvent *event);
-
- void keyPressEvent(QKeyEvent *e);
-
-private Q_SLOTS:
- void on_signals_moved();
-
- void on_group();
-
- void on_ungroup();
-
-Q_SIGNALS:
- void signals_moved();
-
-private:
- QPoint mouse_point_;
- QPoint mouse_down_point_;
- std::shared_ptr<RowItem> mouse_down_item_;
- bool dragging_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_HEADER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_HEADER_H
+#define PULSEVIEW_PV_VIEW_HEADER_H
+
+#include <list>
+#include <memory>
+#include <utility>
+
+#include "marginwidget.hpp"
+
+namespace pv {
+namespace view {
+
+class RowItem;
+class View;
+
+class Header : public MarginWidget
+{
+ Q_OBJECT
+
+private:
+ static const int Padding;
+
+public:
+ Header(View &parent);
+
+ QSize sizeHint() const;
+
+ /**
+ * The horizontal offset, relative to the left edge of the widget,
+ * where the arrows of the trace labels end.
+ */
+ static const int BaselineOffset;
+
+private:
+ std::shared_ptr<pv::view::RowItem> get_mouse_over_row_item(
+ const QPoint &pt);
+
+ void clear_selection();
+
+ void show_popup(const std::shared_ptr<RowItem> &item);
+
+private:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ void mouseLeftPressEvent(QMouseEvent *event);
+ void mousePressEvent(QMouseEvent * event);
+
+ void mouseLeftReleaseEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+
+ void mouseMoveEvent(QMouseEvent *event);
+
+ void leaveEvent(QEvent *event);
+
+ void contextMenuEvent(QContextMenuEvent *event);
+
+ void keyPressEvent(QKeyEvent *e);
+
+private Q_SLOTS:
+ void on_signals_moved();
+
+ void on_group();
+
+ void on_ungroup();
+
+Q_SIGNALS:
+ void signals_moved();
+
+private:
+ QPoint mouse_point_;
+ QPoint mouse_down_point_;
+ std::shared_ptr<RowItem> mouse_down_item_;
+ bool dragging_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_HEADER_H
#include <QFormLayout>
#include <QToolBar>
-#include "logicsignal.h"
-#include "view.h"
-
-#include <pv/sigsession.h>
-#include <pv/devicemanager.h>
-#include <pv/data/logic.h>
-#include <pv/data/logicsnapshot.h>
-#include <pv/view/view.h>
+#include "logicsignal.hpp"
+#include "view.hpp"
+
+#include <pv/sigsession.hpp>
+#include <pv/devicemanager.hpp>
+#include <pv/data/logic.hpp>
+#include <pv/data/logicsnapshot.hpp>
+#include <pv/view/view.hpp>
#include <libsigrok/libsigrok.hpp>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
-#define PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
-
-#include "signal.h"
-
-#include <memory>
-
-class QToolBar;
-
-namespace sigrok {
- class Device;
- class TriggerMatchType;
-}
-
-namespace pv {
-
-namespace data {
-class Logic;
-}
-
-namespace view {
-
-class LogicSignal : public Signal
-{
- Q_OBJECT
-
-private:
- static const int SignalHeight;
- static const int SignalMargin;
-
- static const float Oversampling;
-
- static const QColor EdgeColour;
- static const QColor HighColour;
- static const QColor LowColour;
-
- static const QColor SignalColours[10];
-
-public:
- LogicSignal(pv::SigSession &session,
- std::shared_ptr<sigrok::Device> device,
- std::shared_ptr<sigrok::Channel> channel,
- std::shared_ptr<pv::data::Logic> data);
-
- virtual ~LogicSignal();
-
- std::shared_ptr<pv::data::SignalData> data() const;
-
- std::shared_ptr<pv::data::Logic> logic_data() const;
-
- /**
- * Computes the vertical extents of the contents of this row item.
- * @return A pair containing the minimum and maximum y-values.
- */
- std::pair<int, int> v_extents() const;
-
- /**
- * Paints the background layer of the signal with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal.
- * @param right the x-coordinate of the right edge of the signal.
- **/
- void paint_back(QPainter &p, int left, int right);
-
- /**
- * Paints the mid-layer of the signal with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal.
- * @param right the x-coordinate of the right edge of the signal.
- **/
- void paint_mid(QPainter &p, int left, int right);
-
-private:
- void paint_caps(QPainter &p, QLineF *const lines,
- std::vector< std::pair<int64_t, bool> > &edges,
- bool level, double samples_per_pixel, double pixels_offset,
- float x_offset, float y_offset);
-
- void init_trigger_actions(QWidget *parent);
-
- QAction* match_action(const sigrok::TriggerMatchType *match);
- const sigrok::TriggerMatchType *action_match(QAction *action);
- void populate_popup_form(QWidget *parent, QFormLayout *form);
- void modify_trigger();
-
-private Q_SLOTS:
- void on_trigger();
-
-private:
- std::shared_ptr<sigrok::Device> device_;
- std::shared_ptr<pv::data::Logic> data_;
-
- const sigrok::TriggerMatchType *trigger_match_;
- QToolBar *trigger_bar_;
- QAction *trigger_none_;
- QAction *trigger_rising_;
- QAction *trigger_high_;
- QAction *trigger_falling_;
- QAction *trigger_low_;
- QAction *trigger_change_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
+#define PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
+
+#include "signal.hpp"
+
+#include <memory>
+
+class QToolBar;
+
+namespace sigrok {
+ class Device;
+ class TriggerMatchType;
+}
+
+namespace pv {
+
+namespace data {
+class Logic;
+}
+
+namespace view {
+
+class LogicSignal : public Signal
+{
+ Q_OBJECT
+
+private:
+ static const int SignalHeight;
+ static const int SignalMargin;
+
+ static const float Oversampling;
+
+ static const QColor EdgeColour;
+ static const QColor HighColour;
+ static const QColor LowColour;
+
+ static const QColor SignalColours[10];
+
+public:
+ LogicSignal(pv::SigSession &session,
+ std::shared_ptr<sigrok::Device> device,
+ std::shared_ptr<sigrok::Channel> channel,
+ std::shared_ptr<pv::data::Logic> data);
+
+ virtual ~LogicSignal();
+
+ std::shared_ptr<pv::data::SignalData> data() const;
+
+ std::shared_ptr<pv::data::Logic> logic_data() const;
+
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
+ /**
+ * Paints the background layer of the signal with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal.
+ * @param right the x-coordinate of the right edge of the signal.
+ **/
+ void paint_back(QPainter &p, int left, int right);
+
+ /**
+ * Paints the mid-layer of the signal with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal.
+ * @param right the x-coordinate of the right edge of the signal.
+ **/
+ void paint_mid(QPainter &p, int left, int right);
+
+private:
+ void paint_caps(QPainter &p, QLineF *const lines,
+ std::vector< std::pair<int64_t, bool> > &edges,
+ bool level, double samples_per_pixel, double pixels_offset,
+ float x_offset, float y_offset);
+
+ void init_trigger_actions(QWidget *parent);
+
+ QAction* match_action(const sigrok::TriggerMatchType *match);
+ const sigrok::TriggerMatchType *action_match(QAction *action);
+ void populate_popup_form(QWidget *parent, QFormLayout *form);
+ void modify_trigger();
+
+private Q_SLOTS:
+ void on_trigger();
+
+private:
+ std::shared_ptr<sigrok::Device> device_;
+ std::shared_ptr<pv::data::Logic> data_;
+
+ const sigrok::TriggerMatchType *trigger_match_;
+ QToolBar *trigger_bar_;
+ QAction *trigger_none_;
+ QAction *trigger_rising_;
+ QAction *trigger_high_;
+ QAction *trigger_falling_;
+ QAction *trigger_low_;
+ QAction *trigger_change_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_LOGICSIGNAL_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "view.h"
+#include "view.hpp"
-#include "marginwidget.h"
+#include "marginwidget.hpp"
namespace pv {
namespace view {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_MARGINWIDGET_H
-#define PULSEVIEW_PV_MARGINWIDGET_H
-
-#include <QWidget>
-
-namespace pv {
-namespace view {
-
-class View;
-
-class MarginWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- MarginWidget(pv::view::View &parent);
-
-public Q_SLOTS:
- virtual void clear_selection();
-
-Q_SIGNALS:
- void selection_changed();
-
-protected:
- pv::view::View &view_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_MARGINWIDGET_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_MARGINWIDGET_H
+#define PULSEVIEW_PV_MARGINWIDGET_H
+
+#include <QWidget>
+
+namespace pv {
+namespace view {
+
+class View;
+
+class MarginWidget : public QWidget
+{
+ Q_OBJECT
+
+public:
+ MarginWidget(pv::view::View &parent);
+
+public Q_SLOTS:
+ virtual void clear_selection();
+
+Q_SIGNALS:
+ void selection_changed();
+
+protected:
+ pv::view::View &view_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_MARGINWIDGET_H
#include <assert.h>
-#include "view.h"
+#include "view.hpp"
-#include "rowitem.h"
+#include "rowitem.hpp"
namespace pv {
namespace view {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_HEADERITEM_H
-#define PULSEVIEW_PV_VIEW_HEADERITEM_H
-
-#include <memory>
-
-#include <QPropertyAnimation>
-
-#include "selectableitem.h"
-
-namespace pv {
-namespace view {
-
-class RowItemOwner;
-
-class RowItem : public SelectableItem,
- public std::enable_shared_from_this<pv::view::RowItem>
-{
- Q_OBJECT
- Q_PROPERTY(int visual_v_offset
- READ visual_v_offset
- WRITE set_visual_v_offset)
-
-public:
- /**
- * Constructor.
- */
- RowItem();
-
- /**
- * Returns true if the item is visible and enabled.
- */
- virtual bool enabled() const = 0;
-
- /**
- * Gets the vertical layout offset of this signal.
- */
- int layout_v_offset() const;
-
- /**
- * Sets the vertical layout offset of this signal.
- */
- void set_layout_v_offset(int v_offset);
-
- /**
- * Gets the vertical visual offset of this signal.
- */
- int visual_v_offset() const;
-
- /**
- * Sets the vertical visual offset of this signal.
- */
- void set_visual_v_offset(int v_offset);
-
- /**
- * Sets the visual and layout offset of this signal.
- */
- void force_to_v_offset(int v_offset);
-
- /**
- * Begins an animation that will animate the visual offset toward
- * the layout offset.
- */
- void animate_to_layout_v_offset();
-
- /**
- * Gets the owner this trace in the view trace hierachy.
- */
- pv::view::RowItemOwner* owner() const;
-
- /**
- * Sets the owner this trace in the view trace hierachy.
- * @param The new owner of the trace.
- */
- void set_owner(pv::view::RowItemOwner *owner);
-
- /**
- * Gets the visual y-offset of the axis.
- */
- int get_visual_y() const;
-
- /**
- * Gets the drag point of the row item.
- */
- QPoint point() const;
-
- /**
- * Computes the vertical extents of the contents of this row item.
- * @return A pair containing the minimum and maximum y-values.
- */
- virtual std::pair<int, int> v_extents() const = 0;
-
- /**
- * Paints the background layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal
- * @param right the x-coordinate of the right edge of the signal
- **/
- virtual void paint_back(QPainter &p, int left, int right);
-
- /**
- * Paints the mid-layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal
- * @param right the x-coordinate of the right edge of the signal
- **/
- virtual void paint_mid(QPainter &p, int left, int right);
-
- /**
- * Paints the foreground layer of the trace with a QPainter
- * @param p the QPainter to paint into.
- * @param left the x-coordinate of the left edge of the signal
- * @param right the x-coordinate of the right edge of the signal
- **/
- virtual void paint_fore(QPainter &p, int left, int right);
-
- /**
- * Paints the signal label.
- * @param p the QPainter to paint into.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @param hover true if the label is being hovered over by the mouse.
- */
- virtual void paint_label(QPainter &p, int right, bool hover) = 0;
-
- /**
- * Computes the outline rectangle of a label.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @return Returns the rectangle of the signal label.
- */
- virtual QRectF label_rect(int right) const = 0;
-
-public:
- virtual void hover_point_changed();
-
-protected:
- pv::view::RowItemOwner *owner_;
-
- int layout_v_offset_;
- int visual_v_offset_;
-
-private:
- QPropertyAnimation v_offset_animation_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_HEADERITEM_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_HEADERITEM_H
+#define PULSEVIEW_PV_VIEW_HEADERITEM_H
+
+#include <memory>
+
+#include <QPropertyAnimation>
+
+#include "selectableitem.hpp"
+
+namespace pv {
+namespace view {
+
+class RowItemOwner;
+
+class RowItem : public SelectableItem,
+ public std::enable_shared_from_this<pv::view::RowItem>
+{
+ Q_OBJECT
+ Q_PROPERTY(int visual_v_offset
+ READ visual_v_offset
+ WRITE set_visual_v_offset)
+
+public:
+ /**
+ * Constructor.
+ */
+ RowItem();
+
+ /**
+ * Returns true if the item is visible and enabled.
+ */
+ virtual bool enabled() const = 0;
+
+ /**
+ * Gets the vertical layout offset of this signal.
+ */
+ int layout_v_offset() const;
+
+ /**
+ * Sets the vertical layout offset of this signal.
+ */
+ void set_layout_v_offset(int v_offset);
+
+ /**
+ * Gets the vertical visual offset of this signal.
+ */
+ int visual_v_offset() const;
+
+ /**
+ * Sets the vertical visual offset of this signal.
+ */
+ void set_visual_v_offset(int v_offset);
+
+ /**
+ * Sets the visual and layout offset of this signal.
+ */
+ void force_to_v_offset(int v_offset);
+
+ /**
+ * Begins an animation that will animate the visual offset toward
+ * the layout offset.
+ */
+ void animate_to_layout_v_offset();
+
+ /**
+ * Gets the owner this trace in the view trace hierachy.
+ */
+ pv::view::RowItemOwner* owner() const;
+
+ /**
+ * Sets the owner this trace in the view trace hierachy.
+ * @param The new owner of the trace.
+ */
+ void set_owner(pv::view::RowItemOwner *owner);
+
+ /**
+ * Gets the visual y-offset of the axis.
+ */
+ int get_visual_y() const;
+
+ /**
+ * Gets the drag point of the row item.
+ */
+ QPoint point() const;
+
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ virtual std::pair<int, int> v_extents() const = 0;
+
+ /**
+ * Paints the background layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal
+ * @param right the x-coordinate of the right edge of the signal
+ **/
+ virtual void paint_back(QPainter &p, int left, int right);
+
+ /**
+ * Paints the mid-layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal
+ * @param right the x-coordinate of the right edge of the signal
+ **/
+ virtual void paint_mid(QPainter &p, int left, int right);
+
+ /**
+ * Paints the foreground layer of the trace with a QPainter
+ * @param p the QPainter to paint into.
+ * @param left the x-coordinate of the left edge of the signal
+ * @param right the x-coordinate of the right edge of the signal
+ **/
+ virtual void paint_fore(QPainter &p, int left, int right);
+
+ /**
+ * Paints the signal label.
+ * @param p the QPainter to paint into.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @param hover true if the label is being hovered over by the mouse.
+ */
+ virtual void paint_label(QPainter &p, int right, bool hover) = 0;
+
+ /**
+ * Computes the outline rectangle of a label.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @return Returns the rectangle of the signal label.
+ */
+ virtual QRectF label_rect(int right) const = 0;
+
+public:
+ virtual void hover_point_changed();
+
+protected:
+ pv::view::RowItemOwner *owner_;
+
+ int layout_v_offset_;
+ int visual_v_offset_;
+
+private:
+ QPropertyAnimation v_offset_animation_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_HEADERITEM_H
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
-#define PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
-
-#include <algorithm>
-#include <cassert>
-#include <iterator>
-#include <memory>
-#include <stack>
-#include <type_traits>
-#include <vector>
-
-#include <boost/thread.hpp>
-
-#include <pv/sigsession.h>
-
-namespace pv {
-namespace view {
-
-template<class Owner, class Item> class RowItemIterator
-{
-public:
- typedef typename std::conditional<std::is_const<Owner>::value,
- typename Owner::item_list::const_iterator,
- typename Owner::item_list::iterator>::type child_iterator;
-
- typedef std::shared_ptr<Item> value_type;
- typedef ptrdiff_t difference_type;
- typedef value_type pointer;
- typedef value_type& reference;
- typedef std::forward_iterator_tag iterator_category;
-
-public:
- RowItemIterator(Owner *owner) :
- owner_(owner),
- lock_(owner->session().signals_mutex()) {}
-
- RowItemIterator(Owner *owner, child_iterator iter) :
- owner_(owner),
- lock_(owner->session().signals_mutex()) {
- assert(owner);
- if (iter != owner->child_items().end())
- iter_stack_.push(iter);
- }
-
- RowItemIterator(const RowItemIterator<Owner, Item> &o) :
- owner_(o.owner_),
- lock_(*o.lock_.mutex()),
- iter_stack_(o.iter_stack_) {}
-
- reference operator*() const {
- return *iter_stack_.top();
- }
-
- reference operator->() const {
- return *this;
- }
-
- RowItemIterator<Owner, Item>& operator++() {
- using std::dynamic_pointer_cast;
- using std::shared_ptr;
-
- assert(owner_);
- assert(!iter_stack_.empty());
-
- shared_ptr<Owner> owner(dynamic_pointer_cast<Owner>(
- *iter_stack_.top()));
- if (owner && !owner->child_items().empty()) {
- owner_ = owner.get();
- iter_stack_.push(owner->child_items().begin());
- } else {
- ++iter_stack_.top();
- while (owner_ && iter_stack_.top() ==
- owner_->child_items().end()) {
- iter_stack_.pop();
- owner_ = iter_stack_.empty() ? nullptr :
- (*iter_stack_.top()++)->owner();
- }
- }
-
- return *this;
- }
-
- RowItemIterator<Owner, Item> operator++(int) {
- RowItemIterator<Owner, Item> pre = *this;
- ++*this;
- return pre;
- }
-
- bool operator==(const RowItemIterator &o) const {
- return (iter_stack_.empty() && o.iter_stack_.empty()) ||
- (owner_ == o.owner_ &&
- iter_stack_.size() == o.iter_stack_.size() &&
- std::equal(
- owner_->child_items().cbegin(),
- owner_->child_items().cend(),
- o.owner_->child_items().cbegin()));
- }
-
- bool operator!=(const RowItemIterator &o) const {
- return !((const RowItemIterator&)*this == o);
- }
-
- void swap(RowItemIterator<Owner, Item>& other) {
- swap(owner_, other.owner_);
- swap(iter_stack_, other.iter_stack_);
- }
-
-private:
- Owner *owner_;
- boost::shared_lock<boost::shared_mutex> lock_;
- std::stack<child_iterator> iter_stack_;
-};
-
-template<class Owner, class Item>
-void swap(RowItemIterator<Owner, Item>& a, RowItemIterator<Owner, Item>& b)
-{
- a.swap(b);
-}
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
+#define PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
+
+#include <algorithm>
+#include <cassert>
+#include <iterator>
+#include <memory>
+#include <stack>
+#include <type_traits>
+#include <vector>
+
+#include <boost/thread.hpp>
+
+#include <pv/sigsession.hpp>
+
+namespace pv {
+namespace view {
+
+template<class Owner, class Item> class RowItemIterator
+{
+public:
+ typedef typename std::conditional<std::is_const<Owner>::value,
+ typename Owner::item_list::const_iterator,
+ typename Owner::item_list::iterator>::type child_iterator;
+
+ typedef std::shared_ptr<Item> value_type;
+ typedef ptrdiff_t difference_type;
+ typedef value_type pointer;
+ typedef value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
+
+public:
+ RowItemIterator(Owner *owner) :
+ owner_(owner),
+ lock_(owner->session().signals_mutex()) {}
+
+ RowItemIterator(Owner *owner, child_iterator iter) :
+ owner_(owner),
+ lock_(owner->session().signals_mutex()) {
+ assert(owner);
+ if (iter != owner->child_items().end())
+ iter_stack_.push(iter);
+ }
+
+ RowItemIterator(const RowItemIterator<Owner, Item> &o) :
+ owner_(o.owner_),
+ lock_(*o.lock_.mutex()),
+ iter_stack_(o.iter_stack_) {}
+
+ reference operator*() const {
+ return *iter_stack_.top();
+ }
+
+ reference operator->() const {
+ return *this;
+ }
+
+ RowItemIterator<Owner, Item>& operator++() {
+ using std::dynamic_pointer_cast;
+ using std::shared_ptr;
+
+ assert(owner_);
+ assert(!iter_stack_.empty());
+
+ shared_ptr<Owner> owner(dynamic_pointer_cast<Owner>(
+ *iter_stack_.top()));
+ if (owner && !owner->child_items().empty()) {
+ owner_ = owner.get();
+ iter_stack_.push(owner->child_items().begin());
+ } else {
+ ++iter_stack_.top();
+ while (owner_ && iter_stack_.top() ==
+ owner_->child_items().end()) {
+ iter_stack_.pop();
+ owner_ = iter_stack_.empty() ? nullptr :
+ (*iter_stack_.top()++)->owner();
+ }
+ }
+
+ return *this;
+ }
+
+ RowItemIterator<Owner, Item> operator++(int) {
+ RowItemIterator<Owner, Item> pre = *this;
+ ++*this;
+ return pre;
+ }
+
+ bool operator==(const RowItemIterator &o) const {
+ return (iter_stack_.empty() && o.iter_stack_.empty()) ||
+ (owner_ == o.owner_ &&
+ iter_stack_.size() == o.iter_stack_.size() &&
+ std::equal(
+ owner_->child_items().cbegin(),
+ owner_->child_items().cend(),
+ o.owner_->child_items().cbegin()));
+ }
+
+ bool operator!=(const RowItemIterator &o) const {
+ return !((const RowItemIterator&)*this == o);
+ }
+
+ void swap(RowItemIterator<Owner, Item>& other) {
+ swap(owner_, other.owner_);
+ swap(iter_stack_, other.iter_stack_);
+ }
+
+private:
+ Owner *owner_;
+ boost::shared_lock<boost::shared_mutex> lock_;
+ std::stack<child_iterator> iter_stack_;
+};
+
+template<class Owner, class Item>
+void swap(RowItemIterator<Owner, Item>& a, RowItemIterator<Owner, Item>& b)
+{
+ a.swap(b);
+}
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_ROWITEMITERATOR_H
#include <cassert>
-#include "rowitem.h"
-#include "rowitemowner.h"
+#include "rowitem.hpp"
+#include "rowitemowner.hpp"
using std::max;
using std::make_pair;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
-#define PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
-
-#include <memory>
-#include <vector>
-
-#include "rowitemiterator.h"
-
-namespace pv {
-
-class SigSession;
-
-namespace view {
-
-class RowItem;
-class View;
-
-class RowItemOwner
-{
-public:
- typedef std::vector< std::shared_ptr<RowItem> > item_list;
- typedef RowItemIterator<RowItemOwner, RowItem> iterator;
- typedef RowItemIterator<const RowItemOwner, RowItem> const_iterator;
-
-public:
- /**
- * Returns the session of the onwer.
- */
- virtual pv::SigSession& session() = 0;
-
- /**
- * Returns the session of the owner.
- */
- virtual const pv::SigSession& session() const = 0;
-
- /**
- * Returns the view of the owner.
- */
- virtual pv::view::View* view() = 0;
-
- /**
- * Returns the view of the owner.
- */
- virtual const pv::view::View* view() const = 0;
-
- virtual int owner_visual_v_offset() const = 0;
-
- /**
- * Returns the number of nested parents that this row item owner has.
- */
- virtual unsigned int depth() const = 0;
-
- /**
- * Returns a list of row items owned by this object.
- */
- virtual item_list& child_items();
-
- /**
- * Returns a list of row items owned by this object.
- */
- virtual const item_list& child_items() const;
-
- /**
- * Clears the list of child items.
- */
- void clear_child_items();
-
- /**
- * Adds a child item to this object.
- */
- void add_child_item(std::shared_ptr<RowItem> item);
-
- /**
- * Removes a child item from this object.
- */
- void remove_child_item(std::shared_ptr<RowItem> item);
-
- /**
- * Returns a depth-first iterator at the beginning of the child RowItem
- * tree.
- */
- iterator begin();
-
- /**
- * Returns a depth-first iterator at the end of the child RowItem tree.
- */
- iterator end();
-
- /**
- * Returns a constant depth-first iterator at the beginning of the
- * child RowItem tree.
- */
- const_iterator begin() const;
-
- /**
- * Returns a constant depth-first iterator at the end of the child
- * RowItem tree.
- */
- const_iterator end() const;
-
- /**
- * Computes the vertical extents of the contents of this row item owner.
- * @return A pair containing the minimum and maximum y-values.
- */
- std::pair<int, int> v_extents() const;
-
- virtual void restack_items();
-
-public:
- virtual void appearance_changed(bool label, bool content) = 0;
-
- virtual void extents_changed(bool horz, bool vert) = 0;
-
-private:
- item_list items_;
-};
-
-} // view
-} // pv
-
-#endif // PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2014 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
+#define PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
+
+#include <memory>
+#include <vector>
+
+#include "rowitemiterator.hpp"
+
+namespace pv {
+
+class SigSession;
+
+namespace view {
+
+class RowItem;
+class View;
+
+class RowItemOwner
+{
+public:
+ typedef std::vector< std::shared_ptr<RowItem> > item_list;
+ typedef RowItemIterator<RowItemOwner, RowItem> iterator;
+ typedef RowItemIterator<const RowItemOwner, RowItem> const_iterator;
+
+public:
+ /**
+ * Returns the session of the onwer.
+ */
+ virtual pv::SigSession& session() = 0;
+
+ /**
+ * Returns the session of the owner.
+ */
+ virtual const pv::SigSession& session() const = 0;
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual pv::view::View* view() = 0;
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual const pv::view::View* view() const = 0;
+
+ virtual int owner_visual_v_offset() const = 0;
+
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ virtual unsigned int depth() const = 0;
+
+ /**
+ * Returns a list of row items owned by this object.
+ */
+ virtual item_list& child_items();
+
+ /**
+ * Returns a list of row items owned by this object.
+ */
+ virtual const item_list& child_items() const;
+
+ /**
+ * Clears the list of child items.
+ */
+ void clear_child_items();
+
+ /**
+ * Adds a child item to this object.
+ */
+ void add_child_item(std::shared_ptr<RowItem> item);
+
+ /**
+ * Removes a child item from this object.
+ */
+ void remove_child_item(std::shared_ptr<RowItem> item);
+
+ /**
+ * Returns a depth-first iterator at the beginning of the child RowItem
+ * tree.
+ */
+ iterator begin();
+
+ /**
+ * Returns a depth-first iterator at the end of the child RowItem tree.
+ */
+ iterator end();
+
+ /**
+ * Returns a constant depth-first iterator at the beginning of the
+ * child RowItem tree.
+ */
+ const_iterator begin() const;
+
+ /**
+ * Returns a constant depth-first iterator at the end of the child
+ * RowItem tree.
+ */
+ const_iterator end() const;
+
+ /**
+ * Computes the vertical extents of the contents of this row item owner.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
+ virtual void restack_items();
+
+public:
+ virtual void appearance_changed(bool label, bool content) = 0;
+
+ virtual void extents_changed(bool horz, bool vert) = 0;
+
+private:
+ item_list items_;
+};
+
+} // view
+} // pv
+
+#endif // PULSEVIEW_PV_VIEW_ROWITEMOWNER_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "ruler.h"
+#include "ruler.hpp"
-#include "view.h"
-#include "pv/util.h"
+#include "view.hpp"
+#include "pv/util.hpp"
#include <extdef.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_RULER_H
-#define PULSEVIEW_PV_VIEW_RULER_H
-
-#include <memory>
-
-#include "marginwidget.h"
-
-namespace pv {
-namespace view {
-
-class Ruler : public MarginWidget
-{
- Q_OBJECT
-
-private:
- static const int RulerHeight;
- static const int MinorTickSubdivision;
- static const int ScaleUnits[3];
-
- static const int HoverArrowSize;
-
-public:
- Ruler(View &parent);
-
- /**
- * Find a tick spacing and number formatting that does not cause
- * the values to collide.
- * @param p A QPainter used to determine the needed space for the values.
- * @param scale A pv::view::View's scale.
- * @param offset A pv::view::View's offset.
- *
- * @return The tick period to use in 'first' and the prefix in 'second'.
- */
- static std::pair<double, unsigned int> calculate_tick_spacing(
- QPainter& p, double scale, double offset);
-
-public:
- QSize sizeHint() const;
-
-private:
- void paintEvent(QPaintEvent *event);
-
-private:
- /**
- * Draw a hover arrow under the cursor position.
- */
- void draw_hover_mark(QPainter &p);
-
-private Q_SLOTS:
- void hover_point_changed();
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_RULER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_RULER_H
+#define PULSEVIEW_PV_VIEW_RULER_H
+
+#include <memory>
+
+#include "marginwidget.hpp"
+
+namespace pv {
+namespace view {
+
+class Ruler : public MarginWidget
+{
+ Q_OBJECT
+
+private:
+ static const int RulerHeight;
+ static const int MinorTickSubdivision;
+ static const int ScaleUnits[3];
+
+ static const int HoverArrowSize;
+
+public:
+ Ruler(View &parent);
+
+ /**
+ * Find a tick spacing and number formatting that does not cause
+ * the values to collide.
+ * @param p A QPainter used to determine the needed space for the values.
+ * @param scale A pv::view::View's scale.
+ * @param offset A pv::view::View's offset.
+ *
+ * @return The tick period to use in 'first' and the prefix in 'second'.
+ */
+ static std::pair<double, unsigned int> calculate_tick_spacing(
+ QPainter& p, double scale, double offset);
+
+public:
+ QSize sizeHint() const;
+
+private:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ /**
+ * Draw a hover arrow under the cursor position.
+ */
+ void draw_hover_mark(QPainter &p);
+
+private Q_SLOTS:
+ void hover_point_changed();
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_RULER_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "selectableitem.h"
+#include "selectableitem.hpp"
#include <climits>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_SELECTABLEITEM_H
-#define PULSEVIEW_PV_SELECTABLEITEM_H
-
-#include <list>
-
-#include <QPen>
-
-class QAction;
-class QMenu;
-class QWidget;
-
-namespace pv {
-
-namespace widgets {
-class Popup;
-}
-
-namespace view {
-
-class SelectableItem : public QObject
-{
- Q_OBJECT
-
-private:
- static const int HighlightRadius;
-
-public:
- SelectableItem();
-
-public:
- /**
- * Returns true if the item has been selected by the user.
- */
- bool selected() const;
-
- /**
- * Selects or deselects the signal.
- */
- void select(bool select = true);
-
- /**
- * Returns true if the item is being dragged.
- */
- bool dragging() const;
-
- /**
- * Retunrns the current drag point.
- */
- QPoint drag_point() const;
-
- /**
- * Sets this item into the dragged state.
- */
- void drag();
-
- /**
- * Sets this item into the un-dragged state.
- */
- void drag_release();
-
- /**
- * Get the drag point.
- */
- virtual QPoint point() const = 0;
-
-public:
- virtual QMenu* create_context_menu(QWidget *parent);
-
- virtual pv::widgets::Popup* create_popup(QWidget *parent) = 0;
-
- virtual void delete_pressed();
-
-protected:
- static QPen highlight_pen();
-
-protected:
- QWidget *context_parent_;
-
-private:
- bool selected_;
- QPoint drag_point_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_SELECTABLEITEM_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_SELECTABLEITEM_H
+#define PULSEVIEW_PV_SELECTABLEITEM_H
+
+#include <list>
+
+#include <QPen>
+
+class QAction;
+class QMenu;
+class QWidget;
+
+namespace pv {
+
+namespace widgets {
+class Popup;
+}
+
+namespace view {
+
+class SelectableItem : public QObject
+{
+ Q_OBJECT
+
+private:
+ static const int HighlightRadius;
+
+public:
+ SelectableItem();
+
+public:
+ /**
+ * Returns true if the item has been selected by the user.
+ */
+ bool selected() const;
+
+ /**
+ * Selects or deselects the signal.
+ */
+ void select(bool select = true);
+
+ /**
+ * Returns true if the item is being dragged.
+ */
+ bool dragging() const;
+
+ /**
+ * Retunrns the current drag point.
+ */
+ QPoint drag_point() const;
+
+ /**
+ * Sets this item into the dragged state.
+ */
+ void drag();
+
+ /**
+ * Sets this item into the un-dragged state.
+ */
+ void drag_release();
+
+ /**
+ * Get the drag point.
+ */
+ virtual QPoint point() const = 0;
+
+public:
+ virtual QMenu* create_context_menu(QWidget *parent);
+
+ virtual pv::widgets::Popup* create_popup(QWidget *parent) = 0;
+
+ virtual void delete_pressed();
+
+protected:
+ static QPen highlight_pen();
+
+protected:
+ QWidget *context_parent_;
+
+private:
+ bool selected_;
+ QPoint drag_point_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_SELECTABLEITEM_H
#include <libsigrok/libsigrok.hpp>
-#include "signal.h"
-#include "view.h"
+#include "signal.hpp"
+#include "view.hpp"
using std::shared_ptr;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_SIGNAL_H
-#define PULSEVIEW_PV_VIEW_SIGNAL_H
-
-#include <memory>
-
-#include <QComboBox>
-#include <QWidgetAction>
-
-#include <stdint.h>
-
-#include "trace.h"
-
-namespace sigrok {
- class Channel;
-}
-
-namespace pv {
-
-class SigSession;
-
-namespace data {
-class SignalData;
-}
-
-namespace view {
-
-class Signal : public Trace
-{
- Q_OBJECT
-
-protected:
- Signal(pv::SigSession &session,
- std::shared_ptr<sigrok::Channel> channel);
-
-public:
- /**
- * Sets the name of the signal.
- */
- void set_name(QString name);
-
- virtual std::shared_ptr<pv::data::SignalData> data() const = 0;
-
- /**
- * Returns true if the trace is visible and enabled.
- */
- bool enabled() const;
-
- void enable(bool enable = true);
-
- std::shared_ptr<sigrok::Channel> channel() const;
-
- virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
-
- QMenu* create_context_menu(QWidget *parent);
-
- void delete_pressed();
-
-private Q_SLOTS:
- void on_disable();
-
-protected:
- pv::SigSession &session_;
- std::shared_ptr<sigrok::Channel> channel_;
-
- QComboBox *name_widget_;
- bool updating_name_widget_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_SIGNAL_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_SIGNAL_H
+#define PULSEVIEW_PV_VIEW_SIGNAL_H
+
+#include <memory>
+
+#include <QComboBox>
+#include <QWidgetAction>
+
+#include <stdint.h>
+
+#include "trace.hpp"
+
+namespace sigrok {
+ class Channel;
+}
+
+namespace pv {
+
+class SigSession;
+
+namespace data {
+class SignalData;
+}
+
+namespace view {
+
+class Signal : public Trace
+{
+ Q_OBJECT
+
+protected:
+ Signal(pv::SigSession &session,
+ std::shared_ptr<sigrok::Channel> channel);
+
+public:
+ /**
+ * Sets the name of the signal.
+ */
+ void set_name(QString name);
+
+ virtual std::shared_ptr<pv::data::SignalData> data() const = 0;
+
+ /**
+ * Returns true if the trace is visible and enabled.
+ */
+ bool enabled() const;
+
+ void enable(bool enable = true);
+
+ std::shared_ptr<sigrok::Channel> channel() const;
+
+ virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
+
+ QMenu* create_context_menu(QWidget *parent);
+
+ void delete_pressed();
+
+private Q_SLOTS:
+ void on_disable();
+
+protected:
+ pv::SigSession &session_;
+ std::shared_ptr<sigrok::Channel> channel_;
+
+ QComboBox *name_widget_;
+ bool updating_name_widget_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_SIGNAL_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "timemarker.h"
+#include "timemarker.hpp"
-#include "view.h"
+#include "view.hpp"
#include <QFormLayout>
#include <QPainter>
-#include <pv/widgets/popup.h>
+#include <pv/widgets/popup.hpp>
namespace pv {
namespace view {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_MARKER_H
-#define PULSEVIEW_PV_VIEW_MARKER_H
-
-#include <QColor>
-#include <QDoubleSpinBox>
-#include <QObject>
-#include <QRectF>
-#include <QWidgetAction>
-
-#include "selectableitem.h"
-
-class QPainter;
-class QRect;
-
-namespace pv {
-namespace view {
-
-class View;
-
-class TimeMarker : public SelectableItem
-{
- Q_OBJECT
-
-protected:
- /**
- * Constructor.
- * @param view A reference to the view that owns this marker.
- * @param colour A reference to the colour of this cursor.
- * @param time The time to set the flag to.
- */
- TimeMarker(View &view, const QColor &colour, double time);
-
-public:
- /**
- * Gets the time of the marker.
- */
- double time() const;
-
- /**
- * Sets the time of the marker.
- */
- void set_time(double time);
-
- float get_x() const;
-
- /**
- * Gets the drag point of the row item.
- */
- QPoint point() const;
-
- /**
- * Paints the marker to the viewport.
- * @param p The painter to draw with.
- * @param rect The rectangle of the viewport client area.
- */
- virtual void paint(QPainter &p, const QRect &rect);
-
- /**
- * Gets the marker label rectangle.
- * @param rect The rectangle of the ruler client area.
- * @return Returns the label rectangle.
- */
- virtual QRectF get_label_rect(const QRect &rect) const = 0;
-
- /**
- * Paints the marker's label to the ruler.
- * @param p The painter to draw with.
- * @param rect The rectangle of the ruler client area.
- * @param prefix The SI prefix to paint time value with.
- */
- virtual void paint_label(QPainter &p, const QRect &rect,
- unsigned int prefix) = 0;
-
- pv::widgets::Popup* create_popup(QWidget *parent);
-
-private Q_SLOTS:
- void on_value_changed(double value);
-
-Q_SIGNALS:
- void time_changed();
-
-protected:
- View &view_;
- const QColor &colour_;
-
- double time_;
-
- QSizeF text_size_;
-
- QWidgetAction *value_action_;
- QDoubleSpinBox *value_widget_;
- bool updating_value_widget_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_MARKER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_MARKER_H
+#define PULSEVIEW_PV_VIEW_MARKER_H
+
+#include <QColor>
+#include <QDoubleSpinBox>
+#include <QObject>
+#include <QRectF>
+#include <QWidgetAction>
+
+#include "selectableitem.hpp"
+
+class QPainter;
+class QRect;
+
+namespace pv {
+namespace view {
+
+class View;
+
+class TimeMarker : public SelectableItem
+{
+ Q_OBJECT
+
+protected:
+ /**
+ * Constructor.
+ * @param view A reference to the view that owns this marker.
+ * @param colour A reference to the colour of this cursor.
+ * @param time The time to set the flag to.
+ */
+ TimeMarker(View &view, const QColor &colour, double time);
+
+public:
+ /**
+ * Gets the time of the marker.
+ */
+ double time() const;
+
+ /**
+ * Sets the time of the marker.
+ */
+ void set_time(double time);
+
+ float get_x() const;
+
+ /**
+ * Gets the drag point of the row item.
+ */
+ QPoint point() const;
+
+ /**
+ * Paints the marker to the viewport.
+ * @param p The painter to draw with.
+ * @param rect The rectangle of the viewport client area.
+ */
+ virtual void paint(QPainter &p, const QRect &rect);
+
+ /**
+ * Gets the marker label rectangle.
+ * @param rect The rectangle of the ruler client area.
+ * @return Returns the label rectangle.
+ */
+ virtual QRectF get_label_rect(const QRect &rect) const = 0;
+
+ /**
+ * Paints the marker's label to the ruler.
+ * @param p The painter to draw with.
+ * @param rect The rectangle of the ruler client area.
+ * @param prefix The SI prefix to paint time value with.
+ */
+ virtual void paint_label(QPainter &p, const QRect &rect,
+ unsigned int prefix) = 0;
+
+ pv::widgets::Popup* create_popup(QWidget *parent);
+
+private Q_SLOTS:
+ void on_value_changed(double value);
+
+Q_SIGNALS:
+ void time_changed();
+
+protected:
+ View &view_;
+ const QColor &colour_;
+
+ double time_;
+
+ QSizeF text_size_;
+
+ QWidgetAction *value_action_;
+ QDoubleSpinBox *value_widget_;
+ bool updating_value_widget_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_MARKER_H
#include <QKeyEvent>
#include <QLineEdit>
-#include "trace.h"
-#include "tracepalette.h"
-#include "view.h"
+#include "trace.hpp"
+#include "tracepalette.hpp"
+#include "view.hpp"
-#include <pv/widgets/colourbutton.h>
-#include <pv/widgets/popup.h>
+#include <pv/widgets/colourbutton.hpp>
+#include <pv/widgets/popup.hpp>
namespace pv {
namespace view {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_TRACE_H
-#define PULSEVIEW_PV_VIEW_TRACE_H
-
-#include <QColor>
-#include <QPainter>
-#include <QPen>
-#include <QRect>
-#include <QString>
-
-#include <stdint.h>
-
-#include "rowitem.h"
-
-class QFormLayout;
-
-namespace pv {
-
-namespace widgets {
-class Popup;
-}
-
-namespace view {
-
-class Trace : public RowItem
-{
- Q_OBJECT
-
-private:
- static const QPen AxisPen;
- static const int LabelHitPadding;
-
-protected:
- Trace(QString name);
-
-public:
- /**
- * Gets the name of this signal.
- */
- QString name() const;
-
- /**
- * Sets the name of the signal.
- */
- virtual void set_name(QString name);
-
- /**
- * Get the colour of the signal.
- */
- QColor colour() const;
-
- /**
- * Set the colour of the signal.
- */
- void set_colour(QColor colour);
-
- /**
- * Paints the signal label.
- * @param p the QPainter to paint into.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @param hover true if the label is being hovered over by the mouse.
- */
- virtual void paint_label(QPainter &p, int right, bool hover);
-
- virtual QMenu* create_context_menu(QWidget *parent);
-
- pv::widgets::Popup* create_popup(QWidget *parent);
-
- /**
- * Computes the outline rectangle of a label.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @return Returns the rectangle of the signal label.
- */
- QRectF label_rect(int right) const;
-
-protected:
-
- /**
- * Gets the text colour.
- * @remarks This colour is computed by comparing the lightness
- * of the trace colour against a threshold to determine whether
- * white or black would be more visible.
- */
- QColor get_text_colour() const;
-
- /**
- * Paints a zero axis across the viewport.
- * @param p the QPainter to paint into.
- * @param y the y-offset of the axis.
- * @param left the x-coordinate of the left edge of the view.
- * @param right the x-coordinate of the right edge of the view.
- */
- void paint_axis(QPainter &p, int y, int left, int right);
-
- void add_colour_option(QWidget *parent, QFormLayout *form);
-
- void create_popup_form();
-
- virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
-
-private Q_SLOTS:
- void on_text_changed(const QString &text);
-
- void on_colour_changed(const QColor &colour);
-
- void on_popup_closed();
-
-protected:
- QString name_;
- QColor colour_;
-
-private:
- pv::widgets::Popup *popup_;
- QFormLayout *popup_form_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_TRACE_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_TRACE_H
+#define PULSEVIEW_PV_VIEW_TRACE_H
+
+#include <QColor>
+#include <QPainter>
+#include <QPen>
+#include <QRect>
+#include <QString>
+
+#include <stdint.h>
+
+#include "rowitem.hpp"
+
+class QFormLayout;
+
+namespace pv {
+
+namespace widgets {
+class Popup;
+}
+
+namespace view {
+
+class Trace : public RowItem
+{
+ Q_OBJECT
+
+private:
+ static const QPen AxisPen;
+ static const int LabelHitPadding;
+
+protected:
+ Trace(QString name);
+
+public:
+ /**
+ * Gets the name of this signal.
+ */
+ QString name() const;
+
+ /**
+ * Sets the name of the signal.
+ */
+ virtual void set_name(QString name);
+
+ /**
+ * Get the colour of the signal.
+ */
+ QColor colour() const;
+
+ /**
+ * Set the colour of the signal.
+ */
+ void set_colour(QColor colour);
+
+ /**
+ * Paints the signal label.
+ * @param p the QPainter to paint into.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @param hover true if the label is being hovered over by the mouse.
+ */
+ virtual void paint_label(QPainter &p, int right, bool hover);
+
+ virtual QMenu* create_context_menu(QWidget *parent);
+
+ pv::widgets::Popup* create_popup(QWidget *parent);
+
+ /**
+ * Computes the outline rectangle of a label.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @return Returns the rectangle of the signal label.
+ */
+ QRectF label_rect(int right) const;
+
+protected:
+
+ /**
+ * Gets the text colour.
+ * @remarks This colour is computed by comparing the lightness
+ * of the trace colour against a threshold to determine whether
+ * white or black would be more visible.
+ */
+ QColor get_text_colour() const;
+
+ /**
+ * Paints a zero axis across the viewport.
+ * @param p the QPainter to paint into.
+ * @param y the y-offset of the axis.
+ * @param left the x-coordinate of the left edge of the view.
+ * @param right the x-coordinate of the right edge of the view.
+ */
+ void paint_axis(QPainter &p, int y, int left, int right);
+
+ void add_colour_option(QWidget *parent, QFormLayout *form);
+
+ void create_popup_form();
+
+ virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
+
+private Q_SLOTS:
+ void on_text_changed(const QString &text);
+
+ void on_colour_changed(const QColor &colour);
+
+ void on_popup_closed();
+
+protected:
+ QString name_;
+ QColor colour_;
+
+private:
+ pv::widgets::Popup *popup_;
+ QFormLayout *popup_form_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_TRACE_H
#include <QMenu>
#include <QPainter>
-#include "tracegroup.h"
+#include "tracegroup.hpp"
using std::pair;
using std::shared_ptr;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_TRACEGROUP_H
-#define PULSEVIEW_PV_VIEW_TRACEGROUP_H
-
-#include "rowitem.h"
-#include "rowitemowner.h"
-
-namespace pv {
-namespace view {
-
-class TraceGroup : public RowItem, public RowItemOwner
-{
- Q_OBJECT
-
-private:
- static const int Padding;
- static const int Width;
- static const int LineThickness;
- static const QColor LineColour;
-
-public:
- /**
- * Virtual destructor
- */
- virtual ~TraceGroup();
-
- /**
- * Returns true if the item is visible and enabled.
- */
- bool enabled() const;
-
- /**
- * Returns the session of the onwer.
- */
- pv::SigSession& session();
-
- /**
- * Returns the session of the onwer.
- */
- const pv::SigSession& session() const;
-
- /**
- * Returns the view of the owner.
- */
- virtual pv::view::View* view();
-
- /**
- * Returns the view of the owner.
- */
- virtual const pv::view::View* view() const;
-
- /**
- * Computes the vertical extents of the contents of this row item.
- * @return A pair containing the minimum and maximum y-values.
- */
- std::pair<int, int> v_extents() const;
-
- /**
- * Paints the signal label.
- * @param p the QPainter to paint into.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @param hover true if the label is being hovered over by the mouse.
- */
- void paint_label(QPainter &p, int right, bool hover);
-
- /**
- * Computes the outline rectangle of a label.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @return Returns the rectangle of the signal label.
- */
- QRectF label_rect(int right) const;
-
- /**
- * Determines if a point is in the header label rect.
- * @param left the x-coordinate of the left edge of the header
- * area.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @param point the point to test.
- */
- bool pt_in_label_rect(int left, int right, const QPoint &point);
-
- QMenu* create_context_menu(QWidget *parent);
-
- pv::widgets::Popup* create_popup(QWidget *parent);
-
- /**
- * Returns the total vertical offset of this trace and all it's owners
- */
- int owner_visual_v_offset() const;
-
- void restack_items();
-
- /**
- * Returns the number of nested parents that this row item owner has.
- */
- unsigned int depth() const;
-
- void ungroup();
-
-public:
- void appearance_changed(bool label, bool content);
-
- void extents_changed(bool horz, bool vert);
-
-private Q_SLOTS:
- void on_ungroup();
-};
-
-} // view
-} // pv
-
-#endif // PULSEVIEW_PV_VIEW_TRACEGROUP_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_TRACEGROUP_H
+#define PULSEVIEW_PV_VIEW_TRACEGROUP_H
+
+#include "rowitem.hpp"
+#include "rowitemowner.hpp"
+
+namespace pv {
+namespace view {
+
+class TraceGroup : public RowItem, public RowItemOwner
+{
+ Q_OBJECT
+
+private:
+ static const int Padding;
+ static const int Width;
+ static const int LineThickness;
+ static const QColor LineColour;
+
+public:
+ /**
+ * Virtual destructor
+ */
+ virtual ~TraceGroup();
+
+ /**
+ * Returns true if the item is visible and enabled.
+ */
+ bool enabled() const;
+
+ /**
+ * Returns the session of the onwer.
+ */
+ pv::SigSession& session();
+
+ /**
+ * Returns the session of the onwer.
+ */
+ const pv::SigSession& session() const;
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual pv::view::View* view();
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual const pv::view::View* view() const;
+
+ /**
+ * Computes the vertical extents of the contents of this row item.
+ * @return A pair containing the minimum and maximum y-values.
+ */
+ std::pair<int, int> v_extents() const;
+
+ /**
+ * Paints the signal label.
+ * @param p the QPainter to paint into.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @param hover true if the label is being hovered over by the mouse.
+ */
+ void paint_label(QPainter &p, int right, bool hover);
+
+ /**
+ * Computes the outline rectangle of a label.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @return Returns the rectangle of the signal label.
+ */
+ QRectF label_rect(int right) const;
+
+ /**
+ * Determines if a point is in the header label rect.
+ * @param left the x-coordinate of the left edge of the header
+ * area.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @param point the point to test.
+ */
+ bool pt_in_label_rect(int left, int right, const QPoint &point);
+
+ QMenu* create_context_menu(QWidget *parent);
+
+ pv::widgets::Popup* create_popup(QWidget *parent);
+
+ /**
+ * Returns the total vertical offset of this trace and all it's owners
+ */
+ int owner_visual_v_offset() const;
+
+ void restack_items();
+
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ unsigned int depth() const;
+
+ void ungroup();
+
+public:
+ void appearance_changed(bool label, bool content);
+
+ void extents_changed(bool horz, bool vert);
+
+private Q_SLOTS:
+ void on_ungroup();
+};
+
+} // view
+} // pv
+
+#endif // PULSEVIEW_PV_VIEW_TRACEGROUP_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "tracepalette.h"
+#include "tracepalette.hpp"
namespace pv {
namespace view {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_TRACEPALETTE_H
-#define PULSEVIEW_PV_TRACEPALETTE_H
-
-#include <QColor>
-
-namespace pv {
-namespace view {
-
-class TracePalette
-{
-public:
- static const unsigned int Cols = 8;
- static const unsigned int Rows = 4;
- static const QColor Colours[Cols * Rows];
-};
-
-
-} // view
-} // pv
-
-#endif // PULSEVIEW_PV_VIEW_TRACEPALETTE_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_TRACEPALETTE_H
+#define PULSEVIEW_PV_TRACEPALETTE_H
+
+#include <QColor>
+
+namespace pv {
+namespace view {
+
+class TracePalette
+{
+public:
+ static const unsigned int Cols = 8;
+ static const unsigned int Rows = 4;
+ static const QColor Colours[Cols * Rows];
+};
+
+
+} // view
+} // pv
+
+#endif // PULSEVIEW_PV_VIEW_TRACEPALETTE_H
#include <libsigrok/libsigrok.hpp>
-#include "cursorheader.h"
-#include "decodetrace.h"
-#include "header.h"
-#include "logicsignal.h"
-#include "ruler.h"
-#include "signal.h"
-#include "tracegroup.h"
-#include "view.h"
-#include "viewport.h"
-
-#include "pv/sigsession.h"
-#include "pv/data/logic.h"
-#include "pv/data/logicsnapshot.h"
+#include "cursorheader.hpp"
+#include "decodetrace.hpp"
+#include "header.hpp"
+#include "logicsignal.hpp"
+#include "ruler.hpp"
+#include "signal.hpp"
+#include "tracegroup.hpp"
+#include "view.hpp"
+#include "viewport.hpp"
+
+#include "pv/sigsession.hpp"
+#include "pv/data/logic.hpp"
+#include "pv/data/logicsnapshot.hpp"
using boost::shared_lock;
using boost::shared_mutex;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_VIEW_H
-#define PULSEVIEW_PV_VIEW_VIEW_H
-
-#include <stdint.h>
-
-#include <memory>
-#include <set>
-#include <unordered_map>
-#include <vector>
-
-#include <QAbstractScrollArea>
-#include <QSizeF>
-#include <QTimer>
-
-#include <pv/data/signaldata.h>
-
-#include "cursorpair.h"
-#include "rowitemowner.h"
-
-namespace pv {
-
-class SigSession;
-
-namespace view {
-
-class CursorHeader;
-class Header;
-class Ruler;
-class Viewport;
-
-class View : public QAbstractScrollArea, public RowItemOwner {
- Q_OBJECT
-
-private:
- enum StickyEvents {
- SelectableItemHExtentsChanged = 1,
- SelectableItemVExtentsChanged = 2
- };
-
-private:
- static const double MaxScale;
- static const double MinScale;
-
- static const int MaxScrollValue;
-
-public:
- static const QColor CursorAreaColour;
-
- static const QSizeF LabelPadding;
-
-public:
- explicit View(SigSession &session, QWidget *parent = 0);
-
- SigSession& session();
- const SigSession& session() const;
-
- /**
- * Returns the view of the owner.
- */
- virtual pv::view::View* view();
-
- /**
- * Returns the view of the owner.
- */
- virtual const pv::view::View* view() const;
-
- Viewport* viewport();
-
- const Viewport* viewport() const;
-
- /**
- * Returns the view time scale in seconds per pixel.
- */
- double scale() const;
-
- /**
- * Returns the time offset of the left edge of the view in
- * seconds.
- */
- double offset() const;
- int owner_visual_v_offset() const;
-
- /**
- * Returns the number of nested parents that this row item owner has.
- */
- unsigned int depth() const;
-
- void zoom(double steps);
- void zoom(double steps, int offset);
-
- void zoom_fit();
-
- void zoom_one_to_one();
-
- /**
- * Sets the scale and offset.
- * @param scale The new view scale in seconds per pixel.
- * @param offset The view time offset in seconds.
- */
- void set_scale_offset(double scale, double offset);
-
- std::set< std::shared_ptr<pv::data::SignalData> >
- get_visible_data() const;
-
- std::pair<double, double> get_time_extents() const;
-
- /**
- * Returns true if cursors are displayed. false otherwise.
- */
- bool cursors_shown() const;
-
- /**
- * Shows or hides the cursors.
- */
- void show_cursors(bool show = true);
-
- /**
- * Moves the cursors to a convenient position in the view.
- */
- void centre_cursors();
-
- /**
- * Returns a reference to the pair of cursors.
- */
- CursorPair& cursors();
-
- /**
- * Returns a reference to the pair of cursors.
- */
- const CursorPair& cursors() const;
-
- const QPoint& hover_point() const;
-
- void update_viewport();
-
- void restack_all_row_items();
-
-Q_SIGNALS:
- void hover_point_changed();
-
- void signals_moved();
-
- void selection_changed();
-
- void scale_offset_changed();
-
-private:
- void get_scroll_layout(double &length, double &offset) const;
-
- /**
- * Simultaneously sets the zoom and offset.
- * @param scale The scale to set the view to in seconds per pixel. This
- * value is clamped between MinScale and MaxScale.
- * @param offset The offset of the left edge of the view in seconds.
- */
- void set_zoom(double scale, int offset);
-
- void update_scroll();
-
- void update_layout();
-
- /**
- * Satisifies RowItem functionality.
- * @param p the QPainter to paint into.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @param hover true if the label is being hovered over by the mouse.
- */
- void paint_label(QPainter &p, int right, bool hover);
-
- /**
- * Computes the outline rectangle of a label.
- * @param right the x-coordinate of the right edge of the header
- * area.
- * @return Returns the rectangle of the signal label.
- */
- QRectF label_rect(int right);
-
- static bool add_channels_to_owner(
- const std::vector< std::shared_ptr<sigrok::Channel> > &channels,
- RowItemOwner *owner, int &offset,
- std::unordered_map<std::shared_ptr<sigrok::Channel>,
- std::shared_ptr<Signal> > &signal_map,
- std::function<bool (std::shared_ptr<RowItem>)> filter_func =
- std::function<bool (std::shared_ptr<RowItem>)>());
-
- static void apply_offset(
- std::shared_ptr<RowItem> row_item, int &offset);
-
-private:
- bool eventFilter(QObject *object, QEvent *event);
-
- bool viewportEvent(QEvent *e);
-
- void resizeEvent(QResizeEvent *e);
-
-public:
- void appearance_changed(bool label, bool content);
-
- void extents_changed(bool horz, bool vert);
-
-private Q_SLOTS:
-
- void h_scroll_value_changed(int value);
- void v_scroll_value_changed(int value);
-
- void signals_changed();
- void data_updated();
-
- void marker_time_changed();
-
- void on_signals_moved();
-
- void process_sticky_events();
-
- void on_hover_point_changed();
-
-private:
- SigSession &session_;
-
- Viewport *viewport_;
- Ruler *ruler_;
- CursorHeader *cursorheader_;
- Header *header_;
-
- /// The view time scale in seconds per pixel.
- double scale_;
-
- /// The view time offset in seconds.
- double offset_;
-
- int v_offset_;
- bool updating_scroll_;
-
- bool show_cursors_;
- CursorPair cursors_;
-
- QPoint hover_point_;
-
- unsigned int sticky_events_;
- QTimer lazy_event_handler_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_VIEW_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_VIEW_H
+#define PULSEVIEW_PV_VIEW_VIEW_H
+
+#include <stdint.h>
+
+#include <memory>
+#include <set>
+#include <unordered_map>
+#include <vector>
+
+#include <QAbstractScrollArea>
+#include <QSizeF>
+#include <QTimer>
+
+#include <pv/data/signaldata.hpp>
+
+#include "cursorpair.hpp"
+#include "rowitemowner.hpp"
+
+namespace pv {
+
+class SigSession;
+
+namespace view {
+
+class CursorHeader;
+class Header;
+class Ruler;
+class Viewport;
+
+class View : public QAbstractScrollArea, public RowItemOwner {
+ Q_OBJECT
+
+private:
+ enum StickyEvents {
+ SelectableItemHExtentsChanged = 1,
+ SelectableItemVExtentsChanged = 2
+ };
+
+private:
+ static const double MaxScale;
+ static const double MinScale;
+
+ static const int MaxScrollValue;
+
+public:
+ static const QColor CursorAreaColour;
+
+ static const QSizeF LabelPadding;
+
+public:
+ explicit View(SigSession &session, QWidget *parent = 0);
+
+ SigSession& session();
+ const SigSession& session() const;
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual pv::view::View* view();
+
+ /**
+ * Returns the view of the owner.
+ */
+ virtual const pv::view::View* view() const;
+
+ Viewport* viewport();
+
+ const Viewport* viewport() const;
+
+ /**
+ * Returns the view time scale in seconds per pixel.
+ */
+ double scale() const;
+
+ /**
+ * Returns the time offset of the left edge of the view in
+ * seconds.
+ */
+ double offset() const;
+ int owner_visual_v_offset() const;
+
+ /**
+ * Returns the number of nested parents that this row item owner has.
+ */
+ unsigned int depth() const;
+
+ void zoom(double steps);
+ void zoom(double steps, int offset);
+
+ void zoom_fit();
+
+ void zoom_one_to_one();
+
+ /**
+ * Sets the scale and offset.
+ * @param scale The new view scale in seconds per pixel.
+ * @param offset The view time offset in seconds.
+ */
+ void set_scale_offset(double scale, double offset);
+
+ std::set< std::shared_ptr<pv::data::SignalData> >
+ get_visible_data() const;
+
+ std::pair<double, double> get_time_extents() const;
+
+ /**
+ * Returns true if cursors are displayed. false otherwise.
+ */
+ bool cursors_shown() const;
+
+ /**
+ * Shows or hides the cursors.
+ */
+ void show_cursors(bool show = true);
+
+ /**
+ * Moves the cursors to a convenient position in the view.
+ */
+ void centre_cursors();
+
+ /**
+ * Returns a reference to the pair of cursors.
+ */
+ CursorPair& cursors();
+
+ /**
+ * Returns a reference to the pair of cursors.
+ */
+ const CursorPair& cursors() const;
+
+ const QPoint& hover_point() const;
+
+ void update_viewport();
+
+ void restack_all_row_items();
+
+Q_SIGNALS:
+ void hover_point_changed();
+
+ void signals_moved();
+
+ void selection_changed();
+
+ void scale_offset_changed();
+
+private:
+ void get_scroll_layout(double &length, double &offset) const;
+
+ /**
+ * Simultaneously sets the zoom and offset.
+ * @param scale The scale to set the view to in seconds per pixel. This
+ * value is clamped between MinScale and MaxScale.
+ * @param offset The offset of the left edge of the view in seconds.
+ */
+ void set_zoom(double scale, int offset);
+
+ void update_scroll();
+
+ void update_layout();
+
+ /**
+ * Satisifies RowItem functionality.
+ * @param p the QPainter to paint into.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @param hover true if the label is being hovered over by the mouse.
+ */
+ void paint_label(QPainter &p, int right, bool hover);
+
+ /**
+ * Computes the outline rectangle of a label.
+ * @param right the x-coordinate of the right edge of the header
+ * area.
+ * @return Returns the rectangle of the signal label.
+ */
+ QRectF label_rect(int right);
+
+ static bool add_channels_to_owner(
+ const std::vector< std::shared_ptr<sigrok::Channel> > &channels,
+ RowItemOwner *owner, int &offset,
+ std::unordered_map<std::shared_ptr<sigrok::Channel>,
+ std::shared_ptr<Signal> > &signal_map,
+ std::function<bool (std::shared_ptr<RowItem>)> filter_func =
+ std::function<bool (std::shared_ptr<RowItem>)>());
+
+ static void apply_offset(
+ std::shared_ptr<RowItem> row_item, int &offset);
+
+private:
+ bool eventFilter(QObject *object, QEvent *event);
+
+ bool viewportEvent(QEvent *e);
+
+ void resizeEvent(QResizeEvent *e);
+
+public:
+ void appearance_changed(bool label, bool content);
+
+ void extents_changed(bool horz, bool vert);
+
+private Q_SLOTS:
+
+ void h_scroll_value_changed(int value);
+ void v_scroll_value_changed(int value);
+
+ void signals_changed();
+ void data_updated();
+
+ void marker_time_changed();
+
+ void on_signals_moved();
+
+ void process_sticky_events();
+
+ void on_hover_point_changed();
+
+private:
+ SigSession &session_;
+
+ Viewport *viewport_;
+ Ruler *ruler_;
+ CursorHeader *cursorheader_;
+ Header *header_;
+
+ /// The view time scale in seconds per pixel.
+ double scale_;
+
+ /// The view time offset in seconds.
+ double offset_;
+
+ int v_offset_;
+ bool updating_scroll_;
+
+ bool show_cursors_;
+ CursorPair cursors_;
+
+ QPoint hover_point_;
+
+ unsigned int sticky_events_;
+ QTimer lazy_event_handler_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_VIEW_H
#include <cmath>
#include <algorithm>
-#include "view.h"
-#include "viewport.h"
+#include "signal.hpp"
+#include "view.hpp"
+#include "viewport.hpp"
-#include "signal.h"
-#include "../sigsession.h"
+#include <pv/sigsession.hpp>
#include <QMouseEvent>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_VIEW_VIEWPORT_H
-#define PULSEVIEW_PV_VIEW_VIEWPORT_H
-
-#include <QTimer>
-#include <QWidget>
-#include <QTouchEvent>
-
-class QPainter;
-class QPaintEvent;
-class SigSession;
-
-namespace pv {
-namespace view {
-
-class View;
-
-class Viewport : public QWidget
-{
- Q_OBJECT
-
-public:
- explicit Viewport(View &parent);
-
-protected:
- void paintEvent(QPaintEvent *event);
-
-private:
- bool event(QEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mouseDoubleClickEvent(QMouseEvent * event);
- void wheelEvent(QWheelEvent *event);
- bool touchEvent(QTouchEvent *e);
-
-private Q_SLOTS:
- void on_signals_moved();
-
-private:
- View &view_;
-
- QPoint mouse_down_point_;
- double mouse_down_offset_;
- bool mouse_down_valid_;
-
- double pinch_offset0_;
- double pinch_offset1_;
- bool pinch_zoom_active_;
-};
-
-} // namespace view
-} // namespace pv
-
-#endif // PULSEVIEW_PV_VIEW_VIEWPORT_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_VIEW_VIEWPORT_H
+#define PULSEVIEW_PV_VIEW_VIEWPORT_H
+
+#include <QTimer>
+#include <QWidget>
+#include <QTouchEvent>
+
+class QPainter;
+class QPaintEvent;
+class SigSession;
+
+namespace pv {
+namespace view {
+
+class View;
+
+class Viewport : public QWidget
+{
+ Q_OBJECT
+
+public:
+ explicit Viewport(View &parent);
+
+protected:
+ void paintEvent(QPaintEvent *event);
+
+private:
+ bool event(QEvent *event);
+ void mousePressEvent(QMouseEvent *event);
+ void mouseReleaseEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+ void mouseDoubleClickEvent(QMouseEvent * event);
+ void wheelEvent(QWheelEvent *event);
+ bool touchEvent(QTouchEvent *e);
+
+private Q_SLOTS:
+ void on_signals_moved();
+
+private:
+ View &view_;
+
+ QPoint mouse_down_point_;
+ double mouse_down_offset_;
+ bool mouse_down_valid_;
+
+ double pinch_offset0_;
+ double pinch_offset1_;
+ bool pinch_zoom_active_;
+};
+
+} // namespace view
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEW_VIEWPORT_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "colourbutton.h"
+#include "colourbutton.hpp"
#include <assert.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
-#define PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
-
-#include <QPushButton>
-
-#include "colourpopup.h"
-
-namespace pv {
-namespace widgets {
-
-class ColourButton : public QPushButton
-{
- Q_OBJECT;
-
-private:
- static const int SwatchMargin;
-
-public:
- ColourButton(int rows, int cols, QWidget *parent);
-
- ColourPopup& popup();
-
- const QColor& colour() const;
-
- void set_colour(QColor colour);
-
- void set_palette(const QColor *const palette);
-
-private:
- void paintEvent(QPaintEvent *e);
-
-private Q_SLOTS:
- void on_clicked(bool);
-
- void on_selected(int row, int col);
-
-Q_SIGNALS:
- void selected(const QColor &colour);
-
-private:
- ColourPopup popup_;
- QColor cur_colour_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
+#define PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
+
+#include <QPushButton>
+
+#include "colourpopup.hpp"
+
+namespace pv {
+namespace widgets {
+
+class ColourButton : public QPushButton
+{
+ Q_OBJECT;
+
+private:
+ static const int SwatchMargin;
+
+public:
+ ColourButton(int rows, int cols, QWidget *parent);
+
+ ColourPopup& popup();
+
+ const QColor& colour() const;
+
+ void set_colour(QColor colour);
+
+ void set_palette(const QColor *const palette);
+
+private:
+ void paintEvent(QPaintEvent *e);
+
+private Q_SLOTS:
+ void on_clicked(bool);
+
+ void on_selected(int row, int col);
+
+Q_SIGNALS:
+ void selected(const QColor &colour);
+
+private:
+ ColourPopup popup_;
+ QColor cur_colour_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_COLOURBUTTON_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "colourpopup.h"
+#include "colourpopup.hpp"
namespace pv {
namespace widgets {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
-#define PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
-
-#include "popup.h"
-#include "wellarray.h"
-
-#include <QVBoxLayout>
-
-namespace pv {
-namespace widgets {
-
-class ColourPopup : public Popup
-{
- Q_OBJECT
-
-public:
- ColourPopup(int rows, int cols, QWidget *partent);
-
- QWellArray& well_array();
-
-Q_SIGNALS:
- void selected(int row, int col);
-
-private Q_SLOTS:
- void colour_selected(int, int);
-
-private:
- QWellArray well_array_;
- QVBoxLayout layout_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
+#define PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
+
+#include "popup.hpp"
+#include "wellarray.hpp"
+
+#include <QVBoxLayout>
+
+namespace pv {
+namespace widgets {
+
+class ColourPopup : public Popup
+{
+ Q_OBJECT
+
+public:
+ ColourPopup(int rows, int cols, QWidget *partent);
+
+ QWellArray& well_array();
+
+Q_SIGNALS:
+ void selected(int row, int col);
+
+private Q_SLOTS:
+ void colour_selected(int, int);
+
+private:
+ QWellArray well_array_;
+ QVBoxLayout layout_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_COLOURPOPUP_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "decodergroupbox.h"
+#include "decodergroupbox.hpp"
#include <QHBoxLayout>
#include <QLabel>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
-#define PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
-
-#include <QPushButton>
-
-class QGridLayout;
-class QToolBar;
-
-namespace pv {
-namespace widgets {
-
-class DecoderGroupBox : public QWidget
-{
- Q_OBJECT
-
-public:
- DecoderGroupBox(QString title, QWidget *parent = NULL);
-
- void add_layout(QLayout *layout);
-
- void set_decoder_visible(bool visible);
-
-Q_SIGNALS:
- void delete_decoder();
-
- void show_hide_decoder();
-
-private:
- QGridLayout *const layout_;
- QPushButton show_hide_button_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
+#define PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
+
+#include <QPushButton>
+
+class QGridLayout;
+class QToolBar;
+
+namespace pv {
+namespace widgets {
+
+class DecoderGroupBox : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DecoderGroupBox(QString title, QWidget *parent = NULL);
+
+ void add_layout(QLayout *layout);
+
+ void set_decoder_visible(bool visible);
+
+Q_SIGNALS:
+ void delete_decoder();
+
+ void show_hide_decoder();
+
+private:
+ QGridLayout *const layout_;
+ QPushButton show_hide_button_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
#include <libsigrokdecode/libsigrokdecode.h>
-#include "decodermenu.h"
+#include "decodermenu.hpp"
namespace pv {
namespace widgets {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_DECODERMENU_H
-#define PULSEVIEW_PV_WIDGETS_DECODERMENU_H
-
-#include <QMenu>
-#include <QSignalMapper>
-
-struct srd_decoder;
-
-namespace pv {
-namespace widgets {
-
-class DecoderMenu : public QMenu
-{
- Q_OBJECT;
-
-public:
- DecoderMenu(QWidget *parent, bool first_level_decoder = false);
-
-private:
- static int decoder_name_cmp(const void *a, const void *b);
-
-
-private Q_SLOTS:
- void on_action(QObject *action);
-
-Q_SIGNALS:
- void decoder_selected(srd_decoder *decoder);
-
-private:
- QSignalMapper mapper_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_DECODERMENU_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_DECODERMENU_H
+#define PULSEVIEW_PV_WIDGETS_DECODERMENU_H
+
+#include <QMenu>
+#include <QSignalMapper>
+
+struct srd_decoder;
+
+namespace pv {
+namespace widgets {
+
+class DecoderMenu : public QMenu
+{
+ Q_OBJECT;
+
+public:
+ DecoderMenu(QWidget *parent, bool first_level_decoder = false);
+
+private:
+ static int decoder_name_cmp(const void *a, const void *b);
+
+
+private Q_SLOTS:
+ void on_action(QObject *action);
+
+Q_SIGNALS:
+ void decoder_selected(srd_decoder *decoder);
+
+private:
+ QSignalMapper mapper_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_DECODERMENU_H
#include <QDesktopWidget>
#include <QLineEdit>
-#include "popup.h"
+#include "popup.hpp"
using std::max;
using std::min;
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_POPUP_H
-#define PULSEVIEW_PV_WIDGETS_POPUP_H
-
-#include <QWidget>
-
-namespace pv {
-namespace widgets {
-
-class Popup : public QWidget
-{
- Q_OBJECT
-
-public:
- enum Position
- {
- Right,
- Top,
- Left,
- Bottom
- };
-
-private:
- static const unsigned int ArrowLength;
- static const unsigned int ArrowOverlap;
- static const unsigned int MarginWidth;
-
-public:
- Popup(QWidget *parent);
-
- const QPoint& point() const;
- Position position() const;
-
- void set_position(const QPoint point, Position pos);
-
- bool eventFilter(QObject *obj, QEvent *evt);
-
- void show();
-
-private:
- bool space_for_arrow() const;
-
- QPolygon arrow_polygon() const;
-
- QRegion arrow_region() const;
-
- QRect bubble_rect() const;
-
- QRegion bubble_region() const;
-
- QRegion popup_region() const;
-
- void reposition_widget();
-
-private:
- void closeEvent(QCloseEvent*);
-
- void paintEvent(QPaintEvent*);
-
- void resizeEvent(QResizeEvent*);
-
- void mouseReleaseEvent(QMouseEvent *e);
-
-protected:
- void showEvent(QShowEvent *e);
-
-Q_SIGNALS:
- void closed();
-
-private:
- QPoint point_;
- Position pos_;
-};
-
-} // namespace widgets
-} // namespace pv
-
-#endif // PULSEVIEW_PV_WIDGETS_POPUP_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_POPUP_H
+#define PULSEVIEW_PV_WIDGETS_POPUP_H
+
+#include <QWidget>
+
+namespace pv {
+namespace widgets {
+
+class Popup : public QWidget
+{
+ Q_OBJECT
+
+public:
+ enum Position
+ {
+ Right,
+ Top,
+ Left,
+ Bottom
+ };
+
+private:
+ static const unsigned int ArrowLength;
+ static const unsigned int ArrowOverlap;
+ static const unsigned int MarginWidth;
+
+public:
+ Popup(QWidget *parent);
+
+ const QPoint& point() const;
+ Position position() const;
+
+ void set_position(const QPoint point, Position pos);
+
+ bool eventFilter(QObject *obj, QEvent *evt);
+
+ void show();
+
+private:
+ bool space_for_arrow() const;
+
+ QPolygon arrow_polygon() const;
+
+ QRegion arrow_region() const;
+
+ QRect bubble_rect() const;
+
+ QRegion bubble_region() const;
+
+ QRegion popup_region() const;
+
+ void reposition_widget();
+
+private:
+ void closeEvent(QCloseEvent*);
+
+ void paintEvent(QPaintEvent*);
+
+ void resizeEvent(QResizeEvent*);
+
+ void mouseReleaseEvent(QMouseEvent *e);
+
+protected:
+ void showEvent(QShowEvent *e);
+
+Q_SIGNALS:
+ void closed();
+
+private:
+ QPoint point_;
+ Position pos_;
+};
+
+} // namespace widgets
+} // namespace pv
+
+#endif // PULSEVIEW_PV_WIDGETS_POPUP_H
#include <assert.h>
-#include "popuptoolbutton.h"
+#include "popuptoolbutton.hpp"
namespace pv {
namespace widgets {
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
-#define PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
-
-#include "popup.h"
-
-#include <QToolButton>
-
-namespace pv {
-namespace widgets {
-
-class PopupToolButton : public QToolButton
-{
- Q_OBJECT;
-
-public:
- PopupToolButton(QWidget *parent);
-
- Popup* popup() const;
-
- void set_popup(Popup *popup);
-
-private Q_SLOTS:
- void on_clicked(bool);
-
-private:
- Popup *popup_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
+#define PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
+
+#include "popup.hpp"
+
+#include <QToolButton>
+
+namespace pv {
+namespace widgets {
+
+class PopupToolButton : public QToolButton
+{
+ Q_OBJECT;
+
+public:
+ PopupToolButton(QWidget *parent);
+
+ Popup* popup() const;
+
+ void set_popup(Popup *popup);
+
+private Q_SLOTS:
+ void on_clicked(bool);
+
+private:
+ Popup *popup_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_POPUPTOOLBUTTON_H
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "sweeptimingwidget.h"
+#include "sweeptimingwidget.hpp"
#include <cstdlib>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
-#define PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
-
-#include <libsigrok/libsigrok.h>
-
-#include <QComboBox>
-#include <QDoubleSpinBox>
-#include <QHBoxLayout>
-#include <QLineEdit>
-#include <QWidget>
-
-namespace pv {
-namespace widgets {
-
-class SweepTimingWidget : public QWidget
-{
- Q_OBJECT
-
-private:
- enum ValueType
- {
- None,
- MinMaxStep,
- List
- };
-
-public:
- SweepTimingWidget(const char *suffix, QWidget *parent = NULL);
-
- void show_none();
- void show_min_max_step(uint64_t min, uint64_t max, uint64_t step);
- void show_list(const uint64_t *vals, size_t count);
- void show_125_list(uint64_t min, uint64_t max);
-
- uint64_t value() const;
- void set_value(uint64_t value);
-
-Q_SIGNALS:
- void value_changed();
-
-private:
- const char *const suffix_;
-
- QHBoxLayout layout_;
-
- QDoubleSpinBox value_;
- QComboBox list_;
-
- ValueType value_type_;
-};
-
-} // widgets
-} // pv
-
-#endif // PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
+#define PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
+
+#include <libsigrok/libsigrok.h>
+
+#include <QComboBox>
+#include <QDoubleSpinBox>
+#include <QHBoxLayout>
+#include <QLineEdit>
+#include <QWidget>
+
+namespace pv {
+namespace widgets {
+
+class SweepTimingWidget : public QWidget
+{
+ Q_OBJECT
+
+private:
+ enum ValueType
+ {
+ None,
+ MinMaxStep,
+ List
+ };
+
+public:
+ SweepTimingWidget(const char *suffix, QWidget *parent = NULL);
+
+ void show_none();
+ void show_min_max_step(uint64_t min, uint64_t max, uint64_t step);
+ void show_list(const uint64_t *vals, size_t count);
+ void show_125_list(uint64_t min, uint64_t max);
+
+ uint64_t value() const;
+ void set_value(uint64_t value);
+
+Q_SIGNALS:
+ void value_changed();
+
+private:
+ const char *const suffix_;
+
+ QHBoxLayout layout_;
+
+ QDoubleSpinBox value_;
+ QComboBox list_;
+
+ ValueType value_type_;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_SWEEPTIMINGWIDGET_H
#include <QStyle>
#include <QStyleOptionFrame>
-#include "wellarray.h"
+#include "wellarray.hpp"
void QWellArray::paintEvent(QPaintEvent *e)
{
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QWidget>
-
-struct QWellArrayData;
-
-class QWellArray : public QWidget
-{
- Q_OBJECT
- Q_PROPERTY(int selectedColumn READ selectedColumn)
- Q_PROPERTY(int selectedRow READ selectedRow)
-
-public:
- QWellArray(int rows, int cols, QWidget* parent=0);
- QString cellContent(int row, int col) const;
-
- int selectedColumn() const { return selCol; }
- int selectedRow() const { return selRow; }
-
- virtual void setCurrent(int row, int col);
- virtual void setSelected(int row, int col);
-
- QSize sizeHint() const;
-
- virtual void setCellBrush(int row, int col, const QBrush &);
- QBrush cellBrush(int row, int col);
-
- inline int cellWidth() const
- { return cellw; }
-
- inline int cellHeight() const
- { return cellh; }
-
- inline int rowAt(int y) const
- { return y / cellh; }
-
- inline int columnAt(int x) const
- { if (isRightToLeft()) return ncols - (x / cellw) - 1; return x / cellw; }
-
- inline int rowY(int row) const
- { return cellh * row; }
-
- inline int columnX(int column) const
- { if (isRightToLeft()) return cellw * (ncols - column - 1); return cellw * column; }
-
- inline int numRows() const
- { return nrows; }
-
- inline int numCols() const
- {return ncols; }
-
- inline QRect cellRect() const
- { return QRect(0, 0, cellw, cellh); }
-
- inline QSize gridSize() const
- { return QSize(ncols * cellw, nrows * cellh); }
-
- QRect cellGeometry(int row, int column)
- {
- QRect r;
- if (row >= 0 && row < nrows && column >= 0 && column < ncols)
- r.setRect(columnX(column), rowY(row), cellw, cellh);
- return r;
- }
-
- inline void updateCell(int row, int column) { update(cellGeometry(row, column)); }
-
-Q_SIGNALS:
- void selected(int row, int col);
-
-protected:
- virtual void paintCell(QPainter *, int row, int col, const QRect&);
- virtual void paintCellContents(QPainter *, int row, int col, const QRect&);
-
- void mousePressEvent(QMouseEvent*);
- void mouseReleaseEvent(QMouseEvent*);
- void keyPressEvent(QKeyEvent*);
- void focusInEvent(QFocusEvent*);
- void focusOutEvent(QFocusEvent*);
- void paintEvent(QPaintEvent *);
-
-private:
- Q_DISABLE_COPY(QWellArray)
-
- int nrows;
- int ncols;
- int cellw;
- int cellh;
- int curRow;
- int curCol;
- int selRow;
- int selCol;
- QWellArrayData *d;
-};
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QWidget>
+
+struct QWellArrayData;
+
+class QWellArray : public QWidget
+{
+ Q_OBJECT
+ Q_PROPERTY(int selectedColumn READ selectedColumn)
+ Q_PROPERTY(int selectedRow READ selectedRow)
+
+public:
+ QWellArray(int rows, int cols, QWidget* parent=0);
+ QString cellContent(int row, int col) const;
+
+ int selectedColumn() const { return selCol; }
+ int selectedRow() const { return selRow; }
+
+ virtual void setCurrent(int row, int col);
+ virtual void setSelected(int row, int col);
+
+ QSize sizeHint() const;
+
+ virtual void setCellBrush(int row, int col, const QBrush &);
+ QBrush cellBrush(int row, int col);
+
+ inline int cellWidth() const
+ { return cellw; }
+
+ inline int cellHeight() const
+ { return cellh; }
+
+ inline int rowAt(int y) const
+ { return y / cellh; }
+
+ inline int columnAt(int x) const
+ { if (isRightToLeft()) return ncols - (x / cellw) - 1; return x / cellw; }
+
+ inline int rowY(int row) const
+ { return cellh * row; }
+
+ inline int columnX(int column) const
+ { if (isRightToLeft()) return cellw * (ncols - column - 1); return cellw * column; }
+
+ inline int numRows() const
+ { return nrows; }
+
+ inline int numCols() const
+ {return ncols; }
+
+ inline QRect cellRect() const
+ { return QRect(0, 0, cellw, cellh); }
+
+ inline QSize gridSize() const
+ { return QSize(ncols * cellw, nrows * cellh); }
+
+ QRect cellGeometry(int row, int column)
+ {
+ QRect r;
+ if (row >= 0 && row < nrows && column >= 0 && column < ncols)
+ r.setRect(columnX(column), rowY(row), cellw, cellh);
+ return r;
+ }
+
+ inline void updateCell(int row, int column) { update(cellGeometry(row, column)); }
+
+Q_SIGNALS:
+ void selected(int row, int col);
+
+protected:
+ virtual void paintCell(QPainter *, int row, int col, const QRect&);
+ virtual void paintCellContents(QPainter *, int row, int col, const QRect&);
+
+ void mousePressEvent(QMouseEvent*);
+ void mouseReleaseEvent(QMouseEvent*);
+ void keyPressEvent(QKeyEvent*);
+ void focusInEvent(QFocusEvent*);
+ void focusOutEvent(QFocusEvent*);
+ void paintEvent(QPaintEvent *);
+
+private:
+ Q_DISABLE_COPY(QWellArray)
+
+ int nrows;
+ int ncols;
+ int cellw;
+ int cellh;
+ int curRow;
+ int curCol;
+ int selRow;
+ int selCol;
+ QWellArrayData *d;
+};
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "signalhandler.h"
+#include "signalhandler.hpp"
#include <assert.h>
#include <signal.h>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2013 Adam Reichold
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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
- */
-
-#ifndef SIGNALHANDLER_H
-#define SIGNALHANDLER_H
-
-#include <QObject>
-
-class QSocketNotifier;
-
-class SignalHandler : public QObject
-{
- Q_OBJECT
-
-public:
- static bool prepare_signals();
-
-public:
- explicit SignalHandler(QObject* parent = NULL);
-
-Q_SIGNALS:
- void int_received();
- void term_received();
-
-private Q_SLOTS:
- void on_socket_notifier_activated();
-
-private:
- static void handle_signals(int sig_number);
-
-private:
- QSocketNotifier* socket_notifier_;
-
-private:
- static int sockets_[2];
-};
-
-#endif // SIGNALHANDLER_H
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 Adam Reichold
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
+ */
+
+#ifndef SIGNALHANDLER_H
+#define SIGNALHANDLER_H
+
+#include <QObject>
+
+class QSocketNotifier;
+
+class SignalHandler : public QObject
+{
+ Q_OBJECT
+
+public:
+ static bool prepare_signals();
+
+public:
+ explicit SignalHandler(QObject* parent = NULL);
+
+Q_SIGNALS:
+ void int_received();
+ void term_received();
+
+private Q_SLOTS:
+ void on_socket_notifier_activated();
+
+private:
+ static void handle_signals(int sig_number);
+
+private:
+ QSocketNotifier* socket_notifier_;
+
+private:
+ static int sockets_[2];
+};
+
+#endif // SIGNALHANDLER_H
# This list includes only QObject derived class headers.
set(pulseview_TEST_HEADERS
- ${PROJECT_SOURCE_DIR}/pv/sigsession.h
- ${PROJECT_SOURCE_DIR}/pv/prop/double.h
- ${PROJECT_SOURCE_DIR}/pv/prop/enum.h
- ${PROJECT_SOURCE_DIR}/pv/prop/int.h
- ${PROJECT_SOURCE_DIR}/pv/prop/property.h
- ${PROJECT_SOURCE_DIR}/pv/prop/string.h
- ${PROJECT_SOURCE_DIR}/pv/prop/binding/deviceoptions.h
- ${PROJECT_SOURCE_DIR}/pv/view/cursor.h
- ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.h
- ${PROJECT_SOURCE_DIR}/pv/view/header.h
- ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.h
- ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.h
- ${PROJECT_SOURCE_DIR}/pv/view/ruler.h
- ${PROJECT_SOURCE_DIR}/pv/view/selectableitem.h
- ${PROJECT_SOURCE_DIR}/pv/view/signal.h
- ${PROJECT_SOURCE_DIR}/pv/view/timemarker.h
- ${PROJECT_SOURCE_DIR}/pv/view/trace.h
- ${PROJECT_SOURCE_DIR}/pv/view/view.h
- ${PROJECT_SOURCE_DIR}/pv/view/viewport.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/popup.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.h
+ ${PROJECT_SOURCE_DIR}/pv/sigsession.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/double.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/enum.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/int.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/property.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/string.hpp
+ ${PROJECT_SOURCE_DIR}/pv/prop/binding/deviceoptions.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/cursor.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/cursorheader.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/header.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/logicsignal.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/marginwidget.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/ruler.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/selectableitem.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/signal.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/timemarker.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/trace.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/view.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/viewport.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/popup.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.hpp
)
if(ENABLE_DECODE)
)
list(APPEND pulseview_TEST_HEADERS
- ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.h
- ${PROJECT_SOURCE_DIR}/pv/view/decodetrace.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.h
- ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.h
+ ${PROJECT_SOURCE_DIR}/pv/data/decoderstack.hpp
+ ${PROJECT_SOURCE_DIR}/pv/view/decodetrace.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.hpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.hpp
)
endif()
#include <boost/test/unit_test.hpp>
-#include "../../pv/data/analogsnapshot.h"
+#include <pv/data/analogsnapshot.hpp>
using pv::data::AnalogSnapshot;
#include <boost/test/unit_test.hpp>
-#include "../../pv/data/logicsnapshot.h"
+#include <pv/data/logicsnapshot.hpp>
using pv::data::LogicSnapshot;
using std::vector;