[installation] Init with inital config for global

This commit is contained in:
2025-10-30 15:08:17 +01:00
commit 7640b452ed
3678 changed files with 2200095 additions and 0 deletions

View File

@ -0,0 +1,49 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef ABOUTWIDGET
#define ABOUTWIDGET
#include <QWidget>
#include <QPixmap>
#include <seiscomp/gui/core/ui_aboutwidget.h>
namespace Seiscomp {
namespace Gui {
class AboutWidget : public QWidget {
Q_OBJECT
public:
AboutWidget(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
~AboutWidget();
private:
Ui::AboutWidget _ui;
};
}
}
#endif

View File

@ -0,0 +1,384 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_APPLICATION_H
#define SEISCOMP_GUI_APPLICATION_H
#include <QApplication>
#include <QString>
#include <QRectF>
#ifndef Q_MOC_RUN
#include <seiscomp/client/application.h>
#endif
#include <seiscomp/gui/core/maps.h>
#include <seiscomp/gui/core/scheme.h>
#include <seiscomp/gui/core/messagethread.h>
#ifndef Q_MOC_RUN
#include <seiscomp/gui/core/messages.h>
#endif
#include <seiscomp/gui/core/ui_showplugins.h>
#define SCApp (Seiscomp::Gui::Application::Instance())
#define SCScheme (SCApp->scheme())
class QAbstractItemView;
class QHeaderView;
class QSplashScreen;
namespace Seiscomp {
namespace Core {
DEFINE_SMARTPOINTER(Message);
}
namespace Communication {
DEFINE_SMARTPOINTER(Connection);
}
namespace IO {
DEFINE_SMARTPOINTER(DatabaseInterface);
}
namespace Logging {
class FileOutput;
}
namespace DataModel {
DEFINE_SMARTPOINTER(DatabaseQuery);
DEFINE_SMARTPOINTER(Network);
DEFINE_SMARTPOINTER(Station);
DEFINE_SMARTPOINTER(Notifier);
DEFINE_SMARTPOINTER(Object);
}
namespace Gui {
class ConnectionDialog;
struct MessageGroups {
std::string pick;
std::string amplitude;
std::string magnitude;
std::string location;
std::string focalMechanism;
std::string event;
};
class SC_GUI_API Application : public QObject, public Client::Application {
Q_OBJECT
public:
//! Application flags
enum Flags {
//! Show splash screen on startup
SHOW_SPLASH = 0x001,
//! The application wants a database connection
WANT_DATABASE = 0x002,
//! The application wants a messaging connection
WANT_MESSAGING = 0x004,
//! The connection dialog should be opened when
//! either one of the connections that has been
//! requested with 'WANT_[SERVICE]' failed to create
OPEN_CONNECTION_DIALOG = 0x008,
//! If WANT_DATABASE is enabled and no custom settings
//! are provided in the configuration file it tries to
//! fetch the database connection from the messaging
FETCH_DATABASE = 0x010,
//! Should received notifier messages be applied or not
AUTO_APPLY_NOTIFIER = 0x020,
//! Should received notifier messages be interpreted or not
//! When this flag is not set the signals 'addObject',
//! 'removeObject' and 'updateObject' are not fired
INTERPRETE_NOTIFIER = 0x040,
LOAD_STATIONS = 0x080,
LOAD_INVENTORY = 0x100,
LOAD_CONFIGMODULE = 0x200,
DEFAULT = SHOW_SPLASH |
WANT_DATABASE |
WANT_MESSAGING |
OPEN_CONNECTION_DIALOG |
FETCH_DATABASE |
AUTO_APPLY_NOTIFIER |
INTERPRETE_NOTIFIER
};
enum Type {
//! Console application
Tty,
//! GUI client application
GuiClient
};
public:
Application(int& argc, char **argv, int flags = DEFAULT, Type type = GuiClient);
virtual ~Application();
public:
//! Returns the pointer to the application's instance.
static Application *Instance();
//! Checks if the installed Qt version is at least the
//! one passed in 'ver'
static bool minQtVersion(const char *ver);
//! Creates a CSV table into a string.
static QString createCSV(const QAbstractItemView* view,
const QHeaderView *header = nullptr);
//! Copies all selected items of specified item view to clipboard as CSV
static void copyToClipboard(const QAbstractItemView* view,
const QHeaderView *header = nullptr);
Type type() const;
Scheme &scheme();
QSettings &settings();
const QSettings &settings() const;
bool startFullScreen() const;
bool nonInteractive() const;
bool isReadOnlyMessaging() const { return _readOnlyMessaging; }
const MapsDesc &mapsDesc() const;
const MessageGroups &messageGroups() const;
Core::TimeSpan maxEventAge() const;
QColor configGetColor(const std::string& query, const QColor& base) const;
Gradient configGetColorGradient(const std::string& query, const Gradient& base) const;
QFont configGetFont(const std::string& query, const QFont& base) const;
QPen configGetPen(const std::string& query, const QPen& base) const;
QBrush configGetBrush(const std::string& query, const QBrush& base) const;
void configSetColorGradient(const std::string& query, const Gradient &gradient);
void setFilterCommandsEnabled(bool);
const std::string &commandTarget() const;
void sendCommand(Command command, const std::string& parameter);
void sendCommand(Command command, const std::string& parameter, Core::BaseObject*);
//! Sets the mainwidget which is used as hint to close the
//! splashscreen when the widget is shown
void setMainWidget(QWidget*);
void showMessage(const char*) override;
void showWarning(const char*) override;
bool notify(QObject *receiver, QEvent *e);
bool sendMessage(Seiscomp::Core::Message* msg);
bool sendMessage(const char* group, Seiscomp::Core::Message* msg);
//! This method allows to emit notifier locally. They are not being sent over
//! the messaging but interpreted and signalled to other local components.
void emitNotifier(Seiscomp::DataModel::Notifier* n);
QFont font() const;
void setFont(const QFont &font);
QPalette palette() const;
void setPalette(const QPalette &pal);
protected:
bool init() override;
bool run() override;
void done() override;
void exit(int returnCode) override;
bool initConfiguration() override;
bool initSubscriptions() override;
void schemaValidationNames(std::vector<std::string> &modules,
std::vector<std::string> &plugins) const override;
bool validateParameters() override;
bool handleInitializationError(int) override;
void handleInterrupt(int) throw() override;
virtual QString splashImagePath() const;
signals:
void changedConnection();
void changedDatabase();
void connectionEstablished();
void connectionLost();
void showNotification(NotificationLevel level, QString message);
void messageSkipped(Seiscomp::Client::Packet*);
void messageAvailable(Seiscomp::Core::Message*, Seiscomp::Client::Packet*);
void notifierAvailable(Seiscomp::DataModel::Notifier*);
void addObject(const QString &parentID, Seiscomp::DataModel::Object*);
void removeObject(const QString &parentID, Seiscomp::DataModel::Object*);
void updateObject(const QString &parentID, Seiscomp::DataModel::Object*);
public slots:
void showSettings();
void quit();
private slots:
void createConnection(QString host, QString user, QString group,
int TimeOut, QString peerCertificate);
void destroyConnection();
void databaseChanged();
void messagesAvailable();
void onConnectionEstablished();
void onConnectionLost();
void connectionError(int code);
void objectDestroyed(QObject*);
void closedLastWindow();
void showAbout();
void showHelpIndex();
void showAppHelp();
void showPlugins();
void timerSOH();
void handleSignalNotification();
private:
void startMessageThread();
void closeMessageThread();
void createSettingsDialog();
ConnectionDialog *cdlg();
private:
static Application *_instance;
protected:
struct _GUI_Core_Settings : System::Application::AbstractSettings {
bool fullScreen{false};
bool interactive{true};
std::string guiGroup{"GUI"};
std::string commandTargetClient;
struct _MapsDesc : MapsDesc {
_MapsDesc();
QString format;
void accept(SettingsLinker &linker);
} mapsDesc;
void accept(SettingsLinker &linker);
} _settings;
QApplication *_app;
Type _type;
Scheme *_scheme;
mutable QSettings *_qSettings;
QTimer _timerSOH;
bool _readOnlyMessaging;
Core::TimeSpan _eventTimeAgo;
MessageGroups _messageGroups;
QWidget *_mainWidget;
QSplashScreen *_splash;
ConnectionDialog *_dlgConnection;
bool _settingsOpened;
bool _filterCommands;
MessageThread *_thread;
int _flags;
QSocketNotifier *_signalNotifier;
int _signalSocketFd[2];
};
template <typename T>
class Kicker : public Application {
public:
Kicker(int& argc, char **argv, int flags = DEFAULT)
: Application(argc, argv, flags) {}
protected:
virtual void setupUi(T*) {}
virtual bool initUi(T*) { return true; }
virtual bool run() {
showMessage("Setup user interface");
T* w = new T;
if ( !initUi(w) ) {
showMessage("Kicker initialization failed, abort");
delete w;
return false;
}
setupUi(w);
setMainWidget(w);
if ( startFullScreen() )
w->showFullScreen();
else
w->showNormal();
return Application::run();
}
};
}
}
#endif

View File

@ -0,0 +1,133 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CONNECTIONDIALOG_H
#define SEISCOMP_GUI_CONNECTIONDIALOG_H
#include <seiscomp/gui/core/ui_connectiondialog.h>
#include <seiscomp/gui/qt.h>
#ifndef Q_MOC_RUN
#include <seiscomp/io/database.h>
#include <seiscomp/messaging/connection.h>
#endif
#include <QDialog>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API ConnectionDialog : public QDialog {
Q_OBJECT
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
ConnectionDialog(Seiscomp::Client::ConnectionPtr*,
Seiscomp::IO::DatabaseInterfacePtr*,
QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
~ConnectionDialog();
public:
void setUsername(const QString& username);
void setClientParameters(const QString& server,
const QString& username,
const QString& primaryGroup,
const QStringList& groups,
int timeout,
const QString &peerCertificate);
bool setMessagingEnabled(bool);
bool setDatabaseParameters(const QString &uri);
bool setDatabaseParameters(const QString &type, const QString &connection);
bool setDefaultDatabaseParameters(const QString &uri);
bool setDefaultDatabaseParameters(const QString &type, const QString &connection);
std::string databaseURI() const;
bool connectToMessaging();
bool connectToDatabase();
bool hasConnectionChanged() const;
bool hasDatabaseChanged() const;
// ------------------------------------------------------------------
// Public signals
// ------------------------------------------------------------------
signals:
void aboutToConnect(QString host, QString user, QString group,
int timeout, QString peerCertificate);
void aboutToDisconnect();
void databaseChanged();
// ------------------------------------------------------------------
// Public slots
// ------------------------------------------------------------------
public slots:
void onConnectionError(int code);
int exec();
// ------------------------------------------------------------------
// Protected slots
// ------------------------------------------------------------------
protected slots:
void onConnect();
void onSwitchToReported();
void onDatabaseConnect();
void onItemChanged(QListWidgetItem *item);
void onSelectAll();
void onDeselectAll();
void onPeerCertificateOpen();
// ------------------------------------------------------------------
// Members
// ------------------------------------------------------------------
private:
::Ui::ConnectionDialog _ui;
Seiscomp::Client::ConnectionPtr* _connection;
Seiscomp::IO::DatabaseInterfacePtr* _db;
QStringList _requestedGroups;
bool _requestAllGroups;
bool _messagingEnabled;
bool _changedDatabase;
bool _changedConnection;
QString _reportedDbType;
QString _reportedDbParameters;
};
}
}
#endif

View File

@ -0,0 +1,67 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CONNECTIONSTATELABEL_H
#define SEISCOMP_GUI_CONNECTIONSTATELABEL_H
#include <seiscomp/gui/qt.h>
#include <QLabel>
#include <QPixmap>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API ConnectionStateLabel : public QLabel {
Q_OBJECT
public:
ConnectionStateLabel(QWidget *parent = nullptr, Qt::WindowFlags f = {});
void setPixmaps(const QPixmap &connected, const QPixmap &disconnected);
public slots:
void start(const QString &source);
void stop();
signals:
void customInfoWidgetRequested(const QPoint &pos);
protected:
void mousePressEvent(QMouseEvent *event);
QPixmap _connected;
QPixmap _disconnected;
};
}
}
#endif

View File

@ -0,0 +1,384 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_DIAGRAMWIDGET_H
#define SEISCOMP_GUI_DIAGRAMWIDGET_H
#include <QWidget>
#include <QMenu>
#include <QLabel>
#include <QDialog>
#include <QVector>
#include <QPointF>
#include <QPen>
#include <seiscomp/gui/core/gradient.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API DiagramWidget : public QWidget {
Q_OBJECT
// ------------------------------------------------------------------
// Enumerations
// ------------------------------------------------------------------
public:
enum Type {
Rectangular,
Spherical
};
enum SymbolType {
Circle,
Triangle,
TriangleUpsideDown,
Rectangle,
Diamond
};
enum SelectionMode {
SelectActiveState,
SelectEnableState
};
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
DiagramWidget(QWidget * parent = 0, Type type = Rectangular, Qt::WindowFlags f = Qt::WindowFlags());
~DiagramWidget();
// ------------------------------------------------------------------
// Qt event overrides
// ------------------------------------------------------------------
protected:
void resizeEvent(QResizeEvent *event);
void paintEvent(QPaintEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
// ------------------------------------------------------------------
// Signals
// ------------------------------------------------------------------
signals:
void hover(int id);
void clicked(int id);
void valueActivated(int id);
void valueDeactivated(int id);
void valueActiveStateChanged(int id, bool state);
void valueEnabled(int id);
void valueDisabled(int id);
void valueEnableStateChanged(int id, bool state);
void beginSelection();
void endSelection();
void adjustZoomRect(QRectF& zoomRect);
// ------------------------------------------------------------------
// Interface
// ------------------------------------------------------------------
public:
void setType(Type);
void setColumnCount(int);
int columnCount() const;
void setBackgroundColor(const QColor& c);
void setErrorBarPens(const QPen &penError, const QPen &penDefaultError);
void setMargin(int margin);
void setMarkerDistance(double xDist, double yDist);
void setMarkerDistance(QPointF distances);
void setIndicies(int x, int y);
void setAbscissaName(const QString&);
void setOrdinateName(const QString&);
void setValueDisabledColor(const QColor&);
void setDisabledValuesHidden(bool);
void setDrawGridLines(bool);
void clear();
int count() const;
bool isEmpty() const;
void addValue(qreal abzisse, qreal ordinate);
void addValue(const QPointF& point);
void addValue(const QPointF& point, const QColor& color);
void addValue(int x, int y, qreal abzisse, qreal ordinate);
void addValue(int x, int y, const QPointF& point);
void addValue(int x, int y, const QPointF& point, const QColor& color);
QPointF value(int id) const;
float value(int id, int x) const { return _values[id].cols[x].value; }
void setDisplayRect(const QRectF& rect);
QRectF displayRect() const;
QRectF boundingRect() const;
const QRect &diagramRect() const { return _diagramArea; }
QVector<int> getValues(const QRectF& rect) const;
QVector<int> getSelectedValues() const;
QRectF getSelectedValuesRect() const;
void selectValues(const QRectF& targetRect);
void setValue(int id, int x, qreal v, qreal lowerError = -1, qreal upperError = -1,
bool defaultError = false);
void setValue(int id, const QPointF& p);
void setValue(int id, int x, int y, const QPointF& p);
void setValueColor(int id, const QColor& c);
void setValueColor(int id, int x, const QColor& c);
void setValueValid(int id, int x, bool valid);
void setValueSymbol(int id, SymbolType type);
void setValueSelected(int id, bool selected);
void setValueEnabled(int id, bool enabled);
bool isValueValid(int id, int x) const;
bool isValueSelected(int id) const;
bool isValueEnabled(int id) const;
bool isValueShown(int id) const;
void showValue(int id, bool = true);
void hideValue(int id, bool = true);
void updateBoundingRect();
int hoveredValue() const { return _hoverId; }
public slots:
void setDrawErrorBars(bool);
// ------------------------------------------------------------------
// Protected interface
// ------------------------------------------------------------------
protected:
virtual void updateContextMenu(QMenu &menu);
virtual void handleContextMenuAction(QAction *action);
virtual void diagramAreaUpdated(const QRect &);
virtual void paintSphericalBackground(QPainter &);
virtual void drawValues(QPainter &painter);
virtual void drawValue(int id, QPainter& painter, const QPointF& p,
SymbolType type, bool valid) const;
// ------------------------------------------------------------------
// Implementation
// ------------------------------------------------------------------
private slots:
void zoomIntoSelectedValues();
void resetZoom();
void selectActiveState();
void selectEnableState();
private:
QPointF projectRectangular(const QPointF& p) const;
QPointF unProjectRectangular(const QPointF& p) const;
QPointF projectSpherical(const QPointF& p) const;
QPointF unProjectSpherical(const QPointF& p) const;
bool containsRectangular(const QRectF&, const QPointF&) const;
bool containsSpherical(const QRectF&, const QPointF&) const;
void updateBoundingRect(const QPointF& p);
void changeState(int id, bool state);
void toggleState(int id);
void restoreState(int id);
void paintRectangular(QPainter &painter);
void paintSpherical(QPainter &painter);
void clipRectRectangular(QRectF &rect);
void clipRectSpherical(QRectF &rect);
void adjustZoomRectangular(QRectF& zoomRect);
void adjustZoomSpherical(QRectF& zoomRect);
void drawAbscissa(QPainter& painter, int y, bool drawMarker, bool topAligned);
void drawOrdinate(QPainter& painter, int x, int abzisseHeight, qreal abzisseValue, bool leftAligned);
void drawHText(QPainter& painter, int x, int y, qreal value, Qt::Alignment al, bool topAligned) const;
void drawVText(QPainter& painter, int x, int y, qreal value, Qt::Alignment al, bool leftAligned) const;
int findValue(const QPoint& p) const;
void checkSelection(int id);
void updateSelection();
void saveStates();
void updateDiagramArea();
// ------------------------------------------------------------------
// Members
// ------------------------------------------------------------------
protected:
typedef QPointF (DiagramWidget::*ProjectFunc)(const QPointF&) const;
typedef QPointF (DiagramWidget::*UnProjectFunc)(const QPointF&) const;
typedef bool (DiagramWidget::*ContainsFunc)(const QRectF&, const QPointF&) const;
typedef void (DiagramWidget::*AdjustZoomFunc)(QRectF&);
struct ValueItem {
ValueItem() : type(Circle) {}
ValueItem(int nc, int x, int y, const QPointF& p_, bool active)
: isActive(active), isEnabled(true), isVisible(true), type(Circle) {
saveActiveState = isActive;
saveEnableState = isEnabled;
cols.resize(nc); cols[x].value = p_.x(); cols[y].value = p_.y();
}
ValueItem(int nc, int x, int y, const QPointF& p_, bool active, const QColor& c_)
: isActive(active), isEnabled(true), isVisible(true), type(Circle) {
saveActiveState = isActive;
saveEnableState = isEnabled;
cols.resize(nc); cols[x].value = p_.x(); cols[y].value = p_.y(); cols[y].color = c_;
}
void setColumns(int nc) { cols.resize(nc); }
QPointF pt(int x, int y) const { return QPointF(cols[x].value, cols[y].value); }
void setPt(int x, int y, const QPointF& p_) {
cols[x].value = p_.x(); cols[x].lowerError = -1; cols[x].upperError = -1;
cols[y].value = p_.y(); cols[y].lowerError = -1; cols[y].upperError = -1;
}
float ptx(int x) const { return cols[x].value; }
bool valid(int x, int y) const { return cols[x].valid && cols[y].valid; }
struct ColumnValueItem {
float value;
float lowerError{-1}, upperError{-1};
bool defaultError{false};
QColor color;
bool valid{true};
};
QVector<ColumnValueItem> cols;
bool isActive;
bool isEnabled;
bool isVisible;
bool saveActiveState;
bool saveEnableState;
SymbolType type;
};
enum RubberBandOperation {
Select,
SelectPlus,
SelectMinus
};
QString _nameX;
QString _nameY;
SelectionMode _mode;
Type _type;
QColor _disabledColor;
QColor _background;
QPen _penErrorBar;
QPen _penDefaultErrorBar;
ProjectFunc project;
UnProjectFunc unProject;
ContainsFunc contains;
AdjustZoomFunc adjustZoom;
QRect _clientArea;
QRect _diagramArea;
QPointF _markerDistance;
QVector<ValueItem> _values;
QVector<int> _selected;
QRectF _boundingRect;
QRectF _displayRect;
QRectF _requestRect;
int _columns;
int _xIndex;
int _yIndex;
int _horMargin, _verMargin; // horizintal/vertical margins
int _tickLength, _tickLengthA; // unannotated/annotated tick length
int _annotOffset;
int _textHeight;
QRectF _rubberBand;
RubberBandOperation _rubberBandOperation;
bool _hideDisabledValues;
bool _drawGridLines;
bool _drawErrorBars;
QPointF _draggingStart;
bool _dragStart;
bool _dragZoom;
bool _dragging;
bool _selecting;
bool _indicesChanged;
int _hoverId;
QAction* _zoomAction;
QAction* _resetAction;
QAction* _toggleUncertainties;
QAction* _actionActivate;
QAction* _actionEnable;
};
}
}
#endif

