From 99a2a18a68c163c93c7a0acbc958732ac0c9a0d4 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 11 Jul 2023 16:58:35 +0800 Subject: [PATCH 1/7] Remove the base class SelectableItem --- CMakeLists.txt | 2 - .../{pv/view/selectableitem.cpp => basedef.h} | 51 ++++---------- DSView/pv/view/selectableitem.h | 70 ------------------- DSView/pv/view/trace.cpp | 15 +--- DSView/pv/view/trace.h | 19 +++-- 5 files changed, 30 insertions(+), 127 deletions(-) rename DSView/{pv/view/selectableitem.cpp => basedef.h} (53%) delete mode 100644 DSView/pv/view/selectableitem.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b99341147..0b9dffd16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,7 +277,6 @@ set(DSView_SOURCES DSView/pv/view/dsldial.cpp DSView/pv/dock/dsotriggerdock.cpp DSView/pv/view/trace.cpp - DSView/pv/view/selectableitem.cpp DSView/pv/data/decoderstack.cpp DSView/pv/data/decode/rowdata.cpp DSView/pv/data/decode/row.cpp @@ -379,7 +378,6 @@ set(DSView_HEADERS DSView/pv/dialogs/search.h DSView/pv/dock/dsotriggerdock.h DSView/pv/view/trace.h - DSView/pv/view/selectableitem.h DSView/pv/data/decoderstack.h DSView/pv/view/decodetrace.h DSView/pv/widgets/fakelineedit.h diff --git a/DSView/pv/view/selectableitem.cpp b/DSView/basedef.h similarity index 53% rename from DSView/pv/view/selectableitem.cpp rename to DSView/basedef.h index ed23e2ff7..83a1a199b 100644 --- a/DSView/pv/view/selectableitem.cpp +++ b/DSView/basedef.h @@ -1,9 +1,9 @@ + /* * This file is part of the DSView project. * DSView is based on PulseView. - * - * Copyright (C) 2013 Joel Holdsworth - * Copyright (C) 2014 DreamSourceLab + * + * Copyright (C) 2023 DreamSourceLab * * 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 @@ -20,38 +20,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "selectableitem.h" - -#include -#include -#include - -namespace pv { -namespace view { - -const int SelectableItem::HighlightRadius = 6; - -SelectableItem::SelectableItem() : - _selected(false) -{ -} - -bool SelectableItem::selected() -{ - return _selected; -} - -void SelectableItem::select(bool select) -{ - _selected = select; -} +#ifndef DSV_BASE_DEF_H +#define DSV_BASE_DEF_H -QPen SelectableItem::highlight_pen() -{ - return QPen(QApplication::palette().brush( - QPalette::Highlight), HighlightRadius, - Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin); -} +#ifdef _WIN32 + #define DSV_EXPORT __declspec(dllexport) + #define DSV_IMPORT __declspec(dllimport) + #define DSV_HIDDEN +#else + #define DSV_EXPORT __attribute__((visibility("default"))) + #define DSV_IMPORT __attribute__((visibility("default"))) + #define DSV_HIDDEN __attribute__((visibility("hidden"))) +#endif -} // namespace view -} // namespace pv +#endif \ No newline at end of file diff --git a/DSView/pv/view/selectableitem.h b/DSView/pv/view/selectableitem.h deleted file mode 100644 index 463c49117..000000000 --- a/DSView/pv/view/selectableitem.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This file is part of the DSView project. - * DSView is based on PulseView. - * - * Copyright (C) 2013 Joel Holdsworth - * Copyright (C) 2014 DreamSourceLab - * - * 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 DSVIEW_PV_SELECTABLEITEM_H -#define DSVIEW_PV_SELECTABLEITEM_H - -#include -#include -#include - -class QAction; -class QMenu; -class QWidget; - -namespace pv { - -namespace view { - -//Trace's base class -class SelectableItem : public QObject -{ - Q_OBJECT - -private: - static const int HighlightRadius; - -protected: - SelectableItem(); - -public: - /** - * Returns true if the signal has been selected by the user. - */ - bool selected(); - - /** - * Selects or deselects the signal. - */ - void select(bool select = true); - -protected: - static QPen highlight_pen(); - -private: - bool _selected; -}; - -} // namespace view -} // namespace pv - -#endif // DSVIEW_PV_SELECTABLEITEM_H diff --git a/DSView/pv/view/trace.cpp b/DSView/pv/view/trace.cpp index b9bd648c5..e02058807 100644 --- a/DSView/pv/view/trace.cpp +++ b/DSView/pv/view/trace.cpp @@ -61,6 +61,7 @@ Trace::Trace(QString name, uint16_t index, int type) : { _index_list.push_back(index); _view_index = -1; + _selected = false; } Trace::Trace(QString name, std::list index_list, int type, int sec_index) : @@ -74,6 +75,7 @@ Trace::Trace(QString name, std::list index_list, int type, int sec_index) : _typeWidth(SquareNum) { _view_index = -1; + _selected = false; } Trace::Trace(const Trace &t) : @@ -90,6 +92,7 @@ Trace::Trace(const Trace &t) : _text_size(t._text_size) { _view_index = -1; + _selected = false; } @@ -347,18 +350,6 @@ QColor Trace::get_text_colour() return (_colour.lightness() > 64) ? Qt::black : Qt::white; } -void Trace::on_text_changed(const QString &text) -{ - set_name(text); - text_changed(); -} - -void Trace::on_colour_changed(const QColor &colour) -{ - set_colour(colour); - colour_changed(); -} - int Trace::rows_size() { return 1; diff --git a/DSView/pv/view/trace.h b/DSView/pv/view/trace.h index 70669f487..c163f54e0 100644 --- a/DSView/pv/view/trace.h +++ b/DSView/pv/view/trace.h @@ -28,10 +28,8 @@ #include #include #include - +#include #include - -#include "selectableitem.h" #include "dsldial.h" class QFormLayout; @@ -43,7 +41,7 @@ class View; class Viewport; //base class -class Trace : public SelectableItem +class Trace : public QObject { Q_OBJECT @@ -295,6 +293,14 @@ class Trace : public SelectableItem return _view_index; } + inline bool selected(){ + return _selected; + } + + inline void select(bool flag){ + _selected = flag; + } + protected: /** @@ -322,9 +328,7 @@ class Trace : public SelectableItem void compute_text_size(QPainter &p); private slots: - void on_text_changed(const QString &text); - void on_colour_changed(const QColor &colour); - virtual void resize(); + void resize(); signals: void visibility_changed(); @@ -347,6 +351,7 @@ private slots: int _view_index; QSizeF _text_size; + bool _selected; }; } // namespace view From 77b2028bc876dcc1f1b041f1dd9e5b7d492f5657 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 13 Jul 2023 11:04:22 +0800 Subject: [PATCH 2/7] Rename namespace --- CMakeLists.txt | 200 +----------------- DSView/basedef.h | 26 +++ DSView/{pv => com}/dstimer.cpp | 7 +- DSView/{pv => com}/dstimer.h | 13 +- DSView/config.h.in | 35 --- DSView/{pv => }/config/appconfig.cpp | 34 +-- DSView/{pv => }/config/appconfig.h | 28 ++- DSView/{pv/data => }/decode/annotation.cpp | 9 +- DSView/{pv/data => }/decode/annotation.h | 19 +- .../data => }/decode/annotationrestable.cpp | 22 +- .../{pv/data => }/decode/annotationrestable.h | 12 +- DSView/{pv/data => }/decode/decoder.cpp | 11 +- DSView/{pv/data => }/decode/decoder.h | 19 +- DSView/{pv/data => }/decode/decoderstatus.cpp | 6 + DSView/{pv/data => }/decode/decoderstatus.h | 11 +- .../dsvdef.cpp => decode/displaydataformat.h} | 38 +++- DSView/{pv/data => }/decode/row.cpp | 10 +- DSView/{pv/data => }/decode/row.h | 16 +- DSView/{pv/data => }/decode/rowdata.cpp | 12 +- DSView/{pv/data => }/decode/rowdata.h | 20 +- DSView/{pv => }/dialogs/about.cpp | 6 +- DSView/{pv => }/dialogs/about.h | 4 +- DSView/{pv => }/dialogs/applicationpardlg.cpp | 2 +- DSView/{pv => }/dialogs/applicationpardlg.h | 2 +- DSView/{pv => }/dialogs/calibration.cpp | 4 +- DSView/{pv => }/dialogs/calibration.h | 4 +- DSView/{pv => }/dialogs/decoderoptionsdlg.cpp | 3 +- DSView/{pv => }/dialogs/decoderoptionsdlg.h | 2 +- DSView/{pv => }/dialogs/deviceoptions.cpp | 4 +- DSView/{pv => }/dialogs/deviceoptions.h | 4 +- DSView/{pv => }/dialogs/dsdialog.cpp | 6 +- DSView/{pv => }/dialogs/dsdialog.h | 4 +- DSView/{pv => }/dialogs/dsmessagebox.cpp | 4 +- DSView/{pv => }/dialogs/dsmessagebox.h | 4 +- DSView/{pv => }/dialogs/dsomeasure.cpp | 6 +- DSView/{pv => }/dialogs/dsomeasure.h | 4 +- DSView/{pv => }/dialogs/fftoptions.cpp | 4 +- DSView/{pv => }/dialogs/fftoptions.h | 4 +- DSView/{pv => }/dialogs/interval.cpp | 4 +- DSView/{pv => }/dialogs/interval.h | 4 +- DSView/{pv => }/dialogs/lissajousoptions.cpp | 6 +- DSView/{pv => }/dialogs/lissajousoptions.h | 4 +- DSView/{pv => }/dialogs/mathoptions.cpp | 6 +- DSView/{pv => }/dialogs/mathoptions.h | 4 +- DSView/{pv => }/dialogs/protocolexp.cpp | 6 +- DSView/{pv => }/dialogs/protocolexp.h | 4 +- DSView/{pv => }/dialogs/protocollist.cpp | 4 +- DSView/{pv => }/dialogs/protocollist.h | 4 +- DSView/{pv => }/dialogs/regionoptions.cpp | 4 +- DSView/{pv => }/dialogs/regionoptions.h | 4 +- DSView/{pv => }/dialogs/search.cpp | 4 +- DSView/{pv => }/dialogs/search.h | 4 +- DSView/{pv => }/dialogs/shadow.cpp | 4 +- DSView/{pv => }/dialogs/shadow.h | 4 +- DSView/{pv => }/dialogs/storeprogress.cpp | 2 +- DSView/{pv => }/dialogs/storeprogress.h | 2 +- DSView/{pv => }/dialogs/waitingdialog.cpp | 4 +- DSView/{pv => }/dialogs/waitingdialog.h | 4 +- DSView/{pv => }/dock/dsotriggerdock.cpp | 4 +- DSView/{pv => }/dock/dsotriggerdock.h | 4 +- DSView/{pv => }/dock/keywordlineedit.cpp | 0 DSView/{pv => }/dock/keywordlineedit.h | 0 DSView/{pv => }/dock/measuredock.cpp | 8 +- DSView/{pv => }/dock/measuredock.h | 4 +- DSView/{pv => }/dock/protocoldock.cpp | 10 +- DSView/{pv => }/dock/protocoldock.h | 4 +- DSView/{pv => }/dock/protocolitemlayer.cpp | 4 +- DSView/{pv => }/dock/protocolitemlayer.h | 2 +- DSView/{pv => }/dock/searchcombobox.cpp | 0 DSView/{pv => }/dock/searchcombobox.h | 0 DSView/{pv => }/dock/searchdock.cpp | 8 +- DSView/{pv => }/dock/searchdock.h | 4 +- DSView/{pv => }/dock/triggerdock.cpp | 4 +- DSView/{pv => }/dock/triggerdock.h | 4 +- DSView/dsapplication.cpp | 51 ----- DSView/dsapplication.h | 37 ---- DSView/{pv => }/interface/icallbacks.h | 0 DSView/{pv => }/log.cpp | 6 +- DSView/{pv => }/log.h | 4 + DSView/main.cpp | 2 +- DSView/{pv/data => model}/analogsnapshot.cpp | 4 +- DSView/{pv/data => model}/analogsnapshot.h | 4 +- DSView/{pv/data => model}/decodermodel.cpp | 4 +- DSView/{pv/data => model}/decodermodel.h | 4 +- DSView/{pv/data => model}/decoderstack.cpp | 7 +- DSView/{pv/data => model}/decoderstack.h | 4 +- DSView/{pv/data => model}/dsosnapshot.cpp | 4 +- DSView/{pv/data => model}/dsosnapshot.h | 4 +- DSView/{pv/data => model}/logicsnapshot.cpp | 4 +- DSView/{pv/data => model}/logicsnapshot.h | 0 DSView/{pv/data => model}/mathstack.cpp | 0 DSView/{pv/data => model}/mathstack.h | 0 DSView/{pv/data => model}/signaldata.cpp | 0 DSView/{pv/data => model}/signaldata.h | 0 DSView/{pv/data => model}/snapshot.cpp | 0 DSView/{pv/data => model}/snapshot.h | 0 DSView/{pv/data => model}/spectrumstack.cpp | 0 DSView/{pv/data => model}/spectrumstack.h | 0 DSView/{pv => }/prop/binding/binding.cpp | 0 DSView/{pv => }/prop/binding/binding.h | 0 .../{pv => }/prop/binding/decoderoptions.cpp | 0 DSView/{pv => }/prop/binding/decoderoptions.h | 0 .../{pv => }/prop/binding/deviceoptions.cpp | 0 DSView/{pv => }/prop/binding/deviceoptions.h | 0 DSView/{pv => }/prop/binding/probeoptions.cpp | 0 DSView/{pv => }/prop/binding/probeoptions.h | 0 DSView/{pv => }/prop/bool.cpp | 0 DSView/{pv => }/prop/bool.h | 0 DSView/{pv => }/prop/double.cpp | 0 DSView/{pv => }/prop/double.h | 0 DSView/{pv => }/prop/enum.cpp | 0 DSView/{pv => }/prop/enum.h | 0 DSView/{pv => }/prop/int.cpp | 0 DSView/{pv => }/prop/int.h | 0 DSView/{pv => }/prop/property.cpp | 0 DSView/{pv => }/prop/property.h | 0 DSView/{pv => }/prop/string.cpp | 0 DSView/{pv => }/prop/string.h | 0 DSView/pv/dsvdef.h | 73 ------- DSView/{pv => }/toolbars/filebar.cpp | 0 DSView/{pv => }/toolbars/filebar.h | 0 DSView/{pv => }/toolbars/logobar.cpp | 0 DSView/{pv => }/toolbars/logobar.h | 0 DSView/{pv => }/toolbars/samplingbar.cpp | 0 DSView/{pv => }/toolbars/samplingbar.h | 0 DSView/{pv => }/toolbars/titlebar.cpp | 0 DSView/{pv => }/toolbars/titlebar.h | 0 DSView/{pv => }/toolbars/trigbar.cpp | 0 DSView/{pv => }/toolbars/trigbar.h | 0 DSView/{pv => }/ui/dscombobox.cpp | 0 DSView/{pv => }/ui/dscombobox.h | 0 DSView/{pv => }/ui/fn.cpp | 0 DSView/{pv => }/ui/fn.h | 0 DSView/{pv => }/ui/langresource.cpp | 0 DSView/{pv => }/ui/langresource.h | 0 DSView/{pv => }/ui/msgbox.cpp | 0 DSView/{pv => }/ui/msgbox.h | 0 DSView/{pv => }/ui/string_ids.h | 0 DSView/{pv => }/utility/array.cpp | 0 DSView/{pv => }/utility/array.h | 0 DSView/{pv => }/utility/encoding.cpp | 0 DSView/{pv => }/utility/encoding.h | 0 DSView/{pv => }/utility/path.cpp | 0 DSView/{pv => }/utility/path.h | 0 DSView/{pv => }/view/analogsignal.cpp | 0 DSView/{pv => }/view/analogsignal.h | 0 DSView/{pv => }/view/cursor.cpp | 0 DSView/{pv => }/view/cursor.h | 0 DSView/{pv => }/view/decodetrace.cpp | 0 DSView/{pv => }/view/decodetrace.h | 0 DSView/{pv => }/view/devmode.cpp | 0 DSView/{pv => }/view/devmode.h | 0 DSView/{pv => }/view/dsldial.cpp | 0 DSView/{pv => }/view/dsldial.h | 0 DSView/{pv => }/view/dsosignal.cpp | 0 DSView/{pv => }/view/dsosignal.h | 0 DSView/{pv => }/view/groupsignal.cpp | 0 DSView/{pv => }/view/groupsignal.h | 0 DSView/{pv => }/view/header.cpp | 0 DSView/{pv => }/view/header.h | 0 DSView/{pv => }/view/lissajoustrace.cpp | 0 DSView/{pv => }/view/lissajoustrace.h | 0 DSView/{pv => }/view/logicsignal.cpp | 0 DSView/{pv => }/view/logicsignal.h | 0 DSView/{pv => }/view/mathtrace.cpp | 0 DSView/{pv => }/view/mathtrace.h | 0 DSView/{pv => }/view/ruler.cpp | 0 DSView/{pv => }/view/ruler.h | 0 DSView/{pv => }/view/signal.cpp | 0 DSView/{pv => }/view/signal.h | 0 DSView/{pv => }/view/spectrumtrace.cpp | 0 DSView/{pv => }/view/spectrumtrace.h | 0 DSView/{pv => }/view/timemarker.cpp | 0 DSView/{pv => }/view/timemarker.h | 0 DSView/{pv => }/view/trace.cpp | 0 DSView/{pv => }/view/trace.h | 0 DSView/{pv => }/view/view.cpp | 0 DSView/{pv => }/view/view.h | 0 DSView/{pv => }/view/viewport.cpp | 0 DSView/{pv => }/view/viewport.h | 0 DSView/{pv => }/view/viewstatus.cpp | 0 DSView/{pv => }/view/viewstatus.h | 0 DSView/{pv => }/view/xcursor.cpp | 0 DSView/{pv => }/view/xcursor.h | 0 DSView/{pv => }/widgets/border.cpp | 0 DSView/{pv => }/widgets/border.h | 0 DSView/{pv => }/widgets/decodergroupbox.cpp | 0 DSView/{pv => }/widgets/decodergroupbox.h | 0 DSView/{pv => }/widgets/decodermenu.cpp | 0 DSView/{pv => }/widgets/decodermenu.h | 0 DSView/{pv => }/widgets/fakelineedit.cpp | 0 DSView/{pv => }/widgets/fakelineedit.h | 0 DSView/{pv => zcore}/ZipMaker.cpp | 0 DSView/{pv => zcore}/ZipMaker.h | 0 DSView/{pv => zcore}/appcontrol.cpp | 0 DSView/{pv => zcore}/appcontrol.h | 0 DSView/{pv => zcore}/deviceagent.cpp | 0 DSView/{pv => zcore}/deviceagent.h | 0 DSView/{pv => zcore}/eventobject.cpp | 0 DSView/{pv => zcore}/eventobject.h | 0 DSView/{pv => zcore}/mainframe.cpp | 0 DSView/{pv => zcore}/mainframe.h | 0 DSView/{pv => zcore}/mainwindow.cpp | 0 DSView/{pv => zcore}/mainwindow.h | 0 DSView/{pv => zcore}/sigsession.cpp | 0 DSView/{pv => zcore}/sigsession.h | 0 DSView/{pv => zcore}/storesession.cpp | 0 DSView/{pv => zcore}/storesession.h | 0 208 files changed, 333 insertions(+), 640 deletions(-) rename DSView/{pv => com}/dstimer.cpp (97%) rename DSView/{pv => com}/dstimer.h (93%) delete mode 100644 DSView/config.h.in rename DSView/{pv => }/config/appconfig.cpp (97%) rename DSView/{pv => }/config/appconfig.h (90%) rename DSView/{pv/data => }/decode/annotation.cpp (98%) rename DSView/{pv/data => }/decode/annotation.h (90%) rename DSView/{pv/data => }/decode/annotationrestable.cpp (95%) rename DSView/{pv/data => }/decode/annotationrestable.h (93%) rename DSView/{pv/data => }/decode/decoder.cpp (97%) rename DSView/{pv/data => }/decode/decoder.h (91%) rename DSView/{pv/data => }/decode/decoderstatus.cpp (93%) rename DSView/{pv/data => }/decode/decoderstatus.h (87%) rename DSView/{pv/dsvdef.cpp => decode/displaydataformat.h} (75%) rename DSView/{pv/data => }/decode/row.cpp (96%) rename DSView/{pv/data => }/decode/row.h (89%) rename DSView/{pv/data => }/decode/rowdata.cpp (95%) rename DSView/{pv/data => }/decode/rowdata.h (83%) rename DSView/{pv => }/dialogs/about.cpp (98%) rename DSView/{pv => }/dialogs/about.h (97%) rename DSView/{pv => }/dialogs/applicationpardlg.cpp (99%) rename DSView/{pv => }/dialogs/applicationpardlg.h (99%) rename DSView/{pv => }/dialogs/calibration.cpp (99%) rename DSView/{pv => }/dialogs/calibration.h (98%) rename DSView/{pv => }/dialogs/decoderoptionsdlg.cpp (99%) rename DSView/{pv => }/dialogs/decoderoptionsdlg.h (99%) rename DSView/{pv => }/dialogs/deviceoptions.cpp (99%) rename DSView/{pv => }/dialogs/deviceoptions.h (99%) rename DSView/{pv => }/dialogs/dsdialog.cpp (98%) rename DSView/{pv => }/dialogs/dsdialog.h (98%) rename DSView/{pv => }/dialogs/dsmessagebox.cpp (99%) rename DSView/{pv => }/dialogs/dsmessagebox.h (98%) rename DSView/{pv => }/dialogs/dsomeasure.cpp (99%) rename DSView/{pv => }/dialogs/dsomeasure.h (98%) rename DSView/{pv => }/dialogs/fftoptions.cpp (99%) rename DSView/{pv => }/dialogs/fftoptions.h (98%) rename DSView/{pv => }/dialogs/interval.cpp (98%) rename DSView/{pv => }/dialogs/interval.h (98%) rename DSView/{pv => }/dialogs/lissajousoptions.cpp (99%) rename DSView/{pv => }/dialogs/lissajousoptions.h (98%) rename DSView/{pv => }/dialogs/mathoptions.cpp (99%) rename DSView/{pv => }/dialogs/mathoptions.h (98%) rename DSView/{pv => }/dialogs/protocolexp.cpp (99%) rename DSView/{pv => }/dialogs/protocolexp.h (98%) rename DSView/{pv => }/dialogs/protocollist.cpp (99%) rename DSView/{pv => }/dialogs/protocollist.h (98%) rename DSView/{pv => }/dialogs/regionoptions.cpp (99%) rename DSView/{pv => }/dialogs/regionoptions.h (97%) rename DSView/{pv => }/dialogs/search.cpp (99%) rename DSView/{pv => }/dialogs/search.h (97%) rename DSView/{pv => }/dialogs/shadow.cpp (98%) rename DSView/{pv => }/dialogs/shadow.h (98%) rename DSView/{pv => }/dialogs/storeprogress.cpp (99%) rename DSView/{pv => }/dialogs/storeprogress.h (99%) rename DSView/{pv => }/dialogs/waitingdialog.cpp (99%) rename DSView/{pv => }/dialogs/waitingdialog.h (98%) rename DSView/{pv => }/dock/dsotriggerdock.cpp (99%) rename DSView/{pv => }/dock/dsotriggerdock.h (98%) rename DSView/{pv => }/dock/keywordlineedit.cpp (100%) rename DSView/{pv => }/dock/keywordlineedit.h (100%) rename DSView/{pv => }/dock/measuredock.cpp (99%) rename DSView/{pv => }/dock/measuredock.h (99%) rename DSView/{pv => }/dock/protocoldock.cpp (99%) rename DSView/{pv => }/dock/protocoldock.h (99%) rename DSView/{pv => }/dock/protocolitemlayer.cpp (98%) rename DSView/{pv => }/dock/protocolitemlayer.h (99%) rename DSView/{pv => }/dock/searchcombobox.cpp (100%) rename DSView/{pv => }/dock/searchcombobox.h (100%) rename DSView/{pv => }/dock/searchdock.cpp (98%) rename DSView/{pv => }/dock/searchdock.h (98%) rename DSView/{pv => }/dock/triggerdock.cpp (99%) rename DSView/{pv => }/dock/triggerdock.h (99%) delete mode 100644 DSView/dsapplication.cpp delete mode 100644 DSView/dsapplication.h rename DSView/{pv => }/interface/icallbacks.h (100%) rename DSView/{pv => }/log.cpp (98%) rename DSView/{pv => }/log.h (97%) rename DSView/{pv/data => model}/analogsnapshot.cpp (99%) rename DSView/{pv/data => model}/analogsnapshot.h (98%) rename DSView/{pv/data => model}/decodermodel.cpp (98%) rename DSView/{pv/data => model}/decodermodel.h (98%) rename DSView/{pv/data => model}/decoderstack.cpp (99%) rename DSView/{pv/data => model}/decoderstack.h (99%) rename DSView/{pv/data => model}/dsosnapshot.cpp (99%) rename DSView/{pv/data => model}/dsosnapshot.h (99%) rename DSView/{pv/data => model}/logicsnapshot.cpp (99%) rename DSView/{pv/data => model}/logicsnapshot.h (100%) rename DSView/{pv/data => model}/mathstack.cpp (100%) rename DSView/{pv/data => model}/mathstack.h (100%) rename DSView/{pv/data => model}/signaldata.cpp (100%) rename DSView/{pv/data => model}/signaldata.h (100%) rename DSView/{pv/data => model}/snapshot.cpp (100%) rename DSView/{pv/data => model}/snapshot.h (100%) rename DSView/{pv/data => model}/spectrumstack.cpp (100%) rename DSView/{pv/data => model}/spectrumstack.h (100%) rename DSView/{pv => }/prop/binding/binding.cpp (100%) rename DSView/{pv => }/prop/binding/binding.h (100%) rename DSView/{pv => }/prop/binding/decoderoptions.cpp (100%) rename DSView/{pv => }/prop/binding/decoderoptions.h (100%) rename DSView/{pv => }/prop/binding/deviceoptions.cpp (100%) rename DSView/{pv => }/prop/binding/deviceoptions.h (100%) rename DSView/{pv => }/prop/binding/probeoptions.cpp (100%) rename DSView/{pv => }/prop/binding/probeoptions.h (100%) rename DSView/{pv => }/prop/bool.cpp (100%) rename DSView/{pv => }/prop/bool.h (100%) rename DSView/{pv => }/prop/double.cpp (100%) rename DSView/{pv => }/prop/double.h (100%) rename DSView/{pv => }/prop/enum.cpp (100%) rename DSView/{pv => }/prop/enum.h (100%) rename DSView/{pv => }/prop/int.cpp (100%) rename DSView/{pv => }/prop/int.h (100%) rename DSView/{pv => }/prop/property.cpp (100%) rename DSView/{pv => }/prop/property.h (100%) rename DSView/{pv => }/prop/string.cpp (100%) rename DSView/{pv => }/prop/string.h (100%) delete mode 100644 DSView/pv/dsvdef.h rename DSView/{pv => }/toolbars/filebar.cpp (100%) rename DSView/{pv => }/toolbars/filebar.h (100%) rename DSView/{pv => }/toolbars/logobar.cpp (100%) rename DSView/{pv => }/toolbars/logobar.h (100%) rename DSView/{pv => }/toolbars/samplingbar.cpp (100%) rename DSView/{pv => }/toolbars/samplingbar.h (100%) rename DSView/{pv => }/toolbars/titlebar.cpp (100%) rename DSView/{pv => }/toolbars/titlebar.h (100%) rename DSView/{pv => }/toolbars/trigbar.cpp (100%) rename DSView/{pv => }/toolbars/trigbar.h (100%) rename DSView/{pv => }/ui/dscombobox.cpp (100%) rename DSView/{pv => }/ui/dscombobox.h (100%) rename DSView/{pv => }/ui/fn.cpp (100%) rename DSView/{pv => }/ui/fn.h (100%) rename DSView/{pv => }/ui/langresource.cpp (100%) rename DSView/{pv => }/ui/langresource.h (100%) rename DSView/{pv => }/ui/msgbox.cpp (100%) rename DSView/{pv => }/ui/msgbox.h (100%) rename DSView/{pv => }/ui/string_ids.h (100%) rename DSView/{pv => }/utility/array.cpp (100%) rename DSView/{pv => }/utility/array.h (100%) rename DSView/{pv => }/utility/encoding.cpp (100%) rename DSView/{pv => }/utility/encoding.h (100%) rename DSView/{pv => }/utility/path.cpp (100%) rename DSView/{pv => }/utility/path.h (100%) rename DSView/{pv => }/view/analogsignal.cpp (100%) rename DSView/{pv => }/view/analogsignal.h (100%) rename DSView/{pv => }/view/cursor.cpp (100%) rename DSView/{pv => }/view/cursor.h (100%) rename DSView/{pv => }/view/decodetrace.cpp (100%) rename DSView/{pv => }/view/decodetrace.h (100%) rename DSView/{pv => }/view/devmode.cpp (100%) rename DSView/{pv => }/view/devmode.h (100%) rename DSView/{pv => }/view/dsldial.cpp (100%) rename DSView/{pv => }/view/dsldial.h (100%) rename DSView/{pv => }/view/dsosignal.cpp (100%) rename DSView/{pv => }/view/dsosignal.h (100%) rename DSView/{pv => }/view/groupsignal.cpp (100%) rename DSView/{pv => }/view/groupsignal.h (100%) rename DSView/{pv => }/view/header.cpp (100%) rename DSView/{pv => }/view/header.h (100%) rename DSView/{pv => }/view/lissajoustrace.cpp (100%) rename DSView/{pv => }/view/lissajoustrace.h (100%) rename DSView/{pv => }/view/logicsignal.cpp (100%) rename DSView/{pv => }/view/logicsignal.h (100%) rename DSView/{pv => }/view/mathtrace.cpp (100%) rename DSView/{pv => }/view/mathtrace.h (100%) rename DSView/{pv => }/view/ruler.cpp (100%) rename DSView/{pv => }/view/ruler.h (100%) rename DSView/{pv => }/view/signal.cpp (100%) rename DSView/{pv => }/view/signal.h (100%) rename DSView/{pv => }/view/spectrumtrace.cpp (100%) rename DSView/{pv => }/view/spectrumtrace.h (100%) rename DSView/{pv => }/view/timemarker.cpp (100%) rename DSView/{pv => }/view/timemarker.h (100%) rename DSView/{pv => }/view/trace.cpp (100%) rename DSView/{pv => }/view/trace.h (100%) rename DSView/{pv => }/view/view.cpp (100%) rename DSView/{pv => }/view/view.h (100%) rename DSView/{pv => }/view/viewport.cpp (100%) rename DSView/{pv => }/view/viewport.h (100%) rename DSView/{pv => }/view/viewstatus.cpp (100%) rename DSView/{pv => }/view/viewstatus.h (100%) rename DSView/{pv => }/view/xcursor.cpp (100%) rename DSView/{pv => }/view/xcursor.h (100%) rename DSView/{pv => }/widgets/border.cpp (100%) rename DSView/{pv => }/widgets/border.h (100%) rename DSView/{pv => }/widgets/decodergroupbox.cpp (100%) rename DSView/{pv => }/widgets/decodergroupbox.h (100%) rename DSView/{pv => }/widgets/decodermenu.cpp (100%) rename DSView/{pv => }/widgets/decodermenu.h (100%) rename DSView/{pv => }/widgets/fakelineedit.cpp (100%) rename DSView/{pv => }/widgets/fakelineedit.h (100%) rename DSView/{pv => zcore}/ZipMaker.cpp (100%) rename DSView/{pv => zcore}/ZipMaker.h (100%) rename DSView/{pv => zcore}/appcontrol.cpp (100%) rename DSView/{pv => zcore}/appcontrol.h (100%) rename DSView/{pv => zcore}/deviceagent.cpp (100%) rename DSView/{pv => zcore}/deviceagent.h (100%) rename DSView/{pv => zcore}/eventobject.cpp (100%) rename DSView/{pv => zcore}/eventobject.h (100%) rename DSView/{pv => zcore}/mainframe.cpp (100%) rename DSView/{pv => zcore}/mainframe.h (100%) rename DSView/{pv => zcore}/mainwindow.cpp (100%) rename DSView/{pv => zcore}/mainwindow.h (100%) rename DSView/{pv => zcore}/sigsession.cpp (100%) rename DSView/{pv => zcore}/sigsession.h (100%) rename DSView/{pv => zcore}/storesession.cpp (100%) rename DSView/{pv => zcore}/storesession.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b9dffd16..88e0dce5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,208 +237,10 @@ find_package(Threads) set(DSView_SOURCES DSView/main.cpp - DSView/dsapplication.cpp - DSView/pv/log.cpp - DSView/pv/sigsession.cpp - DSView/pv/mainwindow.cpp - DSView/pv/data/snapshot.cpp - DSView/pv/data/signaldata.cpp - DSView/pv/data/logicsnapshot.cpp - DSView/pv/data/analogsnapshot.cpp - DSView/pv/dialogs/deviceoptions.cpp - DSView/pv/prop/property.cpp - DSView/pv/prop/int.cpp - DSView/pv/prop/enum.cpp - DSView/pv/prop/double.cpp - DSView/pv/prop/bool.cpp - DSView/pv/prop/binding/binding.cpp - DSView/pv/toolbars/samplingbar.cpp - DSView/pv/view/viewport.cpp - DSView/pv/view/view.cpp - DSView/pv/view/timemarker.cpp - DSView/pv/view/signal.cpp - DSView/pv/view/ruler.cpp - DSView/pv/view/logicsignal.cpp - DSView/pv/view/header.cpp - DSView/pv/view/cursor.cpp - DSView/pv/view/analogsignal.cpp - DSView/pv/prop/binding/deviceoptions.cpp - DSView/pv/toolbars/trigbar.cpp - DSView/pv/toolbars/filebar.cpp - DSView/pv/dock/protocoldock.cpp - DSView/pv/dock/triggerdock.cpp - DSView/pv/dock/measuredock.cpp - DSView/pv/dock/searchdock.cpp - DSView/pv/toolbars/logobar.cpp - DSView/pv/dialogs/about.cpp - DSView/pv/dialogs/search.cpp - DSView/pv/data/dsosnapshot.cpp - DSView/pv/view/dsosignal.cpp - DSView/pv/view/dsldial.cpp - DSView/pv/dock/dsotriggerdock.cpp - DSView/pv/view/trace.cpp - DSView/pv/data/decoderstack.cpp - DSView/pv/data/decode/rowdata.cpp - DSView/pv/data/decode/row.cpp - DSView/pv/data/decode/decoder.cpp - DSView/pv/data/decode/annotation.cpp - DSView/pv/view/decodetrace.cpp - DSView/pv/prop/binding/decoderoptions.cpp - DSView/pv/widgets/fakelineedit.cpp - DSView/pv/widgets/decodermenu.cpp - DSView/pv/widgets/decodergroupbox.cpp - DSView/pv/prop/string.cpp - DSView/pv/dialogs/storeprogress.cpp - DSView/pv/storesession.cpp - DSView/pv/view/devmode.cpp - DSView/pv/dialogs/waitingdialog.cpp - DSView/pv/dialogs/dsomeasure.cpp - DSView/pv/dialogs/calibration.cpp - DSView/pv/data/decodermodel.cpp - DSView/pv/dialogs/protocollist.cpp - DSView/pv/dialogs/protocolexp.cpp - DSView/pv/dialogs/fftoptions.cpp - DSView/pv/data/mathstack.cpp - DSView/pv/view/mathtrace.cpp - DSView/pv/toolbars/titlebar.cpp - DSView/pv/mainframe.cpp - DSView/pv/widgets/border.cpp - DSView/pv/dialogs/dsmessagebox.cpp - DSView/pv/dialogs/shadow.cpp - DSView/pv/dialogs/dsdialog.cpp - DSView/pv/dialogs/interval.cpp - DSView/pv/prop/binding/probeoptions.cpp - DSView/pv/view/viewstatus.cpp - DSView/pv/dialogs/lissajousoptions.cpp - DSView/pv/view/lissajoustrace.cpp - DSView/pv/view/spectrumtrace.cpp - DSView/pv/data/spectrumstack.cpp - DSView/pv/dialogs/mathoptions.cpp - DSView/pv/dialogs/regionoptions.cpp - DSView/pv/view/xcursor.cpp - DSView/pv/dock/protocoldock.cpp - DSView/pv/data/decoderstack.cpp - DSView/pv/data/decode/annotation.cpp - DSView/pv/data/decode/decoder.cpp - DSView/pv/data/decode/row.cpp - DSView/pv/data/decode/rowdata.cpp - DSView/pv/prop/binding/decoderoptions.cpp - DSView/pv/view/decodetrace.cpp - DSView/pv/widgets/decodergroupbox.cpp - DSView/pv/widgets/decodermenu.cpp - DSView/pv/config/appconfig.cpp - DSView/pv/appcontrol.cpp - DSView/pv/dstimer.cpp - DSView/pv/eventobject.cpp - DSView/pv/ZipMaker.cpp - DSView/pv/data/decode/annotationrestable.cpp - DSView/pv/data/decode/decoderstatus.cpp - DSView/pv/dock/protocolitemlayer.cpp - DSView/pv/ui/msgbox.cpp - DSView/pv/ui/dscombobox.cpp - DSView/pv/dsvdef.cpp - DSView/pv/dialogs/applicationpardlg.cpp - DSView/pv/dock/keywordlineedit.cpp - DSView/pv/dock/searchcombobox.cpp - DSView/pv/dialogs/decoderoptionsdlg.cpp - DSView/pv/utility/encoding.cpp - DSView/pv/utility/path.cpp - DSView/pv/utility/array.cpp - DSView/pv/deviceagent.cpp - DSView/pv/ui/langresource.cpp - DSView/pv/ui/fn.cpp ) set(DSView_HEADERS - DSView/mystyle.h - DSView/pv/log.h - DSView/pv/sigsession.h - DSView/pv/mainwindow.h - DSView/pv/dialogs/deviceoptions.h - DSView/pv/prop/property.h - DSView/pv/prop/int.h - DSView/pv/prop/enum.h - DSView/pv/prop/double.h - DSView/pv/prop/bool.h - DSView/pv/toolbars/samplingbar.h - DSView/pv/view/viewport.h - DSView/pv/view/view.h - DSView/pv/view/timemarker.h - DSView/pv/view/ruler.h - DSView/pv/view/header.h - DSView/pv/view/cursor.h - DSView/pv/toolbars/trigbar.h - DSView/pv/toolbars/filebar.h - DSView/pv/dock/protocoldock.h - DSView/pv/dock/triggerdock.h - DSView/pv/dock/measuredock.h - DSView/pv/dock/searchdock.h - DSView/pv/toolbars/logobar.h - DSView/pv/dialogs/about.h - DSView/pv/dialogs/search.h - DSView/pv/dock/dsotriggerdock.h - DSView/pv/view/trace.h - DSView/pv/data/decoderstack.h - DSView/pv/view/decodetrace.h - DSView/pv/widgets/fakelineedit.h - DSView/pv/widgets/decodermenu.h - DSView/pv/widgets/decodergroupbox.h - DSView/pv/prop/string.h - DSView/pv/dialogs/storeprogress.h - DSView/pv/storesession.h - DSView/pv/view/devmode.h - DSView/pv/dialogs/waitingdialog.h - DSView/pv/dialogs/dsomeasure.h - DSView/pv/dialogs/calibration.h - DSView/pv/dialogs/protocollist.h - DSView/pv/dialogs/protocolexp.h - DSView/pv/dialogs/fftoptions.h - DSView/pv/data/mathstack.h - DSView/pv/view/mathtrace.h - DSView/pv/view/viewstatus.h - DSView/pv/toolbars/titlebar.h - DSView/pv/mainframe.h - DSView/pv/widgets/border.h - DSView/pv/dialogs/dsmessagebox.h - DSView/pv/dialogs/shadow.h - DSView/pv/dialogs/dsdialog.h - DSView/pv/dialogs/interval.h - DSView/pv/dialogs/lissajousoptions.h - DSView/pv/view/lissajoustrace.h - DSView/pv/view/spectrumtrace.h - DSView/pv/data/spectrumstack.h - DSView/pv/dialogs/mathoptions.h - DSView/pv/dialogs/regionoptions.h - DSView/pv/view/xcursor.h - DSView/pv/view/signal.h - DSView/pv/view/logicsignal.h - DSView/pv/view/analogsignal.h - DSView/pv/view/dsosignal.h - DSView/pv/dock/protocoldock.h - DSView/pv/data/decoderstack.h - DSView/pv/view/decodetrace.h - DSView/pv/widgets/decodergroupbox.h - DSView/pv/widgets/decodermenu.h - DSView/pv/config/appconfig.h - DSView/pv/appcontrol.h - DSView/pv/dstimer.h - DSView/pv/eventobject.h - DSView/pv/ZipMaker.h - DSView/pv/data/decode/annotationrestable.h - DSView/pv/data/decode/decoderstatus.h - DSView/pv/dock/protocolitemlayer.h - DSView/pv/ui/msgbox.h - DSView/pv/ui/dscombobox.h - DSView/pv/dsvdef.h - DSView/pv/dialogs/applicationpardlg.h - DSView/pv/dock/keywordlineedit.h - DSView/pv/dock/searchcombobox.h - DSView/pv/dialogs/decoderoptionsdlg.h - DSView/pv/utility/encoding.h - DSView/pv/utility/path.h - DSView/pv/utility/array.h - DSView/pv/deviceagent.h - DSView/pv/ui/fn.h + ) #=============================================================================== diff --git a/DSView/basedef.h b/DSView/basedef.h index 83a1a199b..53508a4f1 100644 --- a/DSView/basedef.h +++ b/DSView/basedef.h @@ -33,4 +33,30 @@ #define DSV_HIDDEN __attribute__((visibility("hidden"))) #endif + +#define countof(x) (sizeof(x)/sizeof(x[0])) + +#define begin_element(x) (&x[0]) +#define end_element(x) (&x[countof(x)]) + +enum View_type { + TIME_VIEW, + FFT_VIEW, + ALL_VIEW +}; + +#define DESTROY_OBJECT(p) if((p)){delete (p); p = NULL;} +#define DESTROY_QT_OBJECT(p) if((p)){((p))->deleteLater(); p = NULL;} +#define DESTROY_QT_LATER(p) ((p))->deleteLater(); + +#define RELEASE_ARRAY(a) for (auto ptr : (a)){delete ptr;} (a).clear(); + +#define ABS_VAL(x) ((x) > 0 ? (x) : -(x)) + +#define ds_max(a,b) ((a) > (b) ? (a) : (b)) +#define ds_min(a,b) ((a) < (b) ? (a) : (b)) + +#define SESSION_FORMAT_VERSION 3 +#define HEADER_FORMAT_VERSION 3 + #endif \ No newline at end of file diff --git a/DSView/pv/dstimer.cpp b/DSView/com/dstimer.cpp similarity index 97% rename from DSView/pv/dstimer.cpp rename to DSView/com/dstimer.cpp index 405a21e65..800ec32dc 100644 --- a/DSView/pv/dstimer.cpp +++ b/DSView/com/dstimer.cpp @@ -22,7 +22,9 @@ #include "dstimer.h" #include - +namespace dsv{ +namespace com{ + DsTimer::DsTimer() { _binded = false; @@ -106,3 +108,6 @@ void DsTimer::SetCallback(CALLBACL_FUNC f) { _beginTime = high_resolution_clock::now(); } + +} //namespace com +} //namespace dsv diff --git a/DSView/pv/dstimer.h b/DSView/com/dstimer.h similarity index 93% rename from DSView/pv/dstimer.h rename to DSView/com/dstimer.h index 276bc6421..61b34a4cd 100644 --- a/DSView/pv/dstimer.h +++ b/DSView/com/dstimer.h @@ -19,19 +19,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _DS_TIMER_H -#define _DS_TIMER_H +#ifndef COM_DS_TIMER_H +#define COM_DS_TIMER_H #include #include #include #include -using std::chrono::high_resolution_clock; -using std::chrono::milliseconds; +namespace dsv{ +namespace com{ typedef std::function CALLBACL_FUNC; +using std::chrono::high_resolution_clock; +using std::chrono::milliseconds; class DsTimer : protected QObject { @@ -71,4 +73,7 @@ private slots: CALLBACL_FUNC _call; }; +} //namespace com +} //namespace dsv + #endif diff --git a/DSView/config.h.in b/DSView/config.h.in deleted file mode 100644 index 0962573c3..000000000 --- a/DSView/config.h.in +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the PulseView project. - * DSView is based on PulseView. - * - * Copyright (C) 2012 Alexandru Gagniuc - * - * 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, see . - */ - -#ifndef _DSVIEW_CONFIG_H -#define _DSVIEW_CONFIG_H - -/* Application details */ -#define DS_TITLE "@DS_TITLE@" -#define DS_DESCRIPTION "@DS_DESCRIPTION@" -#define DS_BIN_NAME "@PROJECT_NAME@" - -/* DSView version information */ -#define DS_VERSION_MAJOR @DS_VERSION_MAJOR@ -#define DS_VERSION_MINOR @DS_VERSION_MINOR@ -#define DS_VERSION_MICRO @DS_VERSION_MICRO@ -#define DS_VERSION_STRING "@DS_VERSION_STRING@" - -#endif diff --git a/DSView/pv/config/appconfig.cpp b/DSView/config/appconfig.cpp similarity index 97% rename from DSView/pv/config/appconfig.cpp rename to DSView/config/appconfig.cpp index 99141b89b..211fde3ae 100644 --- a/DSView/pv/config/appconfig.cpp +++ b/DSView/config/appconfig.cpp @@ -27,7 +27,10 @@ #include #include #include "../log.h" - + +namespace dsv{ +namespace config{ + #define MAX_PROTOCOL_FORMAT_LIST 15 StringPair::StringPair(const std::string &key, const std::string &value) @@ -386,7 +389,7 @@ std::string AppConfig::GetProtocolFormat(const std::string &protocolName) } //-------------api -QString GetIconPath() +QString AppConfig::GetIconPath() { QString style = AppConfig::Instance().frameOptions.style; if (style == ""){ @@ -395,7 +398,7 @@ QString GetIconPath() return ":/icons/" + style; } -QString GetAppDataDir() +QString AppConfig::GetAppDataDir() { //applicationDirPath not end with '/' #ifdef Q_OS_LINUX @@ -431,7 +434,7 @@ QString GetAppDataDir() #endif } -QString GetFirmwareDir() +QString AppConfig::GetFirmwareDir() { QDir dir1 = GetAppDataDir() + "/res"; // ./res @@ -450,16 +453,16 @@ QString GetFirmwareDir() return dir1.absolutePath(); } -QString GetUserDataDir() +QString AppConfig::GetUserDataDir() { - #if QT_VERSION >= 0x050400 +#if QT_VERSION >= 0x050400 return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); - #else +#else return QStandardPaths::writableLocation(QStandardPaths::DataLocation); - #endif +#endif } -QString GetDecodeScriptDir() +QString AppConfig::GetDecodeScriptDir() { QString path = GetAppDataDir() + "/decoders"; @@ -474,16 +477,19 @@ QString GetDecodeScriptDir() // ../share/libsigrokdecode4DSL/decoders if (dir.cd("..") && dir.cd("share") && dir.cd("libsigrokdecode4DSL") && dir.cd("decoders")) { - return dir.absolutePath(); + return dir.absolutePath(); } return ""; } -QString GetProfileDir() +QString AppConfig::GetProfileDir() { - #if QT_VERSION >= 0x050400 +#if QT_VERSION >= 0x050400 return QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); - #else +#else return QStandardPaths::writableLocation(QStandardPaths::DataLocation); - #endif +#endif } + +} //config +} //dsv diff --git a/DSView/pv/config/appconfig.h b/DSView/config/appconfig.h similarity index 90% rename from DSView/pv/config/appconfig.h rename to DSView/config/appconfig.h index e34b91ea3..8c4d3cad3 100644 --- a/DSView/pv/config/appconfig.h +++ b/DSView/config/appconfig.h @@ -19,13 +19,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#pragma once + +#ifndef CONFIG_APPCONIFG_H +#define CONFIG_APPCONIFG_H #include #include #include #include +namespace dsv{ +namespace config{ + #define LAN_CN 25 #define LAN_EN 31 @@ -33,14 +38,7 @@ #define THEME_STYLE_LIGHT "light" #define APP_NAME "DSView" - -//--------------------api--- -QString GetIconPath(); -QString GetAppDataDir(); -QString GetFirmwareDir(); -QString GetUserDataDir(); -QString GetDecodeScriptDir(); -QString GetProfileDir(); + //------------------class @@ -146,8 +144,20 @@ class AppConfig return frameOptions.language == LAN_CN; } + static QString GetIconPath(); + static QString GetAppDataDir(); + static QString GetFirmwareDir(); + static QString GetUserDataDir(); + static QString GetDecodeScriptDir(); + static QString GetProfileDir(); + public: AppOptions appOptions; UserHistory userHistory; FrameOptions frameOptions; }; + +} //config +} //dsv + +#endif diff --git a/DSView/pv/data/decode/annotation.cpp b/DSView/decode/annotation.cpp similarity index 98% rename from DSView/pv/data/decode/annotation.cpp rename to DSView/decode/annotation.cpp index 8574136dd..57fe8363f 100644 --- a/DSView/pv/data/decode/annotation.cpp +++ b/DSView/decode/annotation.cpp @@ -31,14 +31,12 @@ #include #include #include - #include "../../config/appconfig.h" #include "decoderstatus.h" -#include "../../dsvdef.h" +#include "../basedef.h" -namespace pv { -namespace data { +namespace dsv { namespace decode { Annotation::Annotation(const srd_proto_data *const pdata, DecoderStatus *status) @@ -185,5 +183,4 @@ bool Annotation::is_numberic() } } // namespace decode -} // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/decode/annotation.h b/DSView/decode/annotation.h similarity index 90% rename from DSView/pv/data/decode/annotation.h rename to DSView/decode/annotation.h index a5b0e4409..95f0b5ef9 100644 --- a/DSView/pv/data/decode/annotation.h +++ b/DSView/decode/annotation.h @@ -20,23 +20,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef DSVIEW_PV_VIEW_DECODE_ANNOTATION_H -#define DSVIEW_PV_VIEW_DECODE_ANNOTATION_H +#ifndef DECODE_ANNOTATION_H +#define DECODE_ANNOTATION_H #include - #include #include -class AnnotationResTable; -class DecoderStatus; - struct srd_proto_data; -namespace pv { -namespace data { +namespace dsv { namespace decode { +class AnnotationResTable; +class DecoderStatus; + //create at DecoderStack.annotation_callback class Annotation { @@ -75,8 +73,7 @@ class Annotation DecoderStatus *_status; /*a global variable*/ }; -} // namespace decode -} // namespace data -} // namespace pv +} //namespace decode +} //namespace dsv #endif // DSVIEW_PV_VIEW_DECODE_ANNOTATION_H diff --git a/DSView/pv/data/decode/annotationrestable.cpp b/DSView/decode/annotationrestable.cpp similarity index 95% rename from DSView/pv/data/decode/annotationrestable.cpp rename to DSView/decode/annotationrestable.cpp index 6f2ec96ab..fdb6f8650 100644 --- a/DSView/pv/data/decode/annotationrestable.cpp +++ b/DSView/decode/annotationrestable.cpp @@ -23,8 +23,11 @@ #include #include #include -#include "../../log.h" -#include "../../dsvdef.h" +#include "../log.h" +#include "../basedef.h" + +namespace dsv { +namespace decode { const char g_bin_cvt_table[] = "0000000100100011010001010110011110001001101010111100110111101111"; @@ -137,7 +140,7 @@ const char* AnnotationResTable::format_to_string(const char *hex_str, int fmt) { //flow, convert to oct\dec\bin format const char *data = hex_str; - if (data[0] == 0 || fmt == DecoderDataFormat::hex){ + if (data[0] == 0 || fmt == DisplayDataFormat::hex){ return data; } @@ -186,19 +189,19 @@ const char* AnnotationResTable::format_to_string(const char *hex_str, int fmt) } //get bin format - if (fmt == DecoderDataFormat::bin){ + if (fmt == DisplayDataFormat::bin){ return buf; } //get oct format - if (fmt == DecoderDataFormat::oct){ + if (fmt == DisplayDataFormat::oct){ char *oct_buf = bin2oct_string(g_oct_format_tmp_buffer, sizeof(g_oct_format_tmp_buffer), buf, len * 4); return oct_buf; } //64 bit integer - if (fmt == DecoderDataFormat::dec && len * 4 <= 64){ + if (fmt == DisplayDataFormat::dec && len * 4 <= 64){ long long lv = bin2long_string(buf, len * 4); g_number_tmp_64[0] = 0; sprintf(g_number_tmp_64, "%lld", lv); @@ -206,7 +209,7 @@ const char* AnnotationResTable::format_to_string(const char *hex_str, int fmt) } //ascii - if (fmt == DecoderDataFormat::ascii && len < 30 - 3){ + if (fmt == DisplayDataFormat::ascii && len < 30 - 3){ if (len == 2){ int lv = (int)bin2long_string(buf, len * 4); //can display chars @@ -229,7 +232,7 @@ const char* AnnotationResTable::format_numberic(const char *hex_str, int fmt) { assert(hex_str); - if (hex_str[0] == 0 || fmt == DecoderDataFormat::hex){ + if (hex_str[0] == 0 || fmt == DisplayDataFormat::hex){ return hex_str; } @@ -396,4 +399,7 @@ void AnnotationResTable::decimalToBinString(unsigned long long num, int bitSize, wr--; } } + +} //namespace decode +} //namespace dsv diff --git a/DSView/pv/data/decode/annotationrestable.h b/DSView/decode/annotationrestable.h similarity index 93% rename from DSView/pv/data/decode/annotationrestable.h rename to DSView/decode/annotationrestable.h index 740c56f74..233521bf8 100644 --- a/DSView/pv/data/decode/annotationrestable.h +++ b/DSView/decode/annotationrestable.h @@ -19,16 +19,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#pragma once #include #include #include #include +#ifndef DECODE_ANNOTATION_RES_TABLE_H +#define DECODE_ANNOTATION_RES_TABLE_H + #define DECODER_MAX_DATA_BLOCK_LEN 256 #define CONVERT_STR_MAX_LEN 150 +namespace dsv { +namespace decode { + struct AnnotationSourceItem { bool is_numeric; @@ -70,3 +75,8 @@ class AnnotationResTable char g_number_tmp_64[30]; char g_all_buf[CONVERT_STR_MAX_LEN + 1]; }; + +#endif + +} //namespace decode +} //namespace dsv diff --git a/DSView/pv/data/decode/decoder.cpp b/DSView/decode/decoder.cpp similarity index 97% rename from DSView/pv/data/decode/decoder.cpp rename to DSView/decode/decoder.cpp index c51d9cf3d..37b5dde4d 100644 --- a/DSView/pv/data/decode/decoder.cpp +++ b/DSView/decode/decoder.cpp @@ -24,10 +24,8 @@ #include "decoder.h" #include - -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ Decoder::Decoder(const srd_decoder *const dec): _decoder(dec) @@ -139,6 +137,5 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session) } -} // decode -} // data -} // pv +} //namespace decode +} //namespace dsv diff --git a/DSView/pv/data/decode/decoder.h b/DSView/decode/decoder.h similarity index 91% rename from DSView/pv/data/decode/decoder.h rename to DSView/decode/decoder.h index 268ff1341..2442a4490 100644 --- a/DSView/pv/data/decode/decoder.h +++ b/DSView/decode/decoder.h @@ -20,15 +20,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef DSVIEW_PV_DATA_DECODE_DECODER_H -#define DSVIEW_PV_DATA_DECODE_DECODER_H +#ifndef DECODE_DECODER_H +#define DECODE_DECODER_H #include #include #include #include -#include - +#include #include struct srd_decoder; @@ -36,9 +35,8 @@ struct srd_decoder_inst; struct srd_channel; struct srd_session; -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ class Decoder { @@ -118,8 +116,7 @@ class Decoder bool _shown; }; -} // namespace decode -} // namespace data -} // namespace pv +} //namespace decode +} //namespace dsv -#endif // DSVIEW_PV_DATA_DECODE_DECODER_H +#endif diff --git a/DSView/pv/data/decode/decoderstatus.cpp b/DSView/decode/decoderstatus.cpp similarity index 93% rename from DSView/pv/data/decode/decoderstatus.cpp rename to DSView/decode/decoderstatus.cpp index ea2c45bd5..c43c0a0ec 100644 --- a/DSView/pv/data/decode/decoderstatus.cpp +++ b/DSView/decode/decoderstatus.cpp @@ -21,6 +21,9 @@ #include "decoderstatus.h" +namespace dsv{ +namespace decode{ + DecoderStatus::DecoderStatus() { m_bNumeric = false; @@ -33,3 +36,6 @@ void DecoderStatus::clear() m_resTable.reset(); m_bNumeric = false; } + +} //namespace decode +} //namespace dsv diff --git a/DSView/pv/data/decode/decoderstatus.h b/DSView/decode/decoderstatus.h similarity index 87% rename from DSView/pv/data/decode/decoderstatus.h rename to DSView/decode/decoderstatus.h index bf09d81d0..d71e28feb 100644 --- a/DSView/pv/data/decode/decoderstatus.h +++ b/DSView/decode/decoderstatus.h @@ -19,10 +19,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#pragma once +#ifndef DECODE_DECODER_STATUS_H +#define DECODE_DECODER_STATUS_H #include "annotationrestable.h" +namespace dsv{ +namespace decode{ + class DecoderStatus { public: @@ -36,3 +40,8 @@ class DecoderStatus void *sdr_decoder_handle; AnnotationResTable m_resTable; }; + +#endif //DECODE_DECODER_STATUS_H + +} //namespace decode +} //namespace dsv diff --git a/DSView/pv/dsvdef.cpp b/DSView/decode/displaydataformat.h similarity index 75% rename from DSView/pv/dsvdef.cpp rename to DSView/decode/displaydataformat.h index d54f53f4c..5150b67ad 100644 --- a/DSView/pv/dsvdef.cpp +++ b/DSView/decode/displaydataformat.h @@ -2,7 +2,7 @@ * This file is part of the DSView project. * DSView is based on PulseView. * - * Copyright (C) 2021 DreamSourceLab + * Copyright (C) 2023 DreamSourceLab * * 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 @@ -19,19 +19,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "dsvdef.h" +#ifndef DECODE_DISPLAY_DATA_FORMAT_H +#define DECODE_DISPLAY_DATA_FORMAT_H + #include -#ifdef DS_DEBUG_TRACE -#include - void ds_print(const char *s){ - printf(s); - } -#endif +namespace dsv{ +namespace decode{ -namespace DecoderDataFormat + +class DisplayDataFormat { - int Parse(const char *name){ + +public: + enum + { + hex=0, + dec=1, + oct=2, + bin=3, + ascii=4 + }; + + static inline int Parse(const char *name) + { if (strcmp(name, "dec") == 0){ return (int)dec; } @@ -49,4 +60,9 @@ namespace DecoderDataFormat } return (int)hex; } -} +}; + +#endif + +} //namespace decode +} //namespace dsv \ No newline at end of file diff --git a/DSView/pv/data/decode/row.cpp b/DSView/decode/row.cpp similarity index 96% rename from DSView/pv/data/decode/row.cpp rename to DSView/decode/row.cpp index b54b402db..a44e9262b 100644 --- a/DSView/pv/data/decode/row.cpp +++ b/DSView/decode/row.cpp @@ -24,9 +24,8 @@ #include #include -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ Row::Row() : _decoder(NULL), @@ -97,6 +96,5 @@ bool Row::operator<(const Row &other) const (_decoder == other._decoder && _order < other._order); } -} // decode -} // data -} // pv +} //namespace decode +} //namespace dsv \ No newline at end of file diff --git a/DSView/pv/data/decode/row.h b/DSView/decode/row.h similarity index 89% rename from DSView/pv/data/decode/row.h rename to DSView/decode/row.h index 81c1e5cd8..66abbe69f 100644 --- a/DSView/pv/data/decode/row.h +++ b/DSView/decode/row.h @@ -19,8 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef DSVIEW_PV_DATA_DECODE_ROW_H -#define DSVIEW_PV_DATA_DECODE_ROW_H +#ifndef DECODE_ROW_H +#define DECODE_ROW_H #include @@ -29,9 +29,8 @@ struct srd_decoder; struct srd_decoder_annotation_row; -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ //map find key data class Row @@ -69,8 +68,7 @@ class Row int _order; }; -} // decode -} // data -} // pv +} //namespace decode +} //namespace dsv -#endif // DSVIEW_PV_DATA_DECODE_ROW_H +#endif // DECODE_ROW_H diff --git a/DSView/pv/data/decode/rowdata.cpp b/DSView/decode/rowdata.cpp similarity index 95% rename from DSView/pv/data/decode/rowdata.cpp rename to DSView/decode/rowdata.cpp index abcd4c2f9..1bce2cc24 100644 --- a/DSView/pv/data/decode/rowdata.cpp +++ b/DSView/decode/rowdata.cpp @@ -29,9 +29,8 @@ using std::max; using std::min; using std::vector; -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ std::mutex RowData::_global_visitor_mutex; @@ -81,7 +80,7 @@ uint64_t RowData::get_min_annotation() return _min_annotation; } -void RowData::get_annotation_subset(std::vector &dest, +void RowData::get_annotation_subset(std::vector &dest, uint64_t start_sample, uint64_t end_sample) { std::lock_guard lock(_global_visitor_mutex); @@ -143,6 +142,5 @@ bool RowData::get_annotation(Annotation &ann, uint64_t index) } } -} // decode -} // data -} // pv +} //namespace decode +} //namespace dsv \ No newline at end of file diff --git a/DSView/pv/data/decode/rowdata.h b/DSView/decode/rowdata.h similarity index 83% rename from DSView/pv/data/decode/rowdata.h rename to DSView/decode/rowdata.h index 8314eb6b6..ee349dd4e 100644 --- a/DSView/pv/data/decode/rowdata.h +++ b/DSView/decode/rowdata.h @@ -20,17 +20,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef DSVIEW_PV_DATA_DECODE_ROWDATA_H -#define DSVIEW_PV_DATA_DECODE_ROWDATA_H +#ifndef DECODE_ROWDATA_H +#define DECODE_ROWDATA_H #include #include #include "annotation.h" -namespace pv { -namespace data { -namespace decode { +namespace dsv{ +namespace decode{ class RowData { @@ -52,12 +51,12 @@ class RowData return _item_count; } - bool get_annotation(pv::data::decode::Annotation &ann, uint64_t index); + bool get_annotation(Annotation &ann, uint64_t index); /** * Extracts sorted annotations between two period into a vector. */ - void get_annotation_subset(std::vector &dest, + void get_annotation_subset(std::vector &dest, uint64_t start_sample, uint64_t end_sample); void clear(); @@ -70,8 +69,7 @@ class RowData static std::mutex _global_visitor_mutex; }; -} -} // data -} // pv +} //namespace decode +} //namespace dsv -#endif // DSVIEW_PV_DATA_DECODE_ROWDATA_H +#endif // DECODE_ROWDATA_H diff --git a/DSView/pv/dialogs/about.cpp b/DSView/dialogs/about.cpp similarity index 98% rename from DSView/pv/dialogs/about.cpp rename to DSView/dialogs/about.cpp index 09cf27aa2..37bf832fd 100644 --- a/DSView/pv/dialogs/about.cpp +++ b/DSView/dialogs/about.cpp @@ -32,11 +32,11 @@ #include #include "../config/appconfig.h" -#include "../dsvdef.h" +#include "../basedef.h" #include "../utility/encoding.h" #include "../ui/langresource.h" -namespace pv { +namespace dsv { namespace dialogs { About::About(QWidget *parent) : @@ -127,4 +127,4 @@ About::~About() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/about.h b/DSView/dialogs/about.h similarity index 97% rename from DSView/pv/dialogs/about.h rename to DSView/dialogs/about.h index a86ca1278..cfbf09ef0 100644 --- a/DSView/pv/dialogs/about.h +++ b/DSView/dialogs/about.h @@ -28,7 +28,7 @@ #include "dsdialog.h" -namespace pv { +namespace dsv { namespace dialogs { class About : public DSDialog @@ -41,6 +41,6 @@ class About : public DSDialog }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_ABOUT_H diff --git a/DSView/pv/dialogs/applicationpardlg.cpp b/DSView/dialogs/applicationpardlg.cpp similarity index 99% rename from DSView/pv/dialogs/applicationpardlg.cpp rename to DSView/dialogs/applicationpardlg.cpp index d2cc9fe75..a04c08d9e 100644 --- a/DSView/pv/dialogs/applicationpardlg.cpp +++ b/DSView/dialogs/applicationpardlg.cpp @@ -39,7 +39,7 @@ #include "../ui/dscombobox.h" #include "../log.h" -namespace pv +namespace dsv { namespace dialogs { diff --git a/DSView/pv/dialogs/applicationpardlg.h b/DSView/dialogs/applicationpardlg.h similarity index 99% rename from DSView/pv/dialogs/applicationpardlg.h rename to DSView/dialogs/applicationpardlg.h index 7c0291a1a..a675c657f 100644 --- a/DSView/pv/dialogs/applicationpardlg.h +++ b/DSView/dialogs/applicationpardlg.h @@ -37,7 +37,7 @@ struct FontBindInfo float *ptr_size; }; -namespace pv +namespace dsv { namespace dialogs { diff --git a/DSView/pv/dialogs/calibration.cpp b/DSView/dialogs/calibration.cpp similarity index 99% rename from DSView/pv/dialogs/calibration.cpp rename to DSView/dialogs/calibration.cpp index 8103be85a..b45f8134f 100644 --- a/DSView/pv/dialogs/calibration.cpp +++ b/DSView/dialogs/calibration.cpp @@ -38,7 +38,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace dialogs { const QString Calibration::VGAIN = QT_TR_NOOP(" VGAIN"); @@ -350,4 +350,4 @@ void Calibration::on_reset() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/calibration.h b/DSView/dialogs/calibration.h similarity index 98% rename from DSView/pv/dialogs/calibration.h rename to DSView/dialogs/calibration.h index 4bbdbf46f..f6d4d6a11 100644 --- a/DSView/pv/dialogs/calibration.h +++ b/DSView/dialogs/calibration.h @@ -35,7 +35,7 @@ class DeviceAgent; -namespace pv { +namespace dsv { namespace dialogs { @@ -82,6 +82,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_CALIBRATION_H diff --git a/DSView/pv/dialogs/decoderoptionsdlg.cpp b/DSView/dialogs/decoderoptionsdlg.cpp similarity index 99% rename from DSView/pv/dialogs/decoderoptionsdlg.cpp rename to DSView/dialogs/decoderoptionsdlg.cpp index 127a8a298..ee73e54ba 100644 --- a/DSView/pv/dialogs/decoderoptionsdlg.cpp +++ b/DSView/dialogs/decoderoptionsdlg.cpp @@ -50,10 +50,9 @@ #include "../ui/langresource.h" #include "../config/appconfig.h" -namespace pv { +namespace dsv { namespace dialogs { - DecoderOptionsDlg::DecoderOptionsDlg(QWidget *parent) :DSDialog(parent) { diff --git a/DSView/pv/dialogs/decoderoptionsdlg.h b/DSView/dialogs/decoderoptionsdlg.h similarity index 99% rename from DSView/pv/dialogs/decoderoptionsdlg.h rename to DSView/dialogs/decoderoptionsdlg.h index f1632e578..bfb571845 100644 --- a/DSView/pv/dialogs/decoderoptionsdlg.h +++ b/DSView/dialogs/decoderoptionsdlg.h @@ -35,7 +35,7 @@ struct srd_channel; #include "dsdialog.h" -namespace pv { +namespace dsv { namespace data{ class DecoderStack; diff --git a/DSView/pv/dialogs/deviceoptions.cpp b/DSView/dialogs/deviceoptions.cpp similarity index 99% rename from DSView/pv/dialogs/deviceoptions.cpp rename to DSView/dialogs/deviceoptions.cpp index 6277338de..a52c5b0b7 100644 --- a/DSView/pv/dialogs/deviceoptions.cpp +++ b/DSView/dialogs/deviceoptions.cpp @@ -84,7 +84,7 @@ void ChannelLabel::on_checked() //--------------------------DeviceOptions -namespace pv { +namespace dsv{ namespace dialogs { DeviceOptions::DeviceOptions(QWidget *parent) : @@ -892,4 +892,4 @@ void DeviceOptions::try_resize_scroll() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/deviceoptions.h b/DSView/dialogs/deviceoptions.h similarity index 99% rename from DSView/pv/dialogs/deviceoptions.h rename to DSView/dialogs/deviceoptions.h index 202fae814..a58a5d8b3 100644 --- a/DSView/pv/dialogs/deviceoptions.h +++ b/DSView/dialogs/deviceoptions.h @@ -80,7 +80,7 @@ struct ChannelModePair class DeviceAgent; -namespace pv { +namespace dsv { namespace dialogs { @@ -152,6 +152,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DEVICEOPTIONS_H diff --git a/DSView/pv/dialogs/dsdialog.cpp b/DSView/dialogs/dsdialog.cpp similarity index 98% rename from DSView/pv/dialogs/dsdialog.cpp rename to DSView/dialogs/dsdialog.cpp index 4a410e3e5..483c5ce4b 100644 --- a/DSView/pv/dialogs/dsdialog.cpp +++ b/DSView/dialogs/dsdialog.cpp @@ -28,11 +28,11 @@ #include #include #include -#include "../dsvdef.h" +#include "../basedef.h" #include "../config/appconfig.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace dialogs { DSDialog::DSDialog() : @@ -193,4 +193,4 @@ void DSDialog::show() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/dsdialog.h b/DSView/dialogs/dsdialog.h similarity index 98% rename from DSView/pv/dialogs/dsdialog.h rename to DSView/dialogs/dsdialog.h index af94c8d6b..ad938c9c3 100644 --- a/DSView/pv/dialogs/dsdialog.h +++ b/DSView/dialogs/dsdialog.h @@ -34,7 +34,7 @@ class QDialogButtonBox; -namespace pv { +namespace dsv { namespace dialogs { class Shadow; @@ -96,6 +96,6 @@ class DSDialog : public QDialog, IFontForm }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DSDIALOG_H diff --git a/DSView/pv/dialogs/dsmessagebox.cpp b/DSView/dialogs/dsmessagebox.cpp similarity index 99% rename from DSView/pv/dialogs/dsmessagebox.cpp rename to DSView/dialogs/dsmessagebox.cpp index 05e0f3f96..885468690 100644 --- a/DSView/pv/dialogs/dsmessagebox.cpp +++ b/DSView/dialogs/dsmessagebox.cpp @@ -33,7 +33,7 @@ #include "../config/appconfig.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace dialogs { DSMessageBox::DSMessageBox(QWidget *parent,const QString title) : @@ -142,4 +142,4 @@ int DSMessageBox::exec() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/dsmessagebox.h b/DSView/dialogs/dsmessagebox.h similarity index 98% rename from DSView/pv/dialogs/dsmessagebox.h rename to DSView/dialogs/dsmessagebox.h index 254dee386..ff950fbdb 100644 --- a/DSView/pv/dialogs/dsmessagebox.h +++ b/DSView/dialogs/dsmessagebox.h @@ -30,7 +30,7 @@ #include "../toolbars/titlebar.h" -namespace pv { +namespace dsv { namespace dialogs { class Shadow; @@ -70,6 +70,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DSMESSAGEBOX_H diff --git a/DSView/pv/dialogs/dsomeasure.cpp b/DSView/dialogs/dsomeasure.cpp similarity index 99% rename from DSView/pv/dialogs/dsomeasure.cpp rename to DSView/dialogs/dsomeasure.cpp index 09f881191..19c1ac12a 100644 --- a/DSView/pv/dialogs/dsomeasure.cpp +++ b/DSView/dialogs/dsomeasure.cpp @@ -34,9 +34,9 @@ #include "../ui/langresource.h" using namespace std; -using namespace pv::view; +using namespace dsv::view; -namespace pv { +namespace dsv { namespace dialogs { DsoMeasure::DsoMeasure(SigSession *session, View &parent, @@ -190,4 +190,4 @@ void DsoMeasure::reset() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/dsomeasure.h b/DSView/dialogs/dsomeasure.h similarity index 98% rename from DSView/pv/dialogs/dsomeasure.h rename to DSView/dialogs/dsomeasure.h index ca541ef1c..0517efbf1 100644 --- a/DSView/pv/dialogs/dsomeasure.h +++ b/DSView/dialogs/dsomeasure.h @@ -33,7 +33,7 @@ #include "../toolbars/titlebar.h" #include "dsdialog.h" -namespace pv { +namespace dsv { class SigSession; @@ -77,6 +77,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DSOMEASURE_H diff --git a/DSView/pv/dialogs/fftoptions.cpp b/DSView/dialogs/fftoptions.cpp similarity index 99% rename from DSView/pv/dialogs/fftoptions.cpp rename to DSView/dialogs/fftoptions.cpp index 54500e7c6..8bde8641d 100644 --- a/DSView/pv/dialogs/fftoptions.cpp +++ b/DSView/dialogs/fftoptions.cpp @@ -36,7 +36,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace dialogs { FftOptions::FftOptions(QWidget *parent, SigSession *session) : @@ -286,4 +286,4 @@ void FftOptions::len_changed(int index) } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/fftoptions.h b/DSView/dialogs/fftoptions.h similarity index 98% rename from DSView/pv/dialogs/fftoptions.h rename to DSView/dialogs/fftoptions.h index 9fe526b6c..7f5e4b221 100644 --- a/DSView/pv/dialogs/fftoptions.h +++ b/DSView/dialogs/fftoptions.h @@ -33,7 +33,7 @@ #include "dsdialog.h" #include "../ui/dscombobox.h" -namespace pv { +namespace dsv { class SigSession; @@ -80,6 +80,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_FFTOPTIONS_H diff --git a/DSView/pv/dialogs/interval.cpp b/DSView/dialogs/interval.cpp similarity index 98% rename from DSView/pv/dialogs/interval.cpp rename to DSView/dialogs/interval.cpp index f9bdec2d3..1bfacf7fe 100644 --- a/DSView/pv/dialogs/interval.cpp +++ b/DSView/dialogs/interval.cpp @@ -25,7 +25,7 @@ #include "../ui/langresource.h" -namespace pv { +namespace dsv { namespace dialogs { Interval::Interval(QWidget *parent) : @@ -106,4 +106,4 @@ void Interval::on_inputbox_changed(double value) } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/interval.h b/DSView/dialogs/interval.h similarity index 98% rename from DSView/pv/dialogs/interval.h rename to DSView/dialogs/interval.h index 825c03309..8c4ced045 100644 --- a/DSView/pv/dialogs/interval.h +++ b/DSView/dialogs/interval.h @@ -32,7 +32,7 @@ #include "../toolbars/titlebar.h" #include "dsdialog.h" -namespace pv { +namespace dsv { namespace dialogs { class Interval : public DSDialog @@ -68,6 +68,6 @@ private Q_SLOTS: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_INTERVAL_H diff --git a/DSView/pv/dialogs/lissajousoptions.cpp b/DSView/dialogs/lissajousoptions.cpp similarity index 99% rename from DSView/pv/dialogs/lissajousoptions.cpp rename to DSView/dialogs/lissajousoptions.cpp index 05c27184c..c58e2703a 100644 --- a/DSView/pv/dialogs/lissajousoptions.cpp +++ b/DSView/dialogs/lissajousoptions.cpp @@ -36,9 +36,9 @@ using namespace boost; using namespace std; -using namespace pv::view; +using namespace dsv::view; -namespace pv { +namespace dsv { namespace dialogs { LissajousOptions::LissajousOptions(SigSession *session, QWidget *parent) : @@ -201,4 +201,4 @@ void LissajousOptions::reject() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/lissajousoptions.h b/DSView/dialogs/lissajousoptions.h similarity index 98% rename from DSView/pv/dialogs/lissajousoptions.h rename to DSView/dialogs/lissajousoptions.h index edb6ce685..cc22ee7c6 100644 --- a/DSView/pv/dialogs/lissajousoptions.h +++ b/DSView/dialogs/lissajousoptions.h @@ -37,7 +37,7 @@ #include "../toolbars/titlebar.h" #include "dsdialog.h" -namespace pv { +namespace dsv { class SigSession; @@ -80,6 +80,6 @@ class LissajousOptions : public DSDialog }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_LISSAJOUSOPTIONS_H diff --git a/DSView/pv/dialogs/mathoptions.cpp b/DSView/dialogs/mathoptions.cpp similarity index 99% rename from DSView/pv/dialogs/mathoptions.cpp rename to DSView/dialogs/mathoptions.cpp index e8b29580d..186c579fc 100644 --- a/DSView/pv/dialogs/mathoptions.cpp +++ b/DSView/dialogs/mathoptions.cpp @@ -36,9 +36,9 @@ using namespace boost; using namespace std; -using namespace pv::view; +using namespace dsv::view; -namespace pv { +namespace dsv { namespace dialogs { MathOptions::MathOptions(SigSession *session, QWidget *parent) : @@ -229,4 +229,4 @@ void MathOptions::reject() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/mathoptions.h b/DSView/dialogs/mathoptions.h similarity index 98% rename from DSView/pv/dialogs/mathoptions.h rename to DSView/dialogs/mathoptions.h index ed6aa2fbe..a47be4947 100644 --- a/DSView/pv/dialogs/mathoptions.h +++ b/DSView/dialogs/mathoptions.h @@ -37,7 +37,7 @@ #include "../toolbars/titlebar.h" #include "dsdialog.h" -namespace pv { +namespace dsv { class SigSession; @@ -80,6 +80,6 @@ class MathOptions : public DSDialog }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_MATHOPTIONS_H diff --git a/DSView/pv/dialogs/protocolexp.cpp b/DSView/dialogs/protocolexp.cpp similarity index 99% rename from DSView/pv/dialogs/protocolexp.cpp rename to DSView/dialogs/protocolexp.cpp index 3f09b7811..26dbcec9b 100644 --- a/DSView/pv/dialogs/protocolexp.cpp +++ b/DSView/dialogs/protocolexp.cpp @@ -46,9 +46,9 @@ #define EXPORT_DEC_ROW_COUNT_MAX 20 -using namespace pv::data::decode; +using namespace dsv::decode; -namespace pv { +namespace dsv { namespace dialogs { ProtocolExp::ProtocolExp(QWidget *parent, SigSession *session) : @@ -340,4 +340,4 @@ void ProtocolExp::cancel_export() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/protocolexp.h b/DSView/dialogs/protocolexp.h similarity index 98% rename from DSView/pv/dialogs/protocolexp.h rename to DSView/dialogs/protocolexp.h index f8afc8446..a962df47f 100644 --- a/DSView/pv/dialogs/protocolexp.h +++ b/DSView/dialogs/protocolexp.h @@ -35,7 +35,7 @@ #include "dsdialog.h" #include "../ui/dscombobox.h" -namespace pv { +namespace dsv { class SigSession; @@ -93,6 +93,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_PROTOCOLEXP_H diff --git a/DSView/pv/dialogs/protocollist.cpp b/DSView/dialogs/protocollist.cpp similarity index 99% rename from DSView/pv/dialogs/protocollist.cpp rename to DSView/dialogs/protocollist.cpp index 9c65f9605..0e2d4a183 100644 --- a/DSView/pv/dialogs/protocollist.cpp +++ b/DSView/dialogs/protocollist.cpp @@ -36,7 +36,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace dialogs { ProtocolList::ProtocolList(QWidget *parent, SigSession *session) : @@ -204,4 +204,4 @@ void ProtocolList::on_row_check(bool show) } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/protocollist.h b/DSView/dialogs/protocollist.h similarity index 98% rename from DSView/pv/dialogs/protocollist.h rename to DSView/dialogs/protocollist.h index 1357d38fd..a6d3c4787 100644 --- a/DSView/pv/dialogs/protocollist.h +++ b/DSView/dialogs/protocollist.h @@ -34,7 +34,7 @@ #include "dsdialog.h" #include "../ui/dscombobox.h" -namespace pv { +namespace dsv { class SigSession; @@ -71,6 +71,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_PROTOCOLLIST_H diff --git a/DSView/pv/dialogs/regionoptions.cpp b/DSView/dialogs/regionoptions.cpp similarity index 99% rename from DSView/pv/dialogs/regionoptions.cpp rename to DSView/dialogs/regionoptions.cpp index c4d2ea725..229263edc 100644 --- a/DSView/pv/dialogs/regionoptions.cpp +++ b/DSView/dialogs/regionoptions.cpp @@ -30,7 +30,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace dialogs { const QString RegionOptions::RegionStart = QT_TR_NOOP("Start"); @@ -114,4 +114,4 @@ void RegionOptions::set_region() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/regionoptions.h b/DSView/dialogs/regionoptions.h similarity index 97% rename from DSView/pv/dialogs/regionoptions.h rename to DSView/dialogs/regionoptions.h index a66b2811a..170a892fa 100644 --- a/DSView/pv/dialogs/regionoptions.h +++ b/DSView/dialogs/regionoptions.h @@ -32,7 +32,7 @@ #include "dsdialog.h" #include "../ui/dscombobox.h" -namespace pv { +namespace dsv { class SigSession; @@ -67,6 +67,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_REGIONOPTIONS_H diff --git a/DSView/pv/dialogs/search.cpp b/DSView/dialogs/search.cpp similarity index 99% rename from DSView/pv/dialogs/search.cpp rename to DSView/dialogs/search.cpp index 8392b0215..79fb7c1b5 100644 --- a/DSView/pv/dialogs/search.cpp +++ b/DSView/dialogs/search.cpp @@ -28,7 +28,7 @@ #include "../ui/langresource.h" -namespace pv { +namespace dsv { namespace dialogs { Search::Search(QWidget *parent, SigSession *session, std::map pattern) : @@ -124,4 +124,4 @@ std::map Search::get_pattern() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/search.h b/DSView/dialogs/search.h similarity index 97% rename from DSView/pv/dialogs/search.h rename to DSView/dialogs/search.h index ff79bfbab..0b8f36c48 100644 --- a/DSView/pv/dialogs/search.h +++ b/DSView/dialogs/search.h @@ -33,7 +33,7 @@ #include "../toolbars/titlebar.h" #include "dsdialog.h" -namespace pv { +namespace dsv { namespace dialogs { class Search : public DSDialog @@ -64,6 +64,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_SEARCH_H diff --git a/DSView/pv/dialogs/shadow.cpp b/DSView/dialogs/shadow.cpp similarity index 98% rename from DSView/pv/dialogs/shadow.cpp rename to DSView/dialogs/shadow.cpp index 0fc91ee46..ecb1704c3 100644 --- a/DSView/pv/dialogs/shadow.cpp +++ b/DSView/dialogs/shadow.cpp @@ -27,7 +27,7 @@ QT_BEGIN_NAMESPACE extern Q_WIDGETS_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0 ); QT_END_NAMESPACE -namespace pv { +namespace dsv { namespace dialogs { Shadow::Shadow(QObject *parent) : @@ -101,4 +101,4 @@ QRectF Shadow::boundingRectFor(const QRectF& rect) const } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/shadow.h b/DSView/dialogs/shadow.h similarity index 98% rename from DSView/pv/dialogs/shadow.h rename to DSView/dialogs/shadow.h index e37bbbad7..50a43cc3e 100644 --- a/DSView/pv/dialogs/shadow.h +++ b/DSView/dialogs/shadow.h @@ -26,7 +26,7 @@ #include #include -namespace pv { +namespace dsv { namespace dialogs { class Shadow : public QGraphicsEffect @@ -54,6 +54,6 @@ class Shadow : public QGraphicsEffect }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_SHADOW_H diff --git a/DSView/pv/dialogs/storeprogress.cpp b/DSView/dialogs/storeprogress.cpp similarity index 99% rename from DSView/pv/dialogs/storeprogress.cpp rename to DSView/dialogs/storeprogress.cpp index 032ad6f0d..8fbdbd9e1 100644 --- a/DSView/pv/dialogs/storeprogress.cpp +++ b/DSView/dialogs/storeprogress.cpp @@ -35,7 +35,7 @@ #include "../ui/langresource.h" -namespace pv { +namespace dsv { namespace dialogs { StoreProgress::StoreProgress(SigSession *session, QWidget *parent) : diff --git a/DSView/pv/dialogs/storeprogress.h b/DSView/dialogs/storeprogress.h similarity index 99% rename from DSView/pv/dialogs/storeprogress.h rename to DSView/dialogs/storeprogress.h index a519135b8..a706c583b 100644 --- a/DSView/pv/dialogs/storeprogress.h +++ b/DSView/dialogs/storeprogress.h @@ -34,7 +34,7 @@ class QGridLayout; class QPushButton; class QWidget; -namespace pv { +namespace dsv { class SigSession; diff --git a/DSView/pv/dialogs/waitingdialog.cpp b/DSView/dialogs/waitingdialog.cpp similarity index 99% rename from DSView/pv/dialogs/waitingdialog.cpp rename to DSView/dialogs/waitingdialog.cpp index 836bb4be8..00d2291bc 100644 --- a/DSView/pv/dialogs/waitingdialog.cpp +++ b/DSView/dialogs/waitingdialog.cpp @@ -38,7 +38,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace dialogs { const QString WaitingDialog::TIPS_WAIT = "Waiting"; @@ -214,4 +214,4 @@ void WaitingDialog::changeText() } } // namespace dialogs -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dialogs/waitingdialog.h b/DSView/dialogs/waitingdialog.h similarity index 98% rename from DSView/pv/dialogs/waitingdialog.h rename to DSView/dialogs/waitingdialog.h index 8bfa4b18c..47d2a6c36 100644 --- a/DSView/pv/dialogs/waitingdialog.h +++ b/DSView/dialogs/waitingdialog.h @@ -34,7 +34,7 @@ class DeviceAgent; -namespace pv { +namespace dsv { namespace dialogs { @@ -81,6 +81,6 @@ private slots: }; } // namespace dialogs -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_WAITINGDIALOG_H diff --git a/DSView/pv/dock/dsotriggerdock.cpp b/DSView/dock/dsotriggerdock.cpp similarity index 99% rename from DSView/pv/dock/dsotriggerdock.cpp rename to DSView/dock/dsotriggerdock.cpp index ed4fd4781..2e04f8f07 100644 --- a/DSView/pv/dock/dsotriggerdock.cpp +++ b/DSView/dock/dsotriggerdock.cpp @@ -41,7 +41,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace dock { DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession *session) : @@ -497,4 +497,4 @@ void DsoTriggerDock::update_font() } } // namespace dock -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dock/dsotriggerdock.h b/DSView/dock/dsotriggerdock.h similarity index 98% rename from DSView/pv/dock/dsotriggerdock.h rename to DSView/dock/dsotriggerdock.h index 4c5c3f276..d610d0c4a 100644 --- a/DSView/pv/dock/dsotriggerdock.h +++ b/DSView/dock/dsotriggerdock.h @@ -35,7 +35,7 @@ #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { class SigSession; @@ -111,6 +111,6 @@ private slots: }; } // namespace dock -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DSOTRIGGERDOCK_H diff --git a/DSView/pv/dock/keywordlineedit.cpp b/DSView/dock/keywordlineedit.cpp similarity index 100% rename from DSView/pv/dock/keywordlineedit.cpp rename to DSView/dock/keywordlineedit.cpp diff --git a/DSView/pv/dock/keywordlineedit.h b/DSView/dock/keywordlineedit.h similarity index 100% rename from DSView/pv/dock/keywordlineedit.h rename to DSView/dock/keywordlineedit.h diff --git a/DSView/pv/dock/measuredock.cpp b/DSView/dock/measuredock.cpp similarity index 99% rename from DSView/pv/dock/measuredock.cpp rename to DSView/dock/measuredock.cpp index 4fa44743d..f5d1c8ff5 100644 --- a/DSView/pv/dock/measuredock.cpp +++ b/DSView/dock/measuredock.cpp @@ -44,10 +44,10 @@ using namespace boost; -namespace pv { +namespace dsv { namespace dock { -using namespace pv::view; +using namespace dsv::view; MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession *session) : QScrollArea(parent), @@ -749,7 +749,7 @@ void MeasureDock::goto_cursor() void MeasureDock::cursor_update() { - using namespace pv::data; + using namespace dsv::data; for(auto it = _opt_row_list.begin(); it != _opt_row_list.end(); it++) { @@ -838,4 +838,4 @@ void MeasureDock::update_font() } } // namespace dock -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dock/measuredock.h b/DSView/dock/measuredock.h similarity index 99% rename from DSView/pv/dock/measuredock.h rename to DSView/dock/measuredock.h index 04442dbfe..4e82ca01b 100644 --- a/DSView/pv/dock/measuredock.h +++ b/DSView/dock/measuredock.h @@ -42,7 +42,7 @@ #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { class SigSession; @@ -159,6 +159,6 @@ public slots: }; } // namespace dock -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_MEASUREDOCK_H diff --git a/DSView/pv/dock/protocoldock.cpp b/DSView/dock/protocoldock.cpp similarity index 99% rename from DSView/pv/dock/protocoldock.cpp rename to DSView/dock/protocoldock.cpp index eeb58903c..16d1a9dbe 100644 --- a/DSView/pv/dock/protocoldock.cpp +++ b/DSView/dock/protocoldock.cpp @@ -59,7 +59,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace dock { ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *session) : @@ -380,7 +380,7 @@ bool ProtocolDock::add_protocol_by_id(QString id, bool silent, std::list_data_handle); DecoderStatus *dstatus = new DecoderStatus(); - dstatus->m_format = (int)DecoderDataFormat::hex; + dstatus->m_format = (int)DisplayDataFormat::hex; QString protocolName(decoder->name); QString protocolId(decoder->id); @@ -411,7 +411,7 @@ bool ProtocolDock::add_protocol_by_id(QString id, bool silent, std::listSetProtocolFormat(fmt.c_str()); - dstatus->m_format = DecoderDataFormat::Parse(fmt.c_str()); + dstatus->m_format = DisplayDataFormat::Parse(fmt.c_str()); } // progress connection @@ -880,7 +880,7 @@ void ProtocolDock::OnProtocolFormatChanged(QString format, void *handle){ if (lay->m_decoderStatus != NULL) { - lay->m_decoderStatus->m_format = DecoderDataFormat::Parse(format.toStdString().c_str()); + lay->m_decoderStatus->m_format = DisplayDataFormat::Parse(format.toStdString().c_str()); protocol_updated(); } @@ -1056,4 +1056,4 @@ bool ProtocolDock::protocol_sort_callback(const DecoderInfoItem *o1, const Decod } } // namespace dock -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dock/protocoldock.h b/DSView/dock/protocoldock.h similarity index 99% rename from DSView/pv/dock/protocoldock.h rename to DSView/dock/protocoldock.h index adbaa233e..a25706d73 100644 --- a/DSView/pv/dock/protocoldock.h +++ b/DSView/dock/protocoldock.h @@ -51,7 +51,7 @@ struct DecoderInfoItem{ void *_data_handle; //srd_decoder* type }; -namespace pv { +namespace dsv { class SigSession; @@ -176,6 +176,6 @@ private slots: }; } // namespace dock -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_PROTOCOLDOCK_H diff --git a/DSView/pv/dock/protocolitemlayer.cpp b/DSView/dock/protocolitemlayer.cpp similarity index 98% rename from DSView/pv/dock/protocolitemlayer.cpp rename to DSView/dock/protocolitemlayer.cpp index c347ad313..4c7a1fdfd 100644 --- a/DSView/pv/dock/protocolitemlayer.cpp +++ b/DSView/dock/protocolitemlayer.cpp @@ -24,7 +24,7 @@ #include #include "../config/appconfig.h" -namespace pv { +namespace dsv { namespace dock { ProtocolItemLayer::ProtocolItemLayer(QWidget *parent, QString protocolName, IProtocolItemLayerCallback *callback) @@ -147,7 +147,7 @@ void ProtocolItemLayer::LoadFormatSelect(bool bSingle) assert(format); m_bSetting = true; - int dex = DecoderDataFormat::Parse(format); + int dex = DisplayDataFormat::Parse(format); if (dex < (int)_format_combox->count()){ _format_combox->setCurrentIndex(dex); } diff --git a/DSView/pv/dock/protocolitemlayer.h b/DSView/dock/protocolitemlayer.h similarity index 99% rename from DSView/pv/dock/protocolitemlayer.h rename to DSView/dock/protocolitemlayer.h index 38de97a6f..5db77e8b1 100644 --- a/DSView/pv/dock/protocolitemlayer.h +++ b/DSView/dock/protocolitemlayer.h @@ -29,7 +29,7 @@ class DecoderStatus; -namespace pv{ +namespace dsv{ namespace view{ class Trace; diff --git a/DSView/pv/dock/searchcombobox.cpp b/DSView/dock/searchcombobox.cpp similarity index 100% rename from DSView/pv/dock/searchcombobox.cpp rename to DSView/dock/searchcombobox.cpp diff --git a/DSView/pv/dock/searchcombobox.h b/DSView/dock/searchcombobox.h similarity index 100% rename from DSView/pv/dock/searchcombobox.h rename to DSView/dock/searchcombobox.h diff --git a/DSView/pv/dock/searchdock.cpp b/DSView/dock/searchdock.cpp similarity index 98% rename from DSView/pv/dock/searchdock.cpp rename to DSView/dock/searchdock.cpp index a5cd1c15f..f7c917d78 100644 --- a/DSView/pv/dock/searchdock.cpp +++ b/DSView/dock/searchdock.cpp @@ -44,11 +44,11 @@ #include "../appcontrol.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace dock { -using namespace pv::view; -using namespace pv::widgets; +using namespace dsv::view; +using namespace dsv::widgets; SearchDock::SearchDock(QWidget *parent, View &view, SigSession *session) : QWidget(parent), @@ -261,4 +261,4 @@ void SearchDock::update_font() } } // namespace dock -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dock/searchdock.h b/DSView/dock/searchdock.h similarity index 98% rename from DSView/pv/dock/searchdock.h rename to DSView/dock/searchdock.h index 4eb5c300f..e7d6c88d1 100644 --- a/DSView/pv/dock/searchdock.h +++ b/DSView/dock/searchdock.h @@ -45,7 +45,7 @@ #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { class SigSession; @@ -94,6 +94,6 @@ public slots: }; } // namespace dock -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_SEARCHDOCK_H diff --git a/DSView/pv/dock/triggerdock.cpp b/DSView/dock/triggerdock.cpp similarity index 99% rename from DSView/pv/dock/triggerdock.cpp rename to DSView/dock/triggerdock.cpp index 0ca413299..878578709 100644 --- a/DSView/pv/dock/triggerdock.cpp +++ b/DSView/dock/triggerdock.cpp @@ -54,7 +54,7 @@ #include "../appcontrol.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace dock { const int TriggerDock::MinTrigPosition = 1; @@ -1081,4 +1081,4 @@ void TriggerDock::update_font() } } // namespace dock -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/dock/triggerdock.h b/DSView/dock/triggerdock.h similarity index 99% rename from DSView/pv/dock/triggerdock.h rename to DSView/dock/triggerdock.h index edc157d30..7b8a8fb0e 100644 --- a/DSView/pv/dock/triggerdock.h +++ b/DSView/dock/triggerdock.h @@ -43,7 +43,7 @@ #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { class SigSession; @@ -160,6 +160,6 @@ private slots: }; } // namespace dock -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TRIGGERDOCK_H diff --git a/DSView/dsapplication.cpp b/DSView/dsapplication.cpp deleted file mode 100644 index 98cb68977..000000000 --- a/DSView/dsapplication.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the DSView project. - * DSView is based on PulseView. - * - * Copyright (C) 2016 DreamSourceLab - * - * 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 - */ - -#include "dsapplication.h" - -#include - -DSApplication::DSApplication(int &argc, char **argv): - QApplication(argc, argv) -{ -} - -bool DSApplication::notify(QObject *receiver_, QEvent *event_) -{ - try { - return QApplication::notify(receiver_, event_); - } catch ( std::exception& e ) { - QMessageBox msg(NULL); - msg.setText(tr("Application Error")); - msg.setInformativeText(e.what()); - msg.setStandardButtons(QMessageBox::Ok); - msg.setIcon(QMessageBox::Warning); - msg.exec(); - } catch (...) { - QMessageBox msg(NULL); - msg.setText(tr("Application Error")); - msg.setInformativeText(tr("An unexpected error occurred")); - msg.setStandardButtons(QMessageBox::Ok); - msg.setIcon(QMessageBox::Warning); - msg.exec(); - } - return false; -} diff --git a/DSView/dsapplication.h b/DSView/dsapplication.h deleted file mode 100644 index 7e8047456..000000000 --- a/DSView/dsapplication.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of the DSView project. - * DSView is based on PulseView. - * - * Copyright (C) 2016 DreamSourceLab - * - * 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 DSVIEW_DSAPPLICATION_H -#define DSVIEW_DSAPPLICATION_H - -#include -#include - -class DSApplication : public QApplication -{ -public: - DSApplication(int &argc, char ** argv); - // ~MyApplication(); -private: - bool notify(QObject *receiver_, QEvent *event_); -}; - -#endif // DSVIEW_DSAPPLICATION_H diff --git a/DSView/pv/interface/icallbacks.h b/DSView/interface/icallbacks.h similarity index 100% rename from DSView/pv/interface/icallbacks.h rename to DSView/interface/icallbacks.h diff --git a/DSView/pv/log.cpp b/DSView/log.cpp similarity index 98% rename from DSView/pv/log.cpp rename to DSView/log.cpp index c92f1fdab..24001b1dd 100644 --- a/DSView/pv/log.cpp +++ b/DSView/log.cpp @@ -26,6 +26,8 @@ #include "utility/path.h" #include +namespace dsv{ + xlog_writer *dsv_log = nullptr; static xlog_context *log_ctx = nullptr; static bool b_logfile = false; @@ -133,4 +135,6 @@ QString get_dsv_log_path() #endif return lf; -} \ No newline at end of file +} + +} //namespace dsv \ No newline at end of file diff --git a/DSView/pv/log.h b/DSView/log.h similarity index 97% rename from DSView/pv/log.h rename to DSView/log.h index a69433ef1..409cd31fa 100644 --- a/DSView/pv/log.h +++ b/DSView/log.h @@ -25,6 +25,8 @@ #include #include +namespace dsv{ + extern xlog_writer *dsv_log; void dsv_log_init(); @@ -47,4 +49,6 @@ QString get_dsv_log_path(); #define dsv_dbg(fmt, args...) xlog_dbg(dsv_log, LOG_PREFIX fmt, ## args) #define dsv_detail(fmt, args...) xlog_detail(dsv_log, LOG_PREFIX fmt, ## args) +} //namespace dsv + #endif \ No newline at end of file diff --git a/DSView/main.cpp b/DSView/main.cpp index 1278f99c7..909f9a4c1 100644 --- a/DSView/main.cpp +++ b/DSView/main.cpp @@ -30,7 +30,7 @@ #include "dsapplication.h" #include "mystyle.h" #include "pv/mainframe.h" -#include "pv/config/appconfig.h" +#include "config/appconfig.h" #include "config.h" #include "pv/appcontrol.h" #include "pv/log.h" diff --git a/DSView/pv/data/analogsnapshot.cpp b/DSView/model/analogsnapshot.cpp similarity index 99% rename from DSView/pv/data/analogsnapshot.cpp rename to DSView/model/analogsnapshot.cpp index 0e5e82966..098bd9ca9 100644 --- a/DSView/pv/data/analogsnapshot.cpp +++ b/DSView/model/analogsnapshot.cpp @@ -31,7 +31,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace data { const int AnalogSnapshot::EnvelopeScalePower = 4; @@ -404,4 +404,4 @@ void* AnalogSnapshot::get_data(){ } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/analogsnapshot.h b/DSView/model/analogsnapshot.h similarity index 98% rename from DSView/pv/data/analogsnapshot.h rename to DSView/model/analogsnapshot.h index 3356f89ad..362818b92 100644 --- a/DSView/pv/data/analogsnapshot.h +++ b/DSView/model/analogsnapshot.h @@ -34,7 +34,7 @@ namespace AnalogSnapshotTest { class Basic; } -namespace pv { +namespace dsv { namespace data { class AnalogSnapshot : public Snapshot @@ -123,6 +123,6 @@ class AnalogSnapshot : public Snapshot }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_ANALOGSNAPSHOT_H diff --git a/DSView/pv/data/decodermodel.cpp b/DSView/model/decodermodel.cpp similarity index 98% rename from DSView/pv/data/decodermodel.cpp rename to DSView/model/decodermodel.cpp index af62d7b9f..8a14adc53 100644 --- a/DSView/pv/data/decodermodel.cpp +++ b/DSView/model/decodermodel.cpp @@ -29,7 +29,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace data { DecoderModel::DecoderModel(QObject *parent) @@ -97,4 +97,4 @@ QVariant DecoderModel::headerData(int section, } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/decodermodel.h b/DSView/model/decodermodel.h similarity index 98% rename from DSView/pv/data/decodermodel.h rename to DSView/model/decodermodel.h index d35849f42..602c478fe 100644 --- a/DSView/pv/data/decodermodel.h +++ b/DSView/model/decodermodel.h @@ -26,7 +26,7 @@ #include "decode/rowdata.h" -namespace pv { +namespace dsv { namespace data { class DecoderStack; @@ -58,6 +58,6 @@ class DecoderModel : public QAbstractTableModel }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_DECODERMODEL_H diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/model/decoderstack.cpp similarity index 99% rename from DSView/pv/data/decoderstack.cpp rename to DSView/model/decoderstack.cpp index 7e0e33b65..d74532ec9 100644 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/model/decoderstack.cpp @@ -37,13 +37,14 @@ #include "../ui/langresource.h" #include -using namespace pv::data::decode; using namespace std; using namespace boost; -namespace pv { +namespace dsv { namespace data { +using namespace decode; + const double DecoderStack::DecodeMargin = 1.0; const double DecoderStack::DecodeThreshold = 0.2; const int64_t DecoderStack::DecodeChunkLength = 4 * 1024; @@ -871,4 +872,4 @@ const char* DecoderStack::get_root_decoder_id() } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/decoderstack.h b/DSView/model/decoderstack.h similarity index 99% rename from DSView/pv/data/decoderstack.h rename to DSView/model/decoderstack.h index 310161a2d..93dbb3337 100644 --- a/DSView/pv/data/decoderstack.h +++ b/DSView/model/decoderstack.h @@ -39,7 +39,7 @@ namespace DecoderStackTest { class TwoDecoderStack; } -namespace pv { +namespace dsv { class SigSession; @@ -221,6 +221,6 @@ class DecoderStack : public QObject, public SignalData }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_DECODERSTACK_H diff --git a/DSView/pv/data/dsosnapshot.cpp b/DSView/model/dsosnapshot.cpp similarity index 99% rename from DSView/pv/data/dsosnapshot.cpp rename to DSView/model/dsosnapshot.cpp index 3186d4fa4..a907d5047 100644 --- a/DSView/pv/data/dsosnapshot.cpp +++ b/DSView/model/dsosnapshot.cpp @@ -31,7 +31,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace data { const int DsoSnapshot::EnvelopeScalePower = 8; @@ -551,4 +551,4 @@ int DsoSnapshot::get_ch_order(int sig_index) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/dsosnapshot.h b/DSView/model/dsosnapshot.h similarity index 99% rename from DSView/pv/data/dsosnapshot.h rename to DSView/model/dsosnapshot.h index 01955321b..1ad8a8e3c 100644 --- a/DSView/pv/data/dsosnapshot.h +++ b/DSView/model/dsosnapshot.h @@ -33,7 +33,7 @@ namespace DsoSnapshotTest { class Basic; } -namespace pv { +namespace dsv { namespace data { class DsoSnapshot : public Snapshot @@ -156,6 +156,6 @@ class DsoSnapshot : public Snapshot }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_DSOSNAPSHOT_H diff --git a/DSView/pv/data/logicsnapshot.cpp b/DSView/model/logicsnapshot.cpp similarity index 99% rename from DSView/pv/data/logicsnapshot.cpp rename to DSView/model/logicsnapshot.cpp index 36b0ef259..7d80422de 100644 --- a/DSView/pv/data/logicsnapshot.cpp +++ b/DSView/model/logicsnapshot.cpp @@ -32,7 +32,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace data { const uint64_t LogicSnapshot::LevelMask[LogicSnapshot::ScaleLevel] = { @@ -1494,4 +1494,4 @@ void LogicSnapshot::free_head_blocks(int count) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/pv/data/logicsnapshot.h b/DSView/model/logicsnapshot.h similarity index 100% rename from DSView/pv/data/logicsnapshot.h rename to DSView/model/logicsnapshot.h diff --git a/DSView/pv/data/mathstack.cpp b/DSView/model/mathstack.cpp similarity index 100% rename from DSView/pv/data/mathstack.cpp rename to DSView/model/mathstack.cpp diff --git a/DSView/pv/data/mathstack.h b/DSView/model/mathstack.h similarity index 100% rename from DSView/pv/data/mathstack.h rename to DSView/model/mathstack.h diff --git a/DSView/pv/data/signaldata.cpp b/DSView/model/signaldata.cpp similarity index 100% rename from DSView/pv/data/signaldata.cpp rename to DSView/model/signaldata.cpp diff --git a/DSView/pv/data/signaldata.h b/DSView/model/signaldata.h similarity index 100% rename from DSView/pv/data/signaldata.h rename to DSView/model/signaldata.h diff --git a/DSView/pv/data/snapshot.cpp b/DSView/model/snapshot.cpp similarity index 100% rename from DSView/pv/data/snapshot.cpp rename to DSView/model/snapshot.cpp diff --git a/DSView/pv/data/snapshot.h b/DSView/model/snapshot.h similarity index 100% rename from DSView/pv/data/snapshot.h rename to DSView/model/snapshot.h diff --git a/DSView/pv/data/spectrumstack.cpp b/DSView/model/spectrumstack.cpp similarity index 100% rename from DSView/pv/data/spectrumstack.cpp rename to DSView/model/spectrumstack.cpp diff --git a/DSView/pv/data/spectrumstack.h b/DSView/model/spectrumstack.h similarity index 100% rename from DSView/pv/data/spectrumstack.h rename to DSView/model/spectrumstack.h diff --git a/DSView/pv/prop/binding/binding.cpp b/DSView/prop/binding/binding.cpp similarity index 100% rename from DSView/pv/prop/binding/binding.cpp rename to DSView/prop/binding/binding.cpp diff --git a/DSView/pv/prop/binding/binding.h b/DSView/prop/binding/binding.h similarity index 100% rename from DSView/pv/prop/binding/binding.h rename to DSView/prop/binding/binding.h diff --git a/DSView/pv/prop/binding/decoderoptions.cpp b/DSView/prop/binding/decoderoptions.cpp similarity index 100% rename from DSView/pv/prop/binding/decoderoptions.cpp rename to DSView/prop/binding/decoderoptions.cpp diff --git a/DSView/pv/prop/binding/decoderoptions.h b/DSView/prop/binding/decoderoptions.h similarity index 100% rename from DSView/pv/prop/binding/decoderoptions.h rename to DSView/prop/binding/decoderoptions.h diff --git a/DSView/pv/prop/binding/deviceoptions.cpp b/DSView/prop/binding/deviceoptions.cpp similarity index 100% rename from DSView/pv/prop/binding/deviceoptions.cpp rename to DSView/prop/binding/deviceoptions.cpp diff --git a/DSView/pv/prop/binding/deviceoptions.h b/DSView/prop/binding/deviceoptions.h similarity index 100% rename from DSView/pv/prop/binding/deviceoptions.h rename to DSView/prop/binding/deviceoptions.h diff --git a/DSView/pv/prop/binding/probeoptions.cpp b/DSView/prop/binding/probeoptions.cpp similarity index 100% rename from DSView/pv/prop/binding/probeoptions.cpp rename to DSView/prop/binding/probeoptions.cpp diff --git a/DSView/pv/prop/binding/probeoptions.h b/DSView/prop/binding/probeoptions.h similarity index 100% rename from DSView/pv/prop/binding/probeoptions.h rename to DSView/prop/binding/probeoptions.h diff --git a/DSView/pv/prop/bool.cpp b/DSView/prop/bool.cpp similarity index 100% rename from DSView/pv/prop/bool.cpp rename to DSView/prop/bool.cpp diff --git a/DSView/pv/prop/bool.h b/DSView/prop/bool.h similarity index 100% rename from DSView/pv/prop/bool.h rename to DSView/prop/bool.h diff --git a/DSView/pv/prop/double.cpp b/DSView/prop/double.cpp similarity index 100% rename from DSView/pv/prop/double.cpp rename to DSView/prop/double.cpp diff --git a/DSView/pv/prop/double.h b/DSView/prop/double.h similarity index 100% rename from DSView/pv/prop/double.h rename to DSView/prop/double.h diff --git a/DSView/pv/prop/enum.cpp b/DSView/prop/enum.cpp similarity index 100% rename from DSView/pv/prop/enum.cpp rename to DSView/prop/enum.cpp diff --git a/DSView/pv/prop/enum.h b/DSView/prop/enum.h similarity index 100% rename from DSView/pv/prop/enum.h rename to DSView/prop/enum.h diff --git a/DSView/pv/prop/int.cpp b/DSView/prop/int.cpp similarity index 100% rename from DSView/pv/prop/int.cpp rename to DSView/prop/int.cpp diff --git a/DSView/pv/prop/int.h b/DSView/prop/int.h similarity index 100% rename from DSView/pv/prop/int.h rename to DSView/prop/int.h diff --git a/DSView/pv/prop/property.cpp b/DSView/prop/property.cpp similarity index 100% rename from DSView/pv/prop/property.cpp rename to DSView/prop/property.cpp diff --git a/DSView/pv/prop/property.h b/DSView/prop/property.h similarity index 100% rename from DSView/pv/prop/property.h rename to DSView/prop/property.h diff --git a/DSView/pv/prop/string.cpp b/DSView/prop/string.cpp similarity index 100% rename from DSView/pv/prop/string.cpp rename to DSView/prop/string.cpp diff --git a/DSView/pv/prop/string.h b/DSView/prop/string.h similarity index 100% rename from DSView/pv/prop/string.h rename to DSView/prop/string.h diff --git a/DSView/pv/dsvdef.h b/DSView/pv/dsvdef.h deleted file mode 100644 index c52ffb03c..000000000 --- a/DSView/pv/dsvdef.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of the DSView project. - * DSView is based on PulseView. - * - * Copyright (C) 2021 DreamSourceLab - * - * 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 - */ - -#pragma once - -#include "../config.h" - -#define countof(x) (sizeof(x)/sizeof(x[0])) - -#define begin_element(x) (&x[0]) -#define end_element(x) (&x[countof(x)]) - -enum View_type { - TIME_VIEW, - FFT_VIEW, - ALL_VIEW -}; - - -#ifdef DS_DEBUG_TRACE - void ds_print(const char *s); - - #define ds_debug(x) ds_print((x)) -#else - #define ds_debug(x) -#endif - - -#define DESTROY_OBJECT(p) if((p)){delete (p); p = NULL;} -#define DESTROY_QT_OBJECT(p) if((p)){((p))->deleteLater(); p = NULL;} -#define DESTROY_QT_LATER(p) ((p))->deleteLater(); - -#define RELEASE_ARRAY(a) for (auto ptr : (a)){delete ptr;} (a).clear(); - -#define ABS_VAL(x) ((x) > 0 ? (x) : -(x)) - -#define ds_max(a,b) ((a) > (b) ? (a) : (b)) -#define ds_min(a,b) ((a) < (b) ? (a) : (b)) - -#define SESSION_FORMAT_VERSION 3 -#define HEADER_FORMAT_VERSION 3 - -namespace DecoderDataFormat -{ - enum _data_format - { - hex=0, - dec=1, - oct=2, - bin=3, - ascii=4 - }; - - int Parse(const char *name); -} diff --git a/DSView/pv/toolbars/filebar.cpp b/DSView/toolbars/filebar.cpp similarity index 100% rename from DSView/pv/toolbars/filebar.cpp rename to DSView/toolbars/filebar.cpp diff --git a/DSView/pv/toolbars/filebar.h b/DSView/toolbars/filebar.h similarity index 100% rename from DSView/pv/toolbars/filebar.h rename to DSView/toolbars/filebar.h diff --git a/DSView/pv/toolbars/logobar.cpp b/DSView/toolbars/logobar.cpp similarity index 100% rename from DSView/pv/toolbars/logobar.cpp rename to DSView/toolbars/logobar.cpp diff --git a/DSView/pv/toolbars/logobar.h b/DSView/toolbars/logobar.h similarity index 100% rename from DSView/pv/toolbars/logobar.h rename to DSView/toolbars/logobar.h diff --git a/DSView/pv/toolbars/samplingbar.cpp b/DSView/toolbars/samplingbar.cpp similarity index 100% rename from DSView/pv/toolbars/samplingbar.cpp rename to DSView/toolbars/samplingbar.cpp diff --git a/DSView/pv/toolbars/samplingbar.h b/DSView/toolbars/samplingbar.h similarity index 100% rename from DSView/pv/toolbars/samplingbar.h rename to DSView/toolbars/samplingbar.h diff --git a/DSView/pv/toolbars/titlebar.cpp b/DSView/toolbars/titlebar.cpp similarity index 100% rename from DSView/pv/toolbars/titlebar.cpp rename to DSView/toolbars/titlebar.cpp diff --git a/DSView/pv/toolbars/titlebar.h b/DSView/toolbars/titlebar.h similarity index 100% rename from DSView/pv/toolbars/titlebar.h rename to DSView/toolbars/titlebar.h diff --git a/DSView/pv/toolbars/trigbar.cpp b/DSView/toolbars/trigbar.cpp similarity index 100% rename from DSView/pv/toolbars/trigbar.cpp rename to DSView/toolbars/trigbar.cpp diff --git a/DSView/pv/toolbars/trigbar.h b/DSView/toolbars/trigbar.h similarity index 100% rename from DSView/pv/toolbars/trigbar.h rename to DSView/toolbars/trigbar.h diff --git a/DSView/pv/ui/dscombobox.cpp b/DSView/ui/dscombobox.cpp similarity index 100% rename from DSView/pv/ui/dscombobox.cpp rename to DSView/ui/dscombobox.cpp diff --git a/DSView/pv/ui/dscombobox.h b/DSView/ui/dscombobox.h similarity index 100% rename from DSView/pv/ui/dscombobox.h rename to DSView/ui/dscombobox.h diff --git a/DSView/pv/ui/fn.cpp b/DSView/ui/fn.cpp similarity index 100% rename from DSView/pv/ui/fn.cpp rename to DSView/ui/fn.cpp diff --git a/DSView/pv/ui/fn.h b/DSView/ui/fn.h similarity index 100% rename from DSView/pv/ui/fn.h rename to DSView/ui/fn.h diff --git a/DSView/pv/ui/langresource.cpp b/DSView/ui/langresource.cpp similarity index 100% rename from DSView/pv/ui/langresource.cpp rename to DSView/ui/langresource.cpp diff --git a/DSView/pv/ui/langresource.h b/DSView/ui/langresource.h similarity index 100% rename from DSView/pv/ui/langresource.h rename to DSView/ui/langresource.h diff --git a/DSView/pv/ui/msgbox.cpp b/DSView/ui/msgbox.cpp similarity index 100% rename from DSView/pv/ui/msgbox.cpp rename to DSView/ui/msgbox.cpp diff --git a/DSView/pv/ui/msgbox.h b/DSView/ui/msgbox.h similarity index 100% rename from DSView/pv/ui/msgbox.h rename to DSView/ui/msgbox.h diff --git a/DSView/pv/ui/string_ids.h b/DSView/ui/string_ids.h similarity index 100% rename from DSView/pv/ui/string_ids.h rename to DSView/ui/string_ids.h diff --git a/DSView/pv/utility/array.cpp b/DSView/utility/array.cpp similarity index 100% rename from DSView/pv/utility/array.cpp rename to DSView/utility/array.cpp diff --git a/DSView/pv/utility/array.h b/DSView/utility/array.h similarity index 100% rename from DSView/pv/utility/array.h rename to DSView/utility/array.h diff --git a/DSView/pv/utility/encoding.cpp b/DSView/utility/encoding.cpp similarity index 100% rename from DSView/pv/utility/encoding.cpp rename to DSView/utility/encoding.cpp diff --git a/DSView/pv/utility/encoding.h b/DSView/utility/encoding.h similarity index 100% rename from DSView/pv/utility/encoding.h rename to DSView/utility/encoding.h diff --git a/DSView/pv/utility/path.cpp b/DSView/utility/path.cpp similarity index 100% rename from DSView/pv/utility/path.cpp rename to DSView/utility/path.cpp diff --git a/DSView/pv/utility/path.h b/DSView/utility/path.h similarity index 100% rename from DSView/pv/utility/path.h rename to DSView/utility/path.h diff --git a/DSView/pv/view/analogsignal.cpp b/DSView/view/analogsignal.cpp similarity index 100% rename from DSView/pv/view/analogsignal.cpp rename to DSView/view/analogsignal.cpp diff --git a/DSView/pv/view/analogsignal.h b/DSView/view/analogsignal.h similarity index 100% rename from DSView/pv/view/analogsignal.h rename to DSView/view/analogsignal.h diff --git a/DSView/pv/view/cursor.cpp b/DSView/view/cursor.cpp similarity index 100% rename from DSView/pv/view/cursor.cpp rename to DSView/view/cursor.cpp diff --git a/DSView/pv/view/cursor.h b/DSView/view/cursor.h similarity index 100% rename from DSView/pv/view/cursor.h rename to DSView/view/cursor.h diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/view/decodetrace.cpp similarity index 100% rename from DSView/pv/view/decodetrace.cpp rename to DSView/view/decodetrace.cpp diff --git a/DSView/pv/view/decodetrace.h b/DSView/view/decodetrace.h similarity index 100% rename from DSView/pv/view/decodetrace.h rename to DSView/view/decodetrace.h diff --git a/DSView/pv/view/devmode.cpp b/DSView/view/devmode.cpp similarity index 100% rename from DSView/pv/view/devmode.cpp rename to DSView/view/devmode.cpp diff --git a/DSView/pv/view/devmode.h b/DSView/view/devmode.h similarity index 100% rename from DSView/pv/view/devmode.h rename to DSView/view/devmode.h diff --git a/DSView/pv/view/dsldial.cpp b/DSView/view/dsldial.cpp similarity index 100% rename from DSView/pv/view/dsldial.cpp rename to DSView/view/dsldial.cpp diff --git a/DSView/pv/view/dsldial.h b/DSView/view/dsldial.h similarity index 100% rename from DSView/pv/view/dsldial.h rename to DSView/view/dsldial.h diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/view/dsosignal.cpp similarity index 100% rename from DSView/pv/view/dsosignal.cpp rename to DSView/view/dsosignal.cpp diff --git a/DSView/pv/view/dsosignal.h b/DSView/view/dsosignal.h similarity index 100% rename from DSView/pv/view/dsosignal.h rename to DSView/view/dsosignal.h diff --git a/DSView/pv/view/groupsignal.cpp b/DSView/view/groupsignal.cpp similarity index 100% rename from DSView/pv/view/groupsignal.cpp rename to DSView/view/groupsignal.cpp diff --git a/DSView/pv/view/groupsignal.h b/DSView/view/groupsignal.h similarity index 100% rename from DSView/pv/view/groupsignal.h rename to DSView/view/groupsignal.h diff --git a/DSView/pv/view/header.cpp b/DSView/view/header.cpp similarity index 100% rename from DSView/pv/view/header.cpp rename to DSView/view/header.cpp diff --git a/DSView/pv/view/header.h b/DSView/view/header.h similarity index 100% rename from DSView/pv/view/header.h rename to DSView/view/header.h diff --git a/DSView/pv/view/lissajoustrace.cpp b/DSView/view/lissajoustrace.cpp similarity index 100% rename from DSView/pv/view/lissajoustrace.cpp rename to DSView/view/lissajoustrace.cpp diff --git a/DSView/pv/view/lissajoustrace.h b/DSView/view/lissajoustrace.h similarity index 100% rename from DSView/pv/view/lissajoustrace.h rename to DSView/view/lissajoustrace.h diff --git a/DSView/pv/view/logicsignal.cpp b/DSView/view/logicsignal.cpp similarity index 100% rename from DSView/pv/view/logicsignal.cpp rename to DSView/view/logicsignal.cpp diff --git a/DSView/pv/view/logicsignal.h b/DSView/view/logicsignal.h similarity index 100% rename from DSView/pv/view/logicsignal.h rename to DSView/view/logicsignal.h diff --git a/DSView/pv/view/mathtrace.cpp b/DSView/view/mathtrace.cpp similarity index 100% rename from DSView/pv/view/mathtrace.cpp rename to DSView/view/mathtrace.cpp diff --git a/DSView/pv/view/mathtrace.h b/DSView/view/mathtrace.h similarity index 100% rename from DSView/pv/view/mathtrace.h rename to DSView/view/mathtrace.h diff --git a/DSView/pv/view/ruler.cpp b/DSView/view/ruler.cpp similarity index 100% rename from DSView/pv/view/ruler.cpp rename to DSView/view/ruler.cpp diff --git a/DSView/pv/view/ruler.h b/DSView/view/ruler.h similarity index 100% rename from DSView/pv/view/ruler.h rename to DSView/view/ruler.h diff --git a/DSView/pv/view/signal.cpp b/DSView/view/signal.cpp similarity index 100% rename from DSView/pv/view/signal.cpp rename to DSView/view/signal.cpp diff --git a/DSView/pv/view/signal.h b/DSView/view/signal.h similarity index 100% rename from DSView/pv/view/signal.h rename to DSView/view/signal.h diff --git a/DSView/pv/view/spectrumtrace.cpp b/DSView/view/spectrumtrace.cpp similarity index 100% rename from DSView/pv/view/spectrumtrace.cpp rename to DSView/view/spectrumtrace.cpp diff --git a/DSView/pv/view/spectrumtrace.h b/DSView/view/spectrumtrace.h similarity index 100% rename from DSView/pv/view/spectrumtrace.h rename to DSView/view/spectrumtrace.h diff --git a/DSView/pv/view/timemarker.cpp b/DSView/view/timemarker.cpp similarity index 100% rename from DSView/pv/view/timemarker.cpp rename to DSView/view/timemarker.cpp diff --git a/DSView/pv/view/timemarker.h b/DSView/view/timemarker.h similarity index 100% rename from DSView/pv/view/timemarker.h rename to DSView/view/timemarker.h diff --git a/DSView/pv/view/trace.cpp b/DSView/view/trace.cpp similarity index 100% rename from DSView/pv/view/trace.cpp rename to DSView/view/trace.cpp diff --git a/DSView/pv/view/trace.h b/DSView/view/trace.h similarity index 100% rename from DSView/pv/view/trace.h rename to DSView/view/trace.h diff --git a/DSView/pv/view/view.cpp b/DSView/view/view.cpp similarity index 100% rename from DSView/pv/view/view.cpp rename to DSView/view/view.cpp diff --git a/DSView/pv/view/view.h b/DSView/view/view.h similarity index 100% rename from DSView/pv/view/view.h rename to DSView/view/view.h diff --git a/DSView/pv/view/viewport.cpp b/DSView/view/viewport.cpp similarity index 100% rename from DSView/pv/view/viewport.cpp rename to DSView/view/viewport.cpp diff --git a/DSView/pv/view/viewport.h b/DSView/view/viewport.h similarity index 100% rename from DSView/pv/view/viewport.h rename to DSView/view/viewport.h diff --git a/DSView/pv/view/viewstatus.cpp b/DSView/view/viewstatus.cpp similarity index 100% rename from DSView/pv/view/viewstatus.cpp rename to DSView/view/viewstatus.cpp diff --git a/DSView/pv/view/viewstatus.h b/DSView/view/viewstatus.h similarity index 100% rename from DSView/pv/view/viewstatus.h rename to DSView/view/viewstatus.h diff --git a/DSView/pv/view/xcursor.cpp b/DSView/view/xcursor.cpp similarity index 100% rename from DSView/pv/view/xcursor.cpp rename to DSView/view/xcursor.cpp diff --git a/DSView/pv/view/xcursor.h b/DSView/view/xcursor.h similarity index 100% rename from DSView/pv/view/xcursor.h rename to DSView/view/xcursor.h diff --git a/DSView/pv/widgets/border.cpp b/DSView/widgets/border.cpp similarity index 100% rename from DSView/pv/widgets/border.cpp rename to DSView/widgets/border.cpp diff --git a/DSView/pv/widgets/border.h b/DSView/widgets/border.h similarity index 100% rename from DSView/pv/widgets/border.h rename to DSView/widgets/border.h diff --git a/DSView/pv/widgets/decodergroupbox.cpp b/DSView/widgets/decodergroupbox.cpp similarity index 100% rename from DSView/pv/widgets/decodergroupbox.cpp rename to DSView/widgets/decodergroupbox.cpp diff --git a/DSView/pv/widgets/decodergroupbox.h b/DSView/widgets/decodergroupbox.h similarity index 100% rename from DSView/pv/widgets/decodergroupbox.h rename to DSView/widgets/decodergroupbox.h diff --git a/DSView/pv/widgets/decodermenu.cpp b/DSView/widgets/decodermenu.cpp similarity index 100% rename from DSView/pv/widgets/decodermenu.cpp rename to DSView/widgets/decodermenu.cpp diff --git a/DSView/pv/widgets/decodermenu.h b/DSView/widgets/decodermenu.h similarity index 100% rename from DSView/pv/widgets/decodermenu.h rename to DSView/widgets/decodermenu.h diff --git a/DSView/pv/widgets/fakelineedit.cpp b/DSView/widgets/fakelineedit.cpp similarity index 100% rename from DSView/pv/widgets/fakelineedit.cpp rename to DSView/widgets/fakelineedit.cpp diff --git a/DSView/pv/widgets/fakelineedit.h b/DSView/widgets/fakelineedit.h similarity index 100% rename from DSView/pv/widgets/fakelineedit.h rename to DSView/widgets/fakelineedit.h diff --git a/DSView/pv/ZipMaker.cpp b/DSView/zcore/ZipMaker.cpp similarity index 100% rename from DSView/pv/ZipMaker.cpp rename to DSView/zcore/ZipMaker.cpp diff --git a/DSView/pv/ZipMaker.h b/DSView/zcore/ZipMaker.h similarity index 100% rename from DSView/pv/ZipMaker.h rename to DSView/zcore/ZipMaker.h diff --git a/DSView/pv/appcontrol.cpp b/DSView/zcore/appcontrol.cpp similarity index 100% rename from DSView/pv/appcontrol.cpp rename to DSView/zcore/appcontrol.cpp diff --git a/DSView/pv/appcontrol.h b/DSView/zcore/appcontrol.h similarity index 100% rename from DSView/pv/appcontrol.h rename to DSView/zcore/appcontrol.h diff --git a/DSView/pv/deviceagent.cpp b/DSView/zcore/deviceagent.cpp similarity index 100% rename from DSView/pv/deviceagent.cpp rename to DSView/zcore/deviceagent.cpp diff --git a/DSView/pv/deviceagent.h b/DSView/zcore/deviceagent.h similarity index 100% rename from DSView/pv/deviceagent.h rename to DSView/zcore/deviceagent.h diff --git a/DSView/pv/eventobject.cpp b/DSView/zcore/eventobject.cpp similarity index 100% rename from DSView/pv/eventobject.cpp rename to DSView/zcore/eventobject.cpp diff --git a/DSView/pv/eventobject.h b/DSView/zcore/eventobject.h similarity index 100% rename from DSView/pv/eventobject.h rename to DSView/zcore/eventobject.h diff --git a/DSView/pv/mainframe.cpp b/DSView/zcore/mainframe.cpp similarity index 100% rename from DSView/pv/mainframe.cpp rename to DSView/zcore/mainframe.cpp diff --git a/DSView/pv/mainframe.h b/DSView/zcore/mainframe.h similarity index 100% rename from DSView/pv/mainframe.h rename to DSView/zcore/mainframe.h diff --git a/DSView/pv/mainwindow.cpp b/DSView/zcore/mainwindow.cpp similarity index 100% rename from DSView/pv/mainwindow.cpp rename to DSView/zcore/mainwindow.cpp diff --git a/DSView/pv/mainwindow.h b/DSView/zcore/mainwindow.h similarity index 100% rename from DSView/pv/mainwindow.h rename to DSView/zcore/mainwindow.h diff --git a/DSView/pv/sigsession.cpp b/DSView/zcore/sigsession.cpp similarity index 100% rename from DSView/pv/sigsession.cpp rename to DSView/zcore/sigsession.cpp diff --git a/DSView/pv/sigsession.h b/DSView/zcore/sigsession.h similarity index 100% rename from DSView/pv/sigsession.h rename to DSView/zcore/sigsession.h diff --git a/DSView/pv/storesession.cpp b/DSView/zcore/storesession.cpp similarity index 100% rename from DSView/pv/storesession.cpp rename to DSView/zcore/storesession.cpp diff --git a/DSView/pv/storesession.h b/DSView/zcore/storesession.h similarity index 100% rename from DSView/pv/storesession.h rename to DSView/zcore/storesession.h From b7141a48dd8e9ed35a14d0da41bbca71be73ada1 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Fri, 14 Jul 2023 09:14:45 +0800 Subject: [PATCH 3/7] Design directory structure 1 --- DSView/model/logicsnapshot.h | 4 ++-- DSView/model/mathstack.cpp | 4 ++-- DSView/model/mathstack.h | 4 ++-- DSView/model/signaldata.cpp | 4 ++-- DSView/model/signaldata.h | 4 ++-- DSView/model/snapshot.cpp | 4 ++-- DSView/model/snapshot.h | 4 ++-- DSView/model/spectrumstack.cpp | 4 ++-- DSView/model/spectrumstack.h | 4 ++-- DSView/prop/binding/binding.cpp | 2 +- DSView/prop/binding/binding.h | 2 +- DSView/prop/binding/decoderoptions.cpp | 2 +- DSView/prop/binding/decoderoptions.h | 2 +- DSView/prop/binding/deviceoptions.cpp | 2 +- DSView/prop/binding/deviceoptions.h | 2 +- DSView/prop/binding/probeoptions.cpp | 2 +- DSView/prop/binding/probeoptions.h | 2 +- DSView/prop/bool.cpp | 2 +- DSView/prop/bool.h | 2 +- DSView/prop/double.cpp | 2 +- DSView/prop/double.h | 2 +- DSView/prop/enum.cpp | 2 +- DSView/prop/enum.h | 2 +- DSView/prop/int.cpp | 2 +- DSView/prop/int.h | 2 +- DSView/prop/property.cpp | 2 +- DSView/prop/property.h | 2 +- DSView/prop/string.cpp | 2 +- DSView/prop/string.h | 2 +- DSView/toolbars/filebar.cpp | 4 ++-- DSView/toolbars/filebar.h | 4 ++-- DSView/toolbars/logobar.cpp | 4 ++-- DSView/toolbars/logobar.h | 4 ++-- DSView/toolbars/samplingbar.cpp | 4 ++-- DSView/toolbars/samplingbar.h | 4 ++-- DSView/toolbars/titlebar.cpp | 4 ++-- DSView/toolbars/titlebar.h | 2 +- 37 files changed, 53 insertions(+), 53 deletions(-) diff --git a/DSView/model/logicsnapshot.h b/DSView/model/logicsnapshot.h index 91741301c..23104983d 100644 --- a/DSView/model/logicsnapshot.h +++ b/DSView/model/logicsnapshot.h @@ -41,7 +41,7 @@ class Pulses; class LongPulses; } -namespace pv { +namespace dsv { namespace data { class LogicSnapshot : public Snapshot @@ -261,6 +261,6 @@ class LogicSnapshot : public Snapshot }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_LOGICSNAPSHOT_H diff --git a/DSView/model/mathstack.cpp b/DSView/model/mathstack.cpp index 01474aea3..ed1529a8e 100644 --- a/DSView/model/mathstack.cpp +++ b/DSView/model/mathstack.cpp @@ -30,7 +30,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace data { const int MathStack::EnvelopeScalePower = 8; @@ -473,4 +473,4 @@ void MathStack::append_to_envelope_level(bool header) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/model/mathstack.h b/DSView/model/mathstack.h index 3b175f1c4..6a2a4105c 100644 --- a/DSView/model/mathstack.h +++ b/DSView/model/mathstack.h @@ -32,7 +32,7 @@ #include #include -namespace pv { +namespace dsv { class SigSession; @@ -148,6 +148,6 @@ class MathStack : public QObject, public SignalData }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_MATHSTACK_H diff --git a/DSView/model/signaldata.cpp b/DSView/model/signaldata.cpp index 31c609377..31a5cc98c 100644 --- a/DSView/model/signaldata.cpp +++ b/DSView/model/signaldata.cpp @@ -24,7 +24,7 @@ #include "signaldata.h" -namespace pv { +namespace dsv { namespace data { SignalData::SignalData() : @@ -42,4 +42,4 @@ void SignalData::set_samplerate(double samplerate) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/model/signaldata.h b/DSView/model/signaldata.h index f32694217..b1ccd559c 100644 --- a/DSView/model/signaldata.h +++ b/DSView/model/signaldata.h @@ -27,7 +27,7 @@ #include #include -namespace pv { +namespace dsv { namespace data { class SignalData @@ -50,6 +50,6 @@ class SignalData }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_SIGNALDATA_H diff --git a/DSView/model/snapshot.cpp b/DSView/model/snapshot.cpp index 026690255..2c666331e 100644 --- a/DSView/model/snapshot.cpp +++ b/DSView/model/snapshot.cpp @@ -26,7 +26,7 @@ #include #include -namespace pv { +namespace dsv { namespace data { Snapshot::Snapshot(int unit_size, uint64_t total_sample_count, unsigned int channel_num) @@ -119,4 +119,4 @@ void Snapshot::set_samplerate(double samplerate) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/model/snapshot.h b/DSView/model/snapshot.h index fa7bce4b6..e1441f262 100644 --- a/DSView/model/snapshot.h +++ b/DSView/model/snapshot.h @@ -26,7 +26,7 @@ #include #include -namespace pv { +namespace dsv { namespace data { class Snapshot @@ -110,6 +110,6 @@ class Snapshot }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_SNAPSHOT_H diff --git a/DSView/model/spectrumstack.cpp b/DSView/model/spectrumstack.cpp index 1d887bded..ee2297765 100644 --- a/DSView/model/spectrumstack.cpp +++ b/DSView/model/spectrumstack.cpp @@ -31,7 +31,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace data { const QString SpectrumStack::windows_support[5] = { @@ -238,4 +238,4 @@ double SpectrumStack::window(uint64_t i, int type) } } // namespace data -} // namespace pv +} // namespace dsv diff --git a/DSView/model/spectrumstack.h b/DSView/model/spectrumstack.h index 58b441278..9a61f88d6 100644 --- a/DSView/model/spectrumstack.h +++ b/DSView/model/spectrumstack.h @@ -33,7 +33,7 @@ #include #include -namespace pv { +namespace dsv { class SigSession; @@ -109,6 +109,6 @@ class SpectrumStack : public QObject, public SignalData }; } // namespace data -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DATA_SPECTRUMSTACK_H diff --git a/DSView/prop/binding/binding.cpp b/DSView/prop/binding/binding.cpp index fb5f9f106..f9f5dcc35 100644 --- a/DSView/prop/binding/binding.cpp +++ b/DSView/prop/binding/binding.cpp @@ -28,7 +28,7 @@ #include "binding.h" -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/binding/binding.h b/DSView/prop/binding/binding.h index 22f94c01a..9870ff548 100644 --- a/DSView/prop/binding/binding.h +++ b/DSView/prop/binding/binding.h @@ -34,7 +34,7 @@ class QFormLayout; class QWidget; -namespace pv { +namespace dsv { namespace prop { class Property; diff --git a/DSView/prop/binding/decoderoptions.cpp b/DSView/prop/binding/decoderoptions.cpp index f5da31378..34a15d0be 100644 --- a/DSView/prop/binding/decoderoptions.cpp +++ b/DSView/prop/binding/decoderoptions.cpp @@ -37,7 +37,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/binding/decoderoptions.h b/DSView/prop/binding/decoderoptions.h index 6e0835281..63b276853 100644 --- a/DSView/prop/binding/decoderoptions.h +++ b/DSView/prop/binding/decoderoptions.h @@ -29,7 +29,7 @@ struct srd_decoder_option; -namespace pv { +namespace dsv { namespace data { class DecoderStack; diff --git a/DSView/prop/binding/deviceoptions.cpp b/DSView/prop/binding/deviceoptions.cpp index 4fe6b22e4..11dbf8fdb 100644 --- a/DSView/prop/binding/deviceoptions.cpp +++ b/DSView/prop/binding/deviceoptions.cpp @@ -38,7 +38,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/binding/deviceoptions.h b/DSView/prop/binding/deviceoptions.h index f23be5dab..a628e88e3 100644 --- a/DSView/prop/binding/deviceoptions.h +++ b/DSView/prop/binding/deviceoptions.h @@ -33,7 +33,7 @@ class DeviceAgent; -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/binding/probeoptions.cpp b/DSView/prop/binding/probeoptions.cpp index bfd2381ad..cc595a17f 100644 --- a/DSView/prop/binding/probeoptions.cpp +++ b/DSView/prop/binding/probeoptions.cpp @@ -35,7 +35,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/binding/probeoptions.h b/DSView/prop/binding/probeoptions.h index 4ba29c2a2..9e1f357d1 100644 --- a/DSView/prop/binding/probeoptions.h +++ b/DSView/prop/binding/probeoptions.h @@ -32,7 +32,7 @@ class DeviceAgent; -namespace pv { +namespace dsv { namespace prop { namespace binding { diff --git a/DSView/prop/bool.cpp b/DSView/prop/bool.cpp index b31369c2b..48ff1437e 100644 --- a/DSView/prop/bool.cpp +++ b/DSView/prop/bool.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace boost; -namespace pv { +namespace dsv { namespace prop { Bool::Bool(QString name, QString label, Getter getter, Setter setter) : diff --git a/DSView/prop/bool.h b/DSView/prop/bool.h index 5603914c0..f70bd438e 100644 --- a/DSView/prop/bool.h +++ b/DSView/prop/bool.h @@ -27,7 +27,7 @@ class QCheckBox; -namespace pv { +namespace dsv { namespace prop { class Bool : public Property diff --git a/DSView/prop/double.cpp b/DSView/prop/double.cpp index b5c7c3d7d..9e356a5a1 100644 --- a/DSView/prop/double.cpp +++ b/DSView/prop/double.cpp @@ -29,7 +29,7 @@ using namespace std; using namespace boost; -namespace pv { +namespace dsv { namespace prop { Double::Double(QString name, QString label, diff --git a/DSView/prop/double.h b/DSView/prop/double.h index f80d5170f..1b7efa932 100644 --- a/DSView/prop/double.h +++ b/DSView/prop/double.h @@ -31,7 +31,7 @@ class QDoubleSpinBox; -namespace pv { +namespace dsv { namespace prop { class Double : public Property diff --git a/DSView/prop/enum.cpp b/DSView/prop/enum.cpp index 78e2a6f75..e5727ba59 100644 --- a/DSView/prop/enum.cpp +++ b/DSView/prop/enum.cpp @@ -30,7 +30,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace prop { Enum::Enum(QString name, QString label, diff --git a/DSView/prop/enum.h b/DSView/prop/enum.h index 416062712..794a98821 100644 --- a/DSView/prop/enum.h +++ b/DSView/prop/enum.h @@ -30,7 +30,7 @@ class DsComboBox; -namespace pv { +namespace dsv { namespace prop { class Enum : public Property diff --git a/DSView/prop/int.cpp b/DSView/prop/int.cpp index 3648193d5..4ac35a733 100644 --- a/DSView/prop/int.cpp +++ b/DSView/prop/int.cpp @@ -46,7 +46,7 @@ using namespace std; //#define UINT32_MAX 0xffffffff //#define UINT64_MAX 0xffffffffffffffff -namespace pv { +namespace dsv { namespace prop { Int::Int(QString name, QString label, diff --git a/DSView/prop/int.h b/DSView/prop/int.h index 0e747540f..4236fe782 100644 --- a/DSView/prop/int.h +++ b/DSView/prop/int.h @@ -31,7 +31,7 @@ class QSpinBox; -namespace pv { +namespace dsv { namespace prop { class Int : public Property diff --git a/DSView/prop/property.cpp b/DSView/prop/property.cpp index 7933398f7..af3346323 100644 --- a/DSView/prop/property.cpp +++ b/DSView/prop/property.cpp @@ -22,7 +22,7 @@ #include "property.h" -namespace pv { +namespace dsv { namespace prop { Property::Property(QString name, QString label, Getter getter, Setter setter) : diff --git a/DSView/prop/property.h b/DSView/prop/property.h index 5ba344be8..a97b60bdf 100644 --- a/DSView/prop/property.h +++ b/DSView/prop/property.h @@ -32,7 +32,7 @@ class QWidget; -namespace pv { +namespace dsv { namespace prop { class Property : public QObject diff --git a/DSView/prop/string.cpp b/DSView/prop/string.cpp index 04648e688..3ef390444 100644 --- a/DSView/prop/string.cpp +++ b/DSView/prop/string.cpp @@ -26,7 +26,7 @@ #include "string.h" -namespace pv { +namespace dsv { namespace prop { String::String(QString name, QString label, diff --git a/DSView/prop/string.h b/DSView/prop/string.h index 1cd0de25f..d73f8d4bb 100644 --- a/DSView/prop/string.h +++ b/DSView/prop/string.h @@ -26,7 +26,7 @@ class QLineEdit; -namespace pv { +namespace dsv { namespace prop { class String : public Property diff --git a/DSView/toolbars/filebar.cpp b/DSView/toolbars/filebar.cpp index a8b9bdf14..6672cca94 100644 --- a/DSView/toolbars/filebar.cpp +++ b/DSView/toolbars/filebar.cpp @@ -33,7 +33,7 @@ #include "../log.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace toolbars { FileBar::FileBar(SigSession *session, QWidget *parent) : @@ -262,4 +262,4 @@ void FileBar::update_font() } } // namespace toolbars -} // namespace pv +} // namespace dsv diff --git a/DSView/toolbars/filebar.h b/DSView/toolbars/filebar.h index 6982ec1f5..78399e936 100644 --- a/DSView/toolbars/filebar.h +++ b/DSView/toolbars/filebar.h @@ -31,7 +31,7 @@ #include "../sigsession.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { namespace toolbars { //toolbar button,referenced by MainWindow @@ -86,6 +86,6 @@ private slots: }; } // namespace toolbars -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TOOLBARS_FILEBAR_H diff --git a/DSView/toolbars/logobar.cpp b/DSView/toolbars/logobar.cpp index f6120e18e..87bf151da 100644 --- a/DSView/toolbars/logobar.cpp +++ b/DSView/toolbars/logobar.cpp @@ -48,7 +48,7 @@ #include "../ui/msgbox.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace toolbars { LogoBar::LogoBar(SigSession *session, QWidget *parent) : @@ -356,4 +356,4 @@ void LogoBar::update_font() } } // namespace toolbars -} // namespace pv +} // namespace dsv diff --git a/DSView/toolbars/logobar.h b/DSView/toolbars/logobar.h index 8d3f2d081..d2fe2429a 100644 --- a/DSView/toolbars/logobar.h +++ b/DSView/toolbars/logobar.h @@ -33,7 +33,7 @@ #include "../sigsession.h" #include "../interface/icallbacks.h" -namespace pv { +namespace dsv { namespace toolbars { //The tool button for help,is a ui class,referenced by MainWindow @@ -103,6 +103,6 @@ private slots: }; } // namespace toolbars -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TOOLBARS_LOGOBAR_H diff --git a/DSView/toolbars/samplingbar.cpp b/DSView/toolbars/samplingbar.cpp index d525f3429..82b0e5025 100644 --- a/DSView/toolbars/samplingbar.cpp +++ b/DSView/toolbars/samplingbar.cpp @@ -49,7 +49,7 @@ using std::max; using std::min; using std::string; -namespace pv +namespace dsv { namespace toolbars { @@ -1263,4 +1263,4 @@ namespace pv } } // namespace toolbars -} // namespace pv +} // namespace dsv diff --git a/DSView/toolbars/samplingbar.h b/DSView/toolbars/samplingbar.h index e8aa63f43..028377af4 100644 --- a/DSView/toolbars/samplingbar.h +++ b/DSView/toolbars/samplingbar.h @@ -42,7 +42,7 @@ struct ds_device_info; class DeviceAgent; -namespace pv +namespace dsv { class SigSession; @@ -172,6 +172,6 @@ namespace pv }; } // namespace toolbars -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TOOLBARS_SAMPLINGBAR_H diff --git a/DSView/toolbars/titlebar.cpp b/DSView/toolbars/titlebar.cpp index abeab20b5..39a5caf18 100644 --- a/DSView/toolbars/titlebar.cpp +++ b/DSView/toolbars/titlebar.cpp @@ -36,7 +36,7 @@ #include "../dsvdef.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace toolbars { TitleBar::TitleBar(bool top, QWidget *parent, bool hasClose) : @@ -244,4 +244,4 @@ void TitleBar::update_font() } } // namespace toolbars -} // namespace pv +} // namespace dsv diff --git a/DSView/toolbars/titlebar.h b/DSView/toolbars/titlebar.h index 1d577bd03..47e9541fc 100644 --- a/DSView/toolbars/titlebar.h +++ b/DSView/toolbars/titlebar.h @@ -29,7 +29,7 @@ class QToolButton; class QHBoxLayout; class QLabel; -namespace pv { +namespace dsv { namespace toolbars { class TitleBar : public QWidget, public IFontForm From a9c536ab9f5e655b07aa0345428e20368322d4b8 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 18 Jul 2023 11:44:51 +0800 Subject: [PATCH 4/7] Directory tree 3 --- DSView/config.h | 35 -- DSView/{zcore => src/appcore}/appcontrol.cpp | 17 +- DSView/{zcore => src/appcore}/appcontrol.h | 10 +- DSView/{zcore => src/appcore}/deviceagent.cpp | 7 +- DSView/{zcore => src/appcore}/deviceagent.h | 5 + DSView/{zcore => src/appcore}/eventobject.cpp | 8 +- DSView/{zcore => src/appcore}/eventobject.h | 6 + DSView/{zcore => src/appcore}/mainframe.cpp | 29 +- DSView/{zcore => src/appcore}/mainframe.h | 22 +- DSView/{zcore => src/appcore}/mainwindow.cpp | 8 +- DSView/{zcore => src/appcore}/mainwindow.h | 11 +- DSView/{zcore => src/appcore}/sigsession.cpp | 61 +- DSView/{zcore => src/appcore}/sigsession.h | 54 +- DSView/{ => src}/basedef.h | 0 DSView/{ => src}/com/dstimer.cpp | 4 +- DSView/{ => src}/com/dstimer.h | 4 +- DSView/{zcore => src/com}/storesession.cpp | 2 +- DSView/{zcore => src/com}/storesession.h | 2 +- .../ZipMaker.cpp => src/com/zipmaker.cpp} | 10 +- .../{zcore/ZipMaker.h => src/com/zipmaker.h} | 6 + DSView/{ => src}/config/appconfig.cpp | 0 DSView/{ => src}/config/appconfig.h | 0 DSView/{model => src/data}/analogsnapshot.cpp | 5 +- DSView/{model => src/data}/analogsnapshot.h | 10 +- DSView/{model => src/data}/decodermodel.cpp | 8 +- DSView/{model => src/data}/decodermodel.h | 15 +- DSView/{model => src/data}/decoderstack.cpp | 16 +- DSView/{model => src/data}/decoderstack.h | 30 +- DSView/{model => src/data}/dsosnapshot.cpp | 5 +- DSView/{model => src/data}/dsosnapshot.h | 7 - DSView/{model => src/data}/logicsnapshot.cpp | 7 +- DSView/{model => src/data}/logicsnapshot.h | 16 +- DSView/{model => src/data}/mathstack.cpp | 5 +- DSView/{model => src/data}/mathstack.h | 16 +- DSView/{model => src/data}/signaldata.cpp | 0 DSView/{model => src/data}/signaldata.h | 0 DSView/{model => src/data}/snapshot.cpp | 0 DSView/{model => src/data}/snapshot.h | 0 DSView/{model => src/data}/spectrumstack.cpp | 7 +- DSView/{model => src/data}/spectrumstack.h | 14 +- DSView/{ => src}/decode/annotation.cpp | 0 DSView/{ => src}/decode/annotation.h | 0 .../{ => src}/decode/annotationrestable.cpp | 0 DSView/{ => src}/decode/annotationrestable.h | 0 DSView/{ => src}/decode/decoder.cpp | 0 DSView/{ => src}/decode/decoder.h | 0 DSView/{ => src}/decode/decoderstatus.cpp | 0 DSView/{ => src}/decode/decoderstatus.h | 0 DSView/{ => src}/decode/displaydataformat.h | 0 DSView/{ => src}/decode/row.cpp | 0 DSView/{ => src}/decode/row.h | 0 DSView/{ => src}/decode/rowdata.cpp | 0 DSView/{ => src}/decode/rowdata.h | 0 DSView/{ => src}/dialogs/about.cpp | 0 DSView/{ => src}/dialogs/about.h | 0 .../{ => src}/dialogs/applicationpardlg.cpp | 0 DSView/{ => src}/dialogs/applicationpardlg.h | 0 DSView/{ => src}/dialogs/calibration.cpp | 0 DSView/{ => src}/dialogs/calibration.h | 0 .../{ => src}/dialogs/decoderoptionsdlg.cpp | 0 DSView/{ => src}/dialogs/decoderoptionsdlg.h | 0 DSView/{ => src}/dialogs/deviceoptions.cpp | 0 DSView/{ => src}/dialogs/deviceoptions.h | 0 DSView/{ => src}/dialogs/dsdialog.cpp | 0 DSView/{ => src}/dialogs/dsdialog.h | 0 DSView/{ => src}/dialogs/dsmessagebox.cpp | 0 DSView/{ => src}/dialogs/dsmessagebox.h | 0 DSView/{ => src}/dialogs/dsomeasure.cpp | 0 DSView/{ => src}/dialogs/dsomeasure.h | 0 DSView/{ => src}/dialogs/fftoptions.cpp | 0 DSView/{ => src}/dialogs/fftoptions.h | 0 DSView/{ => src}/dialogs/interval.cpp | 0 DSView/{ => src}/dialogs/interval.h | 0 DSView/{ => src}/dialogs/lissajousoptions.cpp | 0 DSView/{ => src}/dialogs/lissajousoptions.h | 0 DSView/{ => src}/dialogs/mathoptions.cpp | 0 DSView/{ => src}/dialogs/mathoptions.h | 0 DSView/{ => src}/dialogs/protocolexp.cpp | 0 DSView/{ => src}/dialogs/protocolexp.h | 0 DSView/{ => src}/dialogs/protocollist.cpp | 0 DSView/{ => src}/dialogs/protocollist.h | 0 DSView/{ => src}/dialogs/regionoptions.cpp | 0 DSView/{ => src}/dialogs/regionoptions.h | 0 DSView/{ => src}/dialogs/search.cpp | 0 DSView/{ => src}/dialogs/search.h | 0 DSView/{ => src}/dialogs/shadow.cpp | 0 DSView/{ => src}/dialogs/shadow.h | 0 DSView/{ => src}/dialogs/storeprogress.cpp | 0 DSView/{ => src}/dialogs/storeprogress.h | 0 DSView/{ => src}/dialogs/waitingdialog.cpp | 0 DSView/{ => src}/dialogs/waitingdialog.h | 0 DSView/{ => src}/dock/dsotriggerdock.cpp | 0 DSView/{ => src}/dock/dsotriggerdock.h | 0 DSView/{ => src}/dock/keywordlineedit.cpp | 0 DSView/{ => src}/dock/keywordlineedit.h | 0 DSView/{ => src}/dock/measuredock.cpp | 0 DSView/{ => src}/dock/measuredock.h | 0 DSView/{ => src}/dock/protocoldock.cpp | 0 DSView/{ => src}/dock/protocoldock.h | 0 DSView/{ => src}/dock/protocolitemlayer.cpp | 0 DSView/{ => src}/dock/protocolitemlayer.h | 0 DSView/{ => src}/dock/searchcombobox.cpp | 0 DSView/{ => src}/dock/searchcombobox.h | 0 DSView/{ => src}/dock/searchdock.cpp | 0 DSView/{ => src}/dock/searchdock.h | 0 DSView/{ => src}/dock/triggerdock.cpp | 0 DSView/{ => src}/dock/triggerdock.h | 0 DSView/{ => src}/interface/icallbacks.h | 0 DSView/{ => src}/log.cpp | 0 DSView/{ => src}/log.h | 0 DSView/{ => src}/main.cpp | 0 DSView/{ => src}/mystyle.h | 0 DSView/{ => src}/prop/binding/binding.cpp | 0 DSView/{ => src}/prop/binding/binding.h | 0 .../{ => src}/prop/binding/decoderoptions.cpp | 0 .../{ => src}/prop/binding/decoderoptions.h | 0 .../{ => src}/prop/binding/deviceoptions.cpp | 0 DSView/{ => src}/prop/binding/deviceoptions.h | 0 .../{ => src}/prop/binding/probeoptions.cpp | 0 DSView/{ => src}/prop/binding/probeoptions.h | 0 DSView/{ => src}/prop/bool.cpp | 0 DSView/{ => src}/prop/bool.h | 0 DSView/{ => src}/prop/double.cpp | 0 DSView/{ => src}/prop/double.h | 0 DSView/{ => src}/prop/enum.cpp | 0 DSView/{ => src}/prop/enum.h | 0 DSView/{ => src}/prop/int.cpp | 0 DSView/{ => src}/prop/int.h | 0 DSView/{ => src}/prop/property.cpp | 0 DSView/{ => src}/prop/property.h | 0 DSView/{ => src}/prop/string.cpp | 0 DSView/{ => src}/prop/string.h | 0 DSView/{ => src}/toolbars/filebar.cpp | 0 DSView/{ => src}/toolbars/filebar.h | 0 DSView/{ => src}/toolbars/logobar.cpp | 0 DSView/{ => src}/toolbars/logobar.h | 0 DSView/{ => src}/toolbars/samplingbar.cpp | 0 DSView/{ => src}/toolbars/samplingbar.h | 0 DSView/{ => src}/toolbars/titlebar.cpp | 0 DSView/{ => src}/toolbars/titlebar.h | 2 +- DSView/{ => src}/toolbars/trigbar.cpp | 4 +- DSView/{ => src}/toolbars/trigbar.h | 4 +- DSView/{ => src}/ui/dscombobox.cpp | 0 DSView/{ => src}/ui/dscombobox.h | 0 DSView/{ => src}/ui/fn.cpp | 0 DSView/{ => src}/ui/fn.h | 0 DSView/{ => src}/ui/langresource.cpp | 0 DSView/{ => src}/ui/langresource.h | 0 DSView/{ => src}/ui/msgbox.cpp | 0 DSView/{ => src}/ui/msgbox.h | 2 +- DSView/{ => src}/ui/string_ids.h | 0 DSView/{ => src}/utility/array.cpp | 2 +- DSView/{ => src}/utility/array.h | 2 +- DSView/{ => src}/utility/encoding.cpp | 2 +- DSView/{ => src}/utility/encoding.h | 2 +- DSView/{ => src}/utility/path.cpp | 2 +- DSView/{ => src}/utility/path.h | 2 +- DSView/{ => src}/view/analogsignal.cpp | 10 +- DSView/{ => src}/view/analogsignal.h | 4 +- DSView/{ => src}/view/cursor.cpp | 12 +- DSView/{ => src}/view/cursor.h | 7 +- DSView/{ => src}/view/decodetrace.cpp | 24 +- DSView/{ => src}/view/decodetrace.h | 19 +- DSView/{ => src}/view/devmode.cpp | 19 +- DSView/{ => src}/view/devmode.h | 22 +- DSView/{ => src}/view/dsldial.cpp | 4 +- DSView/{ => src}/view/dsldial.h | 4 +- DSView/{ => src}/view/dsosignal.cpp | 4 +- DSView/{ => src}/view/dsosignal.h | 4 +- DSView/{ => src}/view/groupsignal.cpp | 4 +- DSView/{ => src}/view/groupsignal.h | 4 +- DSView/{ => src}/view/header.cpp | 4 +- DSView/{ => src}/view/header.h | 4 +- DSView/{ => src}/view/lissajoustrace.cpp | 4 +- DSView/{ => src}/view/lissajoustrace.h | 4 +- DSView/{ => src}/view/logicsignal.cpp | 4 +- DSView/{ => src}/view/logicsignal.h | 4 +- DSView/{ => src}/view/mathtrace.cpp | 4 +- DSView/{ => src}/view/mathtrace.h | 4 +- DSView/{ => src}/view/ruler.cpp | 4 +- DSView/{ => src}/view/ruler.h | 4 +- DSView/{ => src}/view/signal.cpp | 4 +- DSView/{ => src}/view/signal.h | 4 +- DSView/{ => src}/view/spectrumtrace.cpp | 4 +- DSView/{ => src}/view/spectrumtrace.h | 4 +- DSView/{ => src}/view/timemarker.cpp | 4 +- DSView/{ => src}/view/timemarker.h | 4 +- DSView/{ => src}/view/trace.cpp | 4 +- DSView/{ => src}/view/trace.h | 4 +- DSView/{ => src}/view/view.cpp | 4 +- DSView/{ => src}/view/view.h | 4 +- DSView/{ => src}/view/viewport.cpp | 4 +- DSView/{ => src}/view/viewport.h | 4 +- DSView/{ => src}/view/viewstatus.cpp | 4 +- DSView/{ => src}/view/viewstatus.h | 4 +- DSView/{ => src}/view/xcursor.cpp | 4 +- DSView/{ => src}/view/xcursor.h | 4 +- DSView/{ => src}/widgets/border.cpp | 4 +- DSView/{ => src}/widgets/border.h | 4 +- DSView/{ => src}/widgets/decodergroupbox.cpp | 2 +- DSView/{ => src}/widgets/decodergroupbox.h | 2 +- DSView/{ => src}/widgets/decodermenu.cpp | 2 +- DSView/{ => src}/widgets/decodermenu.h | 2 +- DSView/{ => src}/widgets/fakelineedit.cpp | 4 +- DSView/{ => src}/widgets/fakelineedit.h | 4 +- DSView/test/CMakeLists.txt | 385 ------------- DSView/test/data/analogsnapshot.cpp | 124 ---- DSView/test/data/logicsnapshot.cpp | 537 ------------------ DSView/test/test.cpp | 23 - 209 files changed, 363 insertions(+), 1461 deletions(-) delete mode 100644 DSView/config.h rename DSView/{zcore => src/appcore}/appcontrol.cpp (94%) rename DSView/{zcore => src/appcore}/appcontrol.h (94%) rename DSView/{zcore => src/appcore}/deviceagent.cpp (99%) rename DSView/{zcore => src/appcore}/deviceagent.h (98%) rename DSView/{zcore => src/appcore}/eventobject.cpp (92%) rename DSView/{zcore => src/appcore}/eventobject.h (95%) rename DSView/{zcore => src/appcore}/mainframe.cpp (95%) rename DSView/{zcore => src/appcore}/mainframe.h (93%) rename DSView/{zcore => src/appcore}/mainwindow.cpp (99%) rename DSView/{zcore => src/appcore}/mainwindow.h (98%) rename DSView/{zcore => src/appcore}/sigsession.cpp (98%) rename DSView/{zcore => src/appcore}/sigsession.h (95%) rename DSView/{ => src}/basedef.h (100%) rename DSView/{ => src}/com/dstimer.cpp (98%) rename DSView/{ => src}/com/dstimer.h (98%) rename DSView/{zcore => src/com}/storesession.cpp (99%) rename DSView/{zcore => src/com}/storesession.h (99%) rename DSView/{zcore/ZipMaker.cpp => src/com/zipmaker.cpp} (98%) rename DSView/{zcore/ZipMaker.h => src/com/zipmaker.h} (97%) rename DSView/{ => src}/config/appconfig.cpp (100%) rename DSView/{ => src}/config/appconfig.h (100%) rename DSView/{model => src/data}/analogsnapshot.cpp (99%) rename DSView/{model => src/data}/analogsnapshot.h (96%) rename DSView/{model => src/data}/decodermodel.cpp (97%) rename DSView/{model => src/data}/decodermodel.h (95%) rename DSView/{model => src/data}/decoderstack.cpp (99%) rename DSView/{model => src/data}/decoderstack.h (95%) rename DSView/{model => src/data}/dsosnapshot.cpp (99%) rename DSView/{model => src/data}/dsosnapshot.h (97%) rename DSView/{model => src/data}/logicsnapshot.cpp (99%) rename DSView/{model => src/data}/logicsnapshot.h (96%) rename DSView/{model => src/data}/mathstack.cpp (99%) rename DSView/{model => src/data}/mathstack.h (97%) rename DSView/{model => src/data}/signaldata.cpp (100%) rename DSView/{model => src/data}/signaldata.h (100%) rename DSView/{model => src/data}/snapshot.cpp (100%) rename DSView/{model => src/data}/snapshot.h (100%) rename DSView/{model => src/data}/spectrumstack.cpp (98%) rename DSView/{model => src/data}/spectrumstack.h (96%) rename DSView/{ => src}/decode/annotation.cpp (100%) rename DSView/{ => src}/decode/annotation.h (100%) rename DSView/{ => src}/decode/annotationrestable.cpp (100%) rename DSView/{ => src}/decode/annotationrestable.h (100%) rename DSView/{ => src}/decode/decoder.cpp (100%) rename DSView/{ => src}/decode/decoder.h (100%) rename DSView/{ => src}/decode/decoderstatus.cpp (100%) rename DSView/{ => src}/decode/decoderstatus.h (100%) rename DSView/{ => src}/decode/displaydataformat.h (100%) rename DSView/{ => src}/decode/row.cpp (100%) rename DSView/{ => src}/decode/row.h (100%) rename DSView/{ => src}/decode/rowdata.cpp (100%) rename DSView/{ => src}/decode/rowdata.h (100%) rename DSView/{ => src}/dialogs/about.cpp (100%) rename DSView/{ => src}/dialogs/about.h (100%) rename DSView/{ => src}/dialogs/applicationpardlg.cpp (100%) rename DSView/{ => src}/dialogs/applicationpardlg.h (100%) rename DSView/{ => src}/dialogs/calibration.cpp (100%) rename DSView/{ => src}/dialogs/calibration.h (100%) rename DSView/{ => src}/dialogs/decoderoptionsdlg.cpp (100%) rename DSView/{ => src}/dialogs/decoderoptionsdlg.h (100%) rename DSView/{ => src}/dialogs/deviceoptions.cpp (100%) rename DSView/{ => src}/dialogs/deviceoptions.h (100%) rename DSView/{ => src}/dialogs/dsdialog.cpp (100%) rename DSView/{ => src}/dialogs/dsdialog.h (100%) rename DSView/{ => src}/dialogs/dsmessagebox.cpp (100%) rename DSView/{ => src}/dialogs/dsmessagebox.h (100%) rename DSView/{ => src}/dialogs/dsomeasure.cpp (100%) rename DSView/{ => src}/dialogs/dsomeasure.h (100%) rename DSView/{ => src}/dialogs/fftoptions.cpp (100%) rename DSView/{ => src}/dialogs/fftoptions.h (100%) rename DSView/{ => src}/dialogs/interval.cpp (100%) rename DSView/{ => src}/dialogs/interval.h (100%) rename DSView/{ => src}/dialogs/lissajousoptions.cpp (100%) rename DSView/{ => src}/dialogs/lissajousoptions.h (100%) rename DSView/{ => src}/dialogs/mathoptions.cpp (100%) rename DSView/{ => src}/dialogs/mathoptions.h (100%) rename DSView/{ => src}/dialogs/protocolexp.cpp (100%) rename DSView/{ => src}/dialogs/protocolexp.h (100%) rename DSView/{ => src}/dialogs/protocollist.cpp (100%) rename DSView/{ => src}/dialogs/protocollist.h (100%) rename DSView/{ => src}/dialogs/regionoptions.cpp (100%) rename DSView/{ => src}/dialogs/regionoptions.h (100%) rename DSView/{ => src}/dialogs/search.cpp (100%) rename DSView/{ => src}/dialogs/search.h (100%) rename DSView/{ => src}/dialogs/shadow.cpp (100%) rename DSView/{ => src}/dialogs/shadow.h (100%) rename DSView/{ => src}/dialogs/storeprogress.cpp (100%) rename DSView/{ => src}/dialogs/storeprogress.h (100%) rename DSView/{ => src}/dialogs/waitingdialog.cpp (100%) rename DSView/{ => src}/dialogs/waitingdialog.h (100%) rename DSView/{ => src}/dock/dsotriggerdock.cpp (100%) rename DSView/{ => src}/dock/dsotriggerdock.h (100%) rename DSView/{ => src}/dock/keywordlineedit.cpp (100%) rename DSView/{ => src}/dock/keywordlineedit.h (100%) rename DSView/{ => src}/dock/measuredock.cpp (100%) rename DSView/{ => src}/dock/measuredock.h (100%) rename DSView/{ => src}/dock/protocoldock.cpp (100%) rename DSView/{ => src}/dock/protocoldock.h (100%) rename DSView/{ => src}/dock/protocolitemlayer.cpp (100%) rename DSView/{ => src}/dock/protocolitemlayer.h (100%) rename DSView/{ => src}/dock/searchcombobox.cpp (100%) rename DSView/{ => src}/dock/searchcombobox.h (100%) rename DSView/{ => src}/dock/searchdock.cpp (100%) rename DSView/{ => src}/dock/searchdock.h (100%) rename DSView/{ => src}/dock/triggerdock.cpp (100%) rename DSView/{ => src}/dock/triggerdock.h (100%) rename DSView/{ => src}/interface/icallbacks.h (100%) rename DSView/{ => src}/log.cpp (100%) rename DSView/{ => src}/log.h (100%) rename DSView/{ => src}/main.cpp (100%) rename DSView/{ => src}/mystyle.h (100%) rename DSView/{ => src}/prop/binding/binding.cpp (100%) rename DSView/{ => src}/prop/binding/binding.h (100%) rename DSView/{ => src}/prop/binding/decoderoptions.cpp (100%) rename DSView/{ => src}/prop/binding/decoderoptions.h (100%) rename DSView/{ => src}/prop/binding/deviceoptions.cpp (100%) rename DSView/{ => src}/prop/binding/deviceoptions.h (100%) rename DSView/{ => src}/prop/binding/probeoptions.cpp (100%) rename DSView/{ => src}/prop/binding/probeoptions.h (100%) rename DSView/{ => src}/prop/bool.cpp (100%) rename DSView/{ => src}/prop/bool.h (100%) rename DSView/{ => src}/prop/double.cpp (100%) rename DSView/{ => src}/prop/double.h (100%) rename DSView/{ => src}/prop/enum.cpp (100%) rename DSView/{ => src}/prop/enum.h (100%) rename DSView/{ => src}/prop/int.cpp (100%) rename DSView/{ => src}/prop/int.h (100%) rename DSView/{ => src}/prop/property.cpp (100%) rename DSView/{ => src}/prop/property.h (100%) rename DSView/{ => src}/prop/string.cpp (100%) rename DSView/{ => src}/prop/string.h (100%) rename DSView/{ => src}/toolbars/filebar.cpp (100%) rename DSView/{ => src}/toolbars/filebar.h (100%) rename DSView/{ => src}/toolbars/logobar.cpp (100%) rename DSView/{ => src}/toolbars/logobar.h (100%) rename DSView/{ => src}/toolbars/samplingbar.cpp (100%) rename DSView/{ => src}/toolbars/samplingbar.h (100%) rename DSView/{ => src}/toolbars/titlebar.cpp (100%) rename DSView/{ => src}/toolbars/titlebar.h (99%) rename DSView/{ => src}/toolbars/trigbar.cpp (99%) rename DSView/{ => src}/toolbars/trigbar.h (98%) rename DSView/{ => src}/ui/dscombobox.cpp (100%) rename DSView/{ => src}/ui/dscombobox.h (100%) rename DSView/{ => src}/ui/fn.cpp (100%) rename DSView/{ => src}/ui/fn.h (100%) rename DSView/{ => src}/ui/langresource.cpp (100%) rename DSView/{ => src}/ui/langresource.h (100%) rename DSView/{ => src}/ui/msgbox.cpp (100%) rename DSView/{ => src}/ui/msgbox.h (99%) rename DSView/{ => src}/ui/string_ids.h (100%) rename DSView/{ => src}/utility/array.cpp (99%) rename DSView/{ => src}/utility/array.h (98%) rename DSView/{ => src}/utility/encoding.cpp (98%) rename DSView/{ => src}/utility/encoding.h (98%) rename DSView/{ => src}/utility/path.cpp (99%) rename DSView/{ => src}/utility/path.h (98%) rename DSView/{ => src}/view/analogsignal.cpp (99%) rename DSView/{ => src}/view/analogsignal.h (99%) rename DSView/{ => src}/view/cursor.cpp (98%) rename DSView/{ => src}/view/cursor.h (98%) rename DSView/{ => src}/view/decodetrace.cpp (98%) rename DSView/{ => src}/view/decodetrace.h (97%) rename DSView/{ => src}/view/devmode.cpp (98%) rename DSView/{ => src}/view/devmode.h (92%) rename DSView/{ => src}/view/dsldial.cpp (99%) rename DSView/{ => src}/view/dsldial.h (98%) rename DSView/{ => src}/view/dsosignal.cpp (99%) rename DSView/{ => src}/view/dsosignal.h (99%) rename DSView/{ => src}/view/groupsignal.cpp (98%) rename DSView/{ => src}/view/groupsignal.h (98%) rename DSView/{ => src}/view/header.cpp (99%) rename DSView/{ => src}/view/header.h (98%) rename DSView/{ => src}/view/lissajoustrace.cpp (99%) rename DSView/{ => src}/view/lissajoustrace.h (98%) rename DSView/{ => src}/view/logicsignal.cpp (99%) rename DSView/{ => src}/view/logicsignal.h (99%) rename DSView/{ => src}/view/mathtrace.cpp (99%) rename DSView/{ => src}/view/mathtrace.h (99%) rename DSView/{ => src}/view/ruler.cpp (99%) rename DSView/{ => src}/view/ruler.h (98%) rename DSView/{ => src}/view/signal.cpp (97%) rename DSView/{ => src}/view/signal.h (98%) rename DSView/{ => src}/view/spectrumtrace.cpp (99%) rename DSView/{ => src}/view/spectrumtrace.h (99%) rename DSView/{ => src}/view/timemarker.cpp (98%) rename DSView/{ => src}/view/timemarker.h (98%) rename DSView/{ => src}/view/trace.cpp (99%) rename DSView/{ => src}/view/trace.h (99%) rename DSView/{ => src}/view/view.cpp (99%) rename DSView/{ => src}/view/view.h (99%) rename DSView/{ => src}/view/viewport.cpp (99%) rename DSView/{ => src}/view/viewport.h (99%) rename DSView/{ => src}/view/viewstatus.cpp (99%) rename DSView/{ => src}/view/viewstatus.h (98%) rename DSView/{ => src}/view/xcursor.cpp (99%) rename DSView/{ => src}/view/xcursor.h (99%) rename DSView/{ => src}/widgets/border.cpp (99%) rename DSView/{ => src}/widgets/border.h (97%) rename DSView/{ => src}/widgets/decodergroupbox.cpp (99%) rename DSView/{ => src}/widgets/decodergroupbox.h (99%) rename DSView/{ => src}/widgets/decodermenu.cpp (99%) rename DSView/{ => src}/widgets/decodermenu.h (98%) rename DSView/{ => src}/widgets/fakelineedit.cpp (97%) rename DSView/{ => src}/widgets/fakelineedit.h (97%) delete mode 100644 DSView/test/CMakeLists.txt delete mode 100644 DSView/test/data/analogsnapshot.cpp delete mode 100644 DSView/test/data/logicsnapshot.cpp delete mode 100644 DSView/test/test.cpp diff --git a/DSView/config.h b/DSView/config.h deleted file mode 100644 index 07d7087b1..000000000 --- a/DSView/config.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the PulseView project. - * DSView is based on PulseView. - * - * Copyright (C) 2012 Alexandru Gagniuc - * - * 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, see . - */ - -#ifndef _DSVIEW_CONFIG_H -#define _DSVIEW_CONFIG_H - -/* Application details */ -#define DS_TITLE "DSView" -#define DS_DESCRIPTION "A GUI for instruments of DreamSourceLab" -#define DS_BIN_NAME "DSView" - -/* DSView version information */ -#define DS_VERSION_MAJOR 1 -#define DS_VERSION_MINOR 3 -#define DS_VERSION_MICRO 0 -#define DS_VERSION_STRING "1.3.0-RC10" - -#endif diff --git a/DSView/zcore/appcontrol.cpp b/DSView/src/appcore/appcontrol.cpp similarity index 94% rename from DSView/zcore/appcontrol.cpp rename to DSView/src/appcore/appcontrol.cpp index 0e1fec53e..e513ca6e9 100644 --- a/DSView/zcore/appcontrol.cpp +++ b/DSView/src/appcore/appcontrol.cpp @@ -29,11 +29,14 @@ #include #include #include "sigsession.h" -#include "dsvdef.h" -#include "config/appconfig.h" -#include "log.h" -#include "utility/path.h" -#include "utility/encoding.h" +#include "../basedef.h" +#include "../config/appconfig.h" +#include "../log.h" +#include "../utility/path.h" +#include "../utility/encoding.h" + +namespace dsv { +namespace appcore { AppControl::AppControl() { @@ -179,3 +182,7 @@ void AppControl::update_font_forms() f->update_font(); } } + +} //namespace com +} //namespace appcore + diff --git a/DSView/zcore/appcontrol.h b/DSView/src/appcore/appcontrol.h similarity index 94% rename from DSView/zcore/appcontrol.h rename to DSView/src/appcore/appcontrol.h index a2f32893f..eb26227f6 100644 --- a/DSView/zcore/appcontrol.h +++ b/DSView/src/appcore/appcontrol.h @@ -28,9 +28,10 @@ struct sr_context; class QWidget; class IFontForm; -namespace pv{ - class SigSession; -} +namespace dsv { +namespace appcore { + +class SigSession; class AppControl { @@ -78,3 +79,6 @@ class AppControl QWidget *_topWindow; std::vector _font_forms; }; + +} //namespace com +} //namespace appcore diff --git a/DSView/zcore/deviceagent.cpp b/DSView/src/appcore/deviceagent.cpp similarity index 99% rename from DSView/zcore/deviceagent.cpp rename to DSView/src/appcore/deviceagent.cpp index 62ebf10eb..9ae0e6393 100644 --- a/DSView/zcore/deviceagent.cpp +++ b/DSView/src/appcore/deviceagent.cpp @@ -21,8 +21,10 @@ #include "deviceagent.h" #include -#include "log.h" +#include "../log.h" +namespace dsv { +namespace appcore { DeviceAgent::DeviceAgent() { @@ -654,5 +656,8 @@ bool DeviceAgent::set_config_double(int key, double value, const sr_channel *ch, return true; } +} //namespace com +} //namespace appcore + //---------------device config end -----------/ diff --git a/DSView/zcore/deviceagent.h b/DSView/src/appcore/deviceagent.h similarity index 98% rename from DSView/zcore/deviceagent.h rename to DSView/src/appcore/deviceagent.h index ae9132d16..876c947e3 100644 --- a/DSView/zcore/deviceagent.h +++ b/DSView/src/appcore/deviceagent.h @@ -28,6 +28,9 @@ #include #include +namespace dsv { +namespace appcore { + class IDeviceAgentCallback { public: @@ -237,5 +240,7 @@ class DeviceAgent IDeviceAgentCallback *_callback; }; +} //namespace com +} //namespace appcore #endif \ No newline at end of file diff --git a/DSView/zcore/eventobject.cpp b/DSView/src/appcore/eventobject.cpp similarity index 92% rename from DSView/zcore/eventobject.cpp rename to DSView/src/appcore/eventobject.cpp index 5f5b9076b..22aab9313 100644 --- a/DSView/zcore/eventobject.cpp +++ b/DSView/src/appcore/eventobject.cpp @@ -21,10 +21,16 @@ #include "eventobject.h" +namespace dsv { +namespace appcore { + EventObject::EventObject(){ } DeviceEventObject::DeviceEventObject() { -} \ No newline at end of file +} + +} //namespace com +} //namespace appcore \ No newline at end of file diff --git a/DSView/zcore/eventobject.h b/DSView/src/appcore/eventobject.h similarity index 95% rename from DSView/zcore/eventobject.h rename to DSView/src/appcore/eventobject.h index e8d1fe9dc..daa8f4161 100644 --- a/DSView/zcore/eventobject.h +++ b/DSView/src/appcore/eventobject.h @@ -24,6 +24,9 @@ #include +namespace dsv { +namespace appcore { + class EventObject : public QObject { Q_OBJECT @@ -62,4 +65,7 @@ class DeviceEventObject : public QObject void device_updated(); }; +} //namespace com +} //namespace appcore + #endif \ No newline at end of file diff --git a/DSView/zcore/mainframe.cpp b/DSView/src/appcore/mainframe.cpp similarity index 95% rename from DSView/zcore/mainframe.cpp rename to DSView/src/appcore/mainframe.cpp index 1ce355c38..8b4b6d34a 100644 --- a/DSView/zcore/mainframe.cpp +++ b/DSView/src/appcore/mainframe.cpp @@ -20,12 +20,6 @@ */ #include "mainframe.h" - -#include "toolbars/titlebar.h" -#include "dialogs/dsmessagebox.h" -#include "dialogs/dsdialog.h" -#include "mainwindow.h" - #include #include #include @@ -44,17 +38,21 @@ #include #include #include +#include -#include "dsvdef.h" -#include "config/appconfig.h" -#include "ui/msgbox.h" +#include "mainwindow.h" +#include "../toolbars/titlebar.h" +#include "../dialogs/dsmessagebox.h" +#include "../dialogs/dsdialog.h" +#include "../basedef.h" +#include "../config/appconfig.h" +#include "../ui/msgbox.h" #include "appcontrol.h" -#include "ui/langresource.h" -#include "log.h" - -#include +#include "../ui/langresource.h" +#include "../log.h" -namespace pv { +namespace dsv { +namespace appcore { MainFrame::MainFrame() { @@ -550,4 +548,5 @@ void MainFrame::show_doc() } } -} // namespace pv +} //namespace com +} //namespace appcore diff --git a/DSView/zcore/mainframe.h b/DSView/src/appcore/mainframe.h similarity index 93% rename from DSView/zcore/mainframe.h rename to DSView/src/appcore/mainframe.h index 3f8c3dbd8..feba0eef0 100644 --- a/DSView/zcore/mainframe.h +++ b/DSView/src/appcore/mainframe.h @@ -23,29 +23,32 @@ #ifndef DSVIEW_PV_MAINFRAME_H #define DSVIEW_PV_MAINFRAME_H -#include "widgets/border.h" - #include #include #include + #ifdef _WIN32 #include #include #endif -namespace pv { - -class MainWindow; +#include "../widgets/border.h" + +namespace dsv { namespace toolbars { -class TitleBar; + class TitleBar; } namespace dialogs { -class DSMessageBox; -class DSDialog; + class DSMessageBox; + class DSDialog; } +namespace appcore { + +class MainWindow; + class MainFrame : public QFrame { Q_OBJECT @@ -118,6 +121,7 @@ public slots: #endif }; -} // namespace pv +} //namespace com +} //namespace appcore #endif // DSVIEW_PV_MAINFRAME_H diff --git a/DSView/zcore/mainwindow.cpp b/DSView/src/appcore/mainwindow.cpp similarity index 99% rename from DSView/zcore/mainwindow.cpp rename to DSView/src/appcore/mainwindow.cpp index e75746f6d..70cc331ac 100644 --- a/DSView/zcore/mainwindow.cpp +++ b/DSView/src/appcore/mainwindow.cpp @@ -103,8 +103,9 @@ #include "dsvdef.h" #include -namespace pv -{ +namespace dsv { +namespace appcore { + MainWindow::MainWindow(toolbars::TitleBar *title_bar, QWidget *parent) : QMainWindow(parent) @@ -2170,4 +2171,5 @@ namespace pv _view->update_all_trace_postion(); } -} // namespace pv +} //namespace com +} //namespace appcore diff --git a/DSView/zcore/mainwindow.h b/DSView/src/appcore/mainwindow.h similarity index 98% rename from DSView/zcore/mainwindow.h rename to DSView/src/appcore/mainwindow.h index 6d28b65c1..8f815ec1a 100644 --- a/DSView/zcore/mainwindow.h +++ b/DSView/src/appcore/mainwindow.h @@ -32,7 +32,7 @@ #include "eventobject.h" #include #include -#include "dstimer.h" +#include "../com/dstimer.h" class QAction; class QMenuBar; @@ -48,7 +48,11 @@ class DeviceAgent; using std::chrono::high_resolution_clock; using std::chrono::milliseconds; -namespace pv { +using dsv::com; + +namespace dsv { +namespace appcore { + class SigSession; @@ -242,6 +246,7 @@ private slots: bool _key_vaild; }; -} // namespace pv +} //namespace com +} //namespace appcore #endif // DSVIEW_PV_MAINWINDOW_H diff --git a/DSView/zcore/sigsession.cpp b/DSView/src/appcore/sigsession.cpp similarity index 98% rename from DSView/zcore/sigsession.cpp rename to DSView/src/appcore/sigsession.cpp index bf6b800fc..c139dc4c0 100644 --- a/DSView/zcore/sigsession.cpp +++ b/DSView/src/appcore/sigsession.cpp @@ -20,44 +20,39 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "sigsession.h" -#include "mainwindow.h" - -#include "data/analogsnapshot.h" -#include "data/dsosnapshot.h" -#include "data/logicsnapshot.h" -#include "data/decoderstack.h" -#include "data/decode/decoder.h" -#include "data/decodermodel.h" -#include "data/spectrumstack.h" -#include "data/mathstack.h" - -#include "view/analogsignal.h" -#include "view/dsosignal.h" -#include "view/logicsignal.h" -#include "view/groupsignal.h" -#include "view/decodetrace.h" -#include "view/spectrumtrace.h" -#include "view/lissajoustrace.h" -#include "view/mathtrace.h" - +#include #include #include #include #include #include - -#include "data/decode/decoderstatus.h" -#include "dsvdef.h" -#include "log.h" -#include "config/appconfig.h" -#include "utility/path.h" -#include "ui/msgbox.h" -#include "ui/langresource.h" - -namespace pv +#include "mainwindow.h" +#include "../data/analogsnapshot.h" +#include "../data/dsosnapshot.h" +#include "../data/logicsnapshot.h" +#include "../data/decoderstack.h" +#include "../data/decode/decoder.h" +#include "../data/decodermodel.h" +#include "../data/spectrumstack.h" +#include "../data/mathstack.h" +#include "../view/analogsignal.h" +#include "../view/dsosignal.h" +#include "../view/logicsignal.h" +#include "../view/groupsignal.h" +#include "../view/decodetrace.h" +#include "../view/spectrumtrace.h" +#include "../view/lissajoustrace.h" +#include "../view/mathtrace.h" +#include "../data/decode/decoderstatus.h" +#include "../basedef.h" +#include "../log.h" +#include "../config/appconfig.h" +#include "../utility/path.h" +#include "../ui/msgbox.h" +#include "../ui/langresource.h" + +namespace dsv { SessionData::SessionData() { @@ -2441,4 +2436,4 @@ namespace pv } } -} // namespace pv +} // namespace dsv diff --git a/DSView/zcore/sigsession.h b/DSView/src/appcore/sigsession.h similarity index 95% rename from DSView/zcore/sigsession.h rename to DSView/src/appcore/sigsession.h index f41c14e6e..1cb35f1e6 100644 --- a/DSView/zcore/sigsession.h +++ b/DSView/src/appcore/sigsession.h @@ -31,49 +31,51 @@ #include #include #include - -#include "view/mathtrace.h" -#include "data/mathstack.h" -#include "interface/icallbacks.h" -#include "dstimer.h" #include + +#include "../view/mathtrace.h" +#include "../data/mathstack.h" +#include "../interface/icallbacks.h" +#include "../com/dstimer.h" #include "deviceagent.h" #include "eventobject.h" -#include "data/logicsnapshot.h" -#include "data/analogsnapshot.h" -#include "data/dsosnapshot.h" +#include "../data/logicsnapshot.h" +#include "../data/analogsnapshot.h" +#include "../data/dsosnapshot.h" struct srd_decoder; struct srd_channel; -class DecoderStatus; typedef std::lock_guard ds_lock_guard; -namespace pv { +namespace dsv { namespace data { -class SignalData; -class Snapshot; -class AnalogSnapshot; -class DsoSnapshot; -class LogicSnapshot; -class DecoderModel; -class MathStack; + class SignalData; + class Snapshot; + class AnalogSnapshot; + class DsoSnapshot; + class LogicSnapshot; + class DecoderModel; + class MathStack; +} namespace decode { class Decoder; - } + class DecoderStatus; } namespace view { -class Signal; -class GroupSignal; -class DecodeTrace; -class SpectrumTrace; -class LissajousTrace; -class MathTrace; + class Signal; + class GroupSignal; + class DecodeTrace; + class SpectrumTrace; + class LissajousTrace; + class MathTrace; } +namespace appcore { + enum DEVICE_STATUS_TYPE { ST_INIT = 0, @@ -117,7 +119,7 @@ class SessionData data::DsoSnapshot dso; }; -using namespace pv::data; +using namespace dsv::data; //created by MainWindow class SigSession: @@ -602,6 +604,6 @@ class SigSession: static SigSession *_session; }; -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_SIGSESSION_H diff --git a/DSView/basedef.h b/DSView/src/basedef.h similarity index 100% rename from DSView/basedef.h rename to DSView/src/basedef.h diff --git a/DSView/com/dstimer.cpp b/DSView/src/com/dstimer.cpp similarity index 98% rename from DSView/com/dstimer.cpp rename to DSView/src/com/dstimer.cpp index 800ec32dc..de1486240 100644 --- a/DSView/com/dstimer.cpp +++ b/DSView/src/com/dstimer.cpp @@ -22,8 +22,8 @@ #include "dstimer.h" #include -namespace dsv{ -namespace com{ +namespace dsv { +namespace com { DsTimer::DsTimer() { diff --git a/DSView/com/dstimer.h b/DSView/src/com/dstimer.h similarity index 98% rename from DSView/com/dstimer.h rename to DSView/src/com/dstimer.h index 61b34a4cd..999d26f91 100644 --- a/DSView/com/dstimer.h +++ b/DSView/src/com/dstimer.h @@ -27,8 +27,8 @@ #include #include -namespace dsv{ -namespace com{ +namespace dsv { +namespace com { typedef std::function CALLBACL_FUNC; diff --git a/DSView/zcore/storesession.cpp b/DSView/src/com/storesession.cpp similarity index 99% rename from DSView/zcore/storesession.cpp rename to DSView/src/com/storesession.cpp index 7a0c1ed1b..1c13258ce 100644 --- a/DSView/zcore/storesession.cpp +++ b/DSView/src/com/storesession.cpp @@ -64,7 +64,7 @@ #define DEOCDER_CONFIG_VERSION 2 -namespace pv { +namespace dsv { StoreSession::StoreSession(SigSession *session) : _session(session), diff --git a/DSView/zcore/storesession.h b/DSView/src/com/storesession.h similarity index 99% rename from DSView/zcore/storesession.h rename to DSView/src/com/storesession.h index 67974edf0..5d972ae27 100644 --- a/DSView/zcore/storesession.h +++ b/DSView/src/com/storesession.h @@ -33,7 +33,7 @@ #include "ZipMaker.h" -namespace pv { +namespace dsv { class SigSession; diff --git a/DSView/zcore/ZipMaker.cpp b/DSView/src/com/zipmaker.cpp similarity index 98% rename from DSView/zcore/ZipMaker.cpp rename to DSView/src/com/zipmaker.cpp index e81e3df73..45e9e9b62 100644 --- a/DSView/zcore/ZipMaker.cpp +++ b/DSView/src/com/zipmaker.cpp @@ -19,12 +19,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ZipMaker.h" +#include "zipmaker.h" #include #include #include #include #include + +namespace dsv { +namespace com { ZipMaker::ZipMaker() : m_zDoc(NULL) @@ -240,4 +243,7 @@ void ZipReader::ReleaseInnerFileData(ZipInnerFileData *data) if (data){ delete data; } -} \ No newline at end of file +} + +} //namespace com +} //namespace dsv \ No newline at end of file diff --git a/DSView/zcore/ZipMaker.h b/DSView/src/com/zipmaker.h similarity index 97% rename from DSView/zcore/ZipMaker.h rename to DSView/src/com/zipmaker.h index f8eec3f53..8cbc7f3d0 100644 --- a/DSView/zcore/ZipMaker.h +++ b/DSView/src/com/zipmaker.h @@ -27,6 +27,9 @@ #include +namespace dsv { +namespace com { + class ZipMaker { public: @@ -99,4 +102,7 @@ class ZipReader{ private: unzFile m_archive; }; + +} //namespace com +} //namespace dsv diff --git a/DSView/config/appconfig.cpp b/DSView/src/config/appconfig.cpp similarity index 100% rename from DSView/config/appconfig.cpp rename to DSView/src/config/appconfig.cpp diff --git a/DSView/config/appconfig.h b/DSView/src/config/appconfig.h similarity index 100% rename from DSView/config/appconfig.h rename to DSView/src/config/appconfig.h diff --git a/DSView/model/analogsnapshot.cpp b/DSView/src/data/analogsnapshot.cpp similarity index 99% rename from DSView/model/analogsnapshot.cpp rename to DSView/src/data/analogsnapshot.cpp index 098bd9ca9..4bb905625 100644 --- a/DSView/model/analogsnapshot.cpp +++ b/DSView/src/data/analogsnapshot.cpp @@ -20,14 +20,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "analogsnapshot.h" #include #include #include #include #include - -#include "analogsnapshot.h" -#include "../dsvdef.h" +#include "../basedef.h" using namespace std; diff --git a/DSView/model/analogsnapshot.h b/DSView/src/data/analogsnapshot.h similarity index 96% rename from DSView/model/analogsnapshot.h rename to DSView/src/data/analogsnapshot.h index 362818b92..3ee7db658 100644 --- a/DSView/model/analogsnapshot.h +++ b/DSView/src/data/analogsnapshot.h @@ -25,14 +25,9 @@ #define DSVIEW_PV_DATA_ANALOGSNAPSHOT_H #include -#include "snapshot.h" - #include #include - -namespace AnalogSnapshotTest { -class Basic; -} +#include "snapshot.h" namespace dsv { namespace data { @@ -118,8 +113,7 @@ class AnalogSnapshot : public Snapshot private: void *_data; - struct Envelope _envelope_levels[DS_MAX_ANALOG_PROBES_NUM][ScaleStepCount]; - friend class AnalogSnapshotTest::Basic; + struct Envelope _envelope_levels[DS_MAX_ANALOG_PROBES_NUM][ScaleStepCount]; }; } // namespace data diff --git a/DSView/model/decodermodel.cpp b/DSView/src/data/decodermodel.cpp similarity index 97% rename from DSView/model/decodermodel.cpp rename to DSView/src/data/decodermodel.cpp index 8a14adc53..140de3645 100644 --- a/DSView/model/decodermodel.cpp +++ b/DSView/src/data/decodermodel.cpp @@ -19,12 +19,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "decodermodel.h" #include - -#include "decode/annotation.h" -#include "decode/rowdata.h" #include "decoderstack.h" -#include "decodermodel.h" +#include "../decode/annotation.h" +#include "../decode/rowdata.h" + using namespace boost; using namespace std; diff --git a/DSView/model/decodermodel.h b/DSView/src/data/decodermodel.h similarity index 95% rename from DSView/model/decodermodel.h rename to DSView/src/data/decodermodel.h index 602c478fe..592d9eaa7 100644 --- a/DSView/model/decodermodel.h +++ b/DSView/src/data/decodermodel.h @@ -24,19 +24,20 @@ #include -#include "decode/rowdata.h" +#include "../decode/rowdata.h" namespace dsv { -namespace data { - -class DecoderStack; namespace decode { -class Annotation; -class Decoder; -class Row; + class Annotation; + class Decoder; + class Row; } +namespace data { + +class DecoderStack; + class DecoderModel : public QAbstractTableModel { public: diff --git a/DSView/model/decoderstack.cpp b/DSView/src/data/decoderstack.cpp similarity index 99% rename from DSView/model/decoderstack.cpp rename to DSView/src/data/decoderstack.cpp index d74532ec9..ce554ac3e 100644 --- a/DSView/model/decoderstack.cpp +++ b/DSView/src/data/decoderstack.cpp @@ -20,22 +20,20 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - +#include "decoderstack.h" #include #include #include - -#include "decoderstack.h" +#include #include "logicsnapshot.h" -#include "decode/decoder.h" -#include "decode/annotation.h" -#include "decode/rowdata.h" -#include "../sigsession.h" +#include "../decode/decoder.h" +#include "../decode/annotation.h" +#include "../decode/rowdata.h" +#include "../appcore/sigsession.h" #include "../view/logicsignal.h" -#include "../dsvdef.h" +#include "../basedef.h" #include "../log.h" #include "../ui/langresource.h" -#include using namespace std; using namespace boost; diff --git a/DSView/model/decoderstack.h b/DSView/src/data/decoderstack.h similarity index 95% rename from DSView/model/decoderstack.h rename to DSView/src/data/decoderstack.h index 93dbb3337..3b08bf039 100644 --- a/DSView/model/decoderstack.h +++ b/DSView/src/data/decoderstack.h @@ -30,33 +30,29 @@ #include #include -#include "decode/row.h" -#include "../data/signaldata.h" +#include "../decode/row.h" +#include "signaldata.h" #include "decode/decoderstatus.h" - -namespace DecoderStackTest { -class TwoDecoderStack; -} - namespace dsv { -class SigSession; - namespace view { -class LogicSignal; + class SigSession; } -namespace data { - -class LogicSnapshot; +namespace view { + class LogicSignal; +} namespace decode { -class Annotation; -class Decoder; -class RowData; + class Annotation; + class Decoder; + class RowData; } +namespace data { + +class LogicSnapshot; class DecoderStack; struct decode_task_status @@ -216,8 +212,6 @@ class DecoderStack : public QObject, public SignalData bool _is_capture_end; int _progress; bool _is_decoding; - - friend class DecoderStackTest::TwoDecoderStack; }; } // namespace data diff --git a/DSView/model/dsosnapshot.cpp b/DSView/src/data/dsosnapshot.cpp similarity index 99% rename from DSView/model/dsosnapshot.cpp rename to DSView/src/data/dsosnapshot.cpp index a907d5047..5a719864e 100644 --- a/DSView/model/dsosnapshot.cpp +++ b/DSView/src/data/dsosnapshot.cpp @@ -19,14 +19,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "dsosnapshot.h" #include #include #include #include #include - -#include "dsosnapshot.h" -#include "../dsvdef.h" +#include "../basedef.h" #include "../log.h" using namespace std; diff --git a/DSView/model/dsosnapshot.h b/DSView/src/data/dsosnapshot.h similarity index 97% rename from DSView/model/dsosnapshot.h rename to DSView/src/data/dsosnapshot.h index 1ad8a8e3c..a70a1f4fd 100644 --- a/DSView/model/dsosnapshot.h +++ b/DSView/src/data/dsosnapshot.h @@ -25,13 +25,8 @@ #include #include - #include #include "snapshot.h" - -namespace DsoSnapshotTest { -class Basic; -} namespace dsv { namespace data { @@ -151,8 +146,6 @@ class DsoSnapshot : public Snapshot float _data_scale1 = 0; float _data_scale2 = 0; bool _is_file; - - friend class DsoSnapshotTest::Basic; }; } // namespace data diff --git a/DSView/model/logicsnapshot.cpp b/DSView/src/data/logicsnapshot.cpp similarity index 99% rename from DSView/model/logicsnapshot.cpp rename to DSView/src/data/logicsnapshot.cpp index 7d80422de..b89df178c 100644 --- a/DSView/model/logicsnapshot.cpp +++ b/DSView/src/data/logicsnapshot.cpp @@ -19,14 +19,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - + +#include "logicsnapshot.h" #include #include #include #include - -#include "logicsnapshot.h" -#include "../dsvdef.h" +#include "../basedef.h" #include "../log.h" #include "../utility/array.h" diff --git a/DSView/model/logicsnapshot.h b/DSView/src/data/logicsnapshot.h similarity index 96% rename from DSView/model/logicsnapshot.h rename to DSView/src/data/logicsnapshot.h index 23104983d..de4584136 100644 --- a/DSView/model/logicsnapshot.h +++ b/DSView/src/data/logicsnapshot.h @@ -25,22 +25,14 @@ #define DSVIEW_PV_DATA_LOGICSNAPSHOT_H #include -#include "snapshot.h" #include #include #include #include +#include "snapshot.h" #define CHANNEL_MAX_COUNT 64 -namespace LogicSnapshotTest { -class Pow2; -class Basic; -class LargeData; -class Pulses; -class LongPulses; -} - namespace dsv { namespace data { @@ -252,12 +244,6 @@ class LogicSnapshot : public Snapshot std::vector _free_block_list; struct BlockIndex _cur_ref_block_indexs[CHANNEL_MAX_COUNT]; int _lst_free_block_index; - - friend class LogicSnapshotTest::Pow2; - friend class LogicSnapshotTest::Basic; - friend class LogicSnapshotTest::LargeData; - friend class LogicSnapshotTest::Pulses; - friend class LogicSnapshotTest::LongPulses; }; } // namespace data diff --git a/DSView/model/mathstack.cpp b/DSView/src/data/mathstack.cpp similarity index 99% rename from DSView/model/mathstack.cpp rename to DSView/src/data/mathstack.cpp index ed1529a8e..b5f494fc4 100644 --- a/DSView/model/mathstack.cpp +++ b/DSView/src/data/mathstack.cpp @@ -20,10 +20,11 @@ */ #include "mathstack.h" +#include #include "dsosnapshot.h" -#include "../sigsession.h" +#include "../appcore/sigsession.h" #include "../view/dsosignal.h" -#include + #define PI 3.1415 diff --git a/DSView/model/mathstack.h b/DSView/src/data/mathstack.h similarity index 97% rename from DSView/model/mathstack.h rename to DSView/src/data/mathstack.h index 6a2a4105c..a92446930 100644 --- a/DSView/model/mathstack.h +++ b/DSView/src/data/mathstack.h @@ -22,23 +22,21 @@ #ifndef DSVIEW_PV_DATA_MATHSTACK_H #define DSVIEW_PV_DATA_MATHSTACK_H -#include "signaldata.h" - #include - -#include - - #include #include +#include +#include "signaldata.h" namespace dsv { -class SigSession; +namespace appcore { + class SigSession; +} namespace view { -class DsoSignal; -class dslDial; + class DsoSignal; + class dslDial; } namespace data { diff --git a/DSView/model/signaldata.cpp b/DSView/src/data/signaldata.cpp similarity index 100% rename from DSView/model/signaldata.cpp rename to DSView/src/data/signaldata.cpp diff --git a/DSView/model/signaldata.h b/DSView/src/data/signaldata.h similarity index 100% rename from DSView/model/signaldata.h rename to DSView/src/data/signaldata.h diff --git a/DSView/model/snapshot.cpp b/DSView/src/data/snapshot.cpp similarity index 100% rename from DSView/model/snapshot.cpp rename to DSView/src/data/snapshot.cpp diff --git a/DSView/model/snapshot.h b/DSView/src/data/snapshot.h similarity index 100% rename from DSView/model/snapshot.h rename to DSView/src/data/snapshot.h diff --git a/DSView/model/spectrumstack.cpp b/DSView/src/data/spectrumstack.cpp similarity index 98% rename from DSView/model/spectrumstack.cpp rename to DSView/src/data/spectrumstack.cpp index ee2297765..4ae91f328 100644 --- a/DSView/model/spectrumstack.cpp +++ b/DSView/src/data/spectrumstack.cpp @@ -19,12 +19,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "spectrumstack.h" - +#include "spectrumstack.h" +#include #include "dsosnapshot.h" -#include "../sigsession.h" +#include "../appcore/sigsession.h" #include "../view/dsosignal.h" -#include #define PI 3.1415 diff --git a/DSView/model/spectrumstack.h b/DSView/src/data/spectrumstack.h similarity index 96% rename from DSView/model/spectrumstack.h rename to DSView/src/data/spectrumstack.h index 9a61f88d6..0c7f57917 100644 --- a/DSView/model/spectrumstack.h +++ b/DSView/src/data/spectrumstack.h @@ -22,23 +22,21 @@ #ifndef DSVIEW_PV_DATA_SPECTRUMSTACK_H #define DSVIEW_PV_DATA_SPECTRUMSTACK_H -#include "signaldata.h" - #include - -#include - +#include #include - #include #include +#include "signaldata.h" namespace dsv { -class SigSession; +namespace appcore { + class SigSession; +} namespace view { -class DsoSignal; + class DsoSignal; } namespace data { diff --git a/DSView/decode/annotation.cpp b/DSView/src/decode/annotation.cpp similarity index 100% rename from DSView/decode/annotation.cpp rename to DSView/src/decode/annotation.cpp diff --git a/DSView/decode/annotation.h b/DSView/src/decode/annotation.h similarity index 100% rename from DSView/decode/annotation.h rename to DSView/src/decode/annotation.h diff --git a/DSView/decode/annotationrestable.cpp b/DSView/src/decode/annotationrestable.cpp similarity index 100% rename from DSView/decode/annotationrestable.cpp rename to DSView/src/decode/annotationrestable.cpp diff --git a/DSView/decode/annotationrestable.h b/DSView/src/decode/annotationrestable.h similarity index 100% rename from DSView/decode/annotationrestable.h rename to DSView/src/decode/annotationrestable.h diff --git a/DSView/decode/decoder.cpp b/DSView/src/decode/decoder.cpp similarity index 100% rename from DSView/decode/decoder.cpp rename to DSView/src/decode/decoder.cpp diff --git a/DSView/decode/decoder.h b/DSView/src/decode/decoder.h similarity index 100% rename from DSView/decode/decoder.h rename to DSView/src/decode/decoder.h diff --git a/DSView/decode/decoderstatus.cpp b/DSView/src/decode/decoderstatus.cpp similarity index 100% rename from DSView/decode/decoderstatus.cpp rename to DSView/src/decode/decoderstatus.cpp diff --git a/DSView/decode/decoderstatus.h b/DSView/src/decode/decoderstatus.h similarity index 100% rename from DSView/decode/decoderstatus.h rename to DSView/src/decode/decoderstatus.h diff --git a/DSView/decode/displaydataformat.h b/DSView/src/decode/displaydataformat.h similarity index 100% rename from DSView/decode/displaydataformat.h rename to DSView/src/decode/displaydataformat.h diff --git a/DSView/decode/row.cpp b/DSView/src/decode/row.cpp similarity index 100% rename from DSView/decode/row.cpp rename to DSView/src/decode/row.cpp diff --git a/DSView/decode/row.h b/DSView/src/decode/row.h similarity index 100% rename from DSView/decode/row.h rename to DSView/src/decode/row.h diff --git a/DSView/decode/rowdata.cpp b/DSView/src/decode/rowdata.cpp similarity index 100% rename from DSView/decode/rowdata.cpp rename to DSView/src/decode/rowdata.cpp diff --git a/DSView/decode/rowdata.h b/DSView/src/decode/rowdata.h similarity index 100% rename from DSView/decode/rowdata.h rename to DSView/src/decode/rowdata.h diff --git a/DSView/dialogs/about.cpp b/DSView/src/dialogs/about.cpp similarity index 100% rename from DSView/dialogs/about.cpp rename to DSView/src/dialogs/about.cpp diff --git a/DSView/dialogs/about.h b/DSView/src/dialogs/about.h similarity index 100% rename from DSView/dialogs/about.h rename to DSView/src/dialogs/about.h diff --git a/DSView/dialogs/applicationpardlg.cpp b/DSView/src/dialogs/applicationpardlg.cpp similarity index 100% rename from DSView/dialogs/applicationpardlg.cpp rename to DSView/src/dialogs/applicationpardlg.cpp diff --git a/DSView/dialogs/applicationpardlg.h b/DSView/src/dialogs/applicationpardlg.h similarity index 100% rename from DSView/dialogs/applicationpardlg.h rename to DSView/src/dialogs/applicationpardlg.h diff --git a/DSView/dialogs/calibration.cpp b/DSView/src/dialogs/calibration.cpp similarity index 100% rename from DSView/dialogs/calibration.cpp rename to DSView/src/dialogs/calibration.cpp diff --git a/DSView/dialogs/calibration.h b/DSView/src/dialogs/calibration.h similarity index 100% rename from DSView/dialogs/calibration.h rename to DSView/src/dialogs/calibration.h diff --git a/DSView/dialogs/decoderoptionsdlg.cpp b/DSView/src/dialogs/decoderoptionsdlg.cpp similarity index 100% rename from DSView/dialogs/decoderoptionsdlg.cpp rename to DSView/src/dialogs/decoderoptionsdlg.cpp diff --git a/DSView/dialogs/decoderoptionsdlg.h b/DSView/src/dialogs/decoderoptionsdlg.h similarity index 100% rename from DSView/dialogs/decoderoptionsdlg.h rename to DSView/src/dialogs/decoderoptionsdlg.h diff --git a/DSView/dialogs/deviceoptions.cpp b/DSView/src/dialogs/deviceoptions.cpp similarity index 100% rename from DSView/dialogs/deviceoptions.cpp rename to DSView/src/dialogs/deviceoptions.cpp diff --git a/DSView/dialogs/deviceoptions.h b/DSView/src/dialogs/deviceoptions.h similarity index 100% rename from DSView/dialogs/deviceoptions.h rename to DSView/src/dialogs/deviceoptions.h diff --git a/DSView/dialogs/dsdialog.cpp b/DSView/src/dialogs/dsdialog.cpp similarity index 100% rename from DSView/dialogs/dsdialog.cpp rename to DSView/src/dialogs/dsdialog.cpp diff --git a/DSView/dialogs/dsdialog.h b/DSView/src/dialogs/dsdialog.h similarity index 100% rename from DSView/dialogs/dsdialog.h rename to DSView/src/dialogs/dsdialog.h diff --git a/DSView/dialogs/dsmessagebox.cpp b/DSView/src/dialogs/dsmessagebox.cpp similarity index 100% rename from DSView/dialogs/dsmessagebox.cpp rename to DSView/src/dialogs/dsmessagebox.cpp diff --git a/DSView/dialogs/dsmessagebox.h b/DSView/src/dialogs/dsmessagebox.h similarity index 100% rename from DSView/dialogs/dsmessagebox.h rename to DSView/src/dialogs/dsmessagebox.h diff --git a/DSView/dialogs/dsomeasure.cpp b/DSView/src/dialogs/dsomeasure.cpp similarity index 100% rename from DSView/dialogs/dsomeasure.cpp rename to DSView/src/dialogs/dsomeasure.cpp diff --git a/DSView/dialogs/dsomeasure.h b/DSView/src/dialogs/dsomeasure.h similarity index 100% rename from DSView/dialogs/dsomeasure.h rename to DSView/src/dialogs/dsomeasure.h diff --git a/DSView/dialogs/fftoptions.cpp b/DSView/src/dialogs/fftoptions.cpp similarity index 100% rename from DSView/dialogs/fftoptions.cpp rename to DSView/src/dialogs/fftoptions.cpp diff --git a/DSView/dialogs/fftoptions.h b/DSView/src/dialogs/fftoptions.h similarity index 100% rename from DSView/dialogs/fftoptions.h rename to DSView/src/dialogs/fftoptions.h diff --git a/DSView/dialogs/interval.cpp b/DSView/src/dialogs/interval.cpp similarity index 100% rename from DSView/dialogs/interval.cpp rename to DSView/src/dialogs/interval.cpp diff --git a/DSView/dialogs/interval.h b/DSView/src/dialogs/interval.h similarity index 100% rename from DSView/dialogs/interval.h rename to DSView/src/dialogs/interval.h diff --git a/DSView/dialogs/lissajousoptions.cpp b/DSView/src/dialogs/lissajousoptions.cpp similarity index 100% rename from DSView/dialogs/lissajousoptions.cpp rename to DSView/src/dialogs/lissajousoptions.cpp diff --git a/DSView/dialogs/lissajousoptions.h b/DSView/src/dialogs/lissajousoptions.h similarity index 100% rename from DSView/dialogs/lissajousoptions.h rename to DSView/src/dialogs/lissajousoptions.h diff --git a/DSView/dialogs/mathoptions.cpp b/DSView/src/dialogs/mathoptions.cpp similarity index 100% rename from DSView/dialogs/mathoptions.cpp rename to DSView/src/dialogs/mathoptions.cpp diff --git a/DSView/dialogs/mathoptions.h b/DSView/src/dialogs/mathoptions.h similarity index 100% rename from DSView/dialogs/mathoptions.h rename to DSView/src/dialogs/mathoptions.h diff --git a/DSView/dialogs/protocolexp.cpp b/DSView/src/dialogs/protocolexp.cpp similarity index 100% rename from DSView/dialogs/protocolexp.cpp rename to DSView/src/dialogs/protocolexp.cpp diff --git a/DSView/dialogs/protocolexp.h b/DSView/src/dialogs/protocolexp.h similarity index 100% rename from DSView/dialogs/protocolexp.h rename to DSView/src/dialogs/protocolexp.h diff --git a/DSView/dialogs/protocollist.cpp b/DSView/src/dialogs/protocollist.cpp similarity index 100% rename from DSView/dialogs/protocollist.cpp rename to DSView/src/dialogs/protocollist.cpp diff --git a/DSView/dialogs/protocollist.h b/DSView/src/dialogs/protocollist.h similarity index 100% rename from DSView/dialogs/protocollist.h rename to DSView/src/dialogs/protocollist.h diff --git a/DSView/dialogs/regionoptions.cpp b/DSView/src/dialogs/regionoptions.cpp similarity index 100% rename from DSView/dialogs/regionoptions.cpp rename to DSView/src/dialogs/regionoptions.cpp diff --git a/DSView/dialogs/regionoptions.h b/DSView/src/dialogs/regionoptions.h similarity index 100% rename from DSView/dialogs/regionoptions.h rename to DSView/src/dialogs/regionoptions.h diff --git a/DSView/dialogs/search.cpp b/DSView/src/dialogs/search.cpp similarity index 100% rename from DSView/dialogs/search.cpp rename to DSView/src/dialogs/search.cpp diff --git a/DSView/dialogs/search.h b/DSView/src/dialogs/search.h similarity index 100% rename from DSView/dialogs/search.h rename to DSView/src/dialogs/search.h diff --git a/DSView/dialogs/shadow.cpp b/DSView/src/dialogs/shadow.cpp similarity index 100% rename from DSView/dialogs/shadow.cpp rename to DSView/src/dialogs/shadow.cpp diff --git a/DSView/dialogs/shadow.h b/DSView/src/dialogs/shadow.h similarity index 100% rename from DSView/dialogs/shadow.h rename to DSView/src/dialogs/shadow.h diff --git a/DSView/dialogs/storeprogress.cpp b/DSView/src/dialogs/storeprogress.cpp similarity index 100% rename from DSView/dialogs/storeprogress.cpp rename to DSView/src/dialogs/storeprogress.cpp diff --git a/DSView/dialogs/storeprogress.h b/DSView/src/dialogs/storeprogress.h similarity index 100% rename from DSView/dialogs/storeprogress.h rename to DSView/src/dialogs/storeprogress.h diff --git a/DSView/dialogs/waitingdialog.cpp b/DSView/src/dialogs/waitingdialog.cpp similarity index 100% rename from DSView/dialogs/waitingdialog.cpp rename to DSView/src/dialogs/waitingdialog.cpp diff --git a/DSView/dialogs/waitingdialog.h b/DSView/src/dialogs/waitingdialog.h similarity index 100% rename from DSView/dialogs/waitingdialog.h rename to DSView/src/dialogs/waitingdialog.h diff --git a/DSView/dock/dsotriggerdock.cpp b/DSView/src/dock/dsotriggerdock.cpp similarity index 100% rename from DSView/dock/dsotriggerdock.cpp rename to DSView/src/dock/dsotriggerdock.cpp diff --git a/DSView/dock/dsotriggerdock.h b/DSView/src/dock/dsotriggerdock.h similarity index 100% rename from DSView/dock/dsotriggerdock.h rename to DSView/src/dock/dsotriggerdock.h diff --git a/DSView/dock/keywordlineedit.cpp b/DSView/src/dock/keywordlineedit.cpp similarity index 100% rename from DSView/dock/keywordlineedit.cpp rename to DSView/src/dock/keywordlineedit.cpp diff --git a/DSView/dock/keywordlineedit.h b/DSView/src/dock/keywordlineedit.h similarity index 100% rename from DSView/dock/keywordlineedit.h rename to DSView/src/dock/keywordlineedit.h diff --git a/DSView/dock/measuredock.cpp b/DSView/src/dock/measuredock.cpp similarity index 100% rename from DSView/dock/measuredock.cpp rename to DSView/src/dock/measuredock.cpp diff --git a/DSView/dock/measuredock.h b/DSView/src/dock/measuredock.h similarity index 100% rename from DSView/dock/measuredock.h rename to DSView/src/dock/measuredock.h diff --git a/DSView/dock/protocoldock.cpp b/DSView/src/dock/protocoldock.cpp similarity index 100% rename from DSView/dock/protocoldock.cpp rename to DSView/src/dock/protocoldock.cpp diff --git a/DSView/dock/protocoldock.h b/DSView/src/dock/protocoldock.h similarity index 100% rename from DSView/dock/protocoldock.h rename to DSView/src/dock/protocoldock.h diff --git a/DSView/dock/protocolitemlayer.cpp b/DSView/src/dock/protocolitemlayer.cpp similarity index 100% rename from DSView/dock/protocolitemlayer.cpp rename to DSView/src/dock/protocolitemlayer.cpp diff --git a/DSView/dock/protocolitemlayer.h b/DSView/src/dock/protocolitemlayer.h similarity index 100% rename from DSView/dock/protocolitemlayer.h rename to DSView/src/dock/protocolitemlayer.h diff --git a/DSView/dock/searchcombobox.cpp b/DSView/src/dock/searchcombobox.cpp similarity index 100% rename from DSView/dock/searchcombobox.cpp rename to DSView/src/dock/searchcombobox.cpp diff --git a/DSView/dock/searchcombobox.h b/DSView/src/dock/searchcombobox.h similarity index 100% rename from DSView/dock/searchcombobox.h rename to DSView/src/dock/searchcombobox.h diff --git a/DSView/dock/searchdock.cpp b/DSView/src/dock/searchdock.cpp similarity index 100% rename from DSView/dock/searchdock.cpp rename to DSView/src/dock/searchdock.cpp diff --git a/DSView/dock/searchdock.h b/DSView/src/dock/searchdock.h similarity index 100% rename from DSView/dock/searchdock.h rename to DSView/src/dock/searchdock.h diff --git a/DSView/dock/triggerdock.cpp b/DSView/src/dock/triggerdock.cpp similarity index 100% rename from DSView/dock/triggerdock.cpp rename to DSView/src/dock/triggerdock.cpp diff --git a/DSView/dock/triggerdock.h b/DSView/src/dock/triggerdock.h similarity index 100% rename from DSView/dock/triggerdock.h rename to DSView/src/dock/triggerdock.h diff --git a/DSView/interface/icallbacks.h b/DSView/src/interface/icallbacks.h similarity index 100% rename from DSView/interface/icallbacks.h rename to DSView/src/interface/icallbacks.h diff --git a/DSView/log.cpp b/DSView/src/log.cpp similarity index 100% rename from DSView/log.cpp rename to DSView/src/log.cpp diff --git a/DSView/log.h b/DSView/src/log.h similarity index 100% rename from DSView/log.h rename to DSView/src/log.h diff --git a/DSView/main.cpp b/DSView/src/main.cpp similarity index 100% rename from DSView/main.cpp rename to DSView/src/main.cpp diff --git a/DSView/mystyle.h b/DSView/src/mystyle.h similarity index 100% rename from DSView/mystyle.h rename to DSView/src/mystyle.h diff --git a/DSView/prop/binding/binding.cpp b/DSView/src/prop/binding/binding.cpp similarity index 100% rename from DSView/prop/binding/binding.cpp rename to DSView/src/prop/binding/binding.cpp diff --git a/DSView/prop/binding/binding.h b/DSView/src/prop/binding/binding.h similarity index 100% rename from DSView/prop/binding/binding.h rename to DSView/src/prop/binding/binding.h diff --git a/DSView/prop/binding/decoderoptions.cpp b/DSView/src/prop/binding/decoderoptions.cpp similarity index 100% rename from DSView/prop/binding/decoderoptions.cpp rename to DSView/src/prop/binding/decoderoptions.cpp diff --git a/DSView/prop/binding/decoderoptions.h b/DSView/src/prop/binding/decoderoptions.h similarity index 100% rename from DSView/prop/binding/decoderoptions.h rename to DSView/src/prop/binding/decoderoptions.h diff --git a/DSView/prop/binding/deviceoptions.cpp b/DSView/src/prop/binding/deviceoptions.cpp similarity index 100% rename from DSView/prop/binding/deviceoptions.cpp rename to DSView/src/prop/binding/deviceoptions.cpp diff --git a/DSView/prop/binding/deviceoptions.h b/DSView/src/prop/binding/deviceoptions.h similarity index 100% rename from DSView/prop/binding/deviceoptions.h rename to DSView/src/prop/binding/deviceoptions.h diff --git a/DSView/prop/binding/probeoptions.cpp b/DSView/src/prop/binding/probeoptions.cpp similarity index 100% rename from DSView/prop/binding/probeoptions.cpp rename to DSView/src/prop/binding/probeoptions.cpp diff --git a/DSView/prop/binding/probeoptions.h b/DSView/src/prop/binding/probeoptions.h similarity index 100% rename from DSView/prop/binding/probeoptions.h rename to DSView/src/prop/binding/probeoptions.h diff --git a/DSView/prop/bool.cpp b/DSView/src/prop/bool.cpp similarity index 100% rename from DSView/prop/bool.cpp rename to DSView/src/prop/bool.cpp diff --git a/DSView/prop/bool.h b/DSView/src/prop/bool.h similarity index 100% rename from DSView/prop/bool.h rename to DSView/src/prop/bool.h diff --git a/DSView/prop/double.cpp b/DSView/src/prop/double.cpp similarity index 100% rename from DSView/prop/double.cpp rename to DSView/src/prop/double.cpp diff --git a/DSView/prop/double.h b/DSView/src/prop/double.h similarity index 100% rename from DSView/prop/double.h rename to DSView/src/prop/double.h diff --git a/DSView/prop/enum.cpp b/DSView/src/prop/enum.cpp similarity index 100% rename from DSView/prop/enum.cpp rename to DSView/src/prop/enum.cpp diff --git a/DSView/prop/enum.h b/DSView/src/prop/enum.h similarity index 100% rename from DSView/prop/enum.h rename to DSView/src/prop/enum.h diff --git a/DSView/prop/int.cpp b/DSView/src/prop/int.cpp similarity index 100% rename from DSView/prop/int.cpp rename to DSView/src/prop/int.cpp diff --git a/DSView/prop/int.h b/DSView/src/prop/int.h similarity index 100% rename from DSView/prop/int.h rename to DSView/src/prop/int.h diff --git a/DSView/prop/property.cpp b/DSView/src/prop/property.cpp similarity index 100% rename from DSView/prop/property.cpp rename to DSView/src/prop/property.cpp diff --git a/DSView/prop/property.h b/DSView/src/prop/property.h similarity index 100% rename from DSView/prop/property.h rename to DSView/src/prop/property.h diff --git a/DSView/prop/string.cpp b/DSView/src/prop/string.cpp similarity index 100% rename from DSView/prop/string.cpp rename to DSView/src/prop/string.cpp diff --git a/DSView/prop/string.h b/DSView/src/prop/string.h similarity index 100% rename from DSView/prop/string.h rename to DSView/src/prop/string.h diff --git a/DSView/toolbars/filebar.cpp b/DSView/src/toolbars/filebar.cpp similarity index 100% rename from DSView/toolbars/filebar.cpp rename to DSView/src/toolbars/filebar.cpp diff --git a/DSView/toolbars/filebar.h b/DSView/src/toolbars/filebar.h similarity index 100% rename from DSView/toolbars/filebar.h rename to DSView/src/toolbars/filebar.h diff --git a/DSView/toolbars/logobar.cpp b/DSView/src/toolbars/logobar.cpp similarity index 100% rename from DSView/toolbars/logobar.cpp rename to DSView/src/toolbars/logobar.cpp diff --git a/DSView/toolbars/logobar.h b/DSView/src/toolbars/logobar.h similarity index 100% rename from DSView/toolbars/logobar.h rename to DSView/src/toolbars/logobar.h diff --git a/DSView/toolbars/samplingbar.cpp b/DSView/src/toolbars/samplingbar.cpp similarity index 100% rename from DSView/toolbars/samplingbar.cpp rename to DSView/src/toolbars/samplingbar.cpp diff --git a/DSView/toolbars/samplingbar.h b/DSView/src/toolbars/samplingbar.h similarity index 100% rename from DSView/toolbars/samplingbar.h rename to DSView/src/toolbars/samplingbar.h diff --git a/DSView/toolbars/titlebar.cpp b/DSView/src/toolbars/titlebar.cpp similarity index 100% rename from DSView/toolbars/titlebar.cpp rename to DSView/src/toolbars/titlebar.cpp diff --git a/DSView/toolbars/titlebar.h b/DSView/src/toolbars/titlebar.h similarity index 99% rename from DSView/toolbars/titlebar.h rename to DSView/src/toolbars/titlebar.h index 47e9541fc..ccdbb8f00 100644 --- a/DSView/toolbars/titlebar.h +++ b/DSView/src/toolbars/titlebar.h @@ -81,6 +81,6 @@ public slots: }; } // namespace toolbars -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TOOLBARS_TITLEBAR_H diff --git a/DSView/toolbars/trigbar.cpp b/DSView/src/toolbars/trigbar.cpp similarity index 99% rename from DSView/toolbars/trigbar.cpp rename to DSView/src/toolbars/trigbar.cpp index 02f7b5009..29371ff28 100644 --- a/DSView/toolbars/trigbar.cpp +++ b/DSView/src/toolbars/trigbar.cpp @@ -35,7 +35,7 @@ #include "../config/appconfig.h" #include "../ui/fn.h" -namespace pv { +namespace dsv { namespace toolbars { TrigBar::TrigBar(SigSession *session, QWidget *parent) : @@ -379,4 +379,4 @@ void TrigBar::update_font() } } // namespace toolbars -} // namespace pv +} // namespace dsv diff --git a/DSView/toolbars/trigbar.h b/DSView/src/toolbars/trigbar.h similarity index 98% rename from DSView/toolbars/trigbar.h rename to DSView/src/toolbars/trigbar.h index 53c913faf..fbacaedc3 100644 --- a/DSView/toolbars/trigbar.h +++ b/DSView/src/toolbars/trigbar.h @@ -31,7 +31,7 @@ class DockOptions; -namespace pv { +namespace dsv { class SigSession; @@ -109,6 +109,6 @@ public slots: }; } // namespace toolbars -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_TOOLBARS_TRIGBAR_H diff --git a/DSView/ui/dscombobox.cpp b/DSView/src/ui/dscombobox.cpp similarity index 100% rename from DSView/ui/dscombobox.cpp rename to DSView/src/ui/dscombobox.cpp diff --git a/DSView/ui/dscombobox.h b/DSView/src/ui/dscombobox.h similarity index 100% rename from DSView/ui/dscombobox.h rename to DSView/src/ui/dscombobox.h diff --git a/DSView/ui/fn.cpp b/DSView/src/ui/fn.cpp similarity index 100% rename from DSView/ui/fn.cpp rename to DSView/src/ui/fn.cpp diff --git a/DSView/ui/fn.h b/DSView/src/ui/fn.h similarity index 100% rename from DSView/ui/fn.h rename to DSView/src/ui/fn.h diff --git a/DSView/ui/langresource.cpp b/DSView/src/ui/langresource.cpp similarity index 100% rename from DSView/ui/langresource.cpp rename to DSView/src/ui/langresource.cpp diff --git a/DSView/ui/langresource.h b/DSView/src/ui/langresource.h similarity index 100% rename from DSView/ui/langresource.h rename to DSView/src/ui/langresource.h diff --git a/DSView/ui/msgbox.cpp b/DSView/src/ui/msgbox.cpp similarity index 100% rename from DSView/ui/msgbox.cpp rename to DSView/src/ui/msgbox.cpp diff --git a/DSView/ui/msgbox.h b/DSView/src/ui/msgbox.h similarity index 99% rename from DSView/ui/msgbox.h rename to DSView/src/ui/msgbox.h index a067916bc..262de402d 100644 --- a/DSView/ui/msgbox.h +++ b/DSView/src/ui/msgbox.h @@ -25,7 +25,7 @@ class QWidget; -namespace pv{ +namespace dsv{ namespace dialogs{ class DSMessageBox; } diff --git a/DSView/ui/string_ids.h b/DSView/src/ui/string_ids.h similarity index 100% rename from DSView/ui/string_ids.h rename to DSView/src/ui/string_ids.h diff --git a/DSView/utility/array.cpp b/DSView/src/utility/array.cpp similarity index 99% rename from DSView/utility/array.cpp rename to DSView/src/utility/array.cpp index 87513c37e..866a462a5 100644 --- a/DSView/utility/array.cpp +++ b/DSView/src/utility/array.cpp @@ -21,7 +21,7 @@ #include "array.h" #include -namespace pv +namespace dsv { namespace array { diff --git a/DSView/utility/array.h b/DSView/src/utility/array.h similarity index 98% rename from DSView/utility/array.h rename to DSView/src/utility/array.h index 681c0624b..39b92b44f 100644 --- a/DSView/utility/array.h +++ b/DSView/src/utility/array.h @@ -24,7 +24,7 @@ #include -namespace pv +namespace dsv { namespace array { diff --git a/DSView/utility/encoding.cpp b/DSView/src/utility/encoding.cpp similarity index 98% rename from DSView/utility/encoding.cpp rename to DSView/src/utility/encoding.cpp index a891f8c6f..d0670c8e9 100644 --- a/DSView/utility/encoding.cpp +++ b/DSView/src/utility/encoding.cpp @@ -32,7 +32,7 @@ #include #endif -namespace pv{ +namespace dsv{ namespace encoding{ void init() diff --git a/DSView/utility/encoding.h b/DSView/src/utility/encoding.h similarity index 98% rename from DSView/utility/encoding.h rename to DSView/src/utility/encoding.h index 158714f26..21ea60139 100644 --- a/DSView/utility/encoding.h +++ b/DSView/src/utility/encoding.h @@ -24,7 +24,7 @@ class QTextStream; -namespace pv{ +namespace dsv{ namespace encoding{ void init(); diff --git a/DSView/utility/path.cpp b/DSView/src/utility/path.cpp similarity index 99% rename from DSView/utility/path.cpp rename to DSView/src/utility/path.cpp index 7ca423224..ecf54a7b8 100644 --- a/DSView/utility/path.cpp +++ b/DSView/src/utility/path.cpp @@ -26,7 +26,7 @@ #include #endif -namespace pv{ +namespace dsv{ namespace path{ std::string ConvertPath(QString fileName) diff --git a/DSView/utility/path.h b/DSView/src/utility/path.h similarity index 98% rename from DSView/utility/path.h rename to DSView/src/utility/path.h index f5841f292..7c08586b8 100644 --- a/DSView/utility/path.h +++ b/DSView/src/utility/path.h @@ -25,7 +25,7 @@ #include #include -namespace pv{ +namespace dsv{ namespace path{ std::string ConvertPath(QString fileName); diff --git a/DSView/view/analogsignal.cpp b/DSView/src/view/analogsignal.cpp similarity index 99% rename from DSView/view/analogsignal.cpp rename to DSView/src/view/analogsignal.cpp index 39f7faa6a..e295c7bb3 100644 --- a/DSView/view/analogsignal.cpp +++ b/DSView/src/view/analogsignal.cpp @@ -20,18 +20,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "analogsignal.h" #include -#include "../view/analogsignal.h" #include "../data/analogsnapshot.h" -#include "../view/view.h" -#include "../dsvdef.h" +#include "view.h" +#include "../basedef.h" #include "../log.h" using namespace std; #define byte(x) uint##x##_t -namespace pv { +namespace dsv { namespace view { const QColor AnalogSignal::SignalColours[4] = { @@ -668,4 +668,4 @@ void AnalogSignal::set_data(data::AnalogSnapshot *data) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/analogsignal.h b/DSView/src/view/analogsignal.h similarity index 99% rename from DSView/view/analogsignal.h rename to DSView/src/view/analogsignal.h index 7ae93f6aa..c768c562f 100644 --- a/DSView/view/analogsignal.h +++ b/DSView/src/view/analogsignal.h @@ -26,7 +26,7 @@ #include "signal.h" -namespace pv { +namespace dsv { namespace data { class AnalogSnapshot; @@ -181,6 +181,6 @@ class AnalogSignal : public Signal }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_ANALOGSIGNAL_H diff --git a/DSView/view/cursor.cpp b/DSView/src/view/cursor.cpp similarity index 98% rename from DSView/view/cursor.cpp rename to DSView/src/view/cursor.cpp index e9a11af58..1634d0575 100644 --- a/DSView/view/cursor.cpp +++ b/DSView/src/view/cursor.cpp @@ -21,10 +21,6 @@ */ #include "cursor.h" - -#include "ruler.h" -#include "view.h" - #include #include #include @@ -32,9 +28,11 @@ #include #include #include -#include "../dsvdef.h" +#include "ruler.h" +#include "view.h" +#include "../basedef.h" -namespace pv { +namespace dsv { namespace view { const QColor Cursor::LineColour(32, 74, 135); @@ -166,4 +164,4 @@ void Cursor::compute_text_size(QPainter &p, unsigned int prefix) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/cursor.h b/DSView/src/view/cursor.h similarity index 98% rename from DSView/view/cursor.h rename to DSView/src/view/cursor.h index b01f53c2a..8b273dbe2 100644 --- a/DSView/view/cursor.h +++ b/DSView/src/view/cursor.h @@ -24,14 +24,13 @@ #ifndef DSVIEW_PV_VIEW_CURSOR_H #define DSVIEW_PV_VIEW_CURSOR_H -#include "timemarker.h" - #include #include +#include "timemarker.h" class QPainter; -namespace pv { +namespace dsv { namespace view { //created by View @@ -101,6 +100,6 @@ class Cursor : public TimeMarker }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_CURSOR_H diff --git a/DSView/view/decodetrace.cpp b/DSView/src/view/decodetrace.cpp similarity index 98% rename from DSView/view/decodetrace.cpp rename to DSView/src/view/decodetrace.cpp index 49dddf108..0b7ec753d 100644 --- a/DSView/view/decodetrace.cpp +++ b/DSView/src/view/decodetrace.cpp @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "decodetrace.h" #include -#include "../dsvdef.h" #include #include #include @@ -32,31 +32,31 @@ #include #include #include -#include "decodetrace.h" -#include "../sigsession.h" + +#include "logicsignal.h" +#include "view.h" +#include "cursor.h" +#include "../appcore/sigsession.h" #include "../data/decoderstack.h" #include "../data/decode/decoder.h" #include "../data/logicsnapshot.h" #include "../data/decode/annotation.h" -#include "../view/logicsignal.h" -#include "../view/view.h" #include "../widgets/decodergroupbox.h" #include "../widgets/decodermenu.h" -#include "../view/cursor.h" #include "../toolbars/titlebar.h" -#include "../dsvdef.h" #include "../ui/dscombobox.h" #include "../ui/msgbox.h" -#include "../appcontrol.h" +#include "../appcore/appcontrol.h" #include "../dialogs/decoderoptionsdlg.h" #include "../ui/langresource.h" #include "../config/appconfig.h" #include "../log.h" +#include "../basedef.h" using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace view { const QColor DecodeTrace::DecodeColours[4] = { @@ -216,7 +216,7 @@ void DecodeTrace::paint_back(QPainter &p, int left, int right, QColor fore, QCol void DecodeTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QColor back) { - using namespace pv::data::decode; + using namespace dsv::data::decode; assert(_decoder_stack); const QString err = _decoder_stack->error_message(); @@ -316,7 +316,7 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QColo void DecodeTrace::paint_fore(QPainter &p, int left, int right, QColor fore, QColor back) { - using namespace pv::data::decode; + using namespace dsv::data::decode; (void)p; (void)left; @@ -703,4 +703,4 @@ bool DecodeTrace::create_popup(bool isnew) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/decodetrace.h b/DSView/src/view/decodetrace.h similarity index 97% rename from DSView/view/decodetrace.h rename to DSView/src/view/decodetrace.h index 29ebe571d..01a2520ef 100644 --- a/DSView/view/decodetrace.h +++ b/DSView/src/view/decodetrace.h @@ -30,7 +30,6 @@ #include #include #include - #include "trace.h" #include "../prop/binding/decoderoptions.h" #include "../dialogs/dsdialog.h" @@ -40,18 +39,20 @@ struct srd_decoder; class DsComboBox; -namespace pv { +namespace dsv { -class SigSession; +namespace appcore { + class SigSession; +} namespace data { -class DecoderStack; + class DecoderStack; +} namespace decode { -class Annotation; -class Decoder; -class Row; -} + class Annotation; + class Decoder; + class Row; } namespace view { @@ -196,6 +197,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_DECODETRACE_H diff --git a/DSView/view/devmode.cpp b/DSView/src/view/devmode.cpp similarity index 98% rename from DSView/view/devmode.cpp rename to DSView/src/view/devmode.cpp index 015936f3b..213d50997 100644 --- a/DSView/view/devmode.cpp +++ b/DSView/src/view/devmode.cpp @@ -20,24 +20,24 @@ */ #include "devmode.h" -#include "view.h" -#include "trace.h" -#include "../sigsession.h" - #include #include #include #include #include #include - +#include "view.h" +#include "trace.h" +#include "../appcore/sigsession.h" #include "../config/appconfig.h" #include "../ui/msgbox.h" #include "../log.h" #include "../ui/langresource.h" -#include "../appcontrol.h" +#include "../appcore/appcontrol.h" #include "../ui/fn.h" - + +namespace dsv { +namespace view { static const struct dev_mode_name dev_mode_name_list[] = { @@ -45,9 +45,6 @@ static const struct dev_mode_name dev_mode_name_list[] = {ANALOG, "daq.svg"}, {DSO, "osc.svg"}, }; - -namespace pv { -namespace view { DevMode::DevMode(QWidget *parent, SigSession *session) : QWidget(parent) @@ -298,4 +295,4 @@ void DevMode::update_font() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/devmode.h b/DSView/src/view/devmode.h similarity index 92% rename from DSView/view/devmode.h rename to DSView/src/view/devmode.h index 319fceefd..eb3452f3c 100644 --- a/DSView/view/devmode.h +++ b/DSView/src/view/devmode.h @@ -33,19 +33,14 @@ #include #include #include - #include "../interface/icallbacks.h" -struct dev_mode_name{ - int _mode; - const char *_logo; -}; - -class DeviceAgent; +namespace dsv { -namespace pv { - -class SigSession; +namespace appcore { + class SigSession; + class DeviceAgent; +} namespace view { @@ -57,6 +52,11 @@ class DevMode : public QWidget, public IFontForm private: static const int GRID_COLS = 3; + struct dev_mode_name{ + int _mode; + const char *_logo; + }; + public: DevMode(QWidget *parent, SigSession *session); @@ -96,6 +96,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_DEVMODE_H diff --git a/DSView/view/dsldial.cpp b/DSView/src/view/dsldial.cpp similarity index 99% rename from DSView/view/dsldial.cpp rename to DSView/src/view/dsldial.cpp index 3ac842f1e..b17806b6b 100644 --- a/DSView/view/dsldial.cpp +++ b/DSView/src/view/dsldial.cpp @@ -24,7 +24,7 @@ #include #include -namespace pv { +namespace dsv { namespace view { dslDial::dslDial(const uint64_t div, const uint64_t step, @@ -185,4 +185,4 @@ uint64_t dslDial::get_factor() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/dsldial.h b/DSView/src/view/dsldial.h similarity index 98% rename from DSView/view/dsldial.h rename to DSView/src/view/dsldial.h index 6379bb7fd..3c0a53105 100644 --- a/DSView/view/dsldial.h +++ b/DSView/src/view/dsldial.h @@ -26,7 +26,7 @@ #include #include -namespace pv { +namespace dsv { namespace view { //when device is oscilloscope model, to draw the dail on the left @@ -79,6 +79,6 @@ class dslDial : public QObject }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_DSLDIAL_H diff --git a/DSView/view/dsosignal.cpp b/DSView/src/view/dsosignal.cpp similarity index 99% rename from DSView/view/dsosignal.cpp rename to DSView/src/view/dsosignal.cpp index 1ac02efcd..9a3750f8e 100644 --- a/DSView/view/dsosignal.cpp +++ b/DSView/src/view/dsosignal.cpp @@ -34,7 +34,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { const QString DsoSignal::vDialUnit[DsoSignal::vDialUnitCount] = { @@ -1550,4 +1550,4 @@ void DsoSignal::set_data(data::DsoSnapshot *data) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/dsosignal.h b/DSView/src/view/dsosignal.h similarity index 99% rename from DSView/view/dsosignal.h rename to DSView/src/view/dsosignal.h index 660c9bb7e..5ff0a763c 100644 --- a/DSView/view/dsosignal.h +++ b/DSView/src/view/dsosignal.h @@ -26,7 +26,7 @@ #include "signal.h" #include "../dstimer.h" -namespace pv { +namespace dsv { namespace data { class DsoSnapshot; } @@ -310,6 +310,6 @@ class DsoSignal : public Signal }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_DSOSIGNAL_H diff --git a/DSView/view/groupsignal.cpp b/DSView/src/view/groupsignal.cpp similarity index 98% rename from DSView/view/groupsignal.cpp rename to DSView/src/view/groupsignal.cpp index ac8458e99..03a9fe432 100644 --- a/DSView/view/groupsignal.cpp +++ b/DSView/src/view/groupsignal.cpp @@ -27,7 +27,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { const QColor GroupSignal::SignalColours[4] = { @@ -95,6 +95,6 @@ QRectF GroupSignal::get_rect(GroupSetRegions type, int y, int right) } } // namespace view -} // namespace pv +} // namespace dsv */ diff --git a/DSView/view/groupsignal.h b/DSView/src/view/groupsignal.h similarity index 98% rename from DSView/view/groupsignal.h rename to DSView/src/view/groupsignal.h index 2984bfa72..ef3863107 100644 --- a/DSView/view/groupsignal.h +++ b/DSView/src/view/groupsignal.h @@ -28,7 +28,7 @@ #include -namespace pv { +namespace dsv { namespace view { @@ -78,7 +78,7 @@ class GroupSignal : public Trace }; } // namespace view -} // namespace pv +} // namespace dsv */ diff --git a/DSView/view/header.cpp b/DSView/src/view/header.cpp similarity index 99% rename from DSView/view/header.cpp rename to DSView/src/view/header.cpp index f94551980..01f71540f 100644 --- a/DSView/view/header.cpp +++ b/DSView/src/view/header.cpp @@ -50,7 +50,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { Header::Header(View &parent) : @@ -503,4 +503,4 @@ void Header::header_resize() } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/header.h b/DSView/src/view/header.h similarity index 98% rename from DSView/view/header.h rename to DSView/src/view/header.h index d9a9ffe67..867e64b60 100644 --- a/DSView/view/header.h +++ b/DSView/src/view/header.h @@ -30,7 +30,7 @@ #include #include -namespace pv { +namespace dsv { namespace view { class Trace; @@ -97,6 +97,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_HEADER_H diff --git a/DSView/view/lissajoustrace.cpp b/DSView/src/view/lissajoustrace.cpp similarity index 99% rename from DSView/view/lissajoustrace.cpp rename to DSView/src/view/lissajoustrace.cpp index cba662101..e541455a3 100644 --- a/DSView/view/lissajoustrace.cpp +++ b/DSView/src/view/lissajoustrace.cpp @@ -33,7 +33,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { LissajousTrace::LissajousTrace(bool enable, @@ -173,4 +173,4 @@ void LissajousTrace::paint_label(QPainter &p, int right, const QPoint pt, QColor } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/lissajoustrace.h b/DSView/src/view/lissajoustrace.h similarity index 98% rename from DSView/view/lissajoustrace.h rename to DSView/src/view/lissajoustrace.h index 27a6efd50..9ed548d77 100644 --- a/DSView/view/lissajoustrace.h +++ b/DSView/src/view/lissajoustrace.h @@ -25,7 +25,7 @@ #include "trace.h" -namespace pv { +namespace dsv { namespace data { class DsoSnapshot; @@ -117,6 +117,6 @@ class LissajousTrace : public Trace }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_LISSAJOUSTRACE_H diff --git a/DSView/view/logicsignal.cpp b/DSView/src/view/logicsignal.cpp similarity index 99% rename from DSView/view/logicsignal.cpp rename to DSView/src/view/logicsignal.cpp index d027159bc..a744b34d2 100644 --- a/DSView/view/logicsignal.cpp +++ b/DSView/src/view/logicsignal.cpp @@ -31,7 +31,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { //const float LogicSignal::Oversampling = 2.0f; @@ -526,4 +526,4 @@ void LogicSignal::set_data(data::LogicSnapshot* data) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/logicsignal.h b/DSView/src/view/logicsignal.h similarity index 99% rename from DSView/view/logicsignal.h rename to DSView/src/view/logicsignal.h index d902d13a2..dd9efb373 100644 --- a/DSView/view/logicsignal.h +++ b/DSView/src/view/logicsignal.h @@ -28,7 +28,7 @@ #include -namespace pv { +namespace dsv { namespace data { class LogicSnapshot; @@ -129,6 +129,6 @@ class LogicSignal : public Signal }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_LOGICSIGNAL_H diff --git a/DSView/view/mathtrace.cpp b/DSView/src/view/mathtrace.cpp similarity index 99% rename from DSView/view/mathtrace.cpp rename to DSView/src/view/mathtrace.cpp index 5c394ec66..571bd2828 100644 --- a/DSView/view/mathtrace.cpp +++ b/DSView/src/view/mathtrace.cpp @@ -32,7 +32,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { MathTrace::MathTrace(bool enable,data::MathStack *math_stack, @@ -504,4 +504,4 @@ pv::data::MathStack* MathTrace::get_math_stack() } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/mathtrace.h b/DSView/src/view/mathtrace.h similarity index 99% rename from DSView/view/mathtrace.h rename to DSView/src/view/mathtrace.h index 71218975c..44d20f5b9 100644 --- a/DSView/view/mathtrace.h +++ b/DSView/src/view/mathtrace.h @@ -25,7 +25,7 @@ #include "trace.h" -namespace pv { +namespace dsv { namespace data { class DsoSnapshot; @@ -164,6 +164,6 @@ class MathTrace : public Trace }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_MATHTRACE_H diff --git a/DSView/view/ruler.cpp b/DSView/src/view/ruler.cpp similarity index 99% rename from DSView/view/ruler.cpp rename to DSView/src/view/ruler.cpp index 3076275bb..6480da2d3 100644 --- a/DSView/view/ruler.cpp +++ b/DSView/src/view/ruler.cpp @@ -45,7 +45,7 @@ using namespace std; using namespace Qt; -namespace pv { +namespace dsv { namespace view { const int Ruler::MinorTickSubdivision = 4; @@ -751,4 +751,4 @@ double Ruler::get_min_period() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/ruler.h b/DSView/src/view/ruler.h similarity index 98% rename from DSView/view/ruler.h rename to DSView/src/view/ruler.h index 822c7d5fe..bb038e886 100644 --- a/DSView/view/ruler.h +++ b/DSView/src/view/ruler.h @@ -27,7 +27,7 @@ #include #include -namespace pv { +namespace dsv { namespace view { class TimeMarker; @@ -113,6 +113,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_RULER_H diff --git a/DSView/view/signal.cpp b/DSView/src/view/signal.cpp similarity index 97% rename from DSView/view/signal.cpp rename to DSView/src/view/signal.cpp index cbd69482a..f06fdff15 100644 --- a/DSView/view/signal.cpp +++ b/DSView/src/view/signal.cpp @@ -28,7 +28,7 @@ #include "../appcontrol.h" #include "../sigsession.h" -namespace pv { +namespace dsv { namespace view { Signal::Signal(sr_channel *probe) : @@ -57,4 +57,4 @@ void Signal::set_name(QString name) _probe->name = g_strdup(name.toUtf8().data()); } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/signal.h b/DSView/src/view/signal.h similarity index 98% rename from DSView/view/signal.h rename to DSView/src/view/signal.h index 464a09339..f547cd5ed 100644 --- a/DSView/view/signal.h +++ b/DSView/src/view/signal.h @@ -37,7 +37,7 @@ #include #include "trace.h" -namespace pv { +namespace dsv { namespace data { class SignalData; @@ -81,6 +81,6 @@ class Signal : public Trace }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_SIGNAL_H diff --git a/DSView/view/spectrumtrace.cpp b/DSView/src/view/spectrumtrace.cpp similarity index 99% rename from DSView/view/spectrumtrace.cpp rename to DSView/src/view/spectrumtrace.cpp index 0deb82045..d03094424 100644 --- a/DSView/view/spectrumtrace.cpp +++ b/DSView/src/view/spectrumtrace.cpp @@ -37,7 +37,7 @@ using namespace boost; using namespace std; -namespace pv { +namespace dsv { namespace view { const int SpectrumTrace::UpMargin = 0; @@ -496,4 +496,4 @@ QRect SpectrumTrace::get_view_rect() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/spectrumtrace.h b/DSView/src/view/spectrumtrace.h similarity index 99% rename from DSView/view/spectrumtrace.h rename to DSView/src/view/spectrumtrace.h index 30e37b3d9..a2f01f365 100644 --- a/DSView/view/spectrumtrace.h +++ b/DSView/src/view/spectrumtrace.h @@ -30,7 +30,7 @@ struct srd_channel; -namespace pv { +namespace dsv { class SigSession; @@ -152,6 +152,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_SPECTRUMTRACE_H diff --git a/DSView/view/timemarker.cpp b/DSView/src/view/timemarker.cpp similarity index 98% rename from DSView/view/timemarker.cpp rename to DSView/src/view/timemarker.cpp index ad9693e9a..1a4556d75 100644 --- a/DSView/view/timemarker.cpp +++ b/DSView/src/view/timemarker.cpp @@ -27,7 +27,7 @@ #include -namespace pv { +namespace dsv { namespace view { TimeMarker::TimeMarker(View &view, QColor &colour, @@ -89,4 +89,4 @@ void TimeMarker::paint(QPainter &p, const QRect &rect, const bool highlight, int } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/timemarker.h b/DSView/src/view/timemarker.h similarity index 98% rename from DSView/view/timemarker.h rename to DSView/src/view/timemarker.h index 84cc0bcbc..447fc57f7 100644 --- a/DSView/view/timemarker.h +++ b/DSView/src/view/timemarker.h @@ -32,7 +32,7 @@ class QPainter; class QRect; -namespace pv { +namespace dsv { namespace view { class View; @@ -120,6 +120,6 @@ class TimeMarker : public QObject }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_MARKER_H diff --git a/DSView/view/trace.cpp b/DSView/src/view/trace.cpp similarity index 99% rename from DSView/view/trace.cpp rename to DSView/src/view/trace.cpp index e02058807..c429afcfb 100644 --- a/DSView/view/trace.cpp +++ b/DSView/src/view/trace.cpp @@ -35,7 +35,7 @@ #include "../appcontrol.h" -namespace pv { +namespace dsv { namespace view { const QColor Trace::PROBE_COLORS[8] = { @@ -385,4 +385,4 @@ QRectF Trace::get_rect(const char *s, int y, int right) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/trace.h b/DSView/src/view/trace.h similarity index 99% rename from DSView/view/trace.h rename to DSView/src/view/trace.h index c163f54e0..b8b6d19d3 100644 --- a/DSView/view/trace.h +++ b/DSView/src/view/trace.h @@ -34,7 +34,7 @@ class QFormLayout; -namespace pv { +namespace dsv { namespace view { class View; @@ -355,6 +355,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_TRACE_H diff --git a/DSView/view/view.cpp b/DSView/src/view/view.cpp similarity index 99% rename from DSView/view/view.cpp rename to DSView/src/view/view.cpp index edd320193..f58c7d1aa 100644 --- a/DSView/view/view.cpp +++ b/DSView/src/view/view.cpp @@ -54,7 +54,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { const int View::LabelMarginWidth = 70; @@ -1347,4 +1347,4 @@ int View::get_body_height() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/view.h b/DSView/src/view/view.h similarity index 99% rename from DSView/view/view.h rename to DSView/src/view/view.h index dcf3b0be0..f8e419dbd 100644 --- a/DSView/view/view.h +++ b/DSView/src/view/view.h @@ -46,7 +46,7 @@ class DeviceAgent; -namespace pv { +namespace dsv { namespace toolbars { class SamplingBar; @@ -472,6 +472,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_VIEW_H diff --git a/DSView/view/viewport.cpp b/DSView/src/view/viewport.cpp similarity index 99% rename from DSView/view/viewport.cpp rename to DSView/src/view/viewport.cpp index 1d4570b8b..80e524ec5 100644 --- a/DSView/view/viewport.cpp +++ b/DSView/src/view/viewport.cpp @@ -49,7 +49,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { const double Viewport::DragDamping = 1.05; @@ -2018,4 +2018,4 @@ void Viewport::update_lang() } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/viewport.h b/DSView/src/view/viewport.h similarity index 99% rename from DSView/view/viewport.h rename to DSView/src/view/viewport.h index 14c027224..57f947401 100644 --- a/DSView/view/viewport.h +++ b/DSView/src/view/viewport.h @@ -45,7 +45,7 @@ class QAction; using std::chrono::high_resolution_clock; using std::chrono::milliseconds; -namespace pv { +namespace dsv { namespace view { class Signal; @@ -230,6 +230,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_VIEWPORT_H diff --git a/DSView/view/viewstatus.cpp b/DSView/src/view/viewstatus.cpp similarity index 99% rename from DSView/view/viewstatus.cpp rename to DSView/src/view/viewstatus.cpp index feff7362f..b1d777ae1 100644 --- a/DSView/view/viewstatus.cpp +++ b/DSView/src/view/viewstatus.cpp @@ -43,7 +43,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { ViewStatus::ViewStatus(SigSession *session, View &parent) : @@ -298,4 +298,4 @@ void ViewStatus::load_session(QJsonArray measure_array, int version) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/viewstatus.h b/DSView/src/view/viewstatus.h similarity index 98% rename from DSView/view/viewstatus.h rename to DSView/src/view/viewstatus.h index 87ea2a6f2..1a337f948 100644 --- a/DSView/view/viewstatus.h +++ b/DSView/src/view/viewstatus.h @@ -29,7 +29,7 @@ #include #include -namespace pv { +namespace dsv { class SigSession; @@ -78,6 +78,6 @@ public slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_VIEWSTATUS_H diff --git a/DSView/view/xcursor.cpp b/DSView/src/view/xcursor.cpp similarity index 99% rename from DSView/view/xcursor.cpp rename to DSView/src/view/xcursor.cpp index 37adc4f61..52949a843 100644 --- a/DSView/view/xcursor.cpp +++ b/DSView/src/view/xcursor.cpp @@ -31,7 +31,7 @@ using namespace std; -namespace pv { +namespace dsv { namespace view { XCursor::XCursor(View &view, QColor &colour, @@ -271,4 +271,4 @@ void XCursor::paint_label(QPainter &p, const QRect &rect) } } // namespace view -} // namespace pv +} // namespace dsv diff --git a/DSView/view/xcursor.h b/DSView/src/view/xcursor.h similarity index 99% rename from DSView/view/xcursor.h rename to DSView/src/view/xcursor.h index 96f2b8920..d69a9aa1b 100644 --- a/DSView/view/xcursor.h +++ b/DSView/src/view/xcursor.h @@ -32,7 +32,7 @@ class QPainter; class QRect; -namespace pv { +namespace dsv { namespace view { class View; @@ -145,6 +145,6 @@ private slots: }; } // namespace view -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_VIEW_XCURSOR_H diff --git a/DSView/widgets/border.cpp b/DSView/src/widgets/border.cpp similarity index 99% rename from DSView/widgets/border.cpp rename to DSView/src/widgets/border.cpp index ec1b19d6c..a9512d030 100644 --- a/DSView/widgets/border.cpp +++ b/DSView/src/widgets/border.cpp @@ -27,7 +27,7 @@ #include #include "../config/appconfig.h" -namespace pv { +namespace dsv { namespace widgets { const QColor Border::dark_border0 = QColor(80, 80, 80, 255); @@ -141,4 +141,4 @@ void Border::leaveEvent(QEvent*) } } // namespace widgets -} // namespace pv +} // namespace dsv diff --git a/DSView/widgets/border.h b/DSView/src/widgets/border.h similarity index 97% rename from DSView/widgets/border.h rename to DSView/src/widgets/border.h index bc78997ed..1160b7379 100644 --- a/DSView/widgets/border.h +++ b/DSView/src/widgets/border.h @@ -24,7 +24,7 @@ #include -namespace pv { +namespace dsv { namespace widgets { class Border : public QWidget @@ -55,6 +55,6 @@ class Border : public QWidget }; } // namespace widgets -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_WIDGETS_BORDER_H diff --git a/DSView/widgets/decodergroupbox.cpp b/DSView/src/widgets/decodergroupbox.cpp similarity index 99% rename from DSView/widgets/decodergroupbox.cpp rename to DSView/src/widgets/decodergroupbox.cpp index 6bb35e635..e55fe1b3e 100644 --- a/DSView/widgets/decodergroupbox.cpp +++ b/DSView/src/widgets/decodergroupbox.cpp @@ -37,7 +37,7 @@ #include -namespace pv { +namespace dsv { namespace widgets { DecoderGroupBox::DecoderGroupBox(data::DecoderStack *decoder_stack, diff --git a/DSView/widgets/decodergroupbox.h b/DSView/src/widgets/decodergroupbox.h similarity index 99% rename from DSView/widgets/decodergroupbox.h rename to DSView/src/widgets/decodergroupbox.h index 5791a362f..4f58078a8 100644 --- a/DSView/widgets/decodergroupbox.h +++ b/DSView/src/widgets/decodergroupbox.h @@ -29,7 +29,7 @@ #include #include -namespace pv { +namespace dsv { namespace data{ class DecoderStack; diff --git a/DSView/widgets/decodermenu.cpp b/DSView/src/widgets/decodermenu.cpp similarity index 99% rename from DSView/widgets/decodermenu.cpp rename to DSView/src/widgets/decodermenu.cpp index 0072f7882..5966974f3 100644 --- a/DSView/widgets/decodermenu.cpp +++ b/DSView/src/widgets/decodermenu.cpp @@ -23,7 +23,7 @@ #include "decodermenu.h" #include -namespace pv { +namespace dsv { namespace widgets { DecoderMenu::DecoderMenu(QWidget *parent, bool first_level_decoder) : diff --git a/DSView/widgets/decodermenu.h b/DSView/src/widgets/decodermenu.h similarity index 98% rename from DSView/widgets/decodermenu.h rename to DSView/src/widgets/decodermenu.h index ca8b532e9..af01f23ec 100644 --- a/DSView/widgets/decodermenu.h +++ b/DSView/src/widgets/decodermenu.h @@ -27,7 +27,7 @@ struct srd_decoder; -namespace pv { +namespace dsv { namespace widgets { class DecoderMenu : public QMenu diff --git a/DSView/widgets/fakelineedit.cpp b/DSView/src/widgets/fakelineedit.cpp similarity index 97% rename from DSView/widgets/fakelineedit.cpp rename to DSView/src/widgets/fakelineedit.cpp index eb698ba65..e9b7f0ff0 100644 --- a/DSView/widgets/fakelineedit.cpp +++ b/DSView/src/widgets/fakelineedit.cpp @@ -22,7 +22,7 @@ #include "fakelineedit.h" #include -namespace pv { +namespace dsv { namespace widgets { FakeLineEdit::FakeLineEdit(QLineEdit *parent) : @@ -38,4 +38,4 @@ void FakeLineEdit::mousePressEvent(QMouseEvent *event) } } // namespace widgets -} // namespace pv +} // namespace dsv diff --git a/DSView/widgets/fakelineedit.h b/DSView/src/widgets/fakelineedit.h similarity index 97% rename from DSView/widgets/fakelineedit.h rename to DSView/src/widgets/fakelineedit.h index 51b1d7e1b..4a5991226 100644 --- a/DSView/widgets/fakelineedit.h +++ b/DSView/src/widgets/fakelineedit.h @@ -24,7 +24,7 @@ #include -namespace pv { +namespace dsv { class SigSession; @@ -47,6 +47,6 @@ public slots: }; } // namespace widgets -} // namespace pv +} // namespace dsv #endif // DSVIEW_PV_WIDGETS_FAKELINEEDIT_H diff --git a/DSView/test/CMakeLists.txt b/DSView/test/CMakeLists.txt deleted file mode 100644 index 2b48a7b61..000000000 --- a/DSView/test/CMakeLists.txt +++ /dev/null @@ -1,385 +0,0 @@ -## -## This file is part of the DSView project. -## -## Copyright (C) 2012 Joel Holdsworth -## Copyright (C) 2012-2013 Alexandru Gagniuc -## Copyright (C) 2013-2014 DreamSourceLab -## -## 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, see . -## - -cmake_minimum_required(VERSION 2.8.6) - -include(FindPkgConfig) -include(GNUInstallDirs) - -set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake") - -project(DSView) - -#=============================================================================== -#= User Options -#------------------------------------------------------------------------------- - -option(DISABLE_WERROR "Build without -Werror" TRUE) -option(ENABLE_SIGNALS "Build with UNIX signals" TRUE) -option(ENABLE_DECODE "Build with libsigrokdecode" TRUE) -option(ENABLE_COTIRE "Enable cotire" FALSE) -option(ENABLE_TESTS "Enable unit tests" FALSE) -option(STATIC_PKGDEPS_LIBS "Statically link to (pkg-config) libraries" FALSE) -option(FORCE_QT4 "Force use of Qt4 even if Qt5 is available" FALSE) - -if(WIN32) - # On Windows/MinGW we need to statically link to libraries. - # This option is user configurable, but enable it by default on win32. - set(STATIC_PKGDEPS_LIBS TRUE) - - # Windows does not support UNIX signals. - set(ENABLE_SIGNALS FALSE) -endif() - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." - FORCE) -endif() - -#=============================================================================== -#= Dependencies -#------------------------------------------------------------------------------- - -list(APPEND PKGDEPS - "libsigrok4DSL >= 0.2.0" - "libusb-1.0 >= 1.0.16" -) -if(ENABLE_DECODE) - list(APPEND PKGDEPS "libsigrokdecode>=0.3.0") -endif() - -find_package(PkgConfig) -pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS}) - -if(FORCE_QT4) - set(Qt5Core_FOUND FALSE) -else() - find_package(Qt5Core QUIET) -endif() - -if(Qt5Core_FOUND) - message("-- Using Qt5") - find_package(Qt5Widgets REQUIRED) - find_package(Qt5Gui REQUIRED) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") - set(QT_INCLUDE_DIRS ${Qt5Gui_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS}) - set(QT_LIBRARIES Qt5::Gui Qt5::Widgets) - add_definitions(${Qt5Gui_DEFINITIONS} ${Qt5Widgets_DEFINITIONS}) -else() - find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 qmake-mac) - find_package(Qt4 REQUIRED) -endif() - -find_package(Threads) - -find_package(Boost 1.42 COMPONENTS filesystem system thread REQUIRED) -find_package(libusb-1.0 REQUIRED) - -#=============================================================================== -#= Config Header -#------------------------------------------------------------------------------- - -set(DS_TITLE DSView) -set(DS_DESCRIPTION "A GUI for instruments of DreamSourceLab") - -set(DS_VERSION_MAJOR 0) -set(DS_VERSION_MINOR 9) -set(DS_VERSION_MICRO 2) -set(DS_VERSION_STRING - ${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO} -) - -configure_file ( - ${PROJECT_SOURCE_DIR}/config.h.in - ${PROJECT_BINARY_DIR}/config.h -) - -#=============================================================================== -#= Sources -#------------------------------------------------------------------------------- - -set(DSView_SOURCES - main.cpp - pv/devicemanager.cpp - pv/mainwindow.cpp - pv/sigsession.cpp - pv/storesession.cpp - pv/data/analog.cpp - pv/data/analogsnapshot.cpp - pv/data/dso.cpp - pv/data/dsosnapshot.cpp - pv/data/group.cpp - pv/data/groupsnapshot.cpp - pv/data/logic.cpp - pv/data/logicsnapshot.cpp - pv/data/signaldata.cpp - pv/data/snapshot.cpp - pv/device/devinst.cpp - pv/device/device.cpp - pv/device/file.cpp - pv/device/inputfile.cpp - pv/device/sessionfile.cpp - pv/dialogs/about.cpp - pv/dialogs/deviceoptions.cpp - pv/dialogs/search.cpp - pv/dialogs/storeprogress.cpp - pv/dialogs/streamoptions.cpp - pv/dialogs/waitingdialog.cpp - pv/dock/dsotriggerdock.cpp - pv/dock/measuredock.cpp - pv/dock/searchdock.cpp - pv/dock/triggerdock.cpp - pv/prop/bool.cpp - pv/prop/double.cpp - pv/prop/enum.cpp - pv/prop/int.cpp - pv/prop/property.cpp - pv/prop/string.cpp - pv/prop/binding/binding.cpp - pv/prop/binding/binding_deviceoptions.cpp - pv/toolbars/filebar.cpp - pv/toolbars/logobar.cpp - pv/toolbars/samplingbar.cpp - pv/toolbars/trigbar.cpp - pv/view/analogsignal.cpp - pv/view/cursor.cpp - pv/view/devmode.cpp - pv/view/dsldial.cpp - pv/view/dsosignal.cpp - pv/view/groupsignal.cpp - pv/view/header.cpp - pv/view/logicsignal.cpp - pv/view/ruler.cpp - pv/view/selectableitem.cpp - pv/view/signal.cpp - pv/view/timemarker.cpp - pv/view/trace.cpp - pv/view/view.cpp - pv/view/viewport.cpp - pv/widgets/fakelineedit.cpp -) - -set(DSView_HEADERS - pv/mainwindow.h - pv/sigsession.h - pv/storesession.h - pv/device/devinst.h - pv/dialogs/about.h - pv/dialogs/deviceoptions.h - pv/dialogs/search.h - pv/dialogs/storeprogress.h - pv/dialogs/streamoptions.h - pv/dialogs/waitingdialog.h - pv/dock/dsotriggerdock.h - pv/dock/measuredock.h - pv/dock/searchdock.h - pv/dock/triggerdock.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/toolbars/filebar.h - pv/toolbars/logobar.h - pv/toolbars/samplingbar.h - pv/toolbars/trigbar.h - pv/view/cursor.h - pv/view/devmode.h - pv/view/header.h - pv/view/ruler.h - pv/view/selectableitem.h - pv/view/timemarker.h - pv/view/trace.h - pv/view/view.h - pv/view/viewport.h - pv/widgets/fakelineedit.h -) - -set(DSView_FORMS - pv/dialogs/about.ui -) - -set(DSView_RESOURCES - DSView.qrc -) - - -if(ENABLE_DECODE) - list(APPEND DSView_SOURCES - pv/dock/protocoldock.cpp - pv/data/decoderstack.cpp - pv/data/decode/annotation.cpp - pv/data/decode/decoder.cpp - pv/data/decode/row.cpp - pv/data/decode/rowdata.cpp - pv/prop/binding/decoderoptions.cpp - pv/view/decodetrace.cpp - pv/widgets/decodergroupbox.cpp - pv/widgets/decodermenu.cpp - ) - - list(APPEND DSView_HEADERS - pv/dock/protocoldock.h - pv/data/decoderstack.h - pv/view/decodetrace.h - pv/widgets/decodergroupbox.h - pv/widgets/decodermenu.h - ) -endif() - -if(WIN32) - # Use the DSView icon for the DSView.exe executable. - set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_RC_COMPILER} -O coff -I${CMAKE_CURRENT_SOURCE_DIR} ") - enable_language(RC) - list(APPEND DSView_SOURCES DSView.rc) -endif() - -if(Qt5Core_FOUND) - qt5_wrap_cpp(DSView_HEADERS_MOC ${DSView_HEADERS}) - qt5_wrap_ui(DSView_FORMS_HEADERS ${DSView_FORMS}) - qt5_add_resources(DSView_RESOURCES_RCC ${DSView_RESOURCES}) -else() - qt4_wrap_cpp(DSView_HEADERS_MOC ${DSView_HEADERS}) - qt4_wrap_ui(DSView_FORMS_HEADERS ${DSView_FORMS}) - qt4_add_resources(DSView_RESOURCES_RCC ${DSView_RESOURCES}) - include(${QT_USE_FILE}) -endif() - -#=============================================================================== -#= Global Definitions -#------------------------------------------------------------------------------- - -add_definitions(${QT_DEFINITIONS}) -add_definitions(-Wall -Wextra -Wno-return-type -Wno-ignored-qualifiers) - -if(ENABLE_DECODE) - add_definitions(-DENABLE_DECODE) -endif() - -if(NOT DISABLE_WERROR) - add_definitions(-Werror) -endif() - -#=============================================================================== -#= Global Include Directories -#------------------------------------------------------------------------------- - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${Boost_INCLUDE_DIRS} - ${QT_INCLUDE_DIRS} -) - -if(STATIC_PKGDEPS_LIBS) - include_directories(${PKGDEPS_STATIC_INCLUDE_DIRS}) -else() - include_directories(${PKGDEPS_INCLUDE_DIRS}) -endif() - -#=============================================================================== -#= Linker Configuration -#------------------------------------------------------------------------------- - -link_directories(${Boost_LIBRARY_DIRS}) - -set(DSVIEW_LINK_LIBS - ${Boost_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${QT_LIBRARIES} - ${LIBUSB_1_LIBRARIES} -) - -if(STATIC_PKGDEPS_LIBS) - link_directories(${PKGDEPS_STATIC_LIBRARY_DIRS}) - list(APPEND DSVIEW_LINK_LIBS ${PKGDEPS_STATIC_LIBRARIES}) -if(WIN32) - # Workaround for a MinGW linking issue. - list(APPEND PULSEVIEW_LINK_LIBS "-llzma -llcms2") -endif() -else() - link_directories(${PKGDEPS_LIBRARY_DIRS}) - list(APPEND DSVIEW_LINK_LIBS ${PKGDEPS_LIBRARIES}) -endif() - - -add_executable(${PROJECT_NAME} - ${DSView_SOURCES} - ${DSView_HEADERS_MOC} - ${DSView_FORMS_HEADERS} - ${DSView_RESOURCES_RCC} -) - -target_link_libraries(${PROJECT_NAME} ${DSVIEW_LINK_LIBS}) - -if(WIN32) -# Pass -mwindows so that no "DOS box" will open when PulseView is started. -set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") -endif() - - -if(ENABLE_COTIRE) - include(cotire) - cotire(${PROJECT_NAME}) -endif() -set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "/usr/local/lib") - -#=============================================================================== -#= Installation -#------------------------------------------------------------------------------- - -# Install the executable. -install(TARGETS ${PROJECT_NAME} DESTINATION bin/) -install(FILES res/DSLogic.fw DESTINATION bin/res/) -install(FILES res/DSLogic33.bin DESTINATION bin/res/) -install(FILES res/DSLogic50.bin DESTINATION bin/res/) -install(FILES res/DSLogicPro.fw DESTINATION bin/res/) -install(FILES res/DSLogicPro.bin DESTINATION bin/res/) -install(FILES res/DSCope.fw DESTINATION bin/res/) -install(FILES res/DSCope.bin DESTINATION bin/res/) - -#=============================================================================== -#= Packaging (handled by CPack) -#------------------------------------------------------------------------------- - -set(CPACK_PACKAGE_VERSION_MAJOR ${DS_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${DS_VERSION_MINOR}) -set(CPACK_PACKAGE_VERSION_PATCH ${DS_VERSION_MICRO}) -set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README) -set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/COPYING) -set(CPACK_SOURCE_IGNORE_FILES ${CMAKE_CURRENT_BINARY_DIR} ".gitignore" ".git") -set(CPACK_SOURCE_PACKAGE_FILE_NAME - "${CMAKE_PROJECT_NAME}-${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO}") -set(CPACK_SOURCE_GENERATOR "TGZ") - -include(CPack) - -#=============================================================================== -#= Tests -#------------------------------------------------------------------------------- - -if(ENABLE_TESTS) - add_subdirectory(test) - enable_testing() - add_test(test ${CMAKE_CURRENT_BINARY_DIR}/test/DSView-test) -endif(ENABLE_TESTS) diff --git a/DSView/test/data/analogsnapshot.cpp b/DSView/test/data/analogsnapshot.cpp deleted file mode 100644 index 2f46ed51e..000000000 --- a/DSView/test/data/analogsnapshot.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * This file is part of the PulseView project. - * DSView is based on PulseView. - * - * Copyright (C) 2013 Joel Holdsworth - * - * 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 - */ - -#define __STDC_LIMIT_MACROS -#include - -#include -#include "../../pv/data/analogsnapshot.h" -#include "../extdef.h" - -using namespace std; - -using pv::data::AnalogSnapshot; - -BOOST_AUTO_TEST_SUITE(AnalogSnapshotTest) - -void push_analog(AnalogSnapshot &s, unsigned int num_samples, - float value) -{ - sr_datafeed_analog analog; - analog.num_samples = num_samples; - - float *data = new float[num_samples]; - analog.data = data; - while(num_samples-- != 0) - *data++ = value; - - s.append_payload(analog); - delete[] (float*)analog.data; -} - -BOOST_AUTO_TEST_CASE(Basic) -{ - // Create an empty AnalogSnapshot object - sr_datafeed_analog analog; - analog.num_samples = 0; - analog.data = NULL; - - AnalogSnapshot s(analog); - - //----- Test AnalogSnapshot::push_analog -----// - - BOOST_CHECK(s.get_sample_count() == 0); - for (unsigned int i = 0; i < AnalogSnapshot::ScaleStepCount; i++) - { - const AnalogSnapshot::Envelope &m = s._envelope_levels[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); - } - - // Push 8 samples of all zeros - push_analog(s, 8, 0.0f); - - BOOST_CHECK(s.get_sample_count() == 8); - - // There should not be enough samples to have a single mip map sample - for (unsigned int i = 0; i < AnalogSnapshot::ScaleStepCount; i++) - { - const AnalogSnapshot::Envelope &m = s._envelope_levels[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); - } - - // Push 8 samples of 1.0s to bring the total up to 16 - push_analog(s, 8, 1.0f); - - // There should now be enough data for exactly one sample - // in mip map level 0, and that sample should be 0 - const AnalogSnapshot::Envelope &e0 = s._envelope_levels[0]; - BOOST_CHECK_EQUAL(e0.length, 1); - BOOST_CHECK_EQUAL(e0.data_length, AnalogSnapshot::EnvelopeDataUnit); - BOOST_REQUIRE(e0.samples != NULL); - BOOST_CHECK_EQUAL(e0.samples[0].min, 0.0f); - BOOST_CHECK_EQUAL(e0.samples[0].max, 1.0f); - - // The higher levels should still be empty - for (unsigned int i = 1; i < AnalogSnapshot::ScaleStepCount; i++) - { - const AnalogSnapshot::Envelope &m = s._envelope_levels[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); - } - - // Push 240 samples of all zeros to bring the total up to 256 - push_analog(s, 240, -1.0f); - - BOOST_CHECK_EQUAL(e0.length, 16); - BOOST_CHECK_EQUAL(e0.data_length, AnalogSnapshot::EnvelopeDataUnit); - - for (unsigned int i = 1; i < e0.length; i++) { - BOOST_CHECK_EQUAL(e0.samples[i].min, -1.0f); - BOOST_CHECK_EQUAL(e0.samples[i].max, -1.0f); - } - - const AnalogSnapshot::Envelope &e1 = s._envelope_levels[1]; - BOOST_CHECK_EQUAL(e1.length, 1); - BOOST_CHECK_EQUAL(e1.data_length, AnalogSnapshot::EnvelopeDataUnit); - BOOST_REQUIRE(e1.samples != NULL); - BOOST_CHECK_EQUAL(e1.samples[0].min, -1.0f); - BOOST_CHECK_EQUAL(e1.samples[0].max, 1.0f); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/DSView/test/data/logicsnapshot.cpp b/DSView/test/data/logicsnapshot.cpp deleted file mode 100644 index eb4fb6c56..000000000 --- a/DSView/test/data/logicsnapshot.cpp +++ /dev/null @@ -1,537 +0,0 @@ -/* - * This file is part of the PulseView project. - * DSView is based on PulseView. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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 - */ - -#include "../extdef.h" - -#define __STDC_LIMIT_MACROS -#include - -#include - -#include "../../pv/data/logicsnapshot.h" - -using namespace std; - -using pv::data::LogicSnapshot; - -BOOST_AUTO_TEST_SUITE(LogicSnapshotTest) - -void push_logic(LogicSnapshot &s, unsigned int length, uint8_t value) -{ - sr_datafeed_logic logic; - logic.unitsize = 1; - logic.length = length; - logic.data = new uint8_t[length]; - memset(logic.data, value, length * logic.unitsize); - s.append_payload(logic); - delete[] (uint8_t*)logic.data; -} - -BOOST_AUTO_TEST_CASE(Pow2) -{ - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(0, 0), 0); - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(1, 0), 1); - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(2, 0), 2); - - BOOST_CHECK_EQUAL( - LogicSnapshot::pow2_ceil(INT64_MIN, 0), INT64_MIN); - BOOST_CHECK_EQUAL( - LogicSnapshot::pow2_ceil(INT64_MAX, 0), INT64_MAX); - - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(0, 1), 0); - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(1, 1), 2); - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(2, 1), 2); - BOOST_CHECK_EQUAL(LogicSnapshot::pow2_ceil(3, 1), 4); -} - -BOOST_AUTO_TEST_CASE(Basic) -{ - // Create an empty LogicSnapshot object - sr_datafeed_logic logic; - logic.length = 0; - logic.unitsize = 1; - logic.data = NULL; - - LogicSnapshot s(logic); - - //----- Test LogicSnapshot::push_logic -----// - - BOOST_CHECK(s.get_sample_count() == 0); - for (unsigned int i = 0; i < LogicSnapshot::ScaleStepCount; i++) - { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - // Push 8 samples of all zeros - push_logic(s, 8, 0); - - BOOST_CHECK(s.get_sample_count() == 8); - - // There should not be enough samples to have a single mip map sample - for (unsigned int i = 0; i < LogicSnapshot::ScaleStepCount; i++) - { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - // Push 8 samples of 0x11s to bring the total up to 16 - push_logic(s, 8, 0x11); - - // There should now be enough data for exactly one sample - // in mip map level 0, and that sample should be 0 - const LogicSnapshot::MipMapLevel &m0 = s._mip_map[0]; - BOOST_CHECK_EQUAL(m0.length, 1); - BOOST_CHECK_EQUAL(m0.data_length, LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(m0.data != NULL); - BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[0], 0x11); - - // The higher levels should still be empty - for (unsigned int i = 1; i < LogicSnapshot::ScaleStepCount; i++) - { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - // Push 240 samples of all zeros to bring the total up to 256 - push_logic(s, 240, 0); - - BOOST_CHECK_EQUAL(m0.length, 16); - BOOST_CHECK_EQUAL(m0.data_length, LogicSnapshot::MipMapDataUnit); - - BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[1], 0x11); - for (unsigned int i = 2; i < m0.length; i++) - BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[i], 0); - - const LogicSnapshot::MipMapLevel &m1 = s._mip_map[1]; - BOOST_CHECK_EQUAL(m1.length, 1); - BOOST_CHECK_EQUAL(m1.data_length, LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(m1.data != NULL); - BOOST_CHECK_EQUAL(((uint8_t*)m1.data)[0], 0x11); - - //----- Test LogicSnapshot::get_subsampled_edges -----// - - // Test a full view at full zoom. - vector edges; - s.get_subsampled_edges(edges, 0, 255, 1, 0); - BOOST_REQUIRE_EQUAL(edges.size(), 4); - - BOOST_CHECK_EQUAL(edges[0].first, 0); - BOOST_CHECK_EQUAL(edges[1].first, 8); - BOOST_CHECK_EQUAL(edges[2].first, 16); - BOOST_CHECK_EQUAL(edges[3].first, 255); - - // Test a subset at high zoom - edges.clear(); - s.get_subsampled_edges(edges, 6, 17, 0.05f, 0); - BOOST_REQUIRE_EQUAL(edges.size(), 4); - - BOOST_CHECK_EQUAL(edges[0].first, 6); - BOOST_CHECK_EQUAL(edges[1].first, 8); - BOOST_CHECK_EQUAL(edges[2].first, 16); - BOOST_CHECK_EQUAL(edges[3].first, 17); -} - -BOOST_AUTO_TEST_CASE(LargeData) -{ - uint8_t prev_sample; - const unsigned int Length = 1000000; - - sr_datafeed_logic logic; - logic.unitsize = 1; - logic.length = Length; - logic.data = new uint8_t[Length]; - uint8_t *data = (uint8_t*)logic.data; - - for (unsigned int i = 0; i < Length; i++) - *data++ = (uint8_t)(i >> 8); - - LogicSnapshot s(logic); - delete[] (uint8_t*)logic.data; - - BOOST_CHECK(s.get_sample_count() == Length); - - // Check mip map level 0 - BOOST_CHECK_EQUAL(s._mip_map[0].length, 62500); - BOOST_CHECK_EQUAL(s._mip_map[0].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[0].data != NULL); - - prev_sample = 0; - for (unsigned int i = 0; i < s._mip_map[0].length;) - { - BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); - - const uint8_t sample = (uint8_t)((i*16) >> 8); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, - prev_sample ^ sample); - prev_sample = sample; - - for (int j = 1; i < s._mip_map[0].length && j < 16; j++) - { - BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0); - } - } - - // Check mip map level 1 - BOOST_CHECK_EQUAL(s._mip_map[1].length, 3906); - BOOST_CHECK_EQUAL(s._mip_map[1].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[1].data != NULL); - - prev_sample = 0; - for (unsigned int i = 0; i < s._mip_map[1].length; i++) - { - BOOST_TEST_MESSAGE("Testing mip_map[1].data[" << i << "]"); - - const uint8_t sample = i; - const uint8_t expected = sample ^ prev_sample; - prev_sample = i; - - BOOST_CHECK_EQUAL(s.get_subsample(1, i) & 0xFF, expected); - } - - // Check mip map level 2 - BOOST_CHECK_EQUAL(s._mip_map[2].length, 244); - BOOST_CHECK_EQUAL(s._mip_map[2].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[2].data != NULL); - - prev_sample = 0; - for (unsigned int i = 0; i < s._mip_map[2].length; i++) - { - BOOST_TEST_MESSAGE("Testing mip_map[2].data[" << i << "]"); - - const uint8_t sample = i << 4; - const uint8_t expected = (sample ^ prev_sample) | 0x0F; - prev_sample = sample; - - BOOST_CHECK_EQUAL(s.get_subsample(2, i) & 0xFF, expected); - } - - // Check mip map level 3 - BOOST_CHECK_EQUAL(s._mip_map[3].length, 15); - BOOST_CHECK_EQUAL(s._mip_map[3].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[3].data != NULL); - - for (unsigned int i = 0; i < s._mip_map[3].length; i++) - BOOST_CHECK_EQUAL(*((uint8_t*)s._mip_map[3].data + i), - 0xFF); - - // Check the higher levels - for (unsigned int i = 4; i < LogicSnapshot::ScaleStepCount; i++) - { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - //----- Test LogicSnapshot::get_subsampled_edges -----// - // Check in normal case - vector edges; - s.get_subsampled_edges(edges, 0, Length-1, 1, 7); - - BOOST_CHECK_EQUAL(edges.size(), 32); - - for (unsigned int i = 0; i < edges.size() - 1; i++) - { - BOOST_CHECK_EQUAL(edges[i].first, i * 32768); - BOOST_CHECK_EQUAL(edges[i].second, i & 1); - } - - BOOST_CHECK_EQUAL(edges[31].first, 999999); - - // Check in very low zoom case - edges.clear(); - s.get_subsampled_edges(edges, 0, Length-1, 50e6f, 7); - - BOOST_CHECK_EQUAL(edges.size(), 2); -} - -BOOST_AUTO_TEST_CASE(Pulses) -{ - const int Cycles = 3; - const int Period = 64; - const int Length = Cycles * Period; - - vector edges; - - //----- Create a LogicSnapshot -----// - sr_datafeed_logic logic; - logic.unitsize = 1; - logic.length = Length; - logic.data = (uint64_t*)new uint8_t[Length]; - uint8_t *p = (uint8_t*)logic.data; - - for (int i = 0; i < Cycles; i++) { - *p++ = 0xFF; - for (int j = 1; j < Period; j++) - *p++ = 0x00; - } - - LogicSnapshot s(logic); - delete[] (uint8_t*)logic.data; - - //----- Check the mip-map -----// - // Check mip map level 0 - BOOST_CHECK_EQUAL(s._mip_map[0].length, 12); - BOOST_CHECK_EQUAL(s._mip_map[0].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[0].data != NULL); - - for (unsigned int i = 0; i < s._mip_map[0].length;) { - BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0xFF); - - for (int j = 1; - i < s._mip_map[0].length && - j < Period/LogicSnapshot::MipMapScaleFactor; j++) { - BOOST_TEST_MESSAGE( - "Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++) & 0xFF, 0x00); - } - } - - // Check the higher levels are all inactive - for (unsigned int i = 1; i < LogicSnapshot::ScaleStepCount; i++) { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - //----- Test get_subsampled_edges at reduced scale -----// - s.get_subsampled_edges(edges, 0, Length-1, 16.0f, 2); - BOOST_REQUIRE_EQUAL(edges.size(), Cycles + 2); - - BOOST_CHECK_EQUAL(0, false); - for (unsigned int i = 1; i < edges.size(); i++) - BOOST_CHECK_EQUAL(edges[i].second, false); -} - -BOOST_AUTO_TEST_CASE(LongPulses) -{ - const int Cycles = 3; - const int Period = 64; - const int PulseWidth = 16; - const int Length = Cycles * Period; - - int j; - vector edges; - - //----- Create a LogicSnapshot -----// - sr_datafeed_logic logic; - logic.unitsize = 8; - logic.length = Length * 8; - logic.data = (uint64_t*)new uint64_t[Length]; - uint64_t *p = (uint64_t*)logic.data; - - for (int i = 0; i < Cycles; i++) { - for (j = 0; j < PulseWidth; j++) - *p++ = ~0; - for (; j < Period; j++) - *p++ = 0; - } - - LogicSnapshot s(logic); - delete[] (uint64_t*)logic.data; - - //----- Check the mip-map -----// - // Check mip map level 0 - BOOST_CHECK_EQUAL(s._mip_map[0].length, 12); - BOOST_CHECK_EQUAL(s._mip_map[0].data_length, - LogicSnapshot::MipMapDataUnit); - BOOST_REQUIRE(s._mip_map[0].data != NULL); - - for (unsigned int i = 0; i < s._mip_map[0].length;) { - for (j = 0; i < s._mip_map[0].length && j < 2; j++) { - BOOST_TEST_MESSAGE( - "Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++), ~0); - } - - for (; i < s._mip_map[0].length && - j < Period/LogicSnapshot::MipMapScaleFactor; j++) { - BOOST_TEST_MESSAGE( - "Testing mip_map[0].data[" << i << "]"); - BOOST_CHECK_EQUAL(s.get_subsample(0, i++), 0); - } - } - - // Check the higher levels are all inactive - for (unsigned int i = 1; i < LogicSnapshot::ScaleStepCount; i++) { - const LogicSnapshot::MipMapLevel &m = s._mip_map[i]; - BOOST_CHECK_EQUAL(m.length, 0); - BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); - } - - //----- Test get_subsampled_edges at a full scale -----// - s.get_subsampled_edges(edges, 0, Length-1, 16.0f, 2); - BOOST_REQUIRE_EQUAL(edges.size(), Cycles * 2 + 1); - - for (int i = 0; i < Cycles; i++) { - BOOST_CHECK_EQUAL(edges[i*2].first, i * Period); - BOOST_CHECK_EQUAL(edges[i*2].second, true); - BOOST_CHECK_EQUAL(edges[i*2+1].first, i * Period + PulseWidth); - BOOST_CHECK_EQUAL(edges[i*2+1].second, false); - } - - BOOST_CHECK_EQUAL(edges.back().first, Length-1); - BOOST_CHECK_EQUAL(edges.back().second, false); - - //----- Test get_subsampled_edges at a simplified scale -----// - edges.clear(); - s.get_subsampled_edges(edges, 0, Length-1, 17.0f, 2); - - BOOST_CHECK_EQUAL(edges[0].first, 0); - BOOST_CHECK_EQUAL(edges[0].second, true); - BOOST_CHECK_EQUAL(edges[1].first, 16); - BOOST_CHECK_EQUAL(edges[1].second, false); - - for (int i = 1; i < Cycles; i++) { - BOOST_CHECK_EQUAL(edges[i+1].first, i * Period); - BOOST_CHECK_EQUAL(edges[i+1].second, false); - } - - BOOST_CHECK_EQUAL(edges.back().first, Length-1); - BOOST_CHECK_EQUAL(edges.back().second, false); -} - -BOOST_AUTO_TEST_CASE(LisaMUsbHid) -{ - /* This test was created from the beginning of the USB_DM signal in - * sigrok-dumps-usb/lisa_m_usbhid/lisa_m_usbhid.sr - */ - - const int Edges[] = { - 7028, 7033, 7036, 7041, 7044, 7049, 7053, 7066, 7073, 7079, - 7086, 7095, 7103, 7108, 7111, 7116, 7119, 7124, 7136, 7141, - 7148, 7162, 7500 - }; - const int Length = Edges[countof(Edges) - 1]; - - bool state = false; - int lastEdgePos = 0; - - //----- Create a LogicSnapshot -----// - sr_datafeed_logic logic; - logic.unitsize = 1; - logic.length = Length; - logic.data = new uint8_t[Length]; - uint8_t *data = (uint8_t*)logic.data; - - for (unsigned int i = 0; i < countof(Edges); i++) { - const int edgePos = Edges[i]; - memset(&data[lastEdgePos], state ? 0x02 : 0, - edgePos - lastEdgePos - 1); - - lastEdgePos = edgePos; - state = !state; - } - - LogicSnapshot s(logic); - delete[] (uint64_t*)logic.data; - - vector edges; - - - /* The trailing edge of the pulse train is falling in the source data. - * Check this is always true at different scales - */ - - edges.clear(); - s.get_subsampled_edges(edges, 0, Length-1, 33.333332f, 1); - BOOST_CHECK_EQUAL(edges[edges.size() - 2].second, false); -} - -/* - * This test checks the rendering of wide data (more than 8 probes) - * Probe signals are either all-high, or all-low, but are interleaved such that - * they would toggle during every sample if treated like 8 probes. - * The packet contains a large number of samples, so the mipmap generation kicks - * in. - * - * The signals should not toggle (have exactly two edges: the start and end) - */ -BOOST_AUTO_TEST_CASE(WideData) -{ - const int Length = 512<<10; - uint16_t *data = new uint16_t[Length]; - - sr_datafeed_logic logic; - logic.unitsize = sizeof(data[0]); - logic.length = Length * sizeof(data[0]); - logic.data = data; - - for (int i = 0; i < Length; i++) - data[i] = 0x0FF0; - - LogicSnapshot s(logic); - - vector edges; - - edges.clear(); - s.get_subsampled_edges(edges, 0, Length-1, 1, 0); - BOOST_CHECK_EQUAL(edges.size(), 2); - - edges.clear(); - s.get_subsampled_edges(edges, 0, Length-1, 1, 8); - BOOST_CHECK_EQUAL(edges.size(), 2); - - // Cleanup - delete [] data; -} - -/* - * This test is a replica of sixteen.sr attached to Bug #33. - */ -BOOST_AUTO_TEST_CASE(Sixteen) -{ - const int Length = 8; - uint16_t data[Length]; - - sr_datafeed_logic logic; - logic.unitsize = sizeof(data[0]); - logic.length = Length * sizeof(data[0]); - logic.data = data; - - for (int i = 0; i < Length; i++) - data[i] = 0xFFFE; - - LogicSnapshot s(logic); - - vector edges; - s.get_subsampled_edges(edges, 0, 2, 0.0004, 1); - - BOOST_CHECK_EQUAL(edges.size(), 2); -} - -BOOST_AUTO_TEST_SUITE_END() diff --git a/DSView/test/test.cpp b/DSView/test/test.cpp deleted file mode 100644 index b74021a54..000000000 --- a/DSView/test/test.cpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This file is part of the PulseView project. - * DSView is based on PulseView. - * - * Copyright (C) 2012 Joel Holdsworth - * - * 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 - */ - -#define BOOST_TEST_MAIN -#include From e2e8c5280ffc137d0db3996c71b0ebbadd615f92 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 25 Jul 2023 14:32:17 +0800 Subject: [PATCH 5/7] The step 2 of code refactoring for v2.0 --- DSView/src/appcore/appcontrol.cpp | 2 +- DSView/src/appcore/mainframe.cpp | 2 +- DSView/src/appcore/mainwindow.cpp | 4 +- DSView/src/appcore/mainwindow.h | 2 +- DSView/src/data/mathstack.h | 7 +- DSView/src/decode/row.h | 1 - DSView/src/dialogs/decoderoptionsdlg.cpp | 2 +- DSView/src/dialogs/deviceoptions.cpp | 6 +- DSView/src/dialogs/dsdialog.cpp | 8 +- DSView/src/dialogs/dsdialog.h | 2 +- DSView/src/dialogs/dsmessagebox.cpp | 2 +- DSView/src/dock/dsotriggerdock.cpp | 4 +- DSView/src/dock/dsotriggerdock.h | 2 +- DSView/src/dock/measuredock.cpp | 4 +- DSView/src/dock/measuredock.h | 2 +- DSView/src/dock/protocoldock.cpp | 6 +- DSView/src/dock/protocoldock.h | 2 +- DSView/src/dock/protocolitemlayer.cpp | 2 +- DSView/src/dock/protocolitemlayer.h | 2 +- DSView/src/dock/searchdock.cpp | 4 +- DSView/src/dock/searchdock.h | 2 +- DSView/src/dock/triggerdock.cpp | 4 +- DSView/src/dock/triggerdock.h | 2 +- DSView/src/interface/icallbacks.h | 11 --- DSView/src/toolbars/filebar.cpp | 4 +- DSView/src/toolbars/filebar.h | 2 +- DSView/src/toolbars/logobar.cpp | 8 +- DSView/src/toolbars/logobar.h | 2 +- DSView/src/toolbars/samplingbar.cpp | 4 +- DSView/src/toolbars/samplingbar.h | 2 +- DSView/src/toolbars/titlebar.cpp | 4 +- DSView/src/toolbars/titlebar.h | 2 +- DSView/src/toolbars/trigbar.cpp | 4 +- DSView/src/toolbars/trigbar.h | 2 +- .../string_ids.h => uicore/lang_page_ids.h} | 11 ++- DSView/src/uicore/langitemlist.cpp | 84 +++++++++++++++++++ DSView/src/uicore/langitemlist.h | 55 ++++++++++++ DSView/src/{ui => uicore}/langresource.cpp | 0 DSView/src/{ui => uicore}/langresource.h | 2 +- DSView/src/uicore/uitypes.h | 55 ++++++++++++ DSView/src/view/devmode.cpp | 8 +- DSView/src/view/devmode.h | 2 +- DSView/src/view/view.cpp | 2 +- DSView/src/view/view.h | 2 +- DSView/src/view/viewport.cpp | 4 +- DSView/src/view/viewport.h | 2 +- 46 files changed, 264 insertions(+), 82 deletions(-) rename DSView/src/{ui/string_ids.h => uicore/lang_page_ids.h} (86%) create mode 100644 DSView/src/uicore/langitemlist.cpp create mode 100644 DSView/src/uicore/langitemlist.h rename DSView/src/{ui => uicore}/langresource.cpp (100%) rename DSView/src/{ui => uicore}/langresource.h (99%) create mode 100644 DSView/src/uicore/uitypes.h diff --git a/DSView/src/appcore/appcontrol.cpp b/DSView/src/appcore/appcontrol.cpp index 7a0377fbb..3d5a13e7f 100644 --- a/DSView/src/appcore/appcontrol.cpp +++ b/DSView/src/appcore/appcontrol.cpp @@ -181,7 +181,7 @@ void AppControl::remove_font_form(IFontForm *form) void AppControl::update_font_forms() { for (auto f : _font_forms){ - f->update_font(); + f->UpdateFont(); } } diff --git a/DSView/src/appcore/mainframe.cpp b/DSView/src/appcore/mainframe.cpp index 2f2016e2f..680bb0de6 100644 --- a/DSView/src/appcore/mainframe.cpp +++ b/DSView/src/appcore/mainframe.cpp @@ -429,7 +429,7 @@ void MainFrame::readSettings() AppConfig &app = AppConfig::Instance(); if (app.frameOptions.language > 0){ - _mainWindow->switchLanguage(app.frameOptions.language); + _mainWindow->SwitchLanguage(app.frameOptions.language); } int left = app.frameOptions.left; diff --git a/DSView/src/appcore/mainwindow.cpp b/DSView/src/appcore/mainwindow.cpp index dcf006b0c..ff7aa6bf7 100644 --- a/DSView/src/appcore/mainwindow.cpp +++ b/DSView/src/appcore/mainwindow.cpp @@ -238,7 +238,7 @@ namespace appcore { // defaut language AppConfig &app = AppConfig::Instance(); - switchLanguage(app.frameOptions.language); + SwitchLanguage(app.frameOptions.language); switchTheme(app.frameOptions.style); retranslateUi(); @@ -1356,7 +1356,7 @@ namespace appcore { return false; } - void MainWindow::switchLanguage(int language) + void MainWindow::SwitchLanguage(int language) { if (language == 0) return; diff --git a/DSView/src/appcore/mainwindow.h b/DSView/src/appcore/mainwindow.h index fc4f7a3a4..0f01636f5 100644 --- a/DSView/src/appcore/mainwindow.h +++ b/DSView/src/appcore/mainwindow.h @@ -139,7 +139,7 @@ private slots: public: //IMainForm - void switchLanguage(int language) override; + void SwitchLanguage(int language) override; bool able_to_close(); private: diff --git a/DSView/src/data/mathstack.h b/DSView/src/data/mathstack.h index 9e6e6be5c..4864a6cd2 100644 --- a/DSView/src/data/mathstack.h +++ b/DSView/src/data/mathstack.h @@ -29,18 +29,15 @@ #include "signaldata.h" namespace dsv{ - namespace appcore{ + namespace appcore{ class SigSession; } -} -using namespace dsv::appcore; - -namespace dsv{ namespace view{ class DsoSignal; class dslDial; } } +using namespace dsv::appcore; using namespace dsv::view; namespace dsv { diff --git a/DSView/src/decode/row.h b/DSView/src/decode/row.h index 66abbe69f..cf09c7956 100644 --- a/DSView/src/decode/row.h +++ b/DSView/src/decode/row.h @@ -23,7 +23,6 @@ #define DECODE_ROW_H #include - #include "annotation.h" struct srd_decoder; diff --git a/DSView/src/dialogs/decoderoptionsdlg.cpp b/DSView/src/dialogs/decoderoptionsdlg.cpp index e787c1c94..acccd61b7 100644 --- a/DSView/src/dialogs/decoderoptionsdlg.cpp +++ b/DSView/src/dialogs/decoderoptionsdlg.cpp @@ -206,7 +206,7 @@ void DecoderOptionsDlg::load_options_view() confirm_button_box->addWidget(button_box, 0, Qt::AlignRight); form->addRow(confirm_button_box); - this->update_font(); + this->UpdateFont(); int real_content_width = _content_width; int content_height = _contentHeight; diff --git a/DSView/src/dialogs/deviceoptions.cpp b/DSView/src/dialogs/deviceoptions.cpp index e18096d1f..8af806fd7 100644 --- a/DSView/src/dialogs/deviceoptions.cpp +++ b/DSView/src/dialogs/deviceoptions.cpp @@ -398,7 +398,7 @@ void DeviceOptions::logic_probes(QVBoxLayout &layout) enable_all_probes->setMaximumWidth(bt_width); disable_all_probes->setMaximumWidth(bt_width); - this->update_font(); + this->UpdateFont(); contentHeight += enable_all_probes->sizeHint().height(); contentHeight += channel_line_height * row2 + 50; @@ -734,7 +734,7 @@ void DeviceOptions::analog_probes(QGridLayout &layout) layout.addWidget(tabWidget, 0, 0, 1, 1); - this->update_font(); + this->UpdateFont(); _groupHeight2 = tabWidget->sizeHint().height() + 10; _dynamic_panel->setFixedHeight(_groupHeight2); @@ -836,7 +836,7 @@ void DeviceOptions::build_dynamic_panel() int bb = 0; void DeviceOptions::try_resize_scroll() { - this->update_font(); + this->UpdateFont(); // content area height int contentHeight = _groupHeight1 + _groupHeight2 + 20; // +space diff --git a/DSView/src/dialogs/dsdialog.cpp b/DSView/src/dialogs/dsdialog.cpp index 24b0a1d62..98d7a7c0f 100644 --- a/DSView/src/dialogs/dsdialog.cpp +++ b/DSView/src/dialogs/dsdialog.cpp @@ -129,7 +129,7 @@ int DSDialog::exec() connect(_base_button, SIGNAL(accepted()), this, SLOT(accept())); } - update_font(); + UpdateFont(); return QDialog::exec(); } @@ -175,20 +175,20 @@ void DSDialog::build_base(bool hasClose) _main_layout->setContentsMargins(10,5,10,10); } -void DSDialog::update_font() +void DSDialog::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); ui::set_form_font(this, font); if (_titlebar != NULL){ - _titlebar->update_font(); + _titlebar->UpdateFont(); } } void DSDialog::show() { - update_font(); + UpdateFont(); QWidget::show(); } diff --git a/DSView/src/dialogs/dsdialog.h b/DSView/src/dialogs/dsdialog.h index f7ce23232..afcda50cd 100644 --- a/DSView/src/dialogs/dsdialog.h +++ b/DSView/src/dialogs/dsdialog.h @@ -67,7 +67,7 @@ class DSDialog : public QDialog, IFontForm void SetTitleSpace(int h); //IFontForm - void update_font() override; + void UpdateFont() override; void show(); diff --git a/DSView/src/dialogs/dsmessagebox.cpp b/DSView/src/dialogs/dsmessagebox.cpp index da05e2e8a..7eca6413c 100644 --- a/DSView/src/dialogs/dsmessagebox.cpp +++ b/DSView/src/dialogs/dsmessagebox.cpp @@ -136,7 +136,7 @@ int DSMessageBox::exec() ui::set_form_font(this, font); if (_titlebar != NULL){ - _titlebar->update_font(); + _titlebar->UpdateFont(); } return QDialog::exec(); diff --git a/DSView/src/dock/dsotriggerdock.cpp b/DSView/src/dock/dsotriggerdock.cpp index fd632ab58..bcdc8730e 100644 --- a/DSView/src/dock/dsotriggerdock.cpp +++ b/DSView/src/dock/dsotriggerdock.cpp @@ -173,7 +173,7 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession *session) : retranslateUi(); - update_font(); + UpdateFont(); } DsoTriggerDock::~DsoTriggerDock() @@ -488,7 +488,7 @@ void DsoTriggerDock::update_view() connect(_margin_slider, SIGNAL(valueChanged(int)), this, SLOT(margin_changed(int))); } -void DsoTriggerDock::update_font() +void DsoTriggerDock::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/dock/dsotriggerdock.h b/DSView/src/dock/dsotriggerdock.h index c76fe1fd7..3ce9dfd46 100644 --- a/DSView/src/dock/dsotriggerdock.h +++ b/DSView/src/dock/dsotriggerdock.h @@ -63,7 +63,7 @@ class DsoTriggerDock : public QScrollArea, public IFontForm bool check_trig_channel(); //IFontForm - void update_font() override; + void UpdateFont() override; signals: void set_trig_pos(int percent); diff --git a/DSView/src/dock/measuredock.cpp b/DSView/src/dock/measuredock.cpp index b95263033..c3340fb5b 100644 --- a/DSView/src/dock/measuredock.cpp +++ b/DSView/src/dock/measuredock.cpp @@ -150,7 +150,7 @@ MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession *session) : connect(_fen_checkBox, SIGNAL(stateChanged(int)), &_view, SLOT(set_measure_en(int))); connect(&_view, SIGNAL(measure_updated()), this, SLOT(measure_updated())); - update_font(); + UpdateFont(); } MeasureDock::~MeasureDock() @@ -827,7 +827,7 @@ void MeasureDock::del_cursor() _view.update(); } -void MeasureDock::update_font() +void MeasureDock::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/dock/measuredock.h b/DSView/src/dock/measuredock.h index b50fee859..5c8419542 100644 --- a/DSView/src/dock/measuredock.h +++ b/DSView/src/dock/measuredock.h @@ -94,7 +94,7 @@ class MeasureDock : public QScrollArea, public IFontForm void reStyle(); //IFontForm - void update_font() override; + void UpdateFont() override; void build_dist_pannel(); void build_edge_pannel(); diff --git a/DSView/src/dock/protocoldock.cpp b/DSView/src/dock/protocoldock.cpp index c37b5a566..e079c3501 100644 --- a/DSView/src/dock/protocoldock.cpp +++ b/DSView/src/dock/protocoldock.cpp @@ -226,7 +226,7 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio connect(_pro_search_button, SIGNAL(clicked()), this, SLOT(show_protocol_select())); - update_font(); + UpdateFont(); } ProtocolDock::~ProtocolDock() @@ -1041,7 +1041,7 @@ bool ProtocolDock::protocol_sort_callback(const DecoderInfoItem *o1, const Decod } } - void ProtocolDock::update_font() + void ProtocolDock::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); @@ -1049,7 +1049,7 @@ bool ProtocolDock::protocol_sort_callback(const DecoderInfoItem *o1, const Decod _table_view->setFont(font); for(auto lay : _protocol_lay_items){ - lay->update_font(); + lay->UpdateFont(); } font.setPointSizeF(font.pointSizeF() + 1); diff --git a/DSView/src/dock/protocoldock.h b/DSView/src/dock/protocoldock.h index 006c6b903..dcd6cfe27 100644 --- a/DSView/src/dock/protocoldock.h +++ b/DSView/src/dock/protocoldock.h @@ -120,7 +120,7 @@ public IFontForm void update_deocder_item_name(void *trace_handel, const char *name) override; //IFontForm - void update_font() override; + void UpdateFont() override; signals: void protocol_updated(); diff --git a/DSView/src/dock/protocolitemlayer.cpp b/DSView/src/dock/protocolitemlayer.cpp index e5b3ef025..85eba0757 100644 --- a/DSView/src/dock/protocolitemlayer.cpp +++ b/DSView/src/dock/protocolitemlayer.cpp @@ -73,7 +73,7 @@ ProtocolItemLayer::ProtocolItemLayer(QWidget *parent, QString protocolName, IPro connect(_set_button, SIGNAL(clicked()),this, SLOT(on_set_protocol())); connect(_format_combox, SIGNAL(currentIndexChanged(int)),this, SLOT(on_format_select_changed(int))); - update_font(); + UpdateFont(); } ProtocolItemLayer::~ProtocolItemLayer(){ diff --git a/DSView/src/dock/protocolitemlayer.h b/DSView/src/dock/protocolitemlayer.h index 38ad3eb71..1d2954c0f 100644 --- a/DSView/src/dock/protocolitemlayer.h +++ b/DSView/src/dock/protocolitemlayer.h @@ -71,7 +71,7 @@ class ProtocolItemLayer: public QHBoxLayout void set_label_name(QString name); - void update_font(); + void UpdateFont(); private slots: void on_set_protocol(); diff --git a/DSView/src/dock/searchdock.cpp b/DSView/src/dock/searchdock.cpp index 71ecfb99a..90800e89f 100644 --- a/DSView/src/dock/searchdock.cpp +++ b/DSView/src/dock/searchdock.cpp @@ -85,7 +85,7 @@ SearchDock::SearchDock(QWidget *parent, View &view, SigSession *session) : retranslateUi(); - update_font(); + UpdateFont(); connect(&_pre_button, SIGNAL(clicked()), this, SLOT(on_previous())); connect(&_nxt_button, SIGNAL(clicked()),this, SLOT(on_next())); @@ -254,7 +254,7 @@ void SearchDock::on_set() } } -void SearchDock::update_font() +void SearchDock::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/dock/searchdock.h b/DSView/src/dock/searchdock.h index 7d3e390d7..61eac814e 100644 --- a/DSView/src/dock/searchdock.h +++ b/DSView/src/dock/searchdock.h @@ -76,7 +76,7 @@ class SearchDock : public QWidget, public IFontForm void reStyle(); //IFontForm - void update_font() override; + void UpdateFont() override; public slots: void on_previous(); diff --git a/DSView/src/dock/triggerdock.cpp b/DSView/src/dock/triggerdock.cpp index c999715dc..81542b506 100644 --- a/DSView/src/dock/triggerdock.cpp +++ b/DSView/src/dock/triggerdock.cpp @@ -134,7 +134,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession *session) : retranslateUi(); - update_font(); + UpdateFont(); } TriggerDock::~TriggerDock() @@ -1072,7 +1072,7 @@ void TriggerDock::on_serial_hex_changed() _is_serial_val_setting = false; } -void TriggerDock::update_font() +void TriggerDock::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/dock/triggerdock.h b/DSView/src/dock/triggerdock.h index 6285177a1..305c15436 100644 --- a/DSView/src/dock/triggerdock.h +++ b/DSView/src/dock/triggerdock.h @@ -90,7 +90,7 @@ class TriggerDock : public QScrollArea, public IFontForm bool commit_trigger(); //IFontForm - void update_font() override; + void UpdateFont() override; private slots: void simple_trigger(); diff --git a/DSView/src/interface/icallbacks.h b/DSView/src/interface/icallbacks.h index 2cfed68f9..db040596c 100644 --- a/DSView/src/interface/icallbacks.h +++ b/DSView/src/interface/icallbacks.h @@ -59,11 +59,6 @@ class IDlgCallback virtual void OnDlgResult(bool bYes)=0; }; -class IMainForm{ -public: - virtual void switchLanguage(int language)=0; -}; - #define DSV_MSG_START_COLLECT_WORK_PREV 5001 #define DSV_MSG_START_COLLECT_WORK 5002 @@ -108,10 +103,4 @@ class IDecoderPannel virtual void update_deocder_item_name(void *trace_handel, const char *name)=0; }; -class IFontForm -{ -public: - virtual void update_font()=0; -}; - #endif diff --git a/DSView/src/toolbars/filebar.cpp b/DSView/src/toolbars/filebar.cpp index 8d95c61d3..bceaa14b7 100644 --- a/DSView/src/toolbars/filebar.cpp +++ b/DSView/src/toolbars/filebar.cpp @@ -96,7 +96,7 @@ FileBar::FileBar(SigSession *session, QWidget *parent) : connect(_action_export, SIGNAL(triggered()), this, SIGNAL(sig_export())); connect(_action_capture, SIGNAL(triggered()), this, SLOT(on_actionCapture_triggered())); - update_font(); + UpdateFont(); } void FileBar::changeEvent(QEvent *event) @@ -256,7 +256,7 @@ void FileBar::update_view_status() _menu_session->setEnabled(bEnable && is_hardware); } -void FileBar::update_font() +void FileBar::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/toolbars/filebar.h b/DSView/src/toolbars/filebar.h index d958b6a32..09acd940f 100644 --- a/DSView/src/toolbars/filebar.h +++ b/DSView/src/toolbars/filebar.h @@ -58,7 +58,7 @@ class FileBar : public QToolBar, public IFontForm void reStyle(); //IFontForm - void update_font() override; + void UpdateFont() override; signals: void sig_load_file(QString); diff --git a/DSView/src/toolbars/logobar.cpp b/DSView/src/toolbars/logobar.cpp index 3bc831e97..18f05d3df 100644 --- a/DSView/src/toolbars/logobar.cpp +++ b/DSView/src/toolbars/logobar.cpp @@ -124,7 +124,7 @@ LogoBar::LogoBar(SigSession *session, QWidget *parent) : connect(_update, SIGNAL(triggered()), this, SLOT(on_action_update())); connect(_log, SIGNAL(triggered()), this, SLOT(on_action_setting_log())); - update_font(); + UpdateFont(); } void LogoBar::changeEvent(QEvent *event) @@ -188,7 +188,7 @@ void LogoBar::on_actionEn_triggered() QIcon(":/icons/English.svg"))); assert(_mainForm); - _mainForm->switchLanguage(LAN_EN); + _mainForm->SwitchLanguage(LAN_EN); } void LogoBar::on_actionCn_triggered() @@ -196,7 +196,7 @@ void LogoBar::on_actionCn_triggered() _language->setIcon(QIcon::fromTheme("file", QIcon(":/icons/Chinese.svg"))); assert(_mainForm); - _mainForm->switchLanguage(LAN_CN); + _mainForm->SwitchLanguage(LAN_CN); } void LogoBar::on_actionAbout_triggered() @@ -348,7 +348,7 @@ void LogoBar::on_clear_log_file() } } -void LogoBar::update_font() +void LogoBar::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/toolbars/logobar.h b/DSView/src/toolbars/logobar.h index 2372a0fc0..9bb40270e 100644 --- a/DSView/src/toolbars/logobar.h +++ b/DSView/src/toolbars/logobar.h @@ -65,7 +65,7 @@ class LogoBar : public QToolBar, public IFontForm void reStyle(); //IFontForm - void update_font() override; + void UpdateFont() override; signals: //post event message to open user help document, MainWindow class receive it diff --git a/DSView/src/toolbars/samplingbar.cpp b/DSView/src/toolbars/samplingbar.cpp index d53a9e588..1d3cdd35b 100644 --- a/DSView/src/toolbars/samplingbar.cpp +++ b/DSView/src/toolbars/samplingbar.cpp @@ -130,7 +130,7 @@ namespace dsv _instant_action = addWidget(&_instant_button); update_view_status(); - update_font(); + UpdateFont(); connect(&_device_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(on_device_selected())); connect(&_configure_button, SIGNAL(clicked()), this, SLOT(on_configure())); @@ -1257,7 +1257,7 @@ namespace dsv on_instant_stop(); } - void SamplingBar::update_font() + void SamplingBar::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/toolbars/samplingbar.h b/DSView/src/toolbars/samplingbar.h index cc6d338da..7e56aaed9 100644 --- a/DSView/src/toolbars/samplingbar.h +++ b/DSView/src/toolbars/samplingbar.h @@ -129,7 +129,7 @@ namespace toolbars{ bool action_instant_stop(); //IFontForm - void update_font() override; + void UpdateFont() override; private slots: void on_collect_mode(); diff --git a/DSView/src/toolbars/titlebar.cpp b/DSView/src/toolbars/titlebar.cpp index 645045f95..beffbc087 100644 --- a/DSView/src/toolbars/titlebar.cpp +++ b/DSView/src/toolbars/titlebar.cpp @@ -93,7 +93,7 @@ TitleBar::TitleBar(bool top, QWidget *parent, bool hasClose) : setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - update_font(); + UpdateFont(); } TitleBar::~TitleBar(){ @@ -238,7 +238,7 @@ void TitleBar::mouseDoubleClickEvent(QMouseEvent *event) QWidget::mouseDoubleClickEvent(event); } -void TitleBar::update_font() +void TitleBar::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/toolbars/titlebar.h b/DSView/src/toolbars/titlebar.h index d941c5cc3..20b67116c 100644 --- a/DSView/src/toolbars/titlebar.h +++ b/DSView/src/toolbars/titlebar.h @@ -44,7 +44,7 @@ class TitleBar : public QWidget, public IFontForm QString title(); //IFontForm - void update_font() override; + void UpdateFont() override; private: void changeEvent(QEvent *event); diff --git a/DSView/src/toolbars/trigbar.cpp b/DSView/src/toolbars/trigbar.cpp index 8c6d4cb7d..722f7714d 100644 --- a/DSView/src/toolbars/trigbar.cpp +++ b/DSView/src/toolbars/trigbar.cpp @@ -123,7 +123,7 @@ TrigBar::TrigBar(SigSession *session, QWidget *parent) : connect(_light_style, SIGNAL(triggered()), this, SLOT(on_actionLight_triggered())); connect(_action_dispalyOptions, SIGNAL(triggered()), this, SLOT(on_display_setting())); - update_font(); + UpdateFont(); } //语言变化 @@ -371,7 +371,7 @@ void TrigBar::update_checked_status() _search_button.setChecked(opt->searchDock); } -void TrigBar::update_font() +void TrigBar::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/toolbars/trigbar.h b/DSView/src/toolbars/trigbar.h index 8fba1278d..0758ef269 100644 --- a/DSView/src/toolbars/trigbar.h +++ b/DSView/src/toolbars/trigbar.h @@ -64,7 +64,7 @@ class TrigBar : public QToolBar, public IFontForm void update_checked_status(); //IFontForm - void update_font() override; + void UpdateFont() override; signals: void sig_setTheme(QString style); diff --git a/DSView/src/ui/string_ids.h b/DSView/src/uicore/lang_page_ids.h similarity index 86% rename from DSView/src/ui/string_ids.h rename to DSView/src/uicore/lang_page_ids.h index 2fdd88199..2175e533a 100644 --- a/DSView/src/ui/string_ids.h +++ b/DSView/src/uicore/lang_page_ids.h @@ -2,7 +2,7 @@ * This file is part of the DSView project. * DSView is based on PulseView. * - * Copyright (C) 2022 DreamSourceLab + * Copyright (C) 2023 DreamSourceLab * * 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 @@ -19,14 +19,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef STRING_IDS_H -#define STRING_IDS_H +#ifndef LANG_PAGE_IDS_H +#define LANG_PAGE_IDS_H +/** + * Language resource page code. +*/ #define STR_PAGE_MSG 1 #define STR_PAGE_TOOLBAR 2 #define STR_PAGE_DLG 3 #define STR_PAGE_DSL 100 #define STR_PAGE_DECODER 101 -#define IDS_MSG_LOG_LEVEL + #endif \ No newline at end of file diff --git a/DSView/src/uicore/langitemlist.cpp b/DSView/src/uicore/langitemlist.cpp new file mode 100644 index 000000000..4f9a64036 --- /dev/null +++ b/DSView/src/uicore/langitemlist.cpp @@ -0,0 +1,84 @@ +/* + * This file is part of the DSView project. + * DSView is based on PulseView. + * + * Copyright (C) 2023 DreamSourceLab + * + * 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 + */ + +#include "langitemlist.h" +#include +#include "langresource.h" + +LangItemList::LangItemList() +{ + +} + +LangItemList::~LangItemList() +{ + Clear(); +} + +void LangItemList::Clear() +{ + for(auto it = m_items.begin(); it != m_items.end(); it++) + { + delete (*it).setter; + } + m_items.clear(); +} + +void LangItemList::AddItem(int page_id, const char *key_id, const char *defaultStr, ILangSetter *setter) +{ + assert(key_id); + assert(defaultStr); + assert(setter); + + LangItemInfo item = {page_id, key_id, defaultStr, setter}; + m_items.push_back(item); +} + +void LangItemList::RemoveItemBySetterHandle(void *setterHandle) +{ + assert(setterHandle); + + for(auto it = m_items.begin(); it != m_items.end(); it++) + { + if ((*it).setter->GetControlHandle() == setterHandle){ + m_items.erase(it); + break; + } + } +} + +void LangItemList::LoadAllText() +{ + for(auto it = m_items.begin(); it != m_items.end(); it++) + { + int page_id = (*it).lang_page_id; + const char *key_id = (*it).key_id; + const char *def_str = (*it).default_str; + ILangSetter *setter = (*it).setter; + + const char *str = LangResource::Instance()->get_lang_text(page_id, key_id, def_str); + if (str == NULL){ + str = def_str; + } + + setter->SetLangText(str); + } +} \ No newline at end of file diff --git a/DSView/src/uicore/langitemlist.h b/DSView/src/uicore/langitemlist.h new file mode 100644 index 000000000..1a3346f2a --- /dev/null +++ b/DSView/src/uicore/langitemlist.h @@ -0,0 +1,55 @@ +/* + * This file is part of the DSView project. + * DSView is based on PulseView. + * + * Copyright (C) 2023 DreamSourceLab + * + * 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 LANG_ITEM_LIST_H +#define LANG_ITEM_LIST_H + +#include +#include "uitypes.h" +#include "lang_page_ids.h" + +struct LangItemInfo +{ + int lang_page_id; + const char *key_id; + const char *default_str; + ILangSetter *setter; +}; + +class LangItemList +{ +public: + LangItemList(); + ~LangItemList(); + + void Clear(); + + void AddItem(int page_id, const char *key_id, const char *defaultStr, ILangSetter *setter); + + void RemoveItemBySetterHandle(void *setterHandle); + + void LoadAllText(); + +private: + std::vector m_items; +}; + +#endif \ No newline at end of file diff --git a/DSView/src/ui/langresource.cpp b/DSView/src/uicore/langresource.cpp similarity index 100% rename from DSView/src/ui/langresource.cpp rename to DSView/src/uicore/langresource.cpp diff --git a/DSView/src/ui/langresource.h b/DSView/src/uicore/langresource.h similarity index 99% rename from DSView/src/ui/langresource.h rename to DSView/src/uicore/langresource.h index 63a079e64..19ec41eca 100644 --- a/DSView/src/ui/langresource.h +++ b/DSView/src/uicore/langresource.h @@ -27,7 +27,7 @@ #include #include #include -#include "string_ids.h" +#include "lang_page_ids.h" struct lang_key_item { diff --git a/DSView/src/uicore/uitypes.h b/DSView/src/uicore/uitypes.h new file mode 100644 index 000000000..fe3f90688 --- /dev/null +++ b/DSView/src/uicore/uitypes.h @@ -0,0 +1,55 @@ +/* + * This file is part of the DSView project. + * DSView is based on PulseView. + * + * Copyright (C) 2023 DreamSourceLab + * + * 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 UICORE_UI_TYPES_H +#define UICORE_UI_TYPES_H + +class ILangSetter +{ +public: + virtual void SetLangText(const char *szText)=0; + virtual void* GetControlHandle()=0; +}; + +class ILangForm +{ +public: + virtual void LoadLangText()=0; +}; + +class IFontForm +{ +public: + virtual void UpdateFont()=0; +}; + +class IMainForm +{ +public: + virtual void SwitchLanguage(int language)=0; + virtual void AddLangForm(ILangForm *form)=0; + virtual void RemoveLangForm(ILangForm *form)=0; + virtual void AddFontForm(IFontForm *form)=0; + virtual void RemoveFontForm(IFontForm *form)=0; + virtual void UpdateAllFontForm()=0; +}; + +#endif \ No newline at end of file diff --git a/DSView/src/view/devmode.cpp b/DSView/src/view/devmode.cpp index 7030e3cbf..541a903cb 100644 --- a/DSView/src/view/devmode.cpp +++ b/DSView/src/view/devmode.cpp @@ -89,7 +89,7 @@ DevMode::DevMode(QWidget *parent, SigSession *session) : layout->setStretch(1, 100); setLayout(layout); - update_font(); + UpdateFont(); connect(_close_button, SIGNAL(clicked()), this, SLOT(on_close())); } @@ -172,7 +172,7 @@ void DevMode::set_device() _bFile = true; } - update_font(); + UpdateFont(); update(); } @@ -231,7 +231,7 @@ void DevMode::on_mode_change() } } - update_font(); + UpdateFont(); } void DevMode::on_close() @@ -279,7 +279,7 @@ const struct dev_mode_name* DevMode::get_mode_name(int mode) assert(false); } -void DevMode::update_font() +void DevMode::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/view/devmode.h b/DSView/src/view/devmode.h index 5c4fa2d57..235ceed29 100644 --- a/DSView/src/view/devmode.h +++ b/DSView/src/view/devmode.h @@ -72,7 +72,7 @@ class DevMode : public QWidget, public IFontForm const struct dev_mode_name* get_mode_name(int mode); //IFontForm - void update_font() override; + void UpdateFont() override; public slots: void set_device(); diff --git a/DSView/src/view/view.cpp b/DSView/src/view/view.cpp index 622bad0f0..a72b1eb09 100644 --- a/DSView/src/view/view.cpp +++ b/DSView/src/view/view.cpp @@ -1339,7 +1339,7 @@ int View::get_body_height() _time_viewport->update(); } - void View::update_font() + void View::UpdateFont() { headerWidth(); } diff --git a/DSView/src/view/view.h b/DSView/src/view/view.h index 4850306a1..558d6a786 100644 --- a/DSView/src/view/view.h +++ b/DSView/src/view/view.h @@ -320,7 +320,7 @@ class View : public QScrollArea, public IFontForm{ } //IFontForm - void update_font() override; + void UpdateFont() override; signals: void hover_point_changed(); diff --git a/DSView/src/view/viewport.cpp b/DSView/src/view/viewport.cpp index bff5723d1..71267f23b 100644 --- a/DSView/src/view/viewport.cpp +++ b/DSView/src/view/viewport.cpp @@ -106,7 +106,7 @@ Viewport::Viewport(View &parent, View_type type) : _xAction = xAction; setContextMenuPolicy(Qt::CustomContextMenu); - this->update_font(); + this->UpdateFont(); connect(&_trigger_timer, SIGNAL(timeout()),this, SLOT(on_trigger_timer())); connect(&_drag_timer, SIGNAL(timeout()),this, SLOT(on_drag_timer())); @@ -2001,7 +2001,7 @@ void Viewport::add_cursor_x() _view.show_xcursors(true); } -void Viewport::update_font() +void Viewport::UpdateFont() { QFont font = this->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/view/viewport.h b/DSView/src/view/viewport.h index 5114acf98..c75257070 100644 --- a/DSView/src/view/viewport.h +++ b/DSView/src/view/viewport.h @@ -116,7 +116,7 @@ class Viewport : public QWidget, public IFontForm void update_lang(); //IFontForm - void update_font() override; + void UpdateFont() override; protected: bool event(QEvent *event) override; From 78a2ac0a500f9baf2209e7ccb0058c531407164c Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 25 Jul 2023 16:05:03 +0800 Subject: [PATCH 6/7] The step 3 of code refactoring for v2.0 --- DSView/src/appcore/appcontrol.h | 2 +- DSView/src/appcore/mainframe.cpp | 2 +- DSView/src/appcore/mainwindow.cpp | 2 +- DSView/src/appcore/mainwindow.h | 7 +++++++ DSView/src/appcore/sigsession.cpp | 2 +- DSView/src/com/storesession.cpp | 2 +- DSView/src/data/decoderstack.cpp | 2 +- DSView/src/dialogs/about.cpp | 2 +- DSView/src/dialogs/applicationpardlg.cpp | 2 +- DSView/src/dialogs/calibration.cpp | 2 +- DSView/src/dialogs/decoderoptionsdlg.cpp | 2 +- DSView/src/dialogs/deviceoptions.cpp | 2 +- DSView/src/dialogs/dsdialog.h | 1 + DSView/src/dialogs/dsmessagebox.cpp | 2 +- DSView/src/dialogs/dsomeasure.cpp | 2 +- DSView/src/dialogs/fftoptions.cpp | 2 +- DSView/src/dialogs/interval.cpp | 2 +- DSView/src/dialogs/lissajousoptions.cpp | 2 +- DSView/src/dialogs/mathoptions.cpp | 2 +- DSView/src/dialogs/protocolexp.cpp | 2 +- DSView/src/dialogs/protocollist.cpp | 2 +- DSView/src/dialogs/regionoptions.cpp | 2 +- DSView/src/dialogs/search.cpp | 2 +- DSView/src/dialogs/storeprogress.cpp | 2 +- DSView/src/dialogs/waitingdialog.cpp | 2 +- DSView/src/dock/dsotriggerdock.cpp | 4 ++-- DSView/src/dock/dsotriggerdock.h | 1 + DSView/src/dock/measuredock.cpp | 2 +- DSView/src/dock/measuredock.h | 1 + DSView/src/dock/protocoldock.cpp | 2 +- DSView/src/dock/protocoldock.h | 1 + DSView/src/dock/protocolitemlayer.cpp | 3 ++- DSView/src/dock/searchdock.cpp | 2 +- DSView/src/dock/searchdock.h | 1 + DSView/src/dock/triggerdock.cpp | 2 +- DSView/src/dock/triggerdock.h | 1 + DSView/src/main.cpp | 4 ++-- DSView/src/prop/binding/decoderoptions.cpp | 2 +- DSView/src/prop/binding/deviceoptions.cpp | 2 +- DSView/src/prop/binding/probeoptions.cpp | 2 +- DSView/src/toolbars/filebar.cpp | 4 ++-- DSView/src/toolbars/filebar.h | 1 + DSView/src/toolbars/logobar.cpp | 2 +- DSView/src/toolbars/logobar.h | 1 + DSView/src/toolbars/samplingbar.cpp | 2 +- DSView/src/toolbars/samplingbar.h | 1 + DSView/src/toolbars/titlebar.h | 1 + DSView/src/toolbars/trigbar.cpp | 2 +- DSView/src/toolbars/trigbar.h | 1 + DSView/src/ui/msgbox.cpp | 2 +- DSView/src/view/decodetrace.cpp | 2 +- DSView/src/view/devmode.cpp | 2 +- DSView/src/view/devmode.h | 1 + DSView/src/view/header.cpp | 2 +- DSView/src/view/lissajoustrace.cpp | 2 +- DSView/src/view/viewport.cpp | 4 ++-- DSView/src/view/viewstatus.cpp | 2 +- 57 files changed, 68 insertions(+), 48 deletions(-) diff --git a/DSView/src/appcore/appcontrol.h b/DSView/src/appcore/appcontrol.h index 06bc35e8c..27d86836d 100644 --- a/DSView/src/appcore/appcontrol.h +++ b/DSView/src/appcore/appcontrol.h @@ -23,10 +23,10 @@ #include #include +#include "../uicore/uitypes.h" struct sr_context; class QWidget; -class IFontForm; namespace dsv { namespace appcore { diff --git a/DSView/src/appcore/mainframe.cpp b/DSView/src/appcore/mainframe.cpp index 680bb0de6..b4df04c70 100644 --- a/DSView/src/appcore/mainframe.cpp +++ b/DSView/src/appcore/mainframe.cpp @@ -47,7 +47,7 @@ #include "../config/appconfig.h" #include "../ui/msgbox.h" #include "appcontrol.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../log.h" using namespace dsv::config; diff --git a/DSView/src/appcore/mainwindow.cpp b/DSView/src/appcore/mainwindow.cpp index ff7aa6bf7..52789174e 100644 --- a/DSView/src/appcore/mainwindow.cpp +++ b/DSView/src/appcore/mainwindow.cpp @@ -90,7 +90,7 @@ #include "sigsession.h" #include "deviceagent.h" #include "../com/zipmaker.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "mainframe.h" #include "../basedef.h" #include "appcontrol.h" diff --git a/DSView/src/appcore/mainwindow.h b/DSView/src/appcore/mainwindow.h index 0f01636f5..071f7b7e2 100644 --- a/DSView/src/appcore/mainwindow.h +++ b/DSView/src/appcore/mainwindow.h @@ -140,6 +140,13 @@ private slots: public: //IMainForm void SwitchLanguage(int language) override; + + void AddLangForm(ILangForm *form) override{}; + void RemoveLangForm(ILangForm *form)override{}; + void AddFontForm(IFontForm *form)override{}; + void RemoveFontForm(IFontForm *form)override{}; + void UpdateAllFontForm()override{}; + bool able_to_close(); private: diff --git a/DSView/src/appcore/sigsession.cpp b/DSView/src/appcore/sigsession.cpp index a6c921e8c..1cd78106c 100644 --- a/DSView/src/appcore/sigsession.cpp +++ b/DSView/src/appcore/sigsession.cpp @@ -50,7 +50,7 @@ #include "../config/appconfig.h" #include "../utility/path.h" #include "../ui/msgbox.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace dsv::config; diff --git a/DSView/src/com/storesession.cpp b/DSView/src/com/storesession.cpp index c349e5754..fb0ae5083 100644 --- a/DSView/src/com/storesession.cpp +++ b/DSView/src/com/storesession.cpp @@ -58,7 +58,7 @@ #include "../utility/encoding.h" #include "../utility/path.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #define DEOCDER_CONFIG_VERSION 2 diff --git a/DSView/src/data/decoderstack.cpp b/DSView/src/data/decoderstack.cpp index 37034b429..735eec45d 100644 --- a/DSView/src/data/decoderstack.cpp +++ b/DSView/src/data/decoderstack.cpp @@ -33,7 +33,7 @@ #include "../view/logicsignal.h" #include "../basedef.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace std; using namespace boost; diff --git a/DSView/src/dialogs/about.cpp b/DSView/src/dialogs/about.cpp index 8467a9e7c..63e3b8d4e 100644 --- a/DSView/src/dialogs/about.cpp +++ b/DSView/src/dialogs/about.cpp @@ -34,7 +34,7 @@ #include "../config/appconfig.h" #include "../basedef.h" #include "../utility/encoding.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace dsv::config; diff --git a/DSView/src/dialogs/applicationpardlg.cpp b/DSView/src/dialogs/applicationpardlg.cpp index 9df262789..208ff2ae1 100644 --- a/DSView/src/dialogs/applicationpardlg.cpp +++ b/DSView/src/dialogs/applicationpardlg.cpp @@ -32,7 +32,7 @@ #include #include #include "../config/appconfig.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../appcore/appcontrol.h" #include "../appcore/sigsession.h" #include "../ui/dscombobox.h" diff --git a/DSView/src/dialogs/calibration.cpp b/DSView/src/dialogs/calibration.cpp index f410d241a..238a9d945 100644 --- a/DSView/src/dialogs/calibration.cpp +++ b/DSView/src/dialogs/calibration.cpp @@ -31,7 +31,7 @@ #include "../basedef.h" #include "../appcore/appcontrol.h" #include "../appcore/sigsession.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../ui/msgbox.h" using namespace std; diff --git a/DSView/src/dialogs/decoderoptionsdlg.cpp b/DSView/src/dialogs/decoderoptionsdlg.cpp index acccd61b7..00a90cf07 100644 --- a/DSView/src/dialogs/decoderoptionsdlg.cpp +++ b/DSView/src/dialogs/decoderoptionsdlg.cpp @@ -45,7 +45,7 @@ #include "../widgets/decodergroupbox.h" #include "../view/decodetrace.h" #include "../ui/msgbox.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../config/appconfig.h" using namespace dsv::config; diff --git a/DSView/src/dialogs/deviceoptions.cpp b/DSView/src/dialogs/deviceoptions.cpp index 8af806fd7..5abd51b01 100644 --- a/DSView/src/dialogs/deviceoptions.cpp +++ b/DSView/src/dialogs/deviceoptions.cpp @@ -35,7 +35,7 @@ #include "../config/appconfig.h" #include "../appcore/appcontrol.h" #include "../appcore/sigsession.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../log.h" #include "../ui/msgbox.h" diff --git a/DSView/src/dialogs/dsdialog.h b/DSView/src/dialogs/dsdialog.h index afcda50cd..5dc74ab02 100644 --- a/DSView/src/dialogs/dsdialog.h +++ b/DSView/src/dialogs/dsdialog.h @@ -29,6 +29,7 @@ #include #include "../toolbars/titlebar.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" class QDialogButtonBox; diff --git a/DSView/src/dialogs/dsmessagebox.cpp b/DSView/src/dialogs/dsmessagebox.cpp index 7eca6413c..fdf74bfef 100644 --- a/DSView/src/dialogs/dsmessagebox.cpp +++ b/DSView/src/dialogs/dsmessagebox.cpp @@ -28,7 +28,7 @@ #include #include "shadow.h" #include "../basedef.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../config/appconfig.h" #include "../ui/fn.h" diff --git a/DSView/src/dialogs/dsomeasure.cpp b/DSView/src/dialogs/dsomeasure.cpp index 670edef79..003263802 100644 --- a/DSView/src/dialogs/dsomeasure.cpp +++ b/DSView/src/dialogs/dsomeasure.cpp @@ -28,7 +28,7 @@ #include "../appcore/sigsession.h" #include "../view/view.h" #include "../basedef.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace std; using namespace dsv::view; diff --git a/DSView/src/dialogs/fftoptions.cpp b/DSView/src/dialogs/fftoptions.cpp index cafee0dac..831a9052b 100644 --- a/DSView/src/dialogs/fftoptions.cpp +++ b/DSView/src/dialogs/fftoptions.cpp @@ -29,7 +29,7 @@ #include "../view/spectrumtrace.h" #include "../basedef.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace boost; diff --git a/DSView/src/dialogs/interval.cpp b/DSView/src/dialogs/interval.cpp index d0cd5bb82..68d3d0582 100644 --- a/DSView/src/dialogs/interval.cpp +++ b/DSView/src/dialogs/interval.cpp @@ -21,7 +21,7 @@ #include "interval.h" #include -#include "../ui/langresource.h" +#include "../uicore/langresource.h" namespace dsv { namespace dialogs { diff --git a/DSView/src/dialogs/lissajousoptions.cpp b/DSView/src/dialogs/lissajousoptions.cpp index 4a410519e..dbc345cc3 100644 --- a/DSView/src/dialogs/lissajousoptions.cpp +++ b/DSView/src/dialogs/lissajousoptions.cpp @@ -29,7 +29,7 @@ #include "../appcore/sigsession.h" #include "../view/view.h" #include "../view/lissajoustrace.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace boost; diff --git a/DSView/src/dialogs/mathoptions.cpp b/DSView/src/dialogs/mathoptions.cpp index 622e6737b..2a3251b00 100644 --- a/DSView/src/dialogs/mathoptions.cpp +++ b/DSView/src/dialogs/mathoptions.cpp @@ -29,7 +29,7 @@ #include "../view/view.h" #include "../view/mathtrace.h" #include "../data/mathstack.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace boost; using namespace std; diff --git a/DSView/src/dialogs/protocolexp.cpp b/DSView/src/dialogs/protocolexp.cpp index 0ef581ef2..844b36ad6 100644 --- a/DSView/src/dialogs/protocolexp.cpp +++ b/DSView/src/dialogs/protocolexp.cpp @@ -40,7 +40,7 @@ #include "../utility/encoding.h" #include "../utility/path.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #define EXPORT_DEC_ROW_COUNT_MAX 20 diff --git a/DSView/src/dialogs/protocollist.cpp b/DSView/src/dialogs/protocollist.cpp index 80e57f1af..4f171d179 100644 --- a/DSView/src/dialogs/protocollist.cpp +++ b/DSView/src/dialogs/protocollist.cpp @@ -27,7 +27,7 @@ #include "../decode/row.h" #include "../view/decodetrace.h" #include "../data/decodermodel.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace boost; using namespace std; diff --git a/DSView/src/dialogs/regionoptions.cpp b/DSView/src/dialogs/regionoptions.cpp index 343d2ae31..d7e67c1ab 100644 --- a/DSView/src/dialogs/regionoptions.cpp +++ b/DSView/src/dialogs/regionoptions.cpp @@ -23,7 +23,7 @@ #include "../appcore/sigsession.h" #include "../view/cursor.h" #include "../view/view.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace boost; using namespace std; diff --git a/DSView/src/dialogs/search.cpp b/DSView/src/dialogs/search.cpp index ca1af15ef..083e344a3 100644 --- a/DSView/src/dialogs/search.cpp +++ b/DSView/src/dialogs/search.cpp @@ -22,7 +22,7 @@ #include "search.h" #include #include -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../view/logicsignal.h" #include "../appcore/sigsession.h" diff --git a/DSView/src/dialogs/storeprogress.cpp b/DSView/src/dialogs/storeprogress.cpp index 884a30da5..7cd05a7a9 100644 --- a/DSView/src/dialogs/storeprogress.cpp +++ b/DSView/src/dialogs/storeprogress.cpp @@ -32,7 +32,7 @@ #include "../config/appconfig.h" #include "../interface/icallbacks.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace dsv::config; diff --git a/DSView/src/dialogs/waitingdialog.cpp b/DSView/src/dialogs/waitingdialog.cpp index 80d4c3c22..75c77fb7f 100644 --- a/DSView/src/dialogs/waitingdialog.cpp +++ b/DSView/src/dialogs/waitingdialog.cpp @@ -29,7 +29,7 @@ #include "../view/trace.h" #include "../view/dsosignal.h" #include "../config/appconfig.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../appcore/appcontrol.h" #include "../appcore/sigsession.h" diff --git a/DSView/src/dock/dsotriggerdock.cpp b/DSView/src/dock/dsotriggerdock.cpp index bcdc8730e..91731190e 100644 --- a/DSView/src/dock/dsotriggerdock.cpp +++ b/DSView/src/dock/dsotriggerdock.cpp @@ -31,8 +31,8 @@ #include #include "../appcore/sigsession.h" #include "../dialogs/dsmessagebox.h" -#include "../view/dsosignal.h" -#include "../ui/langresource.h" +#include "../view/dsosignal.h" +#include "../uicore/langresource.h" #include "../log.h" #include "../ui/msgbox.h" #include "../config/appconfig.h" diff --git a/DSView/src/dock/dsotriggerdock.h b/DSView/src/dock/dsotriggerdock.h index 3ce9dfd46..8cb31b240 100644 --- a/DSView/src/dock/dsotriggerdock.h +++ b/DSView/src/dock/dsotriggerdock.h @@ -32,6 +32,7 @@ #include #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/dock/measuredock.cpp b/DSView/src/dock/measuredock.cpp index c3340fb5b..f7947eedc 100644 --- a/DSView/src/dock/measuredock.cpp +++ b/DSView/src/dock/measuredock.cpp @@ -34,7 +34,7 @@ #include "../dialogs/dsdialog.h" #include "../dialogs/dsmessagebox.h" #include "../config/appconfig.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../ui/msgbox.h" #include "../appcore/appcontrol.h" #include "../appcore/sigsession.h" diff --git a/DSView/src/dock/measuredock.h b/DSView/src/dock/measuredock.h index 5c8419542..8f936fc44 100644 --- a/DSView/src/dock/measuredock.h +++ b/DSView/src/dock/measuredock.h @@ -40,6 +40,7 @@ #include #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/dock/protocoldock.cpp b/DSView/src/dock/protocoldock.cpp index e079c3501..819d52bb1 100644 --- a/DSView/src/dock/protocoldock.cpp +++ b/DSView/src/dock/protocoldock.cpp @@ -52,7 +52,7 @@ #include "../decode/decoderstatus.h" #include "../decode/decoder.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../appcore/appcontrol.h" #include "../ui/fn.h" #include "../decode/displaydataformat.h" diff --git a/DSView/src/dock/protocoldock.h b/DSView/src/dock/protocoldock.h index dcd6cfe27..f3407157b 100644 --- a/DSView/src/dock/protocoldock.h +++ b/DSView/src/dock/protocoldock.h @@ -44,6 +44,7 @@ #include "keywordlineedit.h" #include "searchcombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/dock/protocolitemlayer.cpp b/DSView/src/dock/protocolitemlayer.cpp index 85eba0757..8bb02e946 100644 --- a/DSView/src/dock/protocolitemlayer.cpp +++ b/DSView/src/dock/protocolitemlayer.cpp @@ -24,6 +24,7 @@ #include #include "../config/appconfig.h" #include "../decode/displaydataformat.h" +#include "../uicore/uitypes.h" using namespace dsv::config; @@ -167,7 +168,7 @@ void ProtocolItemLayer::LoadFormatSelect(bool bSingle) _protocol_label->setText(name); } - void ProtocolItemLayer::update_font() + void ProtocolItemLayer::UpdateFont() { QFont font = _protocol_label->font(); font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); diff --git a/DSView/src/dock/searchdock.cpp b/DSView/src/dock/searchdock.cpp index 90800e89f..8e2b3680f 100644 --- a/DSView/src/dock/searchdock.cpp +++ b/DSView/src/dock/searchdock.cpp @@ -38,7 +38,7 @@ #include "../data/logicsnapshot.h" #include "../dialogs/dsmessagebox.h" #include "../config/appconfig.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../ui/msgbox.h" #include "../appcore/appcontrol.h" #include "../ui/fn.h" diff --git a/DSView/src/dock/searchdock.h b/DSView/src/dock/searchdock.h index 61eac814e..9b5e54034 100644 --- a/DSView/src/dock/searchdock.h +++ b/DSView/src/dock/searchdock.h @@ -41,6 +41,7 @@ #include "../widgets/fakelineedit.h" #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/dock/triggerdock.cpp b/DSView/src/dock/triggerdock.cpp index 81542b506..501cd6232 100644 --- a/DSView/src/dock/triggerdock.cpp +++ b/DSView/src/dock/triggerdock.cpp @@ -46,7 +46,7 @@ #include "../config/appconfig.h" #include "../appcore/deviceagent.h" #include "../view/logicsignal.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../ui/msgbox.h" #include "../log.h" #include "../decode/annotationrestable.h" diff --git a/DSView/src/dock/triggerdock.h b/DSView/src/dock/triggerdock.h index 305c15436..2af49befd 100644 --- a/DSView/src/dock/triggerdock.h +++ b/DSView/src/dock/triggerdock.h @@ -41,6 +41,7 @@ #include #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/main.cpp b/DSView/src/main.cpp index 2a11fe60c..e86d00596 100644 --- a/DSView/src/main.cpp +++ b/DSView/src/main.cpp @@ -32,8 +32,8 @@ #include "config/appconfig.h" #include "config.h" #include "appcore/appcontrol.h" -#include "log.h" -#include "ui/langresource.h" +#include "log.h" +#include "uicore/langresource.h" #include #include #include diff --git a/DSView/src/prop/binding/decoderoptions.cpp b/DSView/src/prop/binding/decoderoptions.cpp index 4f6cf4986..e63b72e60 100644 --- a/DSView/src/prop/binding/decoderoptions.cpp +++ b/DSView/src/prop/binding/decoderoptions.cpp @@ -29,7 +29,7 @@ #include "../string.h" #include "../../data/decoderstack.h" #include "../../decode/decoder.h" -#include "../../ui/langresource.h" +#include "../../uicore/langresource.h" #include "../../config/appconfig.h" using namespace boost; diff --git a/DSView/src/prop/binding/deviceoptions.cpp b/DSView/src/prop/binding/deviceoptions.cpp index 49a4033b9..eb467d466 100644 --- a/DSView/src/prop/binding/deviceoptions.cpp +++ b/DSView/src/prop/binding/deviceoptions.cpp @@ -33,7 +33,7 @@ #include "../../appcore/appcontrol.h" #include "../../appcore/sigsession.h" #include "../../appcore/deviceagent.h" -#include "../../ui/langresource.h" +#include "../../uicore/langresource.h" using namespace std; using namespace dsv::appcore; diff --git a/DSView/src/prop/binding/probeoptions.cpp b/DSView/src/prop/binding/probeoptions.cpp index 85dc04917..8375658bf 100644 --- a/DSView/src/prop/binding/probeoptions.cpp +++ b/DSView/src/prop/binding/probeoptions.cpp @@ -31,7 +31,7 @@ #include "../../log.h" #include "../../appcore/appcontrol.h" #include "../../appcore/sigsession.h" -#include "../../ui/langresource.h" +#include "../../uicore/langresource.h" using namespace std; using namespace dsv::appcore; diff --git a/DSView/src/toolbars/filebar.cpp b/DSView/src/toolbars/filebar.cpp index bceaa14b7..d0d191733 100644 --- a/DSView/src/toolbars/filebar.cpp +++ b/DSView/src/toolbars/filebar.cpp @@ -28,10 +28,10 @@ #include "../ui/msgbox.h" #include "../config/appconfig.h" #include "../utility/path.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../log.h" #include "../ui/fn.h" -#include "../appcore/sigsession.h" +#include "../appcore/sigsession.h" using namespace dsv::config; diff --git a/DSView/src/toolbars/filebar.h b/DSView/src/toolbars/filebar.h index 09acd940f..4035b8062 100644 --- a/DSView/src/toolbars/filebar.h +++ b/DSView/src/toolbars/filebar.h @@ -28,6 +28,7 @@ #include #include #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/toolbars/logobar.cpp b/DSView/src/toolbars/logobar.cpp index 18f05d3df..8785368a5 100644 --- a/DSView/src/toolbars/logobar.cpp +++ b/DSView/src/toolbars/logobar.cpp @@ -41,7 +41,7 @@ #include "../dialogs/dsdialog.h" #include "../appcore/appcontrol.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../ui/msgbox.h" #include "../ui/fn.h" #include "../appcore/sigsession.h" diff --git a/DSView/src/toolbars/logobar.h b/DSView/src/toolbars/logobar.h index 9bb40270e..b6776b7c3 100644 --- a/DSView/src/toolbars/logobar.h +++ b/DSView/src/toolbars/logobar.h @@ -30,6 +30,7 @@ #include #include #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/toolbars/samplingbar.cpp b/DSView/src/toolbars/samplingbar.cpp index 1d3cdd35b..0a68aa0a2 100644 --- a/DSView/src/toolbars/samplingbar.cpp +++ b/DSView/src/toolbars/samplingbar.cpp @@ -36,7 +36,7 @@ #include "../log.h" #include "../appcore/deviceagent.h" #include "../ui/msgbox.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../view/view.h" #include "../ui/fn.h" #include "../appcore/sigsession.h" diff --git a/DSView/src/toolbars/samplingbar.h b/DSView/src/toolbars/samplingbar.h index 7e56aaed9..e33545b6c 100644 --- a/DSView/src/toolbars/samplingbar.h +++ b/DSView/src/toolbars/samplingbar.h @@ -33,6 +33,7 @@ #include #include "../ui/dscombobox.h" #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" struct st_dev_inst; class QAction; diff --git a/DSView/src/toolbars/titlebar.h b/DSView/src/toolbars/titlebar.h index 20b67116c..6824209c7 100644 --- a/DSView/src/toolbars/titlebar.h +++ b/DSView/src/toolbars/titlebar.h @@ -24,6 +24,7 @@ #include #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" class QToolButton; class QHBoxLayout; diff --git a/DSView/src/toolbars/trigbar.cpp b/DSView/src/toolbars/trigbar.cpp index 722f7714d..547c6d354 100644 --- a/DSView/src/toolbars/trigbar.cpp +++ b/DSView/src/toolbars/trigbar.cpp @@ -29,7 +29,7 @@ #include "../dialogs/mathoptions.h" #include "../view/trace.h" #include "../dialogs/applicationpardlg.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../config/appconfig.h" #include "../ui/fn.h" diff --git a/DSView/src/toolbars/trigbar.h b/DSView/src/toolbars/trigbar.h index 0758ef269..ab58cb7c2 100644 --- a/DSView/src/toolbars/trigbar.h +++ b/DSView/src/toolbars/trigbar.h @@ -28,6 +28,7 @@ #include #include #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv { namespace config{ diff --git a/DSView/src/ui/msgbox.cpp b/DSView/src/ui/msgbox.cpp index 95e995d68..a5967ad43 100644 --- a/DSView/src/ui/msgbox.cpp +++ b/DSView/src/ui/msgbox.cpp @@ -25,7 +25,7 @@ #include "../dialogs/dsmessagebox.h" #include "../basedef.h" #include "../appcore/appcontrol.h" -#include "langresource.h" +#include "../uicore/langresource.h" //QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); //QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes|QMessageBox::No); diff --git a/DSView/src/view/decodetrace.cpp b/DSView/src/view/decodetrace.cpp index 8bbc131f9..047b2083b 100644 --- a/DSView/src/view/decodetrace.cpp +++ b/DSView/src/view/decodetrace.cpp @@ -47,7 +47,7 @@ #include "../ui/msgbox.h" #include "../appcore/appcontrol.h" #include "../dialogs/decoderoptionsdlg.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../config/appconfig.h" #include "../log.h" #include "../basedef.h" diff --git a/DSView/src/view/devmode.cpp b/DSView/src/view/devmode.cpp index 541a903cb..7a58c70b5 100644 --- a/DSView/src/view/devmode.cpp +++ b/DSView/src/view/devmode.cpp @@ -32,7 +32,7 @@ #include "../config/appconfig.h" #include "../ui/msgbox.h" #include "../log.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../appcore/appcontrol.h" #include "../ui/fn.h" diff --git a/DSView/src/view/devmode.h b/DSView/src/view/devmode.h index 235ceed29..b64df43ca 100644 --- a/DSView/src/view/devmode.h +++ b/DSView/src/view/devmode.h @@ -34,6 +34,7 @@ #include #include #include "../interface/icallbacks.h" +#include "../uicore/uitypes.h" namespace dsv{ namespace appcore{ diff --git a/DSView/src/view/header.cpp b/DSView/src/view/header.cpp index 90a3111ba..4342871f7 100644 --- a/DSView/src/view/header.cpp +++ b/DSView/src/view/header.cpp @@ -41,7 +41,7 @@ #include "decodetrace.h" #include "../appcore/sigsession.h" #include "../basedef.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../appcore/appcontrol.h" #include "../config/appconfig.h" #include "../ui/fn.h" diff --git a/DSView/src/view/lissajoustrace.cpp b/DSView/src/view/lissajoustrace.cpp index c707cbcec..781adcd5c 100644 --- a/DSView/src/view/lissajoustrace.cpp +++ b/DSView/src/view/lissajoustrace.cpp @@ -26,7 +26,7 @@ #include "../basedef.h" #include "../data/dsosnapshot.h" #include "../appcore/sigsession.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" using namespace std; diff --git a/DSView/src/view/viewport.cpp b/DSView/src/view/viewport.cpp index 71267f23b..a96ca569f 100644 --- a/DSView/src/view/viewport.cpp +++ b/DSView/src/view/viewport.cpp @@ -39,8 +39,8 @@ #include "../config/appconfig.h" #include "../basedef.h" #include "../appcore/appcontrol.h" -#include "../log.h" -#include "../ui/langresource.h" +#include "../log.h" +#include "../uicore/langresource.h" #include "../ui/fn.h" #include "lissajoustrace.h" diff --git a/DSView/src/view/viewstatus.cpp b/DSView/src/view/viewstatus.cpp index 70aacfac0..0013578f5 100644 --- a/DSView/src/view/viewstatus.cpp +++ b/DSView/src/view/viewstatus.cpp @@ -32,7 +32,7 @@ #include "view.h" #include "trace.h" #include "../dialogs/dsomeasure.h" -#include "../ui/langresource.h" +#include "../uicore/langresource.h" #include "../log.h" #include "../config/appconfig.h" #include "../appcore/appcontrol.h" From 9a63adf86d9c6517acfd698a3a7a3276e58caa0d Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Thu, 27 Jul 2023 14:47:06 +0800 Subject: [PATCH 7/7] The step 4 of code refactoring for v2.0 --- DSView/src/data/decoderstack.cpp | 19 ++++++--- DSView/src/data/decoderstack.h | 3 +- libsigrokdecode4DSL/decoder.c | 8 +++- libsigrokdecode4DSL/libsigrokdecode.h | 3 +- libsigrokdecode4DSL/type_decoder.c | 55 +++++++++++++++++++++++---- 5 files changed, 71 insertions(+), 17 deletions(-) diff --git a/DSView/src/data/decoderstack.cpp b/DSView/src/data/decoderstack.cpp index 735eec45d..d79a22b77 100644 --- a/DSView/src/data/decoderstack.cpp +++ b/DSView/src/data/decoderstack.cpp @@ -47,8 +47,9 @@ const int64_t DecoderStack::DecodeChunkLength = 4 * 1024; const unsigned int DecoderStack::DecodeNotifyPeriod = 1024; DecoderStack::DecoderStack(SigSession *session, - const srd_decoder *const dec, DecoderStatus *decoder_status) : - _session(session) + const srd_decoder *dec, DecoderStatus *decoder_status) : + _session(session), + m_decoder(dec) { assert(session); assert(dec); @@ -164,10 +165,12 @@ void DecoderStack::build_row() std::map::const_iterator iter = _rows_gshow.find(row); if (iter == _rows_gshow.end()) { _rows_gshow[row] = true; + if (row.title().contains("bit", Qt::CaseInsensitive) || row.title().contains("warning", Qt::CaseInsensitive)) { _rows_lshow[row] = false; - } else { + } + else { _rows_lshow[row] = true; } } @@ -345,7 +348,6 @@ bool DecoderStack::list_annotation(dsv::decode::Annotation &ann, return false; } - bool DecoderStack::list_row_title(int row, QString &title) { for (auto i = _rows.begin();i != _rows.end(); i++) { @@ -780,6 +782,13 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *self) return; } + if (pdata->pdo->di->decoder != d->m_decoder){ + // dsv_err("ERROR:Is a invalid decoder instance.%p,%p", + // pdata->pdo->di->decoder, + // d->m_decoder); + // assert(false); + } + Annotation *a = new Annotation(pdata, d->_decoder_status); if (a == NULL){ d->_no_memory = true; @@ -790,7 +799,7 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *self) assert(pdata->pdo); assert(pdata->pdo->di); const srd_decoder *const decc = pdata->pdo->di->decoder; - assert(decc); + assert(decc); auto row_iter = d->_rows.end(); diff --git a/DSView/src/data/decoderstack.h b/DSView/src/data/decoderstack.h index 21ea9ed06..6e60ea219 100644 --- a/DSView/src/data/decoderstack.h +++ b/DSView/src/data/decoderstack.h @@ -82,7 +82,7 @@ class DecoderStack : public QObject, public SignalData public: DecoderStack(SigSession *_session, - const srd_decoder *const decoder, DecoderStatus *decoder_status); + const srd_decoder *decoder, DecoderStatus *decoder_status); public: @@ -213,6 +213,7 @@ class DecoderStack : public QObject, public SignalData bool _is_capture_end; int _progress; bool _is_decoding; + const srd_decoder *m_decoder; }; } // namespace data diff --git a/libsigrokdecode4DSL/decoder.c b/libsigrokdecode4DSL/decoder.c index aaca65c25..2e307327d 100644 --- a/libsigrokdecode4DSL/decoder.c +++ b/libsigrokdecode4DSL/decoder.c @@ -457,10 +457,14 @@ static int get_annotations(struct srd_decoder *dec) if (PyTuple_Size(py_ann) == 3) { ann_type = 0; - for (j = 0; j < strlen(annpair[0]); j++) + + for (j = 0; j < strlen(annpair[0]); j++){ ann_type = ann_type * 10 + (annpair[0][j] - '0'); + } + dec->ann_types = g_slist_append(dec->ann_types, GINT_TO_POINTER(ann_type)); - } else if (PyTuple_Size(py_ann) == 2) { + } + else if (PyTuple_Size(py_ann) == 2) { dec->ann_types = g_slist_append(dec->ann_types, GINT_TO_POINTER(ann_type)); ann_type++; } diff --git a/libsigrokdecode4DSL/libsigrokdecode.h b/libsigrokdecode4DSL/libsigrokdecode.h index 79f1d23ad..306c54e5b 100644 --- a/libsigrokdecode4DSL/libsigrokdecode.h +++ b/libsigrokdecode4DSL/libsigrokdecode.h @@ -347,7 +347,8 @@ struct srd_proto_data { }; struct srd_proto_data_annotation { int ann_class; - int ann_type; + int ann_type; + int ann_row_index; char str_number_hex[DECODE_NUM_HEX_MAX_LEN]; //numerical value hex format string long long numberic_value; char **ann_text; //text string lines diff --git a/libsigrokdecode4DSL/type_decoder.c b/libsigrokdecode4DSL/type_decoder.c index 266858403..fd2d5610f 100644 --- a/libsigrokdecode4DSL/type_decoder.c +++ b/libsigrokdecode4DSL/type_decoder.c @@ -178,17 +178,16 @@ static int py_parse_ann_data(PyObject *list_obj, char ***out_strv, int list_size @obj is the fourth param from python calls put() */ static int convert_annotation(struct srd_decoder_inst *di, PyObject *obj, - struct srd_proto_data *pdata) + struct srd_proto_data_annotation *pda) { - PyObject *py_tmp; - struct srd_proto_data_annotation *pda; + PyObject *py_tmp; int ann_class; char **ann_text; gpointer ann_type_ptr; PyGILState_STATE gstate; - int ann_size; + int ann_size; - pda = pdata->data; + assert(pda); gstate = PyGILState_Ensure(); @@ -256,6 +255,8 @@ static int convert_annotation(struct srd_decoder_inst *di, PyObject *obj, pda->ann_type = GPOINTER_TO_INT(ann_type_ptr); pda->ann_text = ann_text; + //srd_info("class:%d, type:%d", ann_class, pda->ann_type); + PyGILState_Release(gstate); return SRD_OK; @@ -458,9 +459,11 @@ static void release_meta(GVariant *gvar) g_variant_unref(gvar); } +//param list: start_sample, end_sample, output_type, [ann_class,[data]] static PyObject *Decoder_put(PyObject *self, PyObject *args) { GSList *l; + GSList *l2; PyObject *py_data, *py_res; struct srd_decoder_inst *di, *next_di; struct srd_pd_output *pdo; @@ -468,9 +471,13 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) struct srd_proto_data_annotation pda; struct srd_proto_data_binary pdb; uint64_t start_sample, end_sample; - int output_id; + int output_id; //The output type index. struct srd_pd_callback *cb; PyGILState_STATE gstate; + struct srd_decoder_annotation_row *ann_row = NULL; + gpointer ann_row_index_ptr = 0; + int row_index; + int ann_class_tmp; py_data = NULL; //the fourth param from python @@ -518,10 +525,42 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) if ((cb = srd_pd_output_callback_find(di->sess, pdo->output_type))) { pdata.data = &pda; /* Convert from PyDict to srd_proto_data_annotation. */ - if (convert_annotation(di, py_data, &pdata) != SRD_OK) { + if (convert_annotation(di, py_data, &pda) != SRD_OK) { /* An error was already logged. */ break; } + + //Get the row index. + pda.ann_row_index = -1; + row_index = 0; + + for (l = di->decoder->annotation_rows; l; l = l->next) + { + ann_row = l->data; + + for (l2 = ann_row->ann_classes; l2; l2 = l2->next) + { + ann_class_tmp = GPOINTER_TO_INT(l2->data); + + if (ann_class_tmp == pda.ann_class){ + pda.ann_row_index = row_index; + break; + } + } + row_index++; + + if (pda.ann_row_index != -1){ + break; + } + } + + if (pda.ann_row_index == -1){ + srd_err("\n\nERROR:The annotation have no row index!decoder:%s,ann-class:%d\n\n", + di->decoder->id, pda.ann_class); + release_annotation(pdata.data); + goto err; + } + Py_BEGIN_ALLOW_THREADS cb->cb(&pdata, cb->cb_data); Py_END_ALLOW_THREADS @@ -601,7 +640,7 @@ static PyObject *Decoder_put(PyObject *self, PyObject *args) } /* - return output info index + Returns the output type index */ static PyObject *Decoder_register(PyObject *self, PyObject *args, PyObject *kwargs)