View File

@ -0,0 +1,94 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_FLOWLAYOUT_H
#define SEISCOMP_GUI_FLOWLAYOUT_H
#include <seiscomp/gui/qt.h>
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
#include <QStyle>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API FlowLayout : public QLayout {
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
FlowLayout(QWidget *parent, int margin = -1, int hSpacing = -1, int vSpacing = -1);
FlowLayout(int margin = -1, int hSpacing = -1, int vSpacing = -1);
~FlowLayout();
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
int horizontalSpacing() const;
int verticalSpacing() const;
// ------------------------------------------------------------------
// QLayout interface
// ------------------------------------------------------------------
public:
void addItem(QLayoutItem *item) override;
Qt::Orientations expandingDirections() const override;
bool hasHeightForWidth() const override;
int heightForWidth(int) const override;
int count() const override;
QLayoutItem *itemAt(int index) const override;
QSize minimumSize() const override;
void setGeometry(const QRect &rect) override;
QSize sizeHint() const override;
QLayoutItem *takeAt(int index) override;
// ------------------------------------------------------------------
// Protected interface
// ------------------------------------------------------------------
protected:
virtual int doLayout(const QRect &rect, bool testOnly) const;
// ------------------------------------------------------------------
// Private members
// ------------------------------------------------------------------
int smartSpacing(QStyle::PixelMetric pm) const;
protected:
QVector<QLayoutItem *> _itemList;
int _hSpace;
int _vSpace;
};
}
}
#endif

View File

@ -0,0 +1,59 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_GRADIENT_H
#define SEISCOMP_GUI_CORE_GRADIENT_H
#include <seiscomp/gui/qt.h>
#include <QColor>
#include <QMap>
#include <QPair>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API Gradient : public QMap<qreal, QPair<QColor, QString> > {
public:
typedef QPair<QColor, QString> ValueType;
public:
Gradient();
public:
//! Sets the color and text at a specified position
void setColorAt(qreal position, const QColor &color,
const QString& text = "");
//! Returns the color at position. If position falls between
//! two color positions, the resulting color will be
//! interpolated linearly between both colors. When the discrete flag
//! is set, the interpolation will be disabled
QColor colorAt(qreal position, bool discrete = false) const;
};
}
}
# endif

View File

@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_INFOTEXT_H
#define SEISCOMP_GUI_INFOTEXT_H
#include <seiscomp/gui/core/ui_infotext.h>
#include <seiscomp/gui/qt.h>
#include <QDialog>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API InfoText : public QDialog {
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
InfoText(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
~InfoText();
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
void setText(const QString& text);
void appendText(const QString& text);
void setReadOnly(bool readOnly);
bool isReadOnly() const;
// ------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------
private:
Ui::InfoText _ui;
};
}
}
#endif

View File

@ -0,0 +1,90 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SC_GUI_INSPECTOR_H
#define SC_GUI_INSPECTOR_H
#include <QTreeWidget>
#include <QTableWidget>
#include <QTimer>
#include <QStack>
#include <seiscomp/gui/core/ui_inspector.h>
#ifndef Q_MOC_RUN
#include <seiscomp/core/baseobject.h>
#endif
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API Inspector : public QWidget {
Q_OBJECT
public:
Inspector(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
~Inspector();
public:
void setObject(Core::BaseObject *obj);
void selectObject(Core::BaseObject *obj);
private:
void addObject(QTreeWidgetItem *parent);
void addProperty(const std::string &name, const std::string &type,
const std::string &value, bool isIndex = false,
bool isOptional = false, bool isReference = false);
void selectObject(QTreeWidgetItem *parent, Core::BaseObject *obj);
bool filterTree(QTreeWidgetItem *parent, const std::string &type,
const std::string &attr, const std::string &value,
QTreeWidgetItem **firstMatch,
bool parentMatch = false);
private slots:
void selectionChanged();
void filterChanged(QString);
void applyFilter();
void linkClicked(QString);
void back();
private:
typedef QPair<Core::BaseObject*, Core::BaseObject*> State;
Core::BaseObject *_object;
Core::BaseObject *_currentSelection;
Ui::Inspector _ui;
QStack<State> _history;
QTimer _filterTimer;
};
}
}
#endif

View File

@ -0,0 +1,41 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_LOCATOR_H
#define SEISCOMP_GUI_LOCATOR_H
#include <seiscomp/gui/qt.h>
#include <seiscomp/seismology/locatorinterface.h>
namespace Seiscomp {
namespace Gui {
DataModel::Origin* relocate(Seismology::LocatorInterface *loc, DataModel::Origin* origin);
}
}
#endif

View File

@ -0,0 +1,137 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_MAINWINDOW_H
#define SEISCOMP_GUI_MAINWINDOW_H
#ifndef Q_MOC_RUN
#include <seiscomp/core/baseobject.h>
#endif
#include <seiscomp/gui/core/connectionstatelabel.h>
#include <seiscomp/gui/core/messages.h>
#include <QMainWindow>
namespace Seiscomp {
namespace Core {
DEFINE_SMARTPOINTER(Message);
}
namespace Client {
DEFINE_SMARTPOINTER(Connection);
DEFINE_SMARTPOINTER(Packet);
}
namespace IO {
DEFINE_SMARTPOINTER(DatabaseInterface);
}
namespace Logging {
class FileOutput;
}
namespace DataModel {
DEFINE_SMARTPOINTER(DatabaseQuery);
DEFINE_SMARTPOINTER(Network);
DEFINE_SMARTPOINTER(Station);
DEFINE_SMARTPOINTER(Notifier);
DEFINE_SMARTPOINTER(Object);
}
namespace Gui {
class SC_GUI_API MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget * parent = 0, Qt::WindowFlags = Qt::WindowFlags());
~MainWindow();
public:
bool restoreGeometry(const QByteArray & geometry);
protected:
void paintEvent(QPaintEvent *e);
void showEvent(QShowEvent*);
void dropEvent(QDropEvent *);
void dragEnterEvent(QDragEnterEvent *);
virtual void toggledFullScreen(bool);
signals:
void fullScreenToggled(bool);
public slots:
void showNormal();
void showFullScreen();
void setTitle(QString);
QString title() const;
private slots:
void onChangedConnection();
void toggleFullScreen();
void connectionEstablished();
void connectionLost();
void inspectConfig();
void inspectInventory();
void showNotification(NotificationLevel level, QString message);
protected:
QAction* _actionToggleFullScreen;
QAction* _actionShowSettings;
private:
QMenuBar *_menuBar;
QWidget *_menuWidget;
ConnectionStateLabel *_connectionState;
QString _title;
bool _showFullscreen;
};
}
}
#endif

View File

@ -0,0 +1,65 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_MAPS_H
#define SEISCOMP_GUI_MAPS_H
#include <seiscomp/gui/qt.h>
#include <QString>
namespace Seiscomp {
namespace Gui {
/**
* ----------------------------------------------------------------------------
* TileStore version history
* ----------------------------------------------------------------------------
* 1
* - Initial version
* 2
* - Allow TileStore::load to return null images
* 3
* - Do not inherit from MapTree and remove MapTreeNode completely
* - Add maxLevel query
* - Replace TextureID with Tile
* - All parameters with type MapTreeNode are replaced by parameters
* with type Tile
* 4 - Add two new methods to notify about asynchronous tile loading
* success and cancellation
*/
#define TILESTORE_VERSION 4
struct SC_GUI_API MapsDesc {
QString location;
QString type;
bool isMercatorProjected;
size_t cacheSize;
};
}
}
#endif

View File

@ -0,0 +1,126 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_MESSAGE_H
#define SEISCOMP_GUI_MESSAGE_H
#ifndef Q_MOC_RUN
#include <seiscomp/core/message.h>
#include <seiscomp/core/enumeration.h>
#endif
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
MAKEENUM(
Command,
EVALUES(
CM_UNDEFINED,
CM_SHOW_ORIGIN,
CM_SHOW_STREAMS,
CM_SHOW_MAGNITUDE,
CM_OBSERVE_LOCATION,
CM_SHOW_NOTIFICATION
),
ENAMES(
"undefined",
"show origin",
"show streams",
"show magnitude",
"observe location",
"show notification"
)
);
MAKEENUM(
NotificationLevel,
EVALUES(
NL_UNDEFINED,
NL_INFO,
NL_WARNING,
NL_CRITICAL,
NL_FAILURE
),
ENAMES(
"undefined",
"info",
"warning",
"critical",
"failure"
)
);
DEFINE_SMARTPOINTER(CommandMessage);
class SC_GUI_API CommandMessage : public Seiscomp::Core::Message {
DECLARE_SC_CLASS(CommandMessage);
DECLARE_SERIALIZATION;
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
private:
CommandMessage();
CommandMessage(const std::string client, Command command);
// ------------------------------------------------------------------
// Message interface
// ------------------------------------------------------------------
public:
void setParameter(const std::string&);
void setObject(Core::BaseObject*);
const std::string& client() const;
Command command() const;
const std::string& parameter() const;
Core::BaseObject* object() const;
bool empty() const;
// ------------------------------------------------------------------
// Implementation
// ------------------------------------------------------------------
private:
std::string _client;
Command _command;
std::string _parameter;
Core::BaseObjectPtr _object;
DECLARE_SC_CLASSFACTORY_FRIEND(CommandMessage);
friend class Application;
};
}
}
#endif

View File

@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_MESSAGETHREAD_H
#define SEISCOMP_GUI_MESSAGETHREAD_H
#ifndef Q_MOC_RUN
#include <seiscomp/gui/qt.h>
#include <seiscomp/messaging/connection.h>
#endif
#include <QtGui>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API MessageThread : public QThread {
Q_OBJECT
public:
MessageThread(Seiscomp::Client::Connection *c);
~MessageThread();
void run();
Seiscomp::Client::Connection *connection() const;
void setReconnectOnErrorEnabled(bool e);
signals:
void messagesAvailable();
void connectionLost();
void connectionEstablished();
void connectionError(int code);
private:
bool _reconnectOnError;
Seiscomp::Client::Connection *_connection;
};
}
}
#endif

View File

@ -0,0 +1,65 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_OPTIONALDOUBLESPINBOX_H
#define SEISCOMP_GUI_OPTIONALDOUBLESPINBOX_H
#include <seiscomp/gui/qt.h>
#include <QDoubleSpinBox>
class QToolButton;
namespace Seiscomp {
namespace Gui {
class SC_GUI_API OptionalDoubleSpinBox : public QDoubleSpinBox {
Q_OBJECT
public:
OptionalDoubleSpinBox(QWidget *parent = 0);
public:
/**
* @brief Returns whether the value is valid or not. A valid value
* is larger than the defined minimum of the value range.
* @return Flag indicating validity
*/
bool isValid() const;
private slots:
void resetContent();
void changedContent();
private:
QToolButton *_resetButton;
int _spacing;
};
}
}
#endif

View File

@ -0,0 +1,79 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_QUESTIONBOX_H
#define SEISCOMP_GUI_QUESTIONBOX_H
#include <seiscomp/gui/core/ui_questionbox.h>
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API QuestionBox {
// ------------------------------------------------------------------
// X'truction
// ------------------------------------------------------------------
public:
QuestionBox(QWidget* parent = 0, Qt::WindowFlags = Qt::WindowFlags());
~QuestionBox();
// ------------------------------------------------------------------
// Public interface
// ------------------------------------------------------------------
public:
void setText(const QString& text);
QString text() const;
void setInfo(const QString& text);
QString info() const;
// ------------------------------------------------------------------
// Reimplemented derived interface
// ------------------------------------------------------------------
public:
int exec();
// ------------------------------------------------------------------
// Attributes
// ------------------------------------------------------------------
private:
QWidget* _parent;
Qt::WindowFlags _flags;
QString _text;
QString _info;
bool _show;
int _lastResult;
};
}
}
#endif

View File

@ -0,0 +1,195 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_RECORDPOLYLINE_H
#define SEISCOMP_GUI_RECORDPOLYLINE_H
#include <QPen>
#include <QPolygon>
#include <QPainter>
#include <QVector>
#ifndef Q_MOC_RUN
#include <seiscomp/core/record.h>
#include <seiscomp/core/typedarray.h>
#include <seiscomp/core/recordsequence.h>
#endif
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
DEFINE_SMARTPOINTER(AbstractRecordPolyline);
class SC_GUI_API AbstractRecordPolyline : public Seiscomp::Core::BaseObject {
public:
virtual void draw(QPainter &) = 0;
virtual void drawGaps(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) = 0;
virtual void draw(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) = 0;
virtual bool isEmpty() const = 0;
qreal baseline() const;
protected:
qreal _baseline;
};
DEFINE_SMARTPOINTER(RecordPolyline);
class SC_GUI_API RecordPolyline : public AbstractRecordPolyline,
public QVector<QPolygon> {
public:
RecordPolyline();
public:
//! creates the record polyline and returns the virtual height
//! of that polyline
void create(Record const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
bool optimization = true);
//! creates the record polyline and returns the virtual height
//! of that polyline
void create(RecordSequence const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
QVector<QPair<int,int> >* gaps = nullptr,
bool optimization = true);
void create(RecordSequence const *,
const Core::Time &start,
const Core::Time &end,
double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
QVector<QPair<int,int> >* gaps = nullptr,
bool optimization = true);
void createStepFunction(RecordSequence const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float multiplier = 1.0);
void createSteps(RecordSequence const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, QVector<QPair<int,int> >* gaps = nullptr);
void createSteps(RecordSequence const *,
const Core::Time &start,
const Core::Time &end,
double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, QVector<QPair<int,int> >* gaps = nullptr);
// Returns the number of points
int points() const;
public:
void draw(QPainter&) override;
void drawGaps(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) override;
void draw(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) override;
bool isEmpty() const override { return QVector<QPolygon>::isEmpty(); }
private:
template <typename T>
void pushRecord(QPolygon *&poly, const T *data, int count,
bool merge,
double yscl, double amplOffset,
bool optimization,
int x0, double sampleWidth,
int &collapsedSamples,
int &y_min, int &y_max,
int &x_out, int &y_out,
int &x_pos, int &y_pos);
};
DEFINE_SMARTPOINTER(RecordPolylineF);
class SC_GUI_API RecordPolylineF : public AbstractRecordPolyline,
public QVector<QPolygonF> {
public:
RecordPolylineF();
public:
//! creates the record polyline and returns the virtual height
//! of that polyline
void create(Record const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
bool optimization = true);
//! creates the record polyline and returns the virtual height
//! of that polyline
void create(RecordSequence const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
QVector<QPair<qreal,qreal> >* gaps = nullptr,
bool optimization = true);
void create(RecordSequence const *,
const Core::Time &start,
const Core::Time &end,
double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, float *timingQuality = nullptr,
QVector<QPair<qreal,qreal> >* gaps = nullptr,
bool optimization = true);
// Returns the number of points
int points() const;
public:
void draw(QPainter &) override;
void drawGaps(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) override;
void draw(QPainter &, int yofs, int height, const QBrush &gapBrush, const QBrush &overlapBrush) override;
bool isEmpty() const override { return QVector<QPolygonF>::isEmpty(); }
private:
template <typename T>
void pushRecord(QPolygonF *&poly, const T *data, int count,
bool merge,
double yscl, double amplOffset,
bool optimization,
qreal x0, double sampleWidth,
int &collapsedSamples,
qreal &y_min, qreal &y_max,
qreal &x_out, qreal &y_out,
qreal &x_pos, qreal &y_pos);
};
inline qreal AbstractRecordPolyline::baseline() const {
return _baseline;
}
}
}
# endif

View File

@ -0,0 +1,165 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_SLCONNECTION_H
#define SEISCOMP_GUI_SLCONNECTION_H
#include <string>
#include <QThread>
#include <QtCore>
#ifndef Q_MOC_RUN
#include <seiscomp/core/record.h>
#include <seiscomp/io/recordinput.h>
#endif
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
//! \brief This class provides a thread to receive records from
//! \brief a stream source.
class SC_GUI_API RecordStreamThread : public QThread {
Q_OBJECT
public:
RecordStreamThread(const std::string& recordStreamURL);
~RecordStreamThread();
public:
bool connect();
void setStartTime(const Seiscomp::Core::Time&);
void setEndTime(const Seiscomp::Core::Time&);
void setTimeWindow(const Seiscomp::Core::TimeWindow&);
bool setTimeout(int seconds);
bool addStation(const std::string& network, const std::string& station);
// Needs to be called after connect()
bool addStream(const std::string& network, const std::string& station,
const std::string& location, const std::string& channel);
// Needs to be called after connect()
bool addStream(const std::string& network, const std::string& station,
const std::string& location, const std::string& channel,
const Seiscomp::Core::Time &stime, const Seiscomp::Core::Time &etime);
// Needs to be called after connect()
bool addStream(const std::string& network, const std::string& station,
const std::string& location, const std::string& channel,
double gain);
void stop(bool waitForTermination);
//! Returns the used stream URL
const std::string& recordStreamURL() const;
//! Returns the array data type this record stream thread is
//! configured to use (default: Array::FLOAT).
Array::DataType dataType() const;
//! Set the array data type this record stream thread should
//! use (default: Array::FLOAT). NOTE: The data type must be
//! set before calling run() to have any impact.
void setDataType(Array::DataType dataType);
//! Returns the array data type this record stream thread is
//! configured to use (default: Array::FLOAT).
Record::Hint recordHint() const;
//! Set the record save hint (default: Record::DATA_ONLY).
//! NOTE: The hint must be set before calling run() to have any impact.
void setRecordHint(Record::Hint hint);
//! Returns the current recordthread ID
int ID() const;
signals:
//! This signal will be fired whenever a new record has been
//! read from the stream source. The receiver has to take care
//! to store the record inside a RecordPtr to prevent memory leaks.
//! The RecordStreamThread does not destroy any objects read from
//! the stream source.
void receivedRecord(Seiscomp::Record*);
//! This signal will be fired if an error occurs.
void handleError(const QString &);
protected:
void run();
private:
typedef std::map<std::string, double> GainMap;
int _id;
std::string _recordStreamURL;
bool _requestedClose;
bool _readingStreams;
Seiscomp::IO::RecordStreamPtr _recordStream;
QMutex _mutex;
static int _numberOfThreads;
GainMap _gainMap;
Array::DataType _dataType;
Record::Hint _recordHint;
};
class SC_GUI_API RecordStreamState : public QObject {
Q_OBJECT
protected:
RecordStreamState();
public:
static RecordStreamState& Instance();
int connectionCount() const;
QList<RecordStreamThread*> connections() const;
private:
void openedConnection(RecordStreamThread*);
void closedConnection(RecordStreamThread*);
signals:
void connectionEstablished(RecordStreamThread*);
void connectionClosed(RecordStreamThread*);
void firstConnectionEstablished();
void lastConnectionClosed();
private:
static RecordStreamState _instance;
int _connectionCount;
QList<RecordStreamThread*> _activeThreads;
friend class RecordStreamThread;
};
} // namespace Gui
} // namespace Seiscomp
#endif

View File

@ -0,0 +1,675 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_RECORDVIEW_H
#define SEISCOMP_GUI_RECORDVIEW_H
#ifndef Q_MOC_RUN
#include <seiscomp/gui/core/recordviewitem.h>
#include <seiscomp/gui/core/timescale.h>
#include <seiscomp/math/filter.h>
#endif
#include <QScrollArea>
#include <QTimer>
#include <QSet>
namespace Seiscomp {
namespace DataModel {
SC_GUI_API
bool operator<(const Seiscomp::DataModel::WaveformStreamID& left,
const Seiscomp::DataModel::WaveformStreamID& right);
}
}
namespace Seiscomp {
class RecordSequence;
namespace Gui {
class TimeScale;
class RecordStreamThread;
class SC_GUI_API RecordView : public QWidget {
Q_OBJECT
public:
enum SelectionMode {
NoSelection = 0,
SingleSelection,
ExtendedSelection
};
enum SelectionOperationFlag {
SelectNone = 0x00,
Select = 0x01,
SelectPlus = 0x02,
SelectMinus = 0x04,
SelectAll = Select | SelectPlus | SelectMinus
};
Q_DECLARE_FLAGS(SelectionOperation, SelectionOperationFlag)
public:
//! Default c'tor
//! The mode defaults to ringbuffer with a buffer
//! size of 30 minutes
RecordView(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(),
TimeScale *timeScale = 0);
//! Creates a RecordView using a time window
RecordView(const Seiscomp::Core::TimeWindow&,
QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(),
TimeScale *timeScale = 0);
//! Creates a RecordView using a timespan and
//! a ringbuffer
RecordView(const Seiscomp::Core::TimeSpan&,
QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(),
TimeScale *timeScale = 0);
~RecordView();
public:
//! Sets the timewindow used for the stream data.
//! Incoming records will only be inserted when they
//! fit into the timewindow.
void setTimeWindow(const Seiscomp::Core::TimeWindow& tw);
//! Sets the buffersize used for the stream data.
//! When setting the buffersize, incoming records will be
//! appended to the end of the stream. Records that do not
//! fit into the buffer will be removed from the front of
//! the buffer: ringbuffer mode
void setBufferSize(const Seiscomp::Core::TimeSpan& ts);
//! Returns the number of record stream
int rowCount() const;
//! Returns the number of visible streams
int visibleRowCount() const;
//! Returns the stream ID used for a row
DataModel::WaveformStreamID streamID(int row) const;
//! Returns whether a row is enabled or not
bool isEnabled(int row) const;
//! Returns the item in row 'row'
RecordViewItem* itemAt(int row) const;
//! Returns the item for streamID
RecordViewItem* item(const DataModel::WaveformStreamID& streamID) const;
//! Adds a new item to the view.
//! If there already has been added an item
//! for streamID, nullptr is returned.
RecordViewItem* addItem(const DataModel::WaveformStreamID&,
const QString& stationCode,
int slotCount = 0);
//! Adds an existing item to the view
bool addItem(RecordViewItem* item);
//! Removes a particular row
bool removeItem(int row);
//! Removes a RecordViewItem
bool removeItem(RecordViewItem*);
//! Removes and returns the item from the given row in the recordview;
//! otherwise returns nullptr.
RecordViewItem* takeItem(int row);
//! Removes the item from the view and returns true or false
bool takeItem(RecordViewItem*);
//! Cycles through all rows that row 'row' is the first
//! row in the view
void cycleToRow(int row);
//! Removes all available rows
void clear();
//! Clears all available records
void clearRecords();
//! Clears all available markers
void clearMarker();
//! Sets the height of a row in pixels
void setRowHeight(int height, bool allowStretch = false);
//! Returns the current row height
int rowHeight() const;
//! Sets the default row height
void setDefaultRowHeight(int height);
//! Sets the number of column to use when a new row is created
void setDefaultItemColumns(int numCols);
//! Sets the spacing between each row in pixels
void setRowSpacing(int spacing);
//! Sets the width of the label for each row
void setLabelWidth(int width);
//! Returns the label width
int labelWidth() const;
//! Sets the spacing between the label and the recordwidget
void setHorizontalSpacing(int);
//! Returns the horizontal spacing
int horizontalSpacing() const;
//! En-/Disables showing frames around the labels and the
//! recordwidgets
void setFramesEnabled(bool);
//! Sets frame margin of the labels and the recordwidgets
void setFrameMargin(int margin);
//! Sets the zoom factor used for zoom in/out slots
void setZoomFactor(float factor);
float zoomFactor() const;
//! Returns the current zoom spot
QPointF zoomSpot() const;
void setMinimumRowHeight(int);
void setMaximumRowHeight(int);
void setRelativeRowHeight(int desiredNumberOfTraces);
//! Returns the current alignment
Seiscomp::Core::Time alignment() const;
//! Returns the current item
RecordViewItem* currentItem() const;
QList<RecordViewItem*> selectedItems() const;
bool hasSelectedItems() const;
double timeRangeMin() const;
double timeRangeMax() const;
double timeScale() const;
Core::Time mapToTime(int x) const;
//! Returns all streams belonging to a station
QList<RecordViewItem*> stationStreams(const std::string& networkCode,
const std::string& stationCode) const;
//! Copies the view state from another recordview
bool copyState(RecordView *from);
//! Moves all items to another RecordView
bool moveItemsTo(RecordView *to);
//! Moves selected streams to another RecordView
bool moveSelectionTo(RecordView *to);
//! Sets the default actions for interactive keyboard
//! navigation:
//! - Left/Right: Moves the records left/right
//! - '+'/'-': Zooms the records vertically
//! - 'y'/'x': Zooms tehe records horizontally
//! - 'f': Toggles filtering
//! - 'r': Toggles showing filtered and raw records
void setDefaultActions();
//! Sets the datasource to read records from.
//! This method initializes the reader thread and
//! holds it until start() is called
bool setDataSource(const QString& streamURL);
//! Connects to the data source
virtual bool connectToDataSource();
//! Starts reading from the set data source
virtual bool start();
//! Stops reading from the data source
virtual void stop();
//! Returns the current recordstream thread
RecordStreamThread* recordStreamThread() const;
QWidget* infoWidget() const;
TimeScale* timeWidget() const;
/**
* @brief Returns the time window covered by all available data
* @return The data time window
*/
Core::TimeWindow coveredTimeRange() const;
Core::TimeWindow visibleTimeRange() const;
public slots:
void setRecordUpdateInterval(int ms);
//! Feeds a record into the RecordView
//! A new row is appended if rec's stream id
//! is fed for the first time
bool feed(const Seiscomp::Record *rec);
bool feed(const Seiscomp::RecordPtr rec);
bool feed(Seiscomp::Record *rec);
void scrollLeft();
void scrollLeftSlowly();
void scrollRight();
void scrollRightSlowly();
void scrollLineUp();
void scrollLineDown();
void scrollPageUp();
void scrollPageDown();
void scrollToTop();
void scrollToBottom();
void selectPreviousRow();
void selectNextRow();
void selectFirstRow();
void selectLastRow();
void enableFilter(bool);
void enableFilter(int, bool);
//! Whether to show the current selected recordstream or
//! both recordstreams
void showAllRecords(bool enable);
//! Whether to show record borders
void showRecordBorders(bool enable);
//! Whether to draw the background using alternating colors
//! The item background will be drawn using QPalette::Base and
//! QPalette::AlternateBase
void setAlternatingRowColors(bool enable);
//! Enables/disables the scrollbar
void showScrollBar(bool show);
//! Whether to automatically insert new items for new records
//! when using feed(...)
void setAutoInsertItem(bool enable);
void setAbsoluteTimeEnabled(bool enable);
void setAutoScale(bool enable);
void setAutoMaxScale(bool enable);
bool isFilterEnabled() const;
void setScale(double t, double a = 0.0f);
void setTimeRange(double t1, double t2);
void setSelection(double t1, double t2);
void move(double offset);
void setSelectionEnabled(bool);
void setSelectionMode(SelectionMode mode);
void clearSelection();
//! Sets the justification of the records regarding the
//! alignment time. 0 (Left) ... 1 (Right)
void setJustification(float);
//! Aligns the RecordView regarding the justification in
//! the current viewport on the set alignment time
void align();
void horizontalZoom(float factor);
void horizontalZoomIn() { horizontalZoom( _zoomFactor); }
void horizontalZoomOut() { horizontalZoom(1.0f/_zoomFactor); }
void verticalZoom(float factor);
void verticalZoomIn() { verticalZoom(_zoomFactor); }
void verticalZoomOut() { verticalZoom(1.0f/_zoomFactor); }
void zoom(float factor);
void zoomIn() { zoom(_zoomFactor); }
void zoomOut() { zoom(1.0f/_zoomFactor); }
void scaleAmplitudesUp();
void scaleAmplitudesDown();
void scaleVisibleAmplitudes();
void scaleAllRecords();
//! Sets the zoom spot. p is in global screen coordinates
void setZoomSpotFromGlobal(const QPoint& p);
//! Sets the relative zoom spot in logical coords
void setZoomSpot(const QPointF& p);
//! Sets the zoom rectangle in global coordinates.
void setZoomRectFromGlobal(const QRect &rect);
void setZoomRect(const QRectF &rect);
//! Sort the items by text of the label using the text in
//! row 'row'
void sortByText(int row);
//! Sort the items by text of the label using first text in
//! row 'row1' and then text in row 'row2'
void sortByText(int row1, int row2);
//! Sort the items by text of the label using first text in
//! row 'row1' and then text in row 'row2' and then text in row 'row3'
void sortByText(int row1, int row2, int row3);
//! Sort the items by text of the label using first text in
//! row 'row1' and then text in row 'row2' and then text in row 'row3'
//! and then text in row 'row4'.
void sortByText(int row1, int row2, int row3, int row4);
//! Sort the items by the value set in column 'column'
void sortByValue(int column);
//! Sort the items by the value set in column1 and then
//! by value in column2
void sortByValue(int column1, int column2);
//! Sort the items by the value set in column1 then
//! by value in column2 and finally by value in column3
void sortByValue(int column1, int column2, int column3);
//! Sort the items by the value set in column1 then
//! by value in column2 then by value in column3 and finally by value
//! in column4
void sortByValue(int column1, int column2, int column3, int column4);
//! Sort the items by text of a row and then by the value set in
//! a column
void sortByTextAndValue(int row, int column);
//! Sort the items by the data set with RecordViewItem::setData
void sortByData();
//! Finds a row by its text using regular expressions.
//! The first occurence according the sorting is returned.
//! If no item matches then -1 is returned.
int findByText(int row, QRegExp &regexp, int startRow = 0) const;
//! Sort the items by the time value of the markers with
//! text markerText
void sortByMarkerTime(const QString& markerText);
void setAlignment(const Seiscomp::Core::Time& time);
//! Aligns all rows on their marker with text set to
//! text.
void alignOnMarker(const QString& text);
//! Sets the cursor text for all rows
void setCursorText(const QString& text);
//! Selects an item
void setItemSelected(RecordViewItem* item, bool select);
void deselectAllItems();
void setCurrentItem(RecordViewItem* item);
void ensureVisible(int row);
void showSlot(int slot);
void showComponent(char componentCode);
//! Enables zooming by drawing a zoomrect with
//! the mouse
void setZoomEnabled(bool = true);
/**
* @brief Enables rubber band selection with the mouse
* @param enable Whether to enable or disable it
* @param filter Which operations are enabled
*/
void setRubberBandSelectionEnabled(bool enable = true,
SelectionOperation filter = SelectAll);
/**
* @brief Restores the default selection mode (rows) and disables
* either rubberband selection or zooming.
*/
void restoreSelectionMode();
void setDefaultDisplay();
//! Sets the parameters used to filter the traces
void setFilter(RecordWidget::Filter *filter);
bool setFilterByName(const QString&);
//! Returns the set filter instance
RecordWidget::Filter *filter() const;
void updateRecords();
void setRecordBorderDrawMode(RecordWidget::RecordBorderDrawMode mode);
signals:
void updatedRecords();
void fedRecord(RecordViewItem*, const Seiscomp::Record*);
void updatedInterval(double da, double dt, double ofs);
void toggledFilter(bool);
void scaleChanged(double time, double amplitude);
void timeRangeChanged(double tmin, double tmax);
void selectionChanged(double smin, double smax);
void alignmentChanged(const Seiscomp::Core::Time&);
void amplScaleChanged(double);
//! This signal will be emitted whenever a new item
//! has been automatically added to the view.
//! Connected classes can set the columns of the item
//! depending on the first record used for creation
//! of the item.
void addedItem(const Seiscomp::Record*, Seiscomp::Gui::RecordViewItem*);
//! This signal is emitted whenever an item will be enabled
//! or disabled
void changedItem(RecordViewItem*, bool enabled);
//! This signal will be emitted when a time (absolut time)
//! has been selected inside a RecordWidget
void selectedTime(Seiscomp::Gui::RecordWidget*, Seiscomp::Core::Time);
void progressStarted();
void progressChanged(int value);
void progressFinished();
//! This signal will be emitted whenever the selection
//! changes and when in SingleSelection mode
void currentItemChanged(RecordViewItem* current, RecordViewItem* last);
//! This signal is emitted whenever the selection changes.
void selectionChanged();
void cursorTextChanged(const QString&);
//! This signal is emitted when a filter string is dropped into the
//! recordview and the filter has been set and enabled successfully
void filterChanged(const QString&);
#ifndef Q_MOC_RUN
// Hack to set the signal public for Qt 4 wich are protected by default.
public:
#endif
/**
* @brief This signal is being emitted if the user selected an area
* with the rubber band selection tool.
* @param rect The selected rectangle in global coordinates
* @param tmin The minimum absolute time of the selected time range
* @param tmax The maximum absolute time of the selected time range
* @param operation The operation to apply.
*/
void selectedRubberBand(QRect rect,
QList<Seiscomp::Gui::RecordViewItem*>,
double tmin, double tmax,
Seiscomp::Gui::RecordView::SelectionOperation operation);
private slots:
void onItemClicked(RecordViewItem*, bool buttonDown = false,
Qt::KeyboardModifiers = Qt::NoModifier);
void selectedTime(Seiscomp::Core::Time);
void sliderAction(int action);
protected:
//! This method can be reimplemented in derived
//! classes to create a custom record widget
virtual RecordWidget *createRecordWidget(
const DataModel::WaveformStreamID &streamID
) const;
//! This method can be reimplemented in derived
//! classes to create a custom label
virtual RecordLabel *createLabel(RecordViewItem*) const;
bool event(QEvent* event);
void showEvent(QShowEvent *event);
void closeEvent(QCloseEvent *event);
void changeEvent(QEvent* e);
void resizeEvent(QResizeEvent *event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void closeThread();
private:
void setupUi();
void colorItem(RecordViewItem* item, int row);
void colorItem(RecordViewItem*);
void scaleContent();
template <typename T>
void sortRows(std::list< std::pair<T, RecordViewItem*> >&);
void layoutRows();
void applyBufferChange();
double mapToUnit(int x) const;
// bool buildFilter(const QString& text, std::vector<Seiscomp::Math::Filtering::IIR::Filter<float>* >* filterList);
private:
enum Mode {
TIME_WINDOW,
RING_BUFFER
};
typedef QMap<DataModel::WaveformStreamID, RecordViewItem*> Items;
typedef QVector<RecordViewItem*> Rows;
typedef QSet<RecordViewItem*> SelectionList;
SelectionMode _selectionMode;
RecordStreamThread* _thread;
RecordViewItem* _currentItem;
TimeScale* _timeScaleWidget;
QScrollArea* _scrollArea;
QWidget* _timeScaleInfo;
QLayout* _timeScaleAuxLayout;
QAction* _filterAction;
QAction* _absTimeAction;
QTimer _recordUpdateTimer;
SelectionList _selectedItems;
Mode _mode;
Seiscomp::Core::Time _timeStart;
Seiscomp::Core::TimeSpan _timeSpan;
Items _items;
Rows _rows;
Core::Time _alignment;
QPointF _zoomSpot;
int _rowHeight;
int _minRowHeight;
int _maxRowHeight;
int _numberOfRows;
int _defaultRowHeight;
float _zoomFactor;
double _tmin, _tmax;
float _amin, _amax; // amplitude range
double _timeScale; // pixels per second
double _minTimeScale;
double _amplScale; // amplitude units per pixel
bool _filtering; // the filter state
bool _alternatingColors;
bool _showAllRecords;
bool _showRecordBorders;
bool _autoInsertItems;
bool _autoScale;
bool _autoMaxScale;
bool _frames;
int _frameMargin;
int _horizontalSpacing;
int _rowSpacing;
int _labelWidth;
int _labelColumns;
RecordWidget::RecordBorderDrawMode _recordBorderDrawMode;
RecordWidget::Filter *_filter;
friend class RecordViewItem;
};
}
}
#endif

View File

@ -0,0 +1,283 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_RECORDVIEWITEM_H
#define SEISCOMP_GUI_RECORDVIEWITEM_H
#ifndef Q_MOC_RUN
#include <seiscomp/core/recordsequence.h>
#include <seiscomp/math/filter.h>
#include <seiscomp/gui/core/recordwidget.h>
#endif
#include <QFrame>
namespace Seiscomp {
namespace Gui {
class RecordView;
class RecordViewItem;
class SC_GUI_API RecordLabel : public QWidget {
Q_OBJECT
public:
RecordLabel(QWidget *parent=0, const char *name=0);
~RecordLabel();
public:
RecordViewItem* recordViewItem() const;
void setBackgroundColor(const QColor&);
virtual void setText(const QString &str, int item=0) = 0;
virtual void setColor(QColor col, int item=0) = 0;
virtual void setFont(const QFont& f, int item=0) = 0;
virtual void setWidth(int width, int item=0) = 0;
virtual void setAlignment(Qt::Alignment al, int item=0) = 0;
virtual void setEditable(bool, int item=0) = 0;
virtual QString text(int item) const = 0;
virtual const QFont& font(int item) const = 0;
virtual void setOrientation(Qt::Orientation) = 0;
virtual int itemCount() const = 0;
void setInteractive(bool interactive);
bool isInteractive() const;
bool isEnabled() const { return _enabled; }
public slots:
void setEnabled(bool enabled);
signals:
//! This signal is emitted when the label has been double-clicked
//! and the label is not interactive
void doubleClicked();
//! This signal is emitted when the label has been double-clicked
//! and the label is interactive
void statusChanged(bool);
//! This signal is emitted when a text entry has been double-clicked
void editRequested(int item, QRect rect);
protected:
void mouseDoubleClickEvent(QMouseEvent *e);
virtual void visibilityChanged(bool) {}
private:
RecordViewItem* _parent;
bool _enabled;
bool _interactive;
friend class RecordViewItem;
};
class SC_GUI_API StandardRecordLabel : public RecordLabel {
public:
StandardRecordLabel(int items=3, QWidget *parent=0, const char* = 0);
~StandardRecordLabel();
public:
void setText(const QString &str, int item=0);
void setColor(QColor col, int item=0);
void setFont(const QFont& f, int item=0);
void setWidth(int width, int item=0);
void setAlignment(Qt::Alignment al, int item=0);
void setEditable(bool, int item=0);
QString text(int item) const;
const QFont& font(int item) const;
void setOrientation(Qt::Orientation o);
int itemCount() const;
protected:
void paintEvent(QPaintEvent *e);
protected:
struct Item {
Item() : colorSet(false) {}
QString text;
QColor color;
bool colorSet;
QFont font;
Qt::Alignment align;
bool editable;
int width;
};
bool _vertical;
QVector<Item> _items;
};
class SC_GUI_API RecordViewItem : public QWidget {
Q_OBJECT
private:
RecordViewItem(RecordView *parent=0, bool withFrame=false, int frameMargin=0,
int hSpacing=0);
RecordViewItem(RecordView *parent, RecordWidget *widget,
RecordSequence* records,
bool withFrame=false, int frameMargin=0, int hSpacing=0);
public:
~RecordViewItem();
public:
RecordView* recordView() const;
bool feed(const Seiscomp::Record *rec);
void setValue(int column, double d);
double value(int column) const;
int columnCount() const;
//! Returns the row inside the RecordView
int row() const;
//! Returns the streamID used for this item
const DataModel::WaveformStreamID& streamID() const;
void setRecords(RecordSequence*);
RecordSequence* records(char componentCode = '?') const;
RecordSequence* filteredRecords(char componentCode = '?') const;
void setBuffer(RecordSequence*);
float timingQuality(char componentCode) const;
bool showSlot(int slot);
bool showRecords(char componentCode);
char currentComponent() const;
void setLabel(RecordLabel* label);
void setLabelText(const QString& text);
void setRecordWidget(RecordWidget *widget);
RecordWidget *widget() { return _widget; }
const RecordWidget *widget() const { return _widget; }
RecordLabel *label () { return _label; }
const RecordLabel *label () const { return _label; }
void enableFiltering(bool);
bool isFilteringEnabled() const;
void setBackgroundColor(const QColor&);
QColor backgroundColor() const;
bool isSelected() const;
bool isHighlighted() const;
void setData(const QVariant&);
const QVariant& data() const;
void setDraggingEnabled(bool);
void setRowHeight(int h);
void setVisible(bool visible);
void forceInvisibilty(bool force);
bool isInvisibilityForced() const;
int mapComponentToSlot(char) const;
char mapSlotToComponent(int) const;
bool insertComponent(char, int);
protected:
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
private:
void setupUi(bool withFrame, int frameMargin, int hSpacing);
void setupConnection();
void setColor();
void clearRecords();
int createComponentToSlotMapping(char);
private slots:
void setSelected(bool);
private slots:
void setHighlight(bool);
void onClickedOnTime(Seiscomp::Core::Time);
void handleLayoutRequest();
signals:
void firstRecordAdded(const Seiscomp::Record*);
void clicked(RecordViewItem*, bool buttonDown, Qt::KeyboardModifiers);
void clickedOnTime(Seiscomp::Gui::RecordViewItem*, Seiscomp::Core::Time);
void componentChanged(RecordViewItem*, char);
private:
typedef QMap<char, int> SlotMap;
RecordView *_parent;
SlotMap _slotMapping;
RecordSequence *_seqTemplate;
RecordWidget *_widget;
RecordLabel *_label;
int _row;
bool _filtering;
bool _selected;
bool _highlight;
char _requestedComponent;
char _currentComponent;
QVector<double> _values;
QLayout *_labelLayout;
QLayout *_widgetLayout;
QVariant _data;
QPoint _dragStart;
bool _enableDragging;
bool _visible;
bool _forceInvisibility;
friend class RecordView;
};
}
}
#endif

View File

@ -0,0 +1,866 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_RECORDWIDGET_H
#define SEISCOMP_GUI_RECORDWIDGET_H
#include <QWidget>
#include <QFrame>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QResizeEvent>
#include <QScrollBar>
#include <QHBoxLayout>
#ifndef Q_MOC_RUN
#include <seiscomp/core/record.h>
#include <seiscomp/datamodel/waveformstreamid.h>
#include <seiscomp/math/filter.h>
#include "recordpolyline.h"
#endif
namespace Seiscomp {
namespace Gui {
class RecordWidget;
//! \brief RecordMarker - marks a certain timestamp in the record
//! \brief sequence with a color and a type.
//!
//! Furthermore a marker can be moved on the stream. This class
//! is useful to correct picks visually.
class SC_GUI_API RecordMarker : public QObject {
Q_OBJECT
public:
RecordMarker(RecordWidget *parent,
const Seiscomp::Core::Time& pos,
Qt::Alignment = Qt::AlignVCenter);
RecordMarker(RecordWidget *parent,
const Seiscomp::Core::Time& pos,
const QString& text,
Qt::Alignment = Qt::AlignVCenter);
RecordMarker(RecordWidget *parent,
const RecordMarker&);
virtual ~RecordMarker();
protected:
void setParent(RecordWidget*);
public:
RecordWidget* parent() const;
void setColor(QColor c);
QColor color() const;
void setAlignment(Qt::Alignment);
Qt::Alignment alignment() const;
void setModifiedColor(QColor c);
QColor modifiedColor() const;
const Seiscomp::Core::Time& time() const;
void setCorrectedTime(const Seiscomp::Core::Time&);
const Seiscomp::Core::Time& correctedTime() const;
void setText(const QString&);
const QString& text() const;
void addAlias(const QString&);
void setDescription(const QString&);
const QString& description() const;
bool matches(const QString &text) const;
//! Returns the text to render
//! When description is empty then text is used else
//! the description itself is going to be rendered
const QString& renderText() const;
void setVisible(bool visible);
bool isVisible() const;
bool isHidden() const;
void setMovable(bool enable);
bool isMovable() const;
void setMoveCopy(bool enable);
bool isMoveCopyEnabled() const;
bool isEnabled() const;
//! Sets internal data to data. This can be used for
//! user data to store anything that a QVariant can store.
void setData(const QVariant& data);
//! Returns the user data set in setData
QVariant data() const;
//! Sets an id for the marker. This id is application depended
//! and can be chosen freely
void setId(int id);
//! Returns the id for the marker
int id() const;
bool isModified() const;
//! Sets the corrected time to the start time
void reset();
//! Sets the start time to the corrected time
void apply();
void update();
virtual RecordMarker *copy();
//! Draws the background of a marker. This method is called before
//! the traces are drawn.
virtual void drawBackground(QPainter &painter, RecordWidget *context,
int x, int y1, int y2,
QColor color, qreal lineWidth);
//! Draws the marker. This method is called after the traces are drawn.
virtual void draw(QPainter &painter, RecordWidget *context,
int x, int y1, int y2,
QColor color, qreal lineWidth);
virtual QString toolTip() const;
public slots:
virtual void setEnabled(bool enable);
private:
RecordWidget *_parent;
QColor _color;
QColor _modifierColor;
Seiscomp::Core::Time _time;
Seiscomp::Core::Time _correctedTime;
QString _text;
QString _description;
QVector<QString> _aliases;
bool _visible;
bool _moveable;
bool _moveCopy;
bool _enabled;
int _id;
Qt::Alignment _alignment;
QVariant _data;
friend class RecordWidget;
};
//!\brief RecordWidgetDecorator - decorates a RecordWidget
//!
//! This class can be used to draw custom decorations before
//! and after the RecordWidget paints its data.
class RecordWidgetDecorator : public QObject {
Q_OBJECT
public:
RecordWidgetDecorator(QObject *parent = 0);
public:
virtual void drawDecoration(QPainter *painter, RecordWidget *widget) = 0;
};
//!\brief RecordWidget - draws seismograms in a rectangular widget
//!
//! This class is only responsible for drawing, it gets records assigned as
//! pointers and is (optional) responsible for their (de)allocation. Only filtered
//! recordstreams are owned by the RecordWidget.
class SC_GUI_API RecordWidget : public QWidget {
Q_OBJECT
public:
enum DrawMode {
Single,
InRows,
Stacked,
SameOffset
};
enum ShadowWidgetFlags {
Raw = 0x01,
Filtered = 0x02
};
enum AxisPosition {
Left,
Right
};
enum RecordBorderDrawMode {
TopLine,
BottomLine,
Box
};
typedef Math::Filtering::InPlaceFilter<double> Filter;
struct Trace {
Trace() = default;
double dyMin{0}; // Data minimum value
double dyMax{0}; // Data maximum value
double dOffset{0}; // Data offset
double absMax{0};
int pyMin{0}; //
int pyMax{0};
double fyMin{-1};
double fyMax{1};
double yMin{0};
double yMax{0};
double yOffset{0}; // The used offset
float timingQuality{-1};
int timingQualityCount{0};
bool dirty{false};
bool visible{false};
AbstractRecordPolylinePtr poly;
QString status;
void reset() {
dyMin = dyMax = dOffset = absMax = 0;
fyMin = -1; fyMax = 1;
pyMin = pyMax = 0;
visible = false;
poly = nullptr;
}
bool validTrace() const {
return poly && !poly->isEmpty();
}
};
public:
RecordWidget(QWidget *parent=0);
RecordWidget(const DataModel::WaveformStreamID& streamID, QWidget *parent=0);
~RecordWidget();
public:
void enableRecordFiltering(int slot, bool enable);
bool isRecordFilteringEnabled(int slot);
bool isRecordVisible(int slot);
bool setRecordVisible(int slot, bool visible);
void setCustomBackgroundColor(QColor c);
void removeCustomBackgroundColor();
bool setRecords(int slot, RecordSequence*, bool owner = true);
bool setRecordID(int slot, const QString &id);
bool setRecordLabel(int slot, const QString &label);
bool setRecordColor(int slot, QColor c);
bool setRecordPen(int slot, const QPen &pen);
bool setRecordAntialiasing(int slot, bool antialiasing);
bool setRecordOptimization(int slot, bool enable);
bool setRecordStepFunction(int slot, bool enable);
bool setRecordBackgroundColor(int slot, QColor c);
bool removeRecordBackgroundColor(int slot);
bool setRecordFilter(int slot, const Filter *f);
bool setRecordScale(int slot, double scale);
bool setRecordUserData(int slot, QVariant data);
bool setRecordStatus(int slot, bool filtered, QString status);
RecordSequence *records() const;
RecordSequence *records(int slot) const;
RecordSequence *filteredRecords(int slot) const;
RecordSequence *takeRecords(int slot);
RecordSequence *createRecords(int slot, bool owner = true);
const Filter *recordFilter(int slot) const;
QString recordID(int slot) const;
QString recordLabel(int slot) const;
bool recordStepFunction(int slot) const;
QColor recordColor(int slot) const;
QPen recordPen(int slot) const;
const double *recordScale(int slot) const;
Trace *traceInfo(int slot, bool filtered = false);
const Trace *traceInfo(int slot, bool filtered = false) const;
QVariant recordUserData(int slot);
int setCurrentRecords(int slot);
int currentRecords() const;
public:
const QRect &canvasRect() const;
void setDrawMode(DrawMode mode);
DrawMode drawMode() const;
void setRecordBorderDrawMode(RecordBorderDrawMode mode);
RecordBorderDrawMode recordBorderDrawMode() const;
void setDrawOffset(bool f);
bool drawOffset() const { return _drawOffset; }
void setDrawSPS(bool f);
bool drawSPS() const { return _drawSPS; }
void setDrawRecordID(bool f);
bool drawRecordID() const { return _drawRecordID; }
void setRowSpacing(int);
int rowSpacing() const;
void setAxisSpacing(int);
int axisSpacing() const;
void setDrawAxis(bool f);
bool drawAxis() const { return _drawAxis; }
void setAxisWidth(int width);
int axisWidth() const;
void setAxisPosition(AxisPosition position);
AxisPosition axisPosition() const;
void setValuePrecision(int p);
int valuePrecision() const { return _valuePrecision; }
//! Sets a shadow widget that gets informed about record changes.
//! Available record slots are copied by reference
//! in that way that the listener is not the owner of the
//! data. Available marker are copied by value.
void setShadowWidget(RecordWidget *shadow, bool copyMarker,
int flags = Raw);
//! Returns the current shadow widget
RecordWidget *shadowWidget() const { return _shadowWidget; }
//! Sets the source widget for all markers.
//! This instance does not hold any marker but displays
//! the source widgets markers. All marker query function
//! are forwarded to source.
void setMarkerSourceWidget(RecordWidget *source);
//! Returns the current marker source widget
RecordWidget *markerSourceWidget() const { return _markerSourceWidget; }
void setDecorator(RecordWidgetDecorator *decorator);
RecordWidgetDecorator *decorator() const { return _decorator; }
//! Returns the fetched timing quality average
float timingQuality(int slot) const;
double timeScale() const { return _pixelPerSecond; }
double amplScale() const { return _amplScale; }
double tmin() const { return _tmin; }
double tmax() const { return _tmax; }
double amplMin() const { return _amplitudeRange[0]; }
double amplMax() const { return _amplitudeRange[1]; }
double smin() const { return _smin; }
double smax() const { return _smax; }
Seiscomp::Core::Time alignment() { return _alignment; }
Seiscomp::Core::Time centerTime();
//! Returns the trace plot position of the given slot
int streamYPos(int slot) const;
//! Returns the trace height of the given slot
int streamHeight(int slot) const;
//! Returns the amplitude range of the available data in the normalization
//! window
QPair<double,double> amplitudeDataRange(int slot) const;
//! Returns the amplitude range of the trace slot where first corresponds
//! to the lower pixel row and second to the upper pixel row
QPair<double,double> amplitudeRange(int slot) const;
void ensureVisibility(const Seiscomp::Core::Time &time, int pixelMargin);
//! Method to inform the widget about a newly inserted
//! record.
virtual void fed(int slot, const Seiscomp::Record *rec);
//! Causes the widget to rebuild its internal data
//! according its size and parameters
void setDirty();
//! Whether to show the current selected recordstream or
//! both recordstreams
void showAllRecords(bool enable);
//! Whether to show record borders
void showRecordBorders(bool enable);
//! Whether to show scaled or raw values. The default is false.
void showScaledValues(bool enable);
bool areScaledValuesShown() const { return _showScaledValues; }
//! Adds a marker to the widget. The ownership takes
//! the widget.
bool addMarker(RecordMarker*);
//! Inserts a marker at pos in the marker list
bool insertMarker(int pos, RecordMarker* marker);
int indexOfMarker(RecordMarker* marker) const;
//! Removes a record marker and returns the instance
RecordMarker *takeMarker(int pos);
RecordMarker *takeMarker(RecordMarker*);
//! Removes and deletes a record marker.
bool removeMarker(int pos);
bool removeMarker(RecordMarker*);
//! Returns the number of markers added to the widget.
int markerCount() const;
//! Returns the i-th marker.
RecordMarker* marker(int i) const;
//! Returns the marker with text set to txt
RecordMarker* marker(const QString& txt, bool movableOnly = false) const;
//! Returns the marker with text set to txt and which is enabled
RecordMarker* enabledMarker(const QString& txt) const;
//! Removes and deletes all marker inserted previously.
void clearMarker();
//! Sets the current marker
void setCurrentMarker(RecordMarker *);
//! Returns the currently focused marker
RecordMarker *currentMarker() const;
//! Returns the current marker under the mouse
RecordMarker *hoveredMarker() const;
//! Returns the marker under position p. If moveableOnly is set
//! to true, only movable markers are checked.
RecordMarker* markerAt(const QPoint& p, bool movableOnly = true, int maxDist = 5) const;
RecordMarker* markerAt(int x, int y, bool movableOnly = true, int maxDist = 5) const;
//! Returns the nearest marker left from time t
RecordMarker* lastMarker(const Seiscomp::Core::Time& t);
//! Returns the nearest marker right from time t
RecordMarker* nextMarker(const Seiscomp::Core::Time& t);
//! Returns the nearest marker at time t
RecordMarker* nearestMarker(const Seiscomp::Core::Time& t, int maxDist = -1);
//! Returns whether the widget has markers that are movable or not
bool hasMovableMarkers() const;
//! Sets the text to be displayed on the cursor
void setCursorText(const QString& text);
//! Returns the current cursor text
QString cursorText() const;
void setCursorPos(const QPoint&);
void setCursorPos(const Seiscomp::Core::Time&);
const Seiscomp::Core::Time& cursorPos() const;
const double *value(const Seiscomp::Core::Time&) const;
//! Returns the time on the left visible side of the widget
Seiscomp::Core::Time leftTime() const;
//! Returns the time on the right visible side of the widget
Seiscomp::Core::Time rightTime() const;
Seiscomp::Core::TimeWindow visibleTimeWindow() const;
Seiscomp::Core::TimeWindow selectedTimeWindow() const;
const Seiscomp::Core::TimeWindow & normalizationWindow() const;
bool isActive() const;
bool isFilteringEnabled() const;
bool isGlobalOffsetEnabled() const;
//! Maps a time to a position relative to the widget
int mapTime(const Core::Time&) const;
//! Maps a time to a position relative to the trace canvas
int mapCanvasTime(const Core::Time&) const;
//! Maps a widget position to a time
Core::Time unmapTime(int x) const;
const DataModel::WaveformStreamID& streamID() const;
void setSlotCount(int);
int slotCount() const;
//! Sets internal data to data. This can be used for
//! user data to store anything that a QVariant can store.
void setData(const QVariant& data);
//! Returns the user data set in setData
QVariant data() const;
public slots:
void setAmplAutoScaleEnabled(bool enable);
//! Sets clipping for drawmode InRows.
void setClippingEnabled(bool);
bool isClippingEnabled() const;
void enableGlobalOffset(bool enable);
void setSelected(double t1, double t2);
void setSelected(Seiscomp::Core::Time t1, Seiscomp::Core::Time t2);
void setScale(double, double=0);
void setTimeScale(double);
void setTimeRange(double, double);
void setAmplRange(double, double);
void setMinimumAmplRange(double, double);
void showTimeRange(double, double);
void translate(double);
void setEnabled(bool enabled);
void setAlignment(Seiscomp::Core::Time t);
void alignOnMarker(const QString& text);
void setAmplScale(double);
void enableFiltering(bool enable);
void setGridSpacing(double, double, double);
void setGridVSpacing(double, double, double);
void setGridVRange(double, double);
void setGridVScale(double);
void setActive(bool);
void setAutoMaxScale(bool);
void setNormalizationWindow(const Seiscomp::Core::TimeWindow&);
void setOffsetWindow(const Seiscomp::Core::TimeWindow&);
//! Sets the maximum slot index for which setFilter(filter) is
//! applied. The semantics of 'any' is bound to value -1.
void setFilterSlotMax(int max);
//! Sets the record filter. The filter will be cloned and will not
//! be touched by the widget. The caller is responsible to destroy
//! the filter used as parameter.
void setFilter(Filter* filter);
void updateRecords();
void clearRecords();
private slots:
void scroll(int);
signals:
//! This signal is emitted when a time (absolut time)
//! has been selected inside the widget. It does not
//! happen when a marker has been hit.
void selectedTime(Seiscomp::Core::Time);
//! This signal is emitted when a time range (absolut time)
//! has been selected inside the widget by holding
//! the left mouse button.
void selectedTimeRange(Seiscomp::Core::Time, Seiscomp::Core::Time);
//! This signal is emitted when a time range (absolut time)
//! is selected while still holding the left mouse button.
void selectedTimeRangeChanged(Seiscomp::Core::Time, Seiscomp::Core::Time);
//! Whenever a current (active) marker has changed
//! this signal will be emittet.
void currentMarkerChanged(Seiscomp::Gui::RecordMarker*);
void cursorMoved(QPoint p);
//! Whenever the cursor changes this signal is emitted.
//! The first parameter is the owner of the cursor and
//! the second parameter is the slot where the cursor has
//! been moved. This usually equals the current slot but
//! when drawing all slots in rows then it might differ.
void cursorUpdated(RecordWidget*, int);
void mouseOver(bool);
//! This signal is emitted when the user clicks with the
//! middle mousebutton into the trace
void clickedOnTime(Seiscomp::Core::Time);
void traceUpdated(Seiscomp::Gui::RecordWidget*);
//! This signal is emitted when the layout of the widget
//! changes. Whenever a new slot has been added or removed
//! and the drawingMode is InRows then a layoutRequest is made.
void layoutRequest();
void axisSettingsChanged(Seiscomp::Gui::RecordWidget*);
protected:
void init();
bool event(QEvent *);
void paintEvent(QPaintEvent*);
void mousePressEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void mouseDoubleClickEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void resizeEvent(QResizeEvent*);
void enterEvent(QEvent*);
void leaveEvent(QEvent*);
void enabledChange(bool) { update(); }
virtual void changedRecords(int slot, RecordSequence*);
virtual void drawActiveCursor(QPainter &painter, int x, int y);
virtual void drawCustomBackground(QPainter &painter);
virtual void customPaintTracesBegin(QPainter &painter);
virtual void customPaintTracesEnd(QPainter &painter);
virtual void createPolyline(int slot, AbstractRecordPolylinePtr &polyline,
RecordSequence const *, double pixelPerSecond,
double amplMin, double amplMax, double amplOffset,
int height, bool optimization, bool highPrecision);
virtual const double *value(int slot, const Seiscomp::Core::Time&) const;
protected:
struct Stream {
enum Index {
Raw = 0,
Filtered = 1
};
Stream(bool owner);
~Stream();
void setDirty();
void free();
RecordSequence *records[2];
Trace traces[2];
bool ownRawRecords;
bool ownFilteredRecords;
bool visible;
bool filtering;
QString id;
QPen pen;
bool antialiasing;
bool stepFunction;
QColor customBackgroundColor;
bool hasCustomBackgroundColor;
bool optimize;
double scale;
// The value range axis, if enabled
QString axisLabel;
double axisSpacing[2];
bool axisDirty;
// Internal variables to track the current trace position
// in widget coordinated
int posY;
int height;
QVariant userData;
Filter *filter;
};
protected:
Stream *getStream(int);
const Stream *getStream(int) const;
bool createFilter();
bool createFilter(int slot);
void filterRecords(Stream *s);
bool setFilteredRecords(int slot, RecordSequence* seq, bool owner);
Record* filteredRecord(Filter *&filter,
const Record*, const Record*,
double tolerance) const;
void prepareRecords(Stream *s);
void drawRecords(Stream *s, int slot);
void drawTrace(QPainter &painter,
const Trace *trace,
const RecordSequence *seq,
const QPen &pen,
const QPoint &paintOffset) const;
void drawRecordBorders(QPainter &painter, const RecordSequence *seq) const;
void drawMarkers(QPainter &painter, QFont &font, const QColor &fg);
void drawAxis(QPainter &painter, const QPen &p);
int canvasWidth() const;
int canvasHeight() const;
private:
typedef QVector<Stream*> StreamMap;
QVariant _data;
DrawMode _drawMode;
RecordBorderDrawMode _recordBorderDrawMode;
Seiscomp::Core::Time _alignment;
bool _clipRows{true};
double _tmin; // time range min
double _tmax; // time range max
double _smin, _smax; // selection
double _pixelPerSecond;
double _amplScale; // pixel per amplitude unit (0=normalize)
double _gridHSpacing[2];
double _gridHOffset;
double _gridVRange[2];
double _gridVSpacing[2];
double _gridVOffset;
double _gridVScale;
double _amplitudeRange[2];
bool _useFixedAmplitudeRange{false};
bool _useMinAmplitudeRange{false};
bool _active{false};
bool _filtering{false};
bool _showScaledValues{false};
bool _drawRecords{false};
bool _drawRecordID{true};
bool _drawOffset{true};
bool _drawSPS{false};
bool _showAllRecords{false};
bool _showRecordBorders{false};
bool _autoMaxScale{false};
bool _enabled;
bool _useGlobalOffset{false};
bool _drawAxis;
int _tracePaintOffset;
int _axisWidth;
AxisPosition _axisPosition;
int _axisSpacing;
int _rowSpacing;
StreamMap _streams;
int _currentSlot;
int _requestedSlot;
int _maxFilterSlot;
int _currentCursorYPos;
int _valuePrecision;
QColor _customBackgroundColor;
bool _hasCustomBackground;
Seiscomp::DataModel::WaveformStreamID _streamID;
QVector<RecordMarker*> _marker;
RecordMarker *_activeMarker;
RecordMarker *_hoveredMarker;
QScrollBar *_scrollBar;
QRect _canvasRect;
int _margins[4];
QString _cursorText;
Seiscomp::Core::Time _cursorPos;
Seiscomp::Core::Time _startDragPos;
Seiscomp::Core::TimeWindow _normalizationWindow;
Seiscomp::Core::TimeWindow _offsetWindow;
RecordWidget *_shadowWidget;
RecordWidget *_markerSourceWidget;
RecordWidgetDecorator *_decorator;
int _shadowWidgetFlags;
};
inline const QRect &RecordWidget::canvasRect() const {
return _canvasRect;
}
inline int RecordWidget::rowSpacing() const {
return _rowSpacing;
}
inline int RecordWidget::axisSpacing() const {
return _axisSpacing;
}
inline int RecordWidget::axisWidth() const {
return _axisWidth;
}
inline RecordWidget::AxisPosition RecordWidget::axisPosition() const {
return _axisPosition;
}
inline int RecordWidget::canvasWidth() const {
return _canvasRect.width();
}
inline int RecordWidget::canvasHeight() const {
return _canvasRect.height();
}
}
}
# endif

View File

@ -0,0 +1,209 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_RULER_H
#define SEISCOMP_GUI_RULER_H
#include <seiscomp/gui/qt.h>
#include <QFrame>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API Ruler : public QFrame
{
Q_OBJECT
public:
enum Position { Bottom, Top, Left, Right };
Ruler(QWidget* = 0, Qt::WindowFlags f = Qt::WindowFlags(), Position pos = Bottom);
~Ruler() {}
void setPosition(Position, bool allowLabelTextRotation = false);
void setReverseDirection(bool reverse);
void setRange(double, double);
void setLimits(double leftValue, double rightValue, double minRange, double maxRange);
void setScale(double);
bool setSelected(double, double);
bool setSelectionHandle(int handle, double pos);
bool setSelectionHandleEnabled(int handle, bool enable);
void setAnnot(double = -1); // -1 is "auto", 0 is none
void setTicks(double = -1); // -1 is "auto", 0 is none
void setSelectionHandleCount(int);
bool isSelectionEnabled() const { return _enableSelection; }
int selectionHandleCount() const;
double selectionHandlePos(int) const;
void setWheelEnabled(bool scale, bool translate);
double minimumRange() const { return _min; }
double maximumRange() const { return _max; }
double minimumSelection() const;
double maximumSelection() const;
double scale() const { return _scl; }
double pixelPerUnit() const { return _scl; }
double dA() const { return _drx[0]; }
double dT() const { return _drx[1]; }
double dOfs() const { return _ofs; }
virtual QSize sizeHint() const;
//! Functions for position independent drawing
int rulerWidth() const { return isHorizontal() ? width() : height(); }
int rulerHeight() const { return isHorizontal() ? height() : width(); }
bool isBottom() const { return _position == Bottom; }
bool isTop() const { return _position == Top; }
bool isLeft() const { return _position == Left; }
bool isRight() const { return _position == Right; }
bool isHorizontal() const { return isBottom() || isTop(); }
bool isVertical() const { return !isHorizontal(); }
public slots:
void showRange(double, double);
void translate(double);
void setAutoScaleEnabled(bool);
void setSelectionEnabled(bool);
void setRangeSelectionEnabled(
bool enabled,
bool emitRangeChangeWhileDragging = false
);
void changed(int pos = -1);
signals:
void scaleChanged(double);
void changedSelection(double, double);
void selectionHandleMoved(int handle, double pos, Qt::KeyboardModifiers);
void selectionHandleMoveFinished();
void changedInterval(double dA, double dT, double ofs);
void dragged(double diffTime);
void dragStarted();
void dragFinished();
void rangeChangeRequested(double tmin, double tmax);
protected:
void paintEvent(QPaintEvent*);
void mousePressEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void wheelEvent(QWheelEvent*);
void resizeEvent(QResizeEvent*);
//! Should be reimplemented in derived classes to
//! customize the displayed string. str holds the string
//! used for displaying and value describes the position
//! on the ruler.
virtual bool getTickText(double pos, double lastPos,
int line, QString &str) const;
virtual void updateIntervals();
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
void setLineCount(int lines, int spacing = 4);
virtual void drawSelection(QPainter &p);
void drawRangeSelection(QPainter &p);
//! Converts ruler position to point in widget coordinates, rx is the
//! position on the ruler, ry the distance from the rulers baseline
QPoint r2wPos(int rx, int ry) const;
//! Converts widget coordinates to ruler position
QPoint w2rPos(int x, int y) const;
//! Converts ruler rectangle to rectangle in widget coordinates.
//! rx is the position on the ruler, ry the distance from the rulers
//! baseline
QRect r2wRect(int rx, int ry, int rw, int rh) const;
//! Draws text at the specified ruler position (rx) with
//! the specified distance (ry) from the rulers baseline.
//! If allowRotate is set to 'true' the text is rotated
//! by 90 degrees if the ruler is in a vertical mode.
bool rulerDrawText(QPainter &p, int rx, int ry,
const QString &text, bool allowClip = false,
bool allowRotate = false) const;
bool rulerDrawTextAtLine(QPainter &p, int rx, int line,
const QString &text, bool allowClip = false,
bool allowRotate = false) const;
void checkLimit(double &tmin, double &tmax);
void changeRange(double tmin, double tmax);
protected:
struct Handle {
Handle() : enabled(true) {}
double pos;
bool enabled;
bool operator<(const Handle &other) const {
return pos < other.pos;
}
};
Position _position;
double _ofs{0};
double _scl{1.0},
_min{0}, _max{0}, // ruler range
_da{-1}, // annotation interval
_dt{-1}, // tick mark interval
_limitLeft, _limitRight,
_limitMinRange, _limitMaxRange;
int _pos{0}, _tickLong, _tickShort, _lc, _lineSpacing;
QVector<Handle> _selectionHandles;
int _currentSelectionHandle{-1};
double _drx[2]; // current intervals
int _dragMode{0};
double _dragStart;
int _iDragStart;
int _rangemin{0}, _rangemax{0};
bool _rangeValid;
bool _enableSelection;
bool _enableRangeSelection{false};
bool _enableLabelRotation{false};
bool _leftToRight{true}; // Or bottomToTop
bool _emitRangeChangeWhileDragging{false};
bool _hover{false};
bool _wheelScale{true};
bool _wheelTranslate{true};
bool _autoScale{false};
};
} // ns Gui
} // ns Seiscomp
# endif // _RULER_H_

View File

@ -0,0 +1,377 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_SCHEME_H
#define SEISCOMP_GUI_SCHEME_H
#include <QColor>
#include <QPen>
#include <QBrush>
#include <QPoint>
#include <QFont>
#include <seiscomp/gui/qt.h>
#include <seiscomp/gui/core/gradient.h>
#include <seiscomp/gui/core/recordwidget.h>
class QTabWidget;
namespace Seiscomp {
namespace Gui {
class SC_GUI_API Scheme {
public:
Scheme();
void applyTabPosition(QTabWidget *tab);
struct Colors {
Colors();
struct Splash {
Splash();
QColor version;
QColor message;
};
struct Picks {
Picks();
QColor manual;
QColor automatic;
QColor undefined;
QColor disabled;
};
struct Arrivals {
Arrivals();
QColor manual;
QColor automatic;
QColor theoretical;
QColor undefined;
QColor disabled;
QPen uncertainties;
QPen defaultUncertainties;
Gradient residuals;
};
struct Magnitudes {
Magnitudes();
QColor set;
QColor unset;
QColor disabled;
Gradient residuals;
};
struct RecordStates {
RecordStates();
QColor unrequested;
QColor requested;
QColor inProgress;
QColor notAvailable;
};
struct BrushPen {
QPen pen;
QBrush brush;
};
struct RecordBorders {
RecordBorders();
BrushPen standard;
BrushPen signatureValid;
BrushPen signatureInvalid;
};
struct Records {
Records();
QColor alignment;
QColor background;
QColor alternateBackground;
QColor foreground;
QColor alternateForeground;
QColor spectrogram;
QPen offset;
QPen gridPen;
QPen subGridPen;
QBrush gaps;
QBrush overlaps;
RecordStates states;
RecordBorders borders;
};
struct Stations {
Stations();
QColor text;
QColor associated;
QColor selected;
QColor triggering;
QColor triggered0;
QColor triggered1;
QColor triggered2;
QColor disabled;
QColor idle;
};
struct QC {
QC();
QColor delay0;
QColor delay1;
QColor delay2;
QColor delay3;
QColor delay4;
QColor delay5;
QColor delay6;
QColor delay7;
QColor qcWarning;
QColor qcError;
QColor qcOk;
QColor qcNotSet;
};
struct ConfigGradient {
Gradient gradient;
bool discrete;
};
struct OriginSymbol {
OriginSymbol();
bool classic;
ConfigGradient depth;
};
struct OriginStatus {
OriginStatus();
QColor automatic;
QColor manual;
};
struct GroundMotion {
GroundMotion();
QColor gmNotSet;
QColor gm0;
QColor gm1;
QColor gm2;
QColor gm3;
QColor gm4;
QColor gm5;
QColor gm6;
QColor gm7;
QColor gm8;
QColor gm9;
};
struct RecordView {
RecordView();
QColor selectedTraceZoom;
};
struct Map {
Map();
QColor lines;
QColor outlines;
QPen directivity;
QPen grid;
QColor stationAnnotations;
QColor cityLabels;
QColor cityOutlines;
QColor cityCapital;
QColor cityNormal;
struct {
QPen normalText;
QPen normalBorder;
QBrush normalBackground;
QPen highlightedText;
QPen highlightedBorder;
QBrush highlightedBackground;
int textSize;
} annotations;
};
struct Legend {
Legend();
QColor background;
QColor border;
QColor text;
QColor headerText;
};
public:
QColor background;
Splash splash;
Records records;
Gradient spectrogram;
Picks picks;
Arrivals arrivals;
Magnitudes magnitudes;
Stations stations;
QC qc;
OriginSymbol originSymbol;
OriginStatus originStatus;
GroundMotion gm;
RecordView recordView;
Map map;
Legend legend;
QMap<std::string, QColor> agencies;
};
struct Fonts {
Fonts();
void setBase(const QFont& f);
QFont base;
QFont smaller;
QFont normal;
QFont large;
QFont highlight;
QFont heading1;
QFont heading2;
QFont heading3;
QFont cityLabels;
QFont splashVersion;
QFont splashMessage;
};
struct Splash {
Splash();
struct Pos {
QPoint pos;
int align;
};
Pos version;
Pos message;
};
struct Map {
Map();
int stationSize;
int originSymbolMinSize;
bool vectorLayerAntiAlias;
bool bilinearFilter;
bool showGrid;
bool showLayers;
bool showCities;
bool showLegends;
int cityPopulationWeight;
bool toBGR;
int polygonRoughness;
std::string projection;
};
struct Marker {
Marker();
int lineWidth;
};
struct RecordBorders {
RecordBorders();
Gui::RecordWidget::RecordBorderDrawMode drawMode;
};
struct Records {
Records();
int lineWidth;
bool antiAliasing;
bool optimize;
RecordBorders recordBorders;
};
struct Precision {
Precision();
int depth;
int distance;
int location;
int magnitude;
int originTime;
int pickTime;
int traceValues;
int rms;
int uncertainties;
};
struct Unit {
Unit();
bool distanceInKM;
};
struct DateTime {
DateTime();
bool useLocalTime;
};
public:
bool showMenu;
bool showStatusBar;
int tabPosition;
Splash splash;
Colors colors;
Marker marker;
Records records;
Map map;
Precision precision;
Unit unit;
DateTime dateTime;
Fonts fonts;
QFont font(int relativeFontSize, bool bold = false, bool italic = false);
void fetch();
};
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SC_GUI_API QColor blend(const QColor& c1, const QColor& c2, int percentOfC1);
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SC_GUI_API QColor blend(const QColor& c1, const QColor& c2);
}
}
#endif

View File

@ -0,0 +1,244 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_SPECTROGRAMRENDERER_H
#define SEISCOMP_GUI_CORE_SPECTROGRAMRENDERER_H
#ifndef Q_MOC_RUN
#include <seiscomp/core/recordsequence.h>
#include <seiscomp/math/restitution/transferfunction.h>
#include <seiscomp/io/recordfilter/spectralizer.h>
#endif
#include <seiscomp/gui/core/lut.h>
#include <QPainter>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API SpectrogramRenderer {
// ----------------------------------------------------------------------
// Public types
// ----------------------------------------------------------------------
public:
enum class NormalizationMode {
Fixed,
Frequency,
Time
};
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
//! C'tor
SpectrogramRenderer();
// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
public:
//! Sets the spectrogram options and calls reset().
bool setOptions(const IO::Spectralizer::Options &opts);
const IO::Spectralizer::Options &options() const { return _options; }
//! Sets the scale of the raw stream data which is 1/gain to convert
//! to sensor units
void setScale(double scale);
//! Sets the color gradient. Key range is normalized to [0,1].
void setGradient(const Gradient &gradient);
//! Sets the gradient range
void setGradientRange(double lowerBound, double upperBound);
double gradientLowerBound() const { return _gradient.lowerBound(); }
double gradientUpperBound() const { return _gradient.upperBound(); }
//! Resets the spectrogram and deletes all data
void reset();
//! Feeds a record for processing. Records must be timely ordered
//! otherwise gaps are produced.
bool feed(const Record *rec);
bool feedSequence(const RecordSequence *seq);
//! Resets the view and feeds the sequence
void setRecords(const RecordSequence *seq);
void setAlignment(const Core::Time &align);
void setTimeRange(double tmin, double tmax);
//! Sets the current time window of the data
void setTimeWindow(const Core::TimeWindow &tw);
//! Sets the frequency range to be displayed. A value lower or equal to
//! zero refers to the global minimum or the global maximum
//! respectively.
void setFrequencyRange(OPT(double) fmin, OPT(double) fmax);
const OPT(double) &frequencyLowerBound() const { return _fmin; }
const OPT(double) &frequencyUpperBound() const { return _fmax; }
void setNormalizeAmplitudes(bool f);
void setNormalizationMode(NormalizationMode mode);
bool normalizeAmplitudes() const { return _normalizationMode != NormalizationMode::Fixed; }
void setLogScale(bool f);
bool logScale() const { return _logarithmic; }
void setSmoothTransform(bool);
bool smoothTransform() const { return _smoothTransform; }
//! Sets the transfer function for deconvolution
void setTransferFunction(Math::Restitution::FFT::TransferFunction *tf);
bool isDirty() const { return _dirty; }
//! Creates the spectrogram. This is usually done in render if the
//! spectrogram is dirty but can called from outside.
void renderSpectrogram();
//! Renders the spectrogram with the given painter into the given rect.
void render(QPainter &p, const QRect &rect, bool labelLeftAlign = true,
bool renderLabels = false);
//! Renders the y axis. This call must precede a call to render otherwise
//! the frequency range can by out of sync.
void renderAxis(QPainter &p, const QRect &rect, bool leftAlign = true,
int paddingOuter = 6, int paddingInner = 0,
bool stretch = false);
QPair<double,double> range() const;
// ----------------------------------------------------------------------
// Private Interface
// ----------------------------------------------------------------------
private:
struct SpecImage {
QImage data;
Core::Time startTime;
Core::TimeSpan dt;
double minimumFrequency;
double maximumFrequency;
int width;
};
DEFINE_SMARTPOINTER(PowerSpectrum);
struct PowerSpectrum : public Core::BaseObject {
PowerSpectrum(const IO::Spectrum &spectrum, double scale)
: startTime(spectrum.startTime()), endTime(spectrum.endTime())
, dt(spectrum.dt()), frequency(spectrum.maximumFrequency()) {
centerTime = startTime + Core::TimeSpan(static_cast<double>(length()) * 0.5);
auto d = spectrum.data();
minimumAmplitude = maximumAmplitude = -1;
if ( d ) {
data = new DoubleArray(d->size());
for ( int i = 0; i < d->size(); ++i ) {
(*data)[i] = (*d)[i].real() * (*d)[i].real() + (*d)[i].imag() * (*d)[i].imag();
if ( minimumAmplitude < 0 || minimumAmplitude > (*data)[i] ) {
minimumAmplitude = (*data)[i];
}
if ( maximumAmplitude < (*data)[i] ) {
maximumAmplitude = (*data)[i];
}
}
if ( minimumAmplitude > 0 ) {
double norm = scale * 0.5 / frequency;
minimumAmplitude = log10(minimumAmplitude * norm * norm);
maximumAmplitude = log10(maximumAmplitude * norm * norm);
}
}
}
bool isValid() const { return data && data->size() > 0; }
Core::TimeSpan length() const { return endTime - startTime; }
const Core::Time &center() const { return centerTime; }
double minimumFrequency() const { return 0; }
double maximumFrequency() const { return frequency; }
Core::Time startTime;
Core::Time endTime;
Core::Time centerTime;
Core::TimeSpan dt;
double frequency;
DoubleArrayPtr data;
double minimumAmplitude;
double maximumAmplitude;
};
void setDirty();
void addSpectrum(const PowerSpectrum *);
void fillRow(SpecImage &img, DoubleArray *spec,
int column, int offset);
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
typedef QList<PowerSpectrumPtr> PowerSpectra;
typedef QList<SpecImage> SpecImageList;
typedef StaticColorLUT<512> Gradient512;
typedef Math::Restitution::FFT::TransferFunctionPtr TransferFunctionPtr;
QImage::Format _imageFormat;
TransferFunctionPtr _transferFunction;
Core::TimeWindow _timeWindow;
Core::Time _alignment;
double _tmin, _tmax;
double _scale;
OPT(double) _fmin, _fmax;
double _ampMin, _ampMax;
IO::Spectralizer::Options _options;
IO::SpectralizerPtr _spectralizer;
PowerSpectra _spectra;
SpecImageList _images;
Gradient512 _gradient;
NormalizationMode _normalizationMode;
double _normalizationAmpRange[2];
bool _logarithmic;
bool _smoothTransform;
bool _dirty;
double _renderedFmin;
double _renderedFmax;
};
inline QPair<double,double> SpectrogramRenderer::range() const {
return QPair<double,double>(_renderedFmin, _renderedFmax);
}
}
}
#endif

View File

@ -0,0 +1,133 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_SPECTROGRAMWIDGET_H
#define SEISCOMP_GUI_CORE_SPECTROGRAMWIDGET_H
#include <QWidget>
#include <seiscomp/gui/core/spectrogramrenderer.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API SpectrogramWidget : public QWidget {
Q_OBJECT
// ----------------------------------------------------------------------
// Public types
// ----------------------------------------------------------------------
public:
typedef IO::Spectralizer::Options SpectrumOptions;
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
SpectrogramWidget(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
// ----------------------------------------------------------------------
// Public Interface
// ----------------------------------------------------------------------
public:
//! Sets the spectrogram options and calls reset().
bool setSpectrumOptions(const SpectrumOptions &opts);
const SpectrumOptions &spectrumOptions() const;
//! Sets the scale of the raw stream data which is 1/gain
void setScale(double scale);
//! Sets the gradient range
void setGradientRange(double lowerBound, double upperBound);
double gradientLowerBound() const;
double gradientUpperBound() const;
//! Resets the spectrogram and deletes all data
void reset();
//! Feeds a record for processing. Records must be timely ordered
//! otherwise gaps are produced.
bool feed(const Record *rec);
bool feedSequence(const RecordSequence *seq);
//! Resets the view and feeds the sequence
void setRecords(const RecordSequence *seq);
void setAlignment(const Core::Time &align);
void setTimeRange(double tmin, double tmax);
//! Sets the current time window of the data
void setTimeWindow(const Core::TimeWindow &tw);
//! Sets the frequency range to be displayed. A value lower or equal to
//! zero refers to the global minimum or the global maximum
//! respectively.
void setFrequencyRange(OPT(double) fmin, OPT(double) fmax);
const OPT(double) &frequencyLowerBound() const;
const OPT(double) &frequencyUpperBound() const;
void setNormalizeAmplitudes(bool f);
bool normalizeAmplitudes() const;
void setLogScale(bool f);
bool logScale() const;
void setSmoothTransform(bool st);
bool smoothTransform() const;
//! Sets the transfer function for deconvolution
void setTransferFunction(Math::Restitution::FFT::TransferFunction *tf);
// ----------------------------------------------------------------------
// Public slots
// ----------------------------------------------------------------------
public slots:
void updateSpectrogram();
// ----------------------------------------------------------------------
// Protected Qt Interface
// ----------------------------------------------------------------------
protected:
void resizeEvent(QResizeEvent *);
void paintEvent(QPaintEvent *);
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
SpectrogramRenderer _renderer;
};
}
}
#endif

View File

@ -0,0 +1,142 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_SPECTRUMWIDGET_H
#define SEISCOMP_GUI_CORE_SPECTRUMWIDGET_H
#include <QWidget>
#include <seiscomp/gui/plot/datay.h>
#include <seiscomp/gui/plot/graph.h>
#ifndef Q_MOC_RUN
#include <seiscomp/math/fft.h>
#include <seiscomp/processing/response.h>
#endif
namespace Seiscomp {
namespace Gui {
class SC_GUI_API SpectrumWidget : public QWidget {
Q_OBJECT
// ----------------------------------------------------------------------
// X'truction
// ----------------------------------------------------------------------
public:
SpectrumWidget(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
void setMargin(int m) { _margin = qMax(0, m); }
/**
* @brief Sets the spectrum values and the Nyquist frequency as the
* frequency of the last spectrum value.
* @param freqNyquist The last spectrum value is measured for that frequency
* @param spec The spectrum values from 0Hz to [fNyquist]Hz
*/
void setSpectrum(double freqNyquist, const Math::ComplexArray &spec,
Processing::Response *resp = nullptr,
QString exportBasename = QString());
//! Access the x-axis
Axis &xAxis() { return _xAxis; }
//! Access the y-axis
Axis &yAxis() { return _yAxis; }
// ----------------------------------------------------------------------
// Public slots
// ----------------------------------------------------------------------
public slots:
void setAmplitudeSpectrum();
void setPhaseSpectrum();
void setPowerSpectrum();
void setLogScaleX(bool logScale);
void setLogScaleY(bool logScale);
void setShowSpectrum(bool show);
void setShowCorrected(bool show);
void setShowResponse(bool show);
/**
* @brief Exports all visible spectra into a simple ASCII file
*/
void exportSpectra();
// ----------------------------------------------------------------------
// QWidget interface
// ----------------------------------------------------------------------
protected:
void resizeEvent(QResizeEvent *e);
void paintEvent(QPaintEvent *e);
// ----------------------------------------------------------------------
// Private methods
// ----------------------------------------------------------------------
private:
void updateData();
void draw(QPainter &, const Graph *);
void updateRanges();
void updateAxisLabels();
// ----------------------------------------------------------------------
// Private members
// ----------------------------------------------------------------------
private:
enum Mode {
Amplitude,
Power,
Phase
};
QString _exportBasename;
double _freqNyquist;
Math::ComplexArray _spec;
Processing::ResponsePtr _resp;
Mode _mode;
Graph _graphPowerSpectrum;
Graph _graphResponseCorrectedPowerSpectrum;
Graph _graphResponsePowerSpectrum;
DataY _powerSpectrum;
DataY _responseCorrectedPowerSpectrum;
DataY _responsePowerSpectrum;
int _margin;
Axis _xAxis;
Axis _yAxis;
Axis _yAxis2;
};
}
}
#endif

View File

@ -0,0 +1,99 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_STREAMWIDGET_H
#define SEISCOMP_GUI_CORE_STREAMWIDGET_H
#include <vector>
#include <map>
#include <list>
#include <QWidget>
#include <QGroupBox>
#ifndef Q_MOC_RUN
#include <seiscomp/core/baseobject.h>
#include <seiscomp/core/recordsequence.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core/timewindow.h>
#include <seiscomp/gui/core/recordstreamthread.h>
#include <seiscomp/gui/core/recordwidget.h>
#include <seiscomp/gui/core/timescale.h>
#include <seiscomp/gui/qt.h>
#endif
namespace Seiscomp {
namespace Gui {
class SC_GUI_API StreamWidget : public QWidget {
Q_OBJECT
public:
StreamWidget(const std::string& recordStreamURL,
const std::string& waveformStreamID,
const double windowLength=600,
QWidget* parent=0);
~StreamWidget();
protected:
virtual void closeEvent(QCloseEvent*);
virtual void showEvent(QShowEvent*);
virtual void resizeEvent(QResizeEvent* evt);
signals:
void StreamWidgetClosed(StreamWidget* widget);
private slots:
void updateRecordWidget(Seiscomp::Record* record);
void updateRecordWidgetAlignment();
private:
void startWaveformDataAcquisition();
void stopWaveformDataAcquisition();
private:
QTimer* _timer;
QGroupBox* _groupBox;
std::unique_ptr<RecordStreamThread> _thread;
RecordWidget* _recordWidget;
RecordSequence* _recordSequence;
Core::TimeSpan _ringBufferSize;
TimeScale* _timeScale;
std::string _recordStreamURL;
std::string _waveformStreamID;
};
} // namespace Gui
} // namespace Seiscomp
#endif

View File

@ -0,0 +1,104 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_TENSORRENDERER_H
#define SEISCOMP_GUI_CORE_TENSORRENDERER_H
#include <QImage>
#include <QColor>
#ifndef Q_MOC_RUN
#include <seiscomp/math/matrix3.h>
#include <seiscomp/math/tensor.h>
#endif
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API TensorRenderer {
// ----------------------------------------------------------------------
// X'struction
// ----------------------------------------------------------------------
public:
TensorRenderer();
// ----------------------------------------------------------------------
// Public interface
// ----------------------------------------------------------------------
public:
void setShadingEnabled(bool);
bool isShadingEnabled() const { return _shading; }
void setMaterial(float ambient, float diffuse);
void setMargin(int);
void setProjectMargin(int);
void setBorderColor(QColor);
void setTColor(QColor);
void setPColor(QColor);
QPoint project(Math::Vector3f &v) const;
QPoint project(Math::Vector3d &v) const;
QPoint project(double azimuth, double dist = 1.0) const;
QPoint projectMargin(double azimuth, int margin, double dist = 1.0) const;
// Unprojects a point in screen coordinates. Returns false if the
// point is not on the sphere (x,y is then valid on the plane and
// z is undefined), true otherwise
bool unproject(Math::Vector3d &v, const QPointF &p) const;
void renderBorder(QImage& img);
// strike, dip and slip are expected to be in degrees
void render(QImage& img, double strike, double dip, double slip);
void render(QImage& img, const Math::Matrix3f &m);
void render(QImage& img, const Math::Matrix3d &m);
void render(QImage& img, const Math::Tensor2Sd &t, const Math::Matrix3f &m);
void render(QImage& img, const Math::Tensor2Sd &t);
void renderNP(QImage& img, double strike, double dip, double slip, QColor color);
private:
QColor _colorT;
QColor _colorP;
QColor _border;
bool _shading;
QPoint _center;
int _radius;
int _ballRadius;
int _projectRadius;
int _margin;
int _projectMargin;
float _materialAmbient;
float _materialDiffuse;
};
}
}
#endif

View File

@ -0,0 +1,73 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_TIMESCALE_H
#define SEISCOMP_GUI_TIMESCALE_H
#include "ruler.h"
#include <seiscomp/core/datetime.h>
#define REPAINT_WITHOUT_ERASE FALSE
#define REPAINT_AFTER_ERASE TRUE
namespace Seiscomp {
namespace Gui {
class SC_GUI_API TimeScale : public Ruler {
Q_OBJECT
public:
TimeScale(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(), Position pos = Bottom);
~TimeScale(){}
void setTimeRange(double tmin, double tmax) {
setRange(tmin, tmax);
}
double tmin() const { return _min; }
double tmax() const { return _max; }
void setAlignment(const Core::Time& t);
const Core::Time &alignment() const { return _alignment; }
public slots:
void setAbsoluteTimeEnabled(bool absoluteTime, bool absoluteDate = true);
protected:
bool getTickText(double pos, double lastPos,
int line, QString &str) const;
void updateIntervals();
protected:
Core::Time _alignment;
bool _showAbsoluteValues;
bool _showAbsoluteDate;
const char *_primaryTimeFormat;
const char *_secondaryTimeFormat;
const char *_relativeTimeFormat;
};
}
}
# endif

View File

@ -0,0 +1,193 @@
/********************************************************************************
** Form generated from reading UI file 'aboutwidget.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_ABOUTWIDGET_H
#define UI_ABOUTWIDGET_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QTabWidget>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_AboutWidget
{
public:
QVBoxLayout *vboxLayout;
QTabWidget *tabWidget;
QWidget *tab;
QGridLayout *gridLayout;
QLabel *label_3;
QLabel *labelVersion;
QLabel *label_6;
QLabel *label_7;
QLabel *label;
QLabel *label_5;
QLabel *label_4;
QSpacerItem *spacerItem;
QLabel *label_2;
QWidget *tab_2;
QVBoxLayout *vboxLayout1;
QTextEdit *textLicense;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem1;
QPushButton *buttonOk;
void setupUi(QWidget *AboutWidget)
{
if (AboutWidget->objectName().isEmpty())
AboutWidget->setObjectName(QString::fromUtf8("AboutWidget"));
AboutWidget->resize(357, 292);
vboxLayout = new QVBoxLayout(AboutWidget);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
tabWidget = new QTabWidget(AboutWidget);
tabWidget->setObjectName(QString::fromUtf8("tabWidget"));
tab = new QWidget();
tab->setObjectName(QString::fromUtf8("tab"));
gridLayout = new QGridLayout(tab);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
label_3 = new QLabel(tab);
label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout->addWidget(label_3, 1, 1, 1, 1);
labelVersion = new QLabel(tab);
labelVersion->setObjectName(QString::fromUtf8("labelVersion"));
gridLayout->addWidget(labelVersion, 0, 1, 1, 1);
label_6 = new QLabel(tab);
label_6->setObjectName(QString::fromUtf8("label_6"));
gridLayout->addWidget(label_6, 2, 1, 1, 1);
label_7 = new QLabel(tab);
label_7->setObjectName(QString::fromUtf8("label_7"));
gridLayout->addWidget(label_7, 4, 1, 1, 1);
label = new QLabel(tab);
label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
label->setSizePolicy(sizePolicy);
gridLayout->addWidget(label, 0, 0, 1, 1);
label_5 = new QLabel(tab);
label_5->setObjectName(QString::fromUtf8("label_5"));
gridLayout->addWidget(label_5, 5, 1, 1, 1);
label_4 = new QLabel(tab);
label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout->addWidget(label_4, 5, 0, 1, 1);
spacerItem = new QSpacerItem(351, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout->addItem(spacerItem, 6, 0, 1, 2);
label_2 = new QLabel(tab);
label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout->addWidget(label_2, 1, 0, 1, 1);
tabWidget->addTab(tab, QString());
tab_2 = new QWidget();
tab_2->setObjectName(QString::fromUtf8("tab_2"));
vboxLayout1 = new QVBoxLayout(tab_2);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
textLicense = new QTextEdit(tab_2);
textLicense->setObjectName(QString::fromUtf8("textLicense"));
textLicense->setReadOnly(true);
vboxLayout1->addWidget(textLicense);
tabWidget->addTab(tab_2, QString());
vboxLayout->addWidget(tabWidget);
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem1 = new QSpacerItem(271, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem1);
buttonOk = new QPushButton(AboutWidget);
buttonOk->setObjectName(QString::fromUtf8("buttonOk"));
hboxLayout->addWidget(buttonOk);
vboxLayout->addLayout(hboxLayout);
retranslateUi(AboutWidget);
QObject::connect(buttonOk, SIGNAL(clicked()), AboutWidget, SLOT(close()));
QMetaObject::connectSlotsByName(AboutWidget);
} // setupUi
void retranslateUi(QWidget *AboutWidget)
{
AboutWidget->setWindowTitle(QCoreApplication::translate("AboutWidget", "About SeisComP::GUI", nullptr));
label_3->setText(QCoreApplication::translate("AboutWidget", "GFZ Potsdam", nullptr));
labelVersion->setText(QCoreApplication::translate("AboutWidget", "-", nullptr));
label_6->setText(QCoreApplication::translate("AboutWidget", "German Research Centre for Geosciences", nullptr));
label_7->setText(QCoreApplication::translate("AboutWidget", "gempa GmbH (http://www.gempa.de)", nullptr));
label->setText(QCoreApplication::translate("AboutWidget", "Version:", nullptr));
label_5->setText(QCoreApplication::translate("AboutWidget", "geofon_dc@gfz-potsdam.de", nullptr));
label_4->setText(QCoreApplication::translate("AboutWidget", "Contact:", nullptr));
label_2->setText(QCoreApplication::translate("AboutWidget", "Authors:", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab), QCoreApplication::translate("AboutWidget", "About", nullptr));
tabWidget->setTabText(tabWidget->indexOf(tab_2), QCoreApplication::translate("AboutWidget", "License", nullptr));
buttonOk->setText(QCoreApplication::translate("AboutWidget", "Ok", nullptr));
} // retranslateUi
};
namespace Ui {
class AboutWidget: public Ui_AboutWidget {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_ABOUTWIDGET_H

View File

@ -0,0 +1,393 @@
/********************************************************************************
** Form generated from reading UI file 'connectiondialog.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_CONNECTIONDIALOG_H
#define UI_CONNECTIONDIALOG_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QListWidget>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QSpinBox>
#include <QtWidgets/QSplitter>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_ConnectionDialog
{
public:
QGridLayout *gridLayout;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem;
QPushButton *btnClose;
QGroupBox *groupDatabase;
QGridLayout *gridLayout1;
QHBoxLayout *hboxLayout1;
QPushButton *btnDbSwitchToReported;
QSpacerItem *spacerItem1;
QPushButton *btnDbConnect;
QComboBox *comboDbType;
QLineEdit *editDbConnection;
QLabel *labelDbType;
QLabel *labelDbConnection;
QLabel *label_7;
QLineEdit *labelDbReported;
QSplitter *splitter;
QGroupBox *groupMessaging;
QGridLayout *gridLayout2;
QLabel *label_4;
QSpinBox *timeoutSpinBox;
QHBoxLayout *hboxLayout2;
QSpacerItem *spacerItem2;
QPushButton *btnConnect;
QLineEdit *editPrimaryGroup;
QLabel *label_5;
QLabel *label_2;
QLineEdit *editServer;
QLineEdit *editUser;
QLabel *label;
QSpacerItem *verticalSpacer;
QLabel *label_3;
QHBoxLayout *horizontalLayout;
QLineEdit *editPeerCertificate;
QToolButton *btnPeerCertificateOpen;
QGroupBox *groupSubscriptions;
QVBoxLayout *vboxLayout;
QListWidget *listSubscriptions;
QHBoxLayout *hboxLayout3;
QPushButton *btnSelectAll;
QSpacerItem *spacerItem3;
QPushButton *btnDeselectAll;
void setupUi(QDialog *ConnectionDialog)
{
if (ConnectionDialog->objectName().isEmpty())
ConnectionDialog->setObjectName(QString::fromUtf8("ConnectionDialog"));
ConnectionDialog->resize(868, 652);
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(ConnectionDialog->sizePolicy().hasHeightForWidth());
ConnectionDialog->setSizePolicy(sizePolicy);
gridLayout = new QGridLayout(ConnectionDialog);
gridLayout->setSpacing(4);
gridLayout->setContentsMargins(4, 4, 4, 4);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(261, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
btnClose = new QPushButton(ConnectionDialog);
btnClose->setObjectName(QString::fromUtf8("btnClose"));
hboxLayout->addWidget(btnClose);
gridLayout->addLayout(hboxLayout, 2, 0, 1, 1);
groupDatabase = new QGroupBox(ConnectionDialog);
groupDatabase->setObjectName(QString::fromUtf8("groupDatabase"));
QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(groupDatabase->sizePolicy().hasHeightForWidth());
groupDatabase->setSizePolicy(sizePolicy1);
gridLayout1 = new QGridLayout(groupDatabase);
#ifndef Q_OS_MAC
gridLayout1->setSpacing(6);
#endif
#ifndef Q_OS_MAC
gridLayout1->setContentsMargins(9, 9, 9, 9);
#endif
gridLayout1->setObjectName(QString::fromUtf8("gridLayout1"));
hboxLayout1 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout1->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
btnDbSwitchToReported = new QPushButton(groupDatabase);
btnDbSwitchToReported->setObjectName(QString::fromUtf8("btnDbSwitchToReported"));
btnDbSwitchToReported->setEnabled(false);
hboxLayout1->addWidget(btnDbSwitchToReported);
spacerItem1 = new QSpacerItem(71, 27, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem1);
btnDbConnect = new QPushButton(groupDatabase);
btnDbConnect->setObjectName(QString::fromUtf8("btnDbConnect"));
hboxLayout1->addWidget(btnDbConnect);
gridLayout1->addLayout(hboxLayout1, 3, 1, 1, 1);
comboDbType = new QComboBox(groupDatabase);
comboDbType->setObjectName(QString::fromUtf8("comboDbType"));
comboDbType->setModelColumn(0);
gridLayout1->addWidget(comboDbType, 0, 1, 1, 1);
editDbConnection = new QLineEdit(groupDatabase);
editDbConnection->setObjectName(QString::fromUtf8("editDbConnection"));
gridLayout1->addWidget(editDbConnection, 1, 1, 1, 1);
labelDbType = new QLabel(groupDatabase);
labelDbType->setObjectName(QString::fromUtf8("labelDbType"));
gridLayout1->addWidget(labelDbType, 0, 0, 1, 1);
labelDbConnection = new QLabel(groupDatabase);
labelDbConnection->setObjectName(QString::fromUtf8("labelDbConnection"));
gridLayout1->addWidget(labelDbConnection, 1, 0, 1, 1);
label_7 = new QLabel(groupDatabase);
label_7->setObjectName(QString::fromUtf8("label_7"));
gridLayout1->addWidget(label_7, 2, 0, 1, 1);
labelDbReported = new QLineEdit(groupDatabase);
labelDbReported->setObjectName(QString::fromUtf8("labelDbReported"));
labelDbReported->setReadOnly(true);
gridLayout1->addWidget(labelDbReported, 2, 1, 1, 1);
gridLayout->addWidget(groupDatabase, 1, 0, 1, 1);
splitter = new QSplitter(ConnectionDialog);
splitter->setObjectName(QString::fromUtf8("splitter"));
splitter->setOrientation(Qt::Horizontal);
groupMessaging = new QGroupBox(splitter);
groupMessaging->setObjectName(QString::fromUtf8("groupMessaging"));
QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Minimum);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
sizePolicy2.setHeightForWidth(groupMessaging->sizePolicy().hasHeightForWidth());
groupMessaging->setSizePolicy(sizePolicy2);
gridLayout2 = new QGridLayout(groupMessaging);
#ifndef Q_OS_MAC
gridLayout2->setSpacing(6);
#endif
#ifndef Q_OS_MAC
gridLayout2->setContentsMargins(9, 9, 9, 9);
#endif
gridLayout2->setObjectName(QString::fromUtf8("gridLayout2"));
label_4 = new QLabel(groupMessaging);
label_4->setObjectName(QString::fromUtf8("label_4"));
gridLayout2->addWidget(label_4, 2, 0, 1, 1);
timeoutSpinBox = new QSpinBox(groupMessaging);
timeoutSpinBox->setObjectName(QString::fromUtf8("timeoutSpinBox"));
gridLayout2->addWidget(timeoutSpinBox, 2, 1, 1, 1);
hboxLayout2 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(0, 0, 0, 0);
hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
spacerItem2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout2->addItem(spacerItem2);
btnConnect = new QPushButton(groupMessaging);
btnConnect->setObjectName(QString::fromUtf8("btnConnect"));
hboxLayout2->addWidget(btnConnect);
gridLayout2->addLayout(hboxLayout2, 6, 0, 1, 2);
editPrimaryGroup = new QLineEdit(groupMessaging);
editPrimaryGroup->setObjectName(QString::fromUtf8("editPrimaryGroup"));
gridLayout2->addWidget(editPrimaryGroup, 3, 1, 1, 1);
label_5 = new QLabel(groupMessaging);
label_5->setObjectName(QString::fromUtf8("label_5"));
gridLayout2->addWidget(label_5, 3, 0, 1, 1);
label_2 = new QLabel(groupMessaging);
label_2->setObjectName(QString::fromUtf8("label_2"));
gridLayout2->addWidget(label_2, 1, 0, 1, 1);
editServer = new QLineEdit(groupMessaging);
editServer->setObjectName(QString::fromUtf8("editServer"));
gridLayout2->addWidget(editServer, 1, 1, 1, 1);
editUser = new QLineEdit(groupMessaging);
editUser->setObjectName(QString::fromUtf8("editUser"));
gridLayout2->addWidget(editUser, 0, 1, 1, 1);
label = new QLabel(groupMessaging);
label->setObjectName(QString::fromUtf8("label"));
gridLayout2->addWidget(label, 0, 0, 1, 1);
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
gridLayout2->addItem(verticalSpacer, 5, 1, 1, 1);
label_3 = new QLabel(groupMessaging);
label_3->setObjectName(QString::fromUtf8("label_3"));
gridLayout2->addWidget(label_3, 4, 0, 1, 1);
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
editPeerCertificate = new QLineEdit(groupMessaging);
editPeerCertificate->setObjectName(QString::fromUtf8("editPeerCertificate"));
sizePolicy2.setHeightForWidth(editPeerCertificate->sizePolicy().hasHeightForWidth());
editPeerCertificate->setSizePolicy(sizePolicy2);
horizontalLayout->addWidget(editPeerCertificate);
btnPeerCertificateOpen = new QToolButton(groupMessaging);
btnPeerCertificateOpen->setObjectName(QString::fromUtf8("btnPeerCertificateOpen"));
horizontalLayout->addWidget(btnPeerCertificateOpen);
gridLayout2->addLayout(horizontalLayout, 4, 1, 1, 1);
splitter->addWidget(groupMessaging);
groupSubscriptions = new QGroupBox(splitter);
groupSubscriptions->setObjectName(QString::fromUtf8("groupSubscriptions"));
groupSubscriptions->setEnabled(false);
sizePolicy2.setHeightForWidth(groupSubscriptions->sizePolicy().hasHeightForWidth());
groupSubscriptions->setSizePolicy(sizePolicy2);
vboxLayout = new QVBoxLayout(groupSubscriptions);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
listSubscriptions = new QListWidget(groupSubscriptions);
listSubscriptions->setObjectName(QString::fromUtf8("listSubscriptions"));
QSizePolicy sizePolicy3(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding);
sizePolicy3.setHorizontalStretch(0);
sizePolicy3.setVerticalStretch(0);
sizePolicy3.setHeightForWidth(listSubscriptions->sizePolicy().hasHeightForWidth());
listSubscriptions->setSizePolicy(sizePolicy3);
vboxLayout->addWidget(listSubscriptions);
hboxLayout3 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout3->setSpacing(6);
#endif
hboxLayout3->setContentsMargins(0, 0, 0, 0);
hboxLayout3->setObjectName(QString::fromUtf8("hboxLayout3"));
btnSelectAll = new QPushButton(groupSubscriptions);
btnSelectAll->setObjectName(QString::fromUtf8("btnSelectAll"));
hboxLayout3->addWidget(btnSelectAll);
spacerItem3 = new QSpacerItem(70, 30, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout3->addItem(spacerItem3);
btnDeselectAll = new QPushButton(groupSubscriptions);
btnDeselectAll->setObjectName(QString::fromUtf8("btnDeselectAll"));
hboxLayout3->addWidget(btnDeselectAll);
vboxLayout->addLayout(hboxLayout3);
splitter->addWidget(groupSubscriptions);
gridLayout->addWidget(splitter, 0, 0, 1, 1);
QWidget::setTabOrder(editUser, editServer);
QWidget::setTabOrder(editServer, timeoutSpinBox);
QWidget::setTabOrder(timeoutSpinBox, editPrimaryGroup);
QWidget::setTabOrder(editPrimaryGroup, btnConnect);
QWidget::setTabOrder(btnConnect, listSubscriptions);
QWidget::setTabOrder(listSubscriptions, comboDbType);
QWidget::setTabOrder(comboDbType, editDbConnection);
QWidget::setTabOrder(editDbConnection, btnDbSwitchToReported);
QWidget::setTabOrder(btnDbSwitchToReported, btnDbConnect);
QWidget::setTabOrder(btnDbConnect, btnClose);
retranslateUi(ConnectionDialog);
QObject::connect(btnClose, SIGNAL(clicked()), ConnectionDialog, SLOT(accept()));
QMetaObject::connectSlotsByName(ConnectionDialog);
} // setupUi
void retranslateUi(QDialog *ConnectionDialog)
{
ConnectionDialog->setWindowTitle(QCoreApplication::translate("ConnectionDialog", "Setup connection", nullptr));
btnClose->setText(QCoreApplication::translate("ConnectionDialog", "Continue", nullptr));
groupDatabase->setTitle(QCoreApplication::translate("ConnectionDialog", "Database", nullptr));
btnDbSwitchToReported->setText(QCoreApplication::translate("ConnectionDialog", "Switch to reported", nullptr));
btnDbConnect->setText(QCoreApplication::translate("ConnectionDialog", "Connect", nullptr));
labelDbType->setText(QCoreApplication::translate("ConnectionDialog", "Type:", nullptr));
labelDbConnection->setText(QCoreApplication::translate("ConnectionDialog", "Connection:", nullptr));
label_7->setText(QCoreApplication::translate("ConnectionDialog", "Reported:", nullptr));
groupMessaging->setTitle(QCoreApplication::translate("ConnectionDialog", "Messaging", nullptr));
label_4->setText(QCoreApplication::translate("ConnectionDialog", "Timeout in sec.:", nullptr));
btnConnect->setText(QCoreApplication::translate("ConnectionDialog", "Connect", nullptr));
label_5->setText(QCoreApplication::translate("ConnectionDialog", "Primary group:", nullptr));
label_2->setText(QCoreApplication::translate("ConnectionDialog", "Server:", nullptr));
editServer->setText(QCoreApplication::translate("ConnectionDialog", "localhost", nullptr));
editUser->setText(QCoreApplication::translate("ConnectionDialog", "user", nullptr));
label->setText(QCoreApplication::translate("ConnectionDialog", "User:", nullptr));
label_3->setText(QCoreApplication::translate("ConnectionDialog", "Peer certificate:", nullptr));
#if QT_CONFIG(tooltip)
btnPeerCertificateOpen->setToolTip(QCoreApplication::translate("ConnectionDialog", "Select peer certificate file", nullptr));
#endif // QT_CONFIG(tooltip)
btnPeerCertificateOpen->setText(QCoreApplication::translate("ConnectionDialog", "...", nullptr));
groupSubscriptions->setTitle(QCoreApplication::translate("ConnectionDialog", "Subscriptions", nullptr));
btnSelectAll->setText(QCoreApplication::translate("ConnectionDialog", "Select All", nullptr));
btnDeselectAll->setText(QCoreApplication::translate("ConnectionDialog", "Deselect All", nullptr));
} // retranslateUi
};
namespace Ui {
class ConnectionDialog: public Ui_ConnectionDialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_CONNECTIONDIALOG_H

View File

@ -0,0 +1,265 @@
/********************************************************************************
** Form generated from reading UI file 'diagramfilter.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_DIAGRAMFILTER_H
#define UI_DIAGRAMFILTER_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QDoubleSpinBox>
#include <QtWidgets/QFrame>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_FilterSettings
{
public:
QVBoxLayout *vboxLayout;
QHBoxLayout *hboxLayout;
QLabel *label;
QComboBox *comboFilter;
QFrame *line;
QFrame *frameNoFilter;
QVBoxLayout *vboxLayout1;
QLabel *label_7;
QSpacerItem *spacerItem;
QFrame *frameAzimuthAroundEpicenter;
QVBoxLayout *vboxLayout2;
QHBoxLayout *hboxLayout1;
QLabel *label_2;
QDoubleSpinBox *spinAzimuthCenter;
QLabel *label_3;
QSpacerItem *spacerItem1;
QLabel *label_4;
QLabel *label_6;
QDoubleSpinBox *spinAzimuthExtent;
QLabel *label_5;
QSpacerItem *spacerItem2;
QHBoxLayout *hboxLayout2;
QSpacerItem *spacerItem3;
QPushButton *okButton;
QPushButton *cancelButton;
void setupUi(QDialog *FilterSettings)
{
if (FilterSettings->objectName().isEmpty())
FilterSettings->setObjectName(QString::fromUtf8("FilterSettings"));
FilterSettings->resize(317, 132);
vboxLayout = new QVBoxLayout(FilterSettings);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
label = new QLabel(FilterSettings);
label->setObjectName(QString::fromUtf8("label"));
QSizePolicy sizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
label->setSizePolicy(sizePolicy);
hboxLayout->addWidget(label);
comboFilter = new QComboBox(FilterSettings);
comboFilter->addItem(QString());
comboFilter->addItem(QString());
comboFilter->setObjectName(QString::fromUtf8("comboFilter"));
hboxLayout->addWidget(comboFilter);
vboxLayout->addLayout(hboxLayout);
line = new QFrame(FilterSettings);
line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(line);
frameNoFilter = new QFrame(FilterSettings);
frameNoFilter->setObjectName(QString::fromUtf8("frameNoFilter"));
frameNoFilter->setFrameShape(QFrame::NoFrame);
frameNoFilter->setFrameShadow(QFrame::Raised);
vboxLayout1 = new QVBoxLayout(frameNoFilter);
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
#endif
vboxLayout1->setContentsMargins(0, 0, 0, 0);
vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
label_7 = new QLabel(frameNoFilter);
label_7->setObjectName(QString::fromUtf8("label_7"));
vboxLayout1->addWidget(label_7);
spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout1->addItem(spacerItem);
vboxLayout->addWidget(frameNoFilter);
frameAzimuthAroundEpicenter = new QFrame(FilterSettings);
frameAzimuthAroundEpicenter->setObjectName(QString::fromUtf8("frameAzimuthAroundEpicenter"));
frameAzimuthAroundEpicenter->setFrameShape(QFrame::NoFrame);
frameAzimuthAroundEpicenter->setFrameShadow(QFrame::Raised);
vboxLayout2 = new QVBoxLayout(frameAzimuthAroundEpicenter);
#ifndef Q_OS_MAC
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(0, 0, 0, 0);
vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
hboxLayout1 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout1->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
label_2 = new QLabel(frameAzimuthAroundEpicenter);
label_2->setObjectName(QString::fromUtf8("label_2"));
sizePolicy.setHeightForWidth(label_2->sizePolicy().hasHeightForWidth());
label_2->setSizePolicy(sizePolicy);
hboxLayout1->addWidget(label_2);
spinAzimuthCenter = new QDoubleSpinBox(frameAzimuthAroundEpicenter);
spinAzimuthCenter->setObjectName(QString::fromUtf8("spinAzimuthCenter"));
spinAzimuthCenter->setDecimals(1);
spinAzimuthCenter->setMaximum(360.000000000000000);
spinAzimuthCenter->setMinimum(-360.000000000000000);
hboxLayout1->addWidget(spinAzimuthCenter);
label_3 = new QLabel(frameAzimuthAroundEpicenter);
label_3->setObjectName(QString::fromUtf8("label_3"));
sizePolicy.setHeightForWidth(label_3->sizePolicy().hasHeightForWidth());
label_3->setSizePolicy(sizePolicy);
hboxLayout1->addWidget(label_3);
spacerItem1 = new QSpacerItem(10, 5, QSizePolicy::Fixed, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem1);
label_4 = new QLabel(frameAzimuthAroundEpicenter);
label_4->setObjectName(QString::fromUtf8("label_4"));
sizePolicy.setHeightForWidth(label_4->sizePolicy().hasHeightForWidth());
label_4->setSizePolicy(sizePolicy);
hboxLayout1->addWidget(label_4);
label_6 = new QLabel(frameAzimuthAroundEpicenter);
label_6->setObjectName(QString::fromUtf8("label_6"));
sizePolicy.setHeightForWidth(label_6->sizePolicy().hasHeightForWidth());
label_6->setSizePolicy(sizePolicy);
hboxLayout1->addWidget(label_6);
spinAzimuthExtent = new QDoubleSpinBox(frameAzimuthAroundEpicenter);
spinAzimuthExtent->setObjectName(QString::fromUtf8("spinAzimuthExtent"));
spinAzimuthExtent->setDecimals(1);
spinAzimuthExtent->setMaximum(180.000000000000000);
spinAzimuthExtent->setMinimum(0.000000000000000);
spinAzimuthExtent->setValue(45.000000000000000);
hboxLayout1->addWidget(spinAzimuthExtent);
label_5 = new QLabel(frameAzimuthAroundEpicenter);
label_5->setObjectName(QString::fromUtf8("label_5"));
sizePolicy.setHeightForWidth(label_5->sizePolicy().hasHeightForWidth());
label_5->setSizePolicy(sizePolicy);
hboxLayout1->addWidget(label_5);
vboxLayout2->addLayout(hboxLayout1);
spacerItem2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout2->addItem(spacerItem2);
vboxLayout->addWidget(frameAzimuthAroundEpicenter);
hboxLayout2 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout2->setSpacing(6);
#endif
hboxLayout2->setContentsMargins(0, 0, 0, 0);
hboxLayout2->setObjectName(QString::fromUtf8("hboxLayout2"));
spacerItem3 = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout2->addItem(spacerItem3);
okButton = new QPushButton(FilterSettings);
okButton->setObjectName(QString::fromUtf8("okButton"));
hboxLayout2->addWidget(okButton);
cancelButton = new QPushButton(FilterSettings);
cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout2->addWidget(cancelButton);
vboxLayout->addLayout(hboxLayout2);
retranslateUi(FilterSettings);
QObject::connect(okButton, SIGNAL(clicked()), FilterSettings, SLOT(accept()));
QObject::connect(cancelButton, SIGNAL(clicked()), FilterSettings, SLOT(reject()));
QMetaObject::connectSlotsByName(FilterSettings);
} // setupUi
void retranslateUi(QDialog *FilterSettings)
{
FilterSettings->setWindowTitle(QCoreApplication::translate("FilterSettings", "Filter settings", nullptr));
label->setText(QCoreApplication::translate("FilterSettings", "Filter:", nullptr));
comboFilter->setItemText(0, QCoreApplication::translate("FilterSettings", "None", nullptr));
comboFilter->setItemText(1, QCoreApplication::translate("FilterSettings", "Azimuth around epicenter", nullptr));
label_7->setText(QCoreApplication::translate("FilterSettings", "No filter. Displays all values.", nullptr));
label_2->setText(QCoreApplication::translate("FilterSettings", "Center:", nullptr));
label_3->setText(QCoreApplication::translate("FilterSettings", "deg", nullptr));
label_4->setText(QCoreApplication::translate("FilterSettings", "Extent:", nullptr));
label_6->setText(QCoreApplication::translate("FilterSettings", "+/-", nullptr));
label_5->setText(QCoreApplication::translate("FilterSettings", "deg", nullptr));
okButton->setText(QCoreApplication::translate("FilterSettings", "OK", nullptr));
cancelButton->setText(QCoreApplication::translate("FilterSettings", "Cancel", nullptr));
} // retranslateUi
};
namespace Ui {
class FilterSettings: public Ui_FilterSettings {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_DIAGRAMFILTER_H

View File

@ -0,0 +1,86 @@
/********************************************************************************
** Form generated from reading UI file 'infotext.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_INFOTEXT_H
#define UI_INFOTEXT_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_InfoText
{
public:
QVBoxLayout *vboxLayout;
QTextEdit *textEdit;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem;
QPushButton *closeButton;
void setupUi(QDialog *InfoText)
{
if (InfoText->objectName().isEmpty())
InfoText->setObjectName(QString::fromUtf8("InfoText"));
InfoText->resize(319, 336);
vboxLayout = new QVBoxLayout(InfoText);
vboxLayout->setSpacing(4);
vboxLayout->setContentsMargins(6, 6, 6, 6);
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
textEdit = new QTextEdit(InfoText);
textEdit->setObjectName(QString::fromUtf8("textEdit"));
textEdit->setReadOnly(true);
vboxLayout->addWidget(textEdit);
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
closeButton = new QPushButton(InfoText);
closeButton->setObjectName(QString::fromUtf8("closeButton"));
hboxLayout->addWidget(closeButton);
vboxLayout->addLayout(hboxLayout);
retranslateUi(InfoText);
QObject::connect(closeButton, SIGNAL(clicked()), InfoText, SLOT(reject()));
QMetaObject::connectSlotsByName(InfoText);
} // setupUi
void retranslateUi(QDialog *InfoText)
{
InfoText->setWindowTitle(QCoreApplication::translate("InfoText", "Information", nullptr));
closeButton->setText(QCoreApplication::translate("InfoText", "Close", nullptr));
} // retranslateUi
};
namespace Ui {
class InfoText: public Ui_InfoText {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_INFOTEXT_H

View File

@ -0,0 +1,102 @@
/********************************************************************************
** Form generated from reading UI file 'inspector.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_INSPECTOR_H
#define UI_INSPECTOR_H
#include <QtCore/QVariant>
#include <QtGui/QIcon>
#include <QtWidgets/QApplication>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QSplitter>
#include <QtWidgets/QTableWidget>
#include <QtWidgets/QToolButton>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Inspector
{
public:
QVBoxLayout *vboxLayout;
QToolButton *buttonBack;
QLineEdit *editFilter;
QSplitter *splitter;
QTreeWidget *treeWidget;
QTableWidget *tableWidget;
void setupUi(QWidget *Inspector)
{
if (Inspector->objectName().isEmpty())
Inspector->setObjectName(QString::fromUtf8("Inspector"));
Inspector->resize(657, 498);
vboxLayout = new QVBoxLayout(Inspector);
vboxLayout->setSpacing(4);
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
buttonBack = new QToolButton(Inspector);
buttonBack->setObjectName(QString::fromUtf8("buttonBack"));
buttonBack->setEnabled(false);
const QIcon icon = QIcon(QString::fromUtf8(":/icons/icons/undo.png"));
buttonBack->setIcon(icon);
vboxLayout->addWidget(buttonBack);
editFilter = new QLineEdit(Inspector);
editFilter->setObjectName(QString::fromUtf8("editFilter"));
vboxLayout->addWidget(editFilter);
splitter = new QSplitter(Inspector);
splitter->setObjectName(QString::fromUtf8("splitter"));
splitter->setOrientation(Qt::Horizontal);
treeWidget = new QTreeWidget(splitter);
treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
splitter->addWidget(treeWidget);
tableWidget = new QTableWidget(splitter);
tableWidget->setObjectName(QString::fromUtf8("tableWidget"));
tableWidget->setAlternatingRowColors(true);
splitter->addWidget(tableWidget);
vboxLayout->addWidget(splitter);
retranslateUi(Inspector);
QMetaObject::connectSlotsByName(Inspector);
} // setupUi
void retranslateUi(QWidget *Inspector)
{
Inspector->setWindowTitle(QCoreApplication::translate("Inspector", "Inspector", nullptr));
#if QT_CONFIG(tooltip)
buttonBack->setToolTip(QString());
#endif // QT_CONFIG(tooltip)
buttonBack->setText(QCoreApplication::translate("Inspector", "...", nullptr));
#if QT_CONFIG(shortcut)
buttonBack->setShortcut(QCoreApplication::translate("Inspector", "Backspace", nullptr));
#endif // QT_CONFIG(shortcut)
#if QT_CONFIG(tooltip)
editFilter->setToolTip(QCoreApplication::translate("Inspector", "Define an object filter, e.g. 'Network.code=GE'. Wildcards are allowed to match a value.", nullptr));
#endif // QT_CONFIG(tooltip)
} // retranslateUi
};
namespace Ui {
class Inspector: public Ui_Inspector {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_INSPECTOR_H

View File

@ -0,0 +1,194 @@
/********************************************************************************
** Form generated from reading UI file 'questionbox.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_QUESTIONBOX_H
#define UI_QUESTIONBOX_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_QuestionBox
{
public:
QVBoxLayout *vboxLayout;
QHBoxLayout *hboxLayout;
QVBoxLayout *vboxLayout1;
QLabel *labelIcon;
QSpacerItem *spacerItem;
QVBoxLayout *vboxLayout2;
QLabel *labelMessage;
QLabel *labelInfo;
QSpacerItem *spacerItem1;
QVBoxLayout *vboxLayout3;
QCheckBox *checkBox;
QHBoxLayout *hboxLayout1;
QPushButton *yesButton;
QSpacerItem *spacerItem2;
QPushButton *noButton;
void setupUi(QDialog *QuestionBox)
{
if (QuestionBox->objectName().isEmpty())
QuestionBox->setObjectName(QString::fromUtf8("QuestionBox"));
QuestionBox->resize(231, 131);
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(QuestionBox->sizePolicy().hasHeightForWidth());
QuestionBox->setSizePolicy(sizePolicy);
QuestionBox->setSizeGripEnabled(false);
QuestionBox->setModal(true);
vboxLayout = new QVBoxLayout(QuestionBox);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
hboxLayout->setContentsMargins(0, 0, 0, 0);
#endif
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
vboxLayout1 = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout1->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout1->setContentsMargins(0, 0, 0, 0);
#endif
vboxLayout1->setObjectName(QString::fromUtf8("vboxLayout1"));
labelIcon = new QLabel(QuestionBox);
labelIcon->setObjectName(QString::fromUtf8("labelIcon"));
QSizePolicy sizePolicy1(QSizePolicy::Maximum, QSizePolicy::Maximum);
sizePolicy1.setHorizontalStretch(0);
sizePolicy1.setVerticalStretch(0);
sizePolicy1.setHeightForWidth(labelIcon->sizePolicy().hasHeightForWidth());
labelIcon->setSizePolicy(sizePolicy1);
labelIcon->setFrameShape(QFrame::NoFrame);
vboxLayout1->addWidget(labelIcon);
spacerItem = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum);
vboxLayout1->addItem(spacerItem);
hboxLayout->addLayout(vboxLayout1);
vboxLayout2 = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout2->setSpacing(6);
#endif
vboxLayout2->setContentsMargins(0, 0, 0, 0);
vboxLayout2->setObjectName(QString::fromUtf8("vboxLayout2"));
labelMessage = new QLabel(QuestionBox);
labelMessage->setObjectName(QString::fromUtf8("labelMessage"));
sizePolicy.setHeightForWidth(labelMessage->sizePolicy().hasHeightForWidth());
labelMessage->setSizePolicy(sizePolicy);
labelMessage->setFrameShape(QFrame::NoFrame);
vboxLayout2->addWidget(labelMessage);
labelInfo = new QLabel(QuestionBox);
labelInfo->setObjectName(QString::fromUtf8("labelInfo"));
sizePolicy.setHeightForWidth(labelInfo->sizePolicy().hasHeightForWidth());
labelInfo->setSizePolicy(sizePolicy);
labelInfo->setMinimumSize(QSize(0, 0));
labelInfo->setFrameShape(QFrame::NoFrame);
vboxLayout2->addWidget(labelInfo);
hboxLayout->addLayout(vboxLayout2);
vboxLayout->addLayout(hboxLayout);
spacerItem1 = new QSpacerItem(20, 10, QSizePolicy::Minimum, QSizePolicy::Maximum);
vboxLayout->addItem(spacerItem1);
vboxLayout3 = new QVBoxLayout();
#ifndef Q_OS_MAC
vboxLayout3->setSpacing(6);
#endif
vboxLayout3->setContentsMargins(0, 0, 0, 0);
vboxLayout3->setObjectName(QString::fromUtf8("vboxLayout3"));
checkBox = new QCheckBox(QuestionBox);
checkBox->setObjectName(QString::fromUtf8("checkBox"));
vboxLayout3->addWidget(checkBox);
hboxLayout1 = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout1->setSpacing(6);
#endif
hboxLayout1->setContentsMargins(0, 0, 0, 0);
hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1"));
yesButton = new QPushButton(QuestionBox);
yesButton->setObjectName(QString::fromUtf8("yesButton"));
hboxLayout1->addWidget(yesButton);
spacerItem2 = new QSpacerItem(54, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout1->addItem(spacerItem2);
noButton = new QPushButton(QuestionBox);
noButton->setObjectName(QString::fromUtf8("noButton"));
hboxLayout1->addWidget(noButton);
vboxLayout3->addLayout(hboxLayout1);
vboxLayout->addLayout(vboxLayout3);
retranslateUi(QuestionBox);
QObject::connect(yesButton, SIGNAL(clicked()), QuestionBox, SLOT(accept()));
QObject::connect(noButton, SIGNAL(clicked()), QuestionBox, SLOT(reject()));
QMetaObject::connectSlotsByName(QuestionBox);
} // setupUi
void retranslateUi(QDialog *QuestionBox)
{
QuestionBox->setWindowTitle(QCoreApplication::translate("QuestionBox", "Question", nullptr));
labelIcon->setText(QString());
labelMessage->setText(QString());
labelInfo->setText(QString());
checkBox->setText(QCoreApplication::translate("QuestionBox", "Do not show this message again", nullptr));
yesButton->setText(QCoreApplication::translate("QuestionBox", "Yes", nullptr));
noButton->setText(QCoreApplication::translate("QuestionBox", "No", nullptr));
} // retranslateUi
};
namespace Ui {
class QuestionBox: public Ui_QuestionBox {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_QUESTIONBOX_H

View File

@ -0,0 +1,99 @@
/********************************************************************************
** Form generated from reading UI file 'showplugins.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_SHOWPLUGINS_H
#define UI_SHOWPLUGINS_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QDialog>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QTextEdit>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_ShowPlugins
{
public:
QVBoxLayout *vboxLayout;
QLabel *labelHeadline;
QTextEdit *content;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem;
QPushButton *closeButton;
void setupUi(QDialog *ShowPlugins)
{
if (ShowPlugins->objectName().isEmpty())
ShowPlugins->setObjectName(QString::fromUtf8("ShowPlugins"));
ShowPlugins->resize(492, 326);
vboxLayout = new QVBoxLayout(ShowPlugins);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
labelHeadline = new QLabel(ShowPlugins);
labelHeadline->setObjectName(QString::fromUtf8("labelHeadline"));
vboxLayout->addWidget(labelHeadline);
content = new QTextEdit(ShowPlugins);
content->setObjectName(QString::fromUtf8("content"));
content->setReadOnly(true);
vboxLayout->addWidget(content);
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem);
closeButton = new QPushButton(ShowPlugins);
closeButton->setObjectName(QString::fromUtf8("closeButton"));
hboxLayout->addWidget(closeButton);
vboxLayout->addLayout(hboxLayout);
retranslateUi(ShowPlugins);
QObject::connect(closeButton, SIGNAL(clicked()), ShowPlugins, SLOT(reject()));
QMetaObject::connectSlotsByName(ShowPlugins);
} // setupUi
void retranslateUi(QDialog *ShowPlugins)
{
ShowPlugins->setWindowTitle(QCoreApplication::translate("ShowPlugins", "Loaded Plugins", nullptr));
labelHeadline->setText(QCoreApplication::translate("ShowPlugins", "TextLabel", nullptr));
content->setHtml(QCoreApplication::translate("ShowPlugins", "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" white-space: pre-wrap; font-family:DejaVu Sans; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;\"><p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p></body></html>", nullptr));
closeButton->setText(QCoreApplication::translate("ShowPlugins", "Close", nullptr));
} // retranslateUi
};
namespace Ui {
class ShowPlugins: public Ui_ShowPlugins {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_SHOWPLUGINS_H

View File

@ -0,0 +1,157 @@
/********************************************************************************
** Form generated from reading UI file 'uncertainties.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_UNCERTAINTIES_H
#define UI_UNCERTAINTIES_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QDoubleSpinBox>
#include <QtWidgets/QFrame>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_Uncertainties
{
public:
QVBoxLayout *vboxLayout;
QCheckBox *cbAsymmetric;
QFrame *line;
QGridLayout *gridLayout;
QDoubleSpinBox *spinLowerUncertainty;
QLabel *labelUpperUncertainty;
QDoubleSpinBox *spinUpperUncertainty;
QLabel *labelLowerUncertainty;
QSpacerItem *spacerItem;
QHBoxLayout *hboxLayout;
QSpacerItem *spacerItem1;
QPushButton *okButton;
QPushButton *cancelButton;
void setupUi(QDialog *Uncertainties)
{
if (Uncertainties->objectName().isEmpty())
Uncertainties->setObjectName(QString::fromUtf8("Uncertainties"));
Uncertainties->resize(212, 151);
vboxLayout = new QVBoxLayout(Uncertainties);
#ifndef Q_OS_MAC
vboxLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
vboxLayout->setContentsMargins(9, 9, 9, 9);
#endif
vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
cbAsymmetric = new QCheckBox(Uncertainties);
cbAsymmetric->setObjectName(QString::fromUtf8("cbAsymmetric"));
vboxLayout->addWidget(cbAsymmetric);
line = new QFrame(Uncertainties);
line->setObjectName(QString::fromUtf8("line"));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
vboxLayout->addWidget(line);
gridLayout = new QGridLayout();
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
gridLayout->setContentsMargins(0, 0, 0, 0);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
spinLowerUncertainty = new QDoubleSpinBox(Uncertainties);
spinLowerUncertainty->setObjectName(QString::fromUtf8("spinLowerUncertainty"));
spinLowerUncertainty->setDecimals(4);
spinLowerUncertainty->setSingleStep(0.500000000000000);
gridLayout->addWidget(spinLowerUncertainty, 0, 1, 1, 1);
labelUpperUncertainty = new QLabel(Uncertainties);
labelUpperUncertainty->setObjectName(QString::fromUtf8("labelUpperUncertainty"));
labelUpperUncertainty->setEnabled(false);
gridLayout->addWidget(labelUpperUncertainty, 1, 0, 1, 1);
spinUpperUncertainty = new QDoubleSpinBox(Uncertainties);
spinUpperUncertainty->setObjectName(QString::fromUtf8("spinUpperUncertainty"));
spinUpperUncertainty->setEnabled(false);
spinUpperUncertainty->setDecimals(4);
spinUpperUncertainty->setSingleStep(0.500000000000000);
gridLayout->addWidget(spinUpperUncertainty, 1, 1, 1, 1);
labelLowerUncertainty = new QLabel(Uncertainties);
labelLowerUncertainty->setObjectName(QString::fromUtf8("labelLowerUncertainty"));
gridLayout->addWidget(labelLowerUncertainty, 0, 0, 1, 1);
vboxLayout->addLayout(gridLayout);
spacerItem = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
vboxLayout->addItem(spacerItem);
hboxLayout = new QHBoxLayout();
#ifndef Q_OS_MAC
hboxLayout->setSpacing(6);
#endif
hboxLayout->setContentsMargins(0, 0, 0, 0);
hboxLayout->setObjectName(QString::fromUtf8("hboxLayout"));
spacerItem1 = new QSpacerItem(131, 31, QSizePolicy::Expanding, QSizePolicy::Minimum);
hboxLayout->addItem(spacerItem1);
okButton = new QPushButton(Uncertainties);
okButton->setObjectName(QString::fromUtf8("okButton"));
hboxLayout->addWidget(okButton);
cancelButton = new QPushButton(Uncertainties);
cancelButton->setObjectName(QString::fromUtf8("cancelButton"));
hboxLayout->addWidget(cancelButton);
vboxLayout->addLayout(hboxLayout);
retranslateUi(Uncertainties);
QObject::connect(okButton, SIGNAL(clicked()), Uncertainties, SLOT(accept()));
QObject::connect(cancelButton, SIGNAL(clicked()), Uncertainties, SLOT(reject()));
QMetaObject::connectSlotsByName(Uncertainties);
} // setupUi
void retranslateUi(QDialog *Uncertainties)
{
Uncertainties->setWindowTitle(QCoreApplication::translate("Uncertainties", "Uncertainty", nullptr));
cbAsymmetric->setText(QCoreApplication::translate("Uncertainties", "Asymmetric uncertainty", nullptr));
labelUpperUncertainty->setText(QCoreApplication::translate("Uncertainties", "Upper uncertainty:", nullptr));
labelLowerUncertainty->setText(QCoreApplication::translate("Uncertainties", "Lower uncertainty:", nullptr));
okButton->setText(QCoreApplication::translate("Uncertainties", "OK", nullptr));
cancelButton->setText(QCoreApplication::translate("Uncertainties", "Cancel", nullptr));
} // retranslateUi
};
namespace Ui {
class Uncertainties: public Ui_Uncertainties {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_UNCERTAINTIES_H

View File

@ -0,0 +1,66 @@
/********************************************************************************
** Form generated from reading UI file 'xmlview.ui'
**
** Created by: Qt User Interface Compiler version 5.15.13
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_XMLVIEW_H
#define UI_XMLVIEW_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_XMLViewDialog
{
public:
QGridLayout *gridLayout;
QTreeWidget *treeWidget;
void setupUi(QWidget *XMLViewDialog)
{
if (XMLViewDialog->objectName().isEmpty())
XMLViewDialog->setObjectName(QString::fromUtf8("XMLViewDialog"));
XMLViewDialog->resize(336, 330);
gridLayout = new QGridLayout(XMLViewDialog);
#ifndef Q_OS_MAC
gridLayout->setSpacing(6);
#endif
#ifndef Q_OS_MAC
gridLayout->setContentsMargins(9, 9, 9, 9);
#endif
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
treeWidget = new QTreeWidget(XMLViewDialog);
treeWidget->setObjectName(QString::fromUtf8("treeWidget"));
treeWidget->setAlternatingRowColors(true);
treeWidget->setIndentation(10);
gridLayout->addWidget(treeWidget, 0, 0, 1, 1);
retranslateUi(XMLViewDialog);
QMetaObject::connectSlotsByName(XMLViewDialog);
} // setupUi
void retranslateUi(QWidget *XMLViewDialog)
{
XMLViewDialog->setWindowTitle(QCoreApplication::translate("XMLViewDialog", "XMLView", nullptr));
} // retranslateUi
};
namespace Ui {
class XMLViewDialog: public Ui_XMLViewDialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_XMLVIEW_H

View File

@ -0,0 +1,66 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_UNCERTAINTIES_H
#define SEISCOMP_GUI_CORE_UNCERTAINTIES_H
#include <QDialog>
#include <seiscomp/gui/core/ui_uncertainties.h>
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API EditUncertainties : public QDialog {
Q_OBJECT
public:
EditUncertainties(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
~EditUncertainties();
void setUncertainties(double lower, double upper);
double lowerUncertainty() const;
double upperUncertainty() const;
signals:
void uncertaintiesChanged(double, double);
private slots:
void lowerChanged(double);
void upperChanged(double);
void symmetryChanged(bool);
private:
Ui::Uncertainties _ui;
};
}
}
#endif

View File

@ -0,0 +1,97 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_UTIL_H
#define SEISCOMP_GUI_UTIL_H
#include <seiscomp/gui/qt.h>
#include <seiscomp/core/datetime.h>
#include <seiscomp/core/defs.h>
#include <QWidget>
#include <vector>
class QLabel;
namespace Seiscomp {
namespace Gui {
SC_GUI_API extern QChar degrees;
SC_GUI_API extern std::string colorConvertError;
SC_GUI_API bool fromString(QColor &value, const std::string &str);
SC_GUI_API QColor readColor(const std::string &query, const std::string &str,
const QColor &base, bool *ok = nullptr);
SC_GUI_API Qt::PenStyle stringToPenStyle(const std::string &str);
SC_GUI_API Qt::PenStyle readPenStyle(const std::string &query, const std::string &str,
Qt::PenStyle base, bool *ok = nullptr);
SC_GUI_API Qt::BrushStyle stringToBrushStyle(const std::string &str);
SC_GUI_API Qt::BrushStyle readBrushStyle(const std::string &query, const std::string &str,
Qt::BrushStyle base, bool *ok = nullptr);
SC_GUI_API QString latitudeToString(double lat, bool withValue = true, bool withUnit = true, int precision = 2);
SC_GUI_API QString longitudeToString(double lon, bool withValue = true, bool withUnit = true, int precision = 2);
SC_GUI_API QString depthToString(double depth, int precision = 0);
SC_GUI_API QString timeToString(const Core::Time &t, const char *fmt, bool addTimeZone = false);
SC_GUI_API void timeToLabel(QLabel *label, const Core::Time &t, const char *fmt, bool addTimeZone = false);
SC_GUI_API QString elapsedTimeString(const Core::TimeSpan &dt);
SC_GUI_API void setMaxWidth(QWidget *w, int numCharacters);
SC_GUI_API void fixWidth(QWidget *w, int numCharacters);
SC_GUI_API void setBold(QWidget *w, bool bold = true);
SC_GUI_API void setItalic(QWidget *w, bool italic = true);
class SC_GUI_API ElideFadeDrawer : public QObject {
public:
ElideFadeDrawer(QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *event);
};
class SC_GUI_API EllipsisDrawer : public QObject {
public:
EllipsisDrawer(QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *event);
};
template <typename T>
class ObjectChangeList : public std::vector<std::pair<typename Core::SmartPointer<T>::Impl, bool> > {
};
}
}
#endif

View File

@ -0,0 +1,51 @@
/***************************************************************************
* Copyright (C) gempa GmbH *
* All rights reserved. *
* Contact: gempa GmbH (seiscomp-dev@gempa.de) *
* *
* GNU Affero General Public License Usage *
* This file may be used under the terms of the GNU Affero *
* Public License version 3.0 as published by the Free Software Foundation *
* and appearing in the file LICENSE included in the packaging of this *
* file. Please review the following information to ensure the GNU Affero *
* Public License version 3.0 requirements will be met: *
* https://www.gnu.org/licenses/agpl-3.0.html. *
* *
* Other Usage *
* Alternatively, this file may be used in accordance with the terms and *
* conditions contained in a signed written agreement between you and *
* gempa GmbH. *
***************************************************************************/
#ifndef SEISCOMP_GUI_CORE_XMLVIEW_H
#define SEISCOMP_GUI_CORE_XMLVIEW_H
#include <QtGui>
#include <seiscomp/gui/core/ui_xmlview.h>
#include <seiscomp/gui/qt.h>
namespace Seiscomp {
namespace Gui {
class SC_GUI_API XMLView : public QWidget {
Q_OBJECT
public:
XMLView(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags(),
bool deleteOnClose = true);
~XMLView();
void setContent(const QString& content);
private:
Ui::XMLViewDialog _ui;
};
}
}
#endif