Install SeisComP and scanloc ARM64 nightly packages
This commit is contained in:
@ -87,6 +87,7 @@ namespace Gui {
|
||||
|
||||
|
||||
class ConnectionDialog;
|
||||
class ProcessManager;
|
||||
|
||||
|
||||
struct MessageGroups {
|
||||
@ -200,6 +201,7 @@ class SC_GUI_API Application : public QObject, public Client::Application {
|
||||
//! Sets the mainwidget which is used as hint to close the
|
||||
//! splashscreen when the widget is shown
|
||||
void setMainWidget(QWidget*);
|
||||
QWidget *mainWidget();
|
||||
|
||||
void showMessage(const char*) override;
|
||||
void showWarning(const char*) override;
|
||||
@ -219,6 +221,8 @@ class SC_GUI_API Application : public QObject, public Client::Application {
|
||||
QPalette palette() const;
|
||||
void setPalette(const QPalette &pal);
|
||||
|
||||
ProcessManager *processManager();
|
||||
|
||||
|
||||
protected:
|
||||
bool init() override;
|
||||
@ -259,6 +263,8 @@ class SC_GUI_API Application : public QObject, public Client::Application {
|
||||
void removeObject(const QString &parentID, Seiscomp::DataModel::Object*);
|
||||
void updateObject(const QString &parentID, Seiscomp::DataModel::Object*);
|
||||
|
||||
void processManagerCreated();
|
||||
|
||||
|
||||
public slots:
|
||||
void showSettings();
|
||||
@ -304,6 +310,7 @@ class SC_GUI_API Application : public QObject, public Client::Application {
|
||||
struct _GUI_Core_Settings : System::Application::AbstractSettings {
|
||||
bool fullScreen{false};
|
||||
bool interactive{true};
|
||||
std::string styleSheet;
|
||||
std::string guiGroup{"GUI"};
|
||||
std::string commandTargetClient;
|
||||
|
||||
@ -340,6 +347,8 @@ class SC_GUI_API Application : public QObject, public Client::Application {
|
||||
|
||||
QSocketNotifier *_signalNotifier;
|
||||
int _signalSocketFd[2];
|
||||
|
||||
ProcessManager *_processManager{nullptr};
|
||||
};
|
||||
|
||||
|
||||
@ -367,10 +376,12 @@ class Kicker : public Application {
|
||||
setupUi(w);
|
||||
setMainWidget(w);
|
||||
|
||||
if ( startFullScreen() )
|
||||
if ( startFullScreen() ) {
|
||||
w->showFullScreen();
|
||||
else
|
||||
}
|
||||
else {
|
||||
w->showNormal();
|
||||
}
|
||||
|
||||
return Application::run();
|
||||
}
|
||||
|
||||
@ -29,8 +29,7 @@
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace Gui {
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
|
||||
class SC_GUI_API ConnectionStateLabel : public QLabel {
|
||||
@ -41,26 +40,23 @@ class SC_GUI_API ConnectionStateLabel : public QLabel {
|
||||
|
||||
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 mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
||||
|
||||
QPixmap _connected;
|
||||
QPixmap _disconnected;
|
||||
bool _isConnected{false};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
106
include/seiscomp/gui/core/icon.h
Normal file
106
include/seiscomp/gui/core/icon.h
Normal file
@ -0,0 +1,106 @@
|
||||
/***************************************************************************
|
||||
* 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_ICON_H
|
||||
#define SEISCOMP_GUI_CORE_ICON_H
|
||||
|
||||
|
||||
#include <QIcon>
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
|
||||
/**
|
||||
* @brief Returns an icon by name.
|
||||
*
|
||||
* Icons will be looked up as SVG resources with path :/sc/icons/{name}.svg.
|
||||
*
|
||||
* The returned icon gets a dedicated QIconEngine which will render the icon
|
||||
* in a given colour or using the application palette for the different states.
|
||||
*
|
||||
* Rendering the icon in a given colour involves blending a coloured quad with
|
||||
* blending mode SourceAtop on the rendered icon. This will effectively render
|
||||
* the icon single coloured. As Qt does not support currentColor with SVG yet,
|
||||
* there is no other option. Multi-coloured icon are a special case anyway and
|
||||
* not easy to fit with all possible application palettes, e.g. dark mode.
|
||||
*
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @return The icon possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QIcon icon(QString name);
|
||||
|
||||
/**
|
||||
* @brief Convenience function which takes a primarly color.
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @param cOnOff The primary color of the icon. This will ignore the application palette.
|
||||
* @return The icon possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QIcon icon(QString name, const QColor &cOnOff);
|
||||
|
||||
/**
|
||||
* @brief Convenience function which takes an on and an off color.
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @param cOn The color of the icon for state = On.
|
||||
* @param cOff The color of the icon for state = Off.
|
||||
* @return The icon possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QIcon icon(QString name, const QColor &cOn, const QColor &cOff);
|
||||
|
||||
/**
|
||||
* @brief Returns an icon pixmap by name.
|
||||
*
|
||||
* Renders an icon in the requested size and optional color.
|
||||
*
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @param size The requested size
|
||||
* @param dpr The device pixel ratio
|
||||
* @param color An optional color.
|
||||
* @param scaledColor An optional color towards which all pixmap colors will be blended.
|
||||
* @return The pixmap possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QPixmap pixmap(const QString &name, const QSize &size, double dpr, const QColor &c = QColor(), const QColor &scaledColor = QColor());
|
||||
|
||||
/**
|
||||
* @brief Convenience function which takes a primarly color.
|
||||
* @param fm The fontMetrics used to calculate the icon size.
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @param color The primary color of the icon. This will ignore the application palette.
|
||||
* @param dpr The device pixel ratio
|
||||
* @return The pixmap possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QPixmap pixmap(const QFontMetrics &fm, const QString &name, const QColor &color, double dpr);
|
||||
|
||||
/**
|
||||
* @brief Convenience function which takes a primarly color.
|
||||
* @param parent The parent widget to extract the pixmap for.
|
||||
* @param name The name of the icon which is effectively the basename of the SVG file.
|
||||
* @param color The primary color of the icon. This will ignore the application palette.
|
||||
* @param scale The size scaling factor.
|
||||
* @return The pixmap possibly invalid if an invalid name was given.
|
||||
*/
|
||||
QPixmap pixmap(const QWidget *parent, const QString &name, const QColor &color = QColor(), double scale = 1.0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@ -70,17 +70,20 @@ DEFINE_SMARTPOINTER(Object);
|
||||
|
||||
namespace Gui {
|
||||
|
||||
class ProcessManager;
|
||||
class ProcessStateLabel;
|
||||
|
||||
|
||||
class SC_GUI_API MainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget * parent = 0, Qt::WindowFlags = Qt::WindowFlags());
|
||||
MainWindow(QWidget *parent = 0, Qt::WindowFlags = Qt::WindowFlags());
|
||||
~MainWindow();
|
||||
|
||||
|
||||
public:
|
||||
bool restoreGeometry(const QByteArray & geometry);
|
||||
bool restoreGeometry(const QByteArray &geometry);
|
||||
|
||||
|
||||
protected:
|
||||
@ -89,10 +92,10 @@ class SC_GUI_API MainWindow : public QMainWindow {
|
||||
void dropEvent(QDropEvent *);
|
||||
void dragEnterEvent(QDragEnterEvent *);
|
||||
|
||||
virtual void toggledFullScreen(bool);
|
||||
virtual void toggledFullScreen(bool isFullScreen);
|
||||
|
||||
signals:
|
||||
void fullScreenToggled(bool);
|
||||
void fullScreenToggled(bool isFullScreen);
|
||||
|
||||
public slots:
|
||||
void showNormal();
|
||||
@ -112,20 +115,22 @@ class SC_GUI_API MainWindow : public QMainWindow {
|
||||
void inspectConfig();
|
||||
void inspectInventory();
|
||||
|
||||
void showNotification(NotificationLevel level, QString message);
|
||||
static void showNotification(const NotificationLevel &level,
|
||||
const QString &message);
|
||||
|
||||
|
||||
protected:
|
||||
QAction* _actionToggleFullScreen;
|
||||
QAction* _actionShowSettings;
|
||||
QAction *_actionToggleFullScreen{nullptr};
|
||||
QAction *_actionShowSettings{nullptr};
|
||||
|
||||
|
||||
private:
|
||||
QMenuBar *_menuBar;
|
||||
QWidget *_menuWidget;
|
||||
ConnectionStateLabel *_connectionState;
|
||||
QMenuBar *_menuBar{nullptr};
|
||||
QWidget *_menuWidget{nullptr};
|
||||
ConnectionStateLabel *_connectionState{nullptr};
|
||||
ProcessStateLabel *_processState{nullptr};
|
||||
QString _title;
|
||||
bool _showFullscreen;
|
||||
bool _showFullscreen{false};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -45,8 +45,9 @@ namespace Gui {
|
||||
* with type Tile
|
||||
* 4 - Add two new methods to notify about asynchronous tile loading
|
||||
* success and cancellation
|
||||
* 5 - Add ImageTree::lockCache and ImageTree::unlockCache.
|
||||
*/
|
||||
#define TILESTORE_VERSION 4
|
||||
#define TILESTORE_VERSION 5
|
||||
|
||||
|
||||
struct SC_GUI_API MapsDesc {
|
||||
|
||||
283
include/seiscomp/gui/core/processmanager.h
Normal file
283
include/seiscomp/gui/core/processmanager.h
Normal 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_PROCESSMANAGER_H
|
||||
#define SEISCOMP_GUI_PROCESSMANAGER_H
|
||||
|
||||
|
||||
#include <seiscomp/gui/core/ui_processmanager.h>
|
||||
|
||||
#include <seiscomp/core/datetime.h>
|
||||
|
||||
#include <seiscomp/gui/core/spinninglabel.h>
|
||||
#include <seiscomp/gui/qt.h>
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QIcon>
|
||||
#include <QLabel>
|
||||
#include <QMainWindow>
|
||||
#include <QMap>
|
||||
#include <QProcess>
|
||||
#include <QSet>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QTextEdit>
|
||||
#include <QVariantAnimation>
|
||||
#include <QVector>
|
||||
|
||||
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
class ProcessStateLabel;
|
||||
|
||||
|
||||
class SC_GUI_API ProcessManager : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// X'struction
|
||||
// ------------------------------------------------------------------
|
||||
public:
|
||||
explicit ProcessManager(QWidget *parent = nullptr,
|
||||
Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected Interface
|
||||
// ------------------------------------------------------------------
|
||||
public:
|
||||
/**
|
||||
* @brief Creates a process with the given name, description and icon.
|
||||
* The process is managed by this instance.
|
||||
* @param name Name of the process
|
||||
* @param description Description of the process shown as tool tip
|
||||
* @param icon Icon to be shown next to the name
|
||||
* @return QProcess instance mananged by this instance
|
||||
*/
|
||||
QProcess *createProcess(QString name, QString description={},
|
||||
QIcon icon={});
|
||||
|
||||
/**
|
||||
* @brief Wait for the process to start. If the start up fails logging
|
||||
* entries are created, the corresponding item is selected in the
|
||||
* process table and the process manager is shown if not already active.
|
||||
* @param process The process to wait to start for
|
||||
* @param timeout Start timeout in milliseconds
|
||||
* @return True if the process could be launched
|
||||
*/
|
||||
bool waitForStarted(QProcess *process, int timeout = 5000);
|
||||
|
||||
/**
|
||||
* @brief Registers output streams to which the stdout and stderr data
|
||||
* of the given process are written to in addition to the console tabs
|
||||
* visible in the process manager.
|
||||
* @param process The process to register the output streams for
|
||||
* @param osOut The output stream used for stdout data
|
||||
* @param osErr The output stream used for stderr data
|
||||
* @return True if the process is managed by the process manager
|
||||
*/
|
||||
bool setOutputStreams(QProcess *process, std::ostream *osOut,
|
||||
std::ostream *osErr=nullptr);
|
||||
|
||||
/**
|
||||
* @brief Limits the data written to the console tabs visible in the
|
||||
* process manager.
|
||||
* @param process The process to implement limits for
|
||||
* @param charsOut Maximum number of characters shown in the stdout tab.
|
||||
* Use a negative number to remove any limit. Use 0 to disable any
|
||||
* output to the stdout tab.
|
||||
* @param charsErr Maximum number of characters shown in the stderr tab.
|
||||
* Use a negative number to remove any limit. Use 0 to disable any
|
||||
* output to the stderr tab.
|
||||
* @return True if the process is managed by the process manager
|
||||
*/
|
||||
bool setConsoleLimits(QProcess *process, int charsOut,
|
||||
int charsErr = -1);
|
||||
|
||||
/**
|
||||
* @brief Create a log entry for the process.
|
||||
* @param process The process to log a message for
|
||||
* @param message The message to add to the process log
|
||||
*/
|
||||
void log(QProcess *process, const QString &message);
|
||||
|
||||
/**
|
||||
* @brief Return total number of processes.
|
||||
* @return Total number of processes
|
||||
*/
|
||||
int processCount();
|
||||
|
||||
/**
|
||||
* @brief Return number of running processes.
|
||||
* @return Number of running
|
||||
*/
|
||||
int runningCount();
|
||||
|
||||
/**
|
||||
* @brief Return number of erroneous processes. This includes processes
|
||||
* that couldn't bestarted, that crashed or exited on error code other
|
||||
* than 0.
|
||||
* @return Number of erroneous processes
|
||||
*/
|
||||
int erroneousCount();
|
||||
|
||||
/**
|
||||
* @brief Stop execution of the process by sending the SIGSTOP (19)
|
||||
* signal. The process may be resumed via SIGCONT (18) later on.
|
||||
* @param process Process to terminate
|
||||
* @return True if the SIGSTOP signal could be sent
|
||||
*/
|
||||
bool stop(QProcess *process);
|
||||
|
||||
/**
|
||||
* @brief Continue execution of the process by sending the SIGCONT (18)
|
||||
* signal. The process must have been stopped via SIGSTOP (19) before.
|
||||
* @param process Process to continue
|
||||
* @return True if the SIGCONT signal could be sent
|
||||
*/
|
||||
bool continue_(QProcess *process);
|
||||
|
||||
/**
|
||||
* @brief Terminate the process gracefully by sending the SIGTERM (9)
|
||||
* signal.
|
||||
* @param process Process to terminate
|
||||
* @return True if the SIGTERM signal could be sent
|
||||
*/
|
||||
bool terminate(QProcess *process);
|
||||
|
||||
/**
|
||||
* @brief Forcefully kill the process by sending the SIGKILL (15)
|
||||
* signal.
|
||||
* @param process Process to kill
|
||||
* @return True if the SIGKILL signal could be sent
|
||||
*/
|
||||
bool kill(QProcess *process);
|
||||
|
||||
// friend class ProcessStateLabel;
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Signals
|
||||
// ------------------------------------------------------------------
|
||||
signals:
|
||||
// emitted if a process was added/removed or any of the managed
|
||||
// processes changed state
|
||||
void stateChanged();
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected Slots
|
||||
// ------------------------------------------------------------------
|
||||
protected slots:
|
||||
void onDataChanged(const QModelIndex &topLeft,
|
||||
const QModelIndex &bottomRight,
|
||||
const QVector<int> &roles = QVector<int>());
|
||||
void onCurrentChanged(const QModelIndex ¤t,
|
||||
const QModelIndex &previous);
|
||||
void onSelectionChanged(const QItemSelection &selected,
|
||||
const QItemSelection &deselected);
|
||||
void onProcessReadyReadStandardOutput();
|
||||
void onProcessReadyReadStandardError();
|
||||
void onProcessStateChanged();
|
||||
void onStopClicked();
|
||||
void onContinueClicked();
|
||||
void onTerminateClicked();
|
||||
void onKillClicked();
|
||||
void onRemoveClicked();
|
||||
void onClearClicked();
|
||||
void onProgressAnimationChanged(const QVariant &value);
|
||||
void onTableContextMenuRequested(const QPoint &pos);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected Interface
|
||||
// ------------------------------------------------------------------
|
||||
protected:
|
||||
// forward declaration
|
||||
struct Item;
|
||||
class Model;
|
||||
|
||||
void init();
|
||||
void updateControls();
|
||||
void updateItemState(Item *item);
|
||||
|
||||
static void addConsoleOutput(QTextEdit *textEdit, const QString &text,
|
||||
int maxChars = -1);
|
||||
static void addLog(const Item *item, const Core::Time &time,
|
||||
const QString &message);
|
||||
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected data members
|
||||
// ------------------------------------------------------------------
|
||||
protected:
|
||||
Ui::ProcessManager _ui;
|
||||
Model *_model{nullptr};
|
||||
QSortFilterProxyModel *_proxyModel{nullptr};
|
||||
QMap<QProcess*, Item*> _items;
|
||||
QSet<QProcess*> _running;
|
||||
QSet<QProcess*> _erroneous;
|
||||
QVariantAnimation _progressAnimation;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Private methods
|
||||
// ------------------------------------------------------------------
|
||||
private:
|
||||
Item *itemForProcess(QProcess *process) const;
|
||||
Item *itemForProcessSender() const;
|
||||
inline const Item *itemForProxyIndex(const QModelIndex &index) const;
|
||||
inline QModelIndex proxyIndexForItem(const Item *item) const;
|
||||
};
|
||||
|
||||
|
||||
class ProcessStateLabel : public SpinningLabel {
|
||||
Q_OBJECT
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// X'struction
|
||||
// ------------------------------------------------------------------
|
||||
public:
|
||||
ProcessStateLabel(ProcessManager *manager, QWidget *parent = nullptr);
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected Slots
|
||||
// ------------------------------------------------------------------
|
||||
protected slots:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void onProcessStateChanged();
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected Interface
|
||||
// ------------------------------------------------------------------
|
||||
protected:
|
||||
void init();
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
// Protected data members
|
||||
// ------------------------------------------------------------------
|
||||
protected:
|
||||
ProcessManager *_manager{nullptr};
|
||||
QPixmap _defaultPixmap;
|
||||
QPixmap _progressPixmap;
|
||||
QPixmap _erroneousPixmap;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Seiscomp::Gui
|
||||
|
||||
#endif
|
||||
@ -79,8 +79,8 @@ class SC_GUI_API RecordPolyline : public AbstractRecordPolyline,
|
||||
bool optimization = true);
|
||||
|
||||
void create(RecordSequence const *,
|
||||
const Core::Time &start,
|
||||
const Core::Time &end,
|
||||
const OPT(Core::Time) &start,
|
||||
const OPT(Core::Time) &end,
|
||||
double pixelPerSecond,
|
||||
double amplMin, double amplMax, double amplOffset,
|
||||
int height, float *timingQuality = nullptr,
|
||||
@ -150,8 +150,8 @@ class SC_GUI_API RecordPolylineF : public AbstractRecordPolyline,
|
||||
bool optimization = true);
|
||||
|
||||
void create(RecordSequence const *,
|
||||
const Core::Time &start,
|
||||
const Core::Time &end,
|
||||
const OPT(Core::Time) &start,
|
||||
const OPT(Core::Time) &end,
|
||||
double pixelPerSecond,
|
||||
double amplMin, double amplMax, double amplOffset,
|
||||
int height, float *timingQuality = nullptr,
|
||||
|
||||
@ -48,9 +48,9 @@ class SC_GUI_API RecordStreamThread : public QThread {
|
||||
public:
|
||||
bool connect();
|
||||
|
||||
void setStartTime(const Seiscomp::Core::Time&);
|
||||
void setEndTime(const Seiscomp::Core::Time&);
|
||||
void setTimeWindow(const Seiscomp::Core::TimeWindow&);
|
||||
void setStartTime(const OPT(Core::Time) &);
|
||||
void setEndTime(const OPT(Core::Time) &);
|
||||
void setTimeWindow(const Core::TimeWindow &);
|
||||
|
||||
bool setTimeout(int seconds);
|
||||
|
||||
@ -62,12 +62,8 @@ class SC_GUI_API RecordStreamThread : public QThread {
|
||||
// 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);
|
||||
const OPT(Seiscomp::Core::Time) &stime,
|
||||
const OPT(Seiscomp::Core::Time) &etime);
|
||||
|
||||
void stop(bool waitForTermination);
|
||||
|
||||
@ -112,17 +108,15 @@ class SC_GUI_API RecordStreamThread : public QThread {
|
||||
|
||||
|
||||
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;
|
||||
int _id;
|
||||
std::string _recordStreamURL;
|
||||
bool _requestedClose;
|
||||
bool _readingStreams;
|
||||
Seiscomp::IO::RecordStreamPtr _recordStream;
|
||||
QMutex _mutex;
|
||||
static int _numberOfThreads;
|
||||
Array::DataType _dataType;
|
||||
Record::Hint _recordHint;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -312,6 +312,10 @@ class SC_GUI_API RecordView : public QWidget {
|
||||
//! Whether to show record borders
|
||||
void showRecordBorders(bool enable);
|
||||
|
||||
//! Whether to show engineering values with unit prefix such as
|
||||
//! milli, kilo, etc.
|
||||
void showEngineeringValues(bool enable);
|
||||
|
||||
//! Whether to draw the background using alternating colors
|
||||
//! The item background will be drawn using QPalette::Base and
|
||||
//! QPalette::AlternateBase
|
||||
@ -422,7 +426,7 @@ class SC_GUI_API RecordView : public QWidget {
|
||||
//! 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 ®exp, int startRow = 0) const;
|
||||
int findByText(int row, const QRegularExpression ®exp, int startRow = 0) const;
|
||||
|
||||
//! Sort the items by the time value of the markers with
|
||||
//! text markerText
|
||||
@ -603,66 +607,66 @@ class SC_GUI_API RecordView : public QWidget {
|
||||
typedef QVector<RecordViewItem*> Rows;
|
||||
typedef QSet<RecordViewItem*> SelectionList;
|
||||
|
||||
SelectionMode _selectionMode;
|
||||
SelectionMode _selectionMode{NoSelection};
|
||||
|
||||
RecordStreamThread* _thread;
|
||||
RecordViewItem* _currentItem;
|
||||
RecordStreamThread *_thread{nullptr};
|
||||
RecordViewItem *_currentItem{nullptr};
|
||||
|
||||
TimeScale* _timeScaleWidget;
|
||||
QScrollArea* _scrollArea;
|
||||
QWidget* _timeScaleInfo;
|
||||
QLayout* _timeScaleAuxLayout;
|
||||
TimeScale *_timeScaleWidget{nullptr};
|
||||
QScrollArea *_scrollArea{nullptr};
|
||||
QWidget *_timeScaleInfo{nullptr};
|
||||
QLayout *_timeScaleAuxLayout{nullptr};
|
||||
|
||||
QAction* _filterAction;
|
||||
QAction* _absTimeAction;
|
||||
QAction *_filterAction{nullptr};
|
||||
QAction *_absTimeAction{nullptr};
|
||||
|
||||
QTimer _recordUpdateTimer;
|
||||
QTimer _recordUpdateTimer;
|
||||
|
||||
SelectionList _selectedItems;
|
||||
SelectionList _selectedItems;
|
||||
|
||||
Mode _mode;
|
||||
Seiscomp::Core::Time _timeStart;
|
||||
Mode _mode{RING_BUFFER};
|
||||
Seiscomp::Core::Time _timeStart;
|
||||
Seiscomp::Core::TimeSpan _timeSpan;
|
||||
|
||||
Items _items;
|
||||
Rows _rows;
|
||||
Core::Time _alignment;
|
||||
Items _items;
|
||||
Rows _rows;
|
||||
Core::Time _alignment;
|
||||
|
||||
QPointF _zoomSpot;
|
||||
QPointF _zoomSpot{0.5, 0.5};
|
||||
|
||||
int _rowHeight;
|
||||
int _minRowHeight;
|
||||
int _maxRowHeight;
|
||||
int _numberOfRows;
|
||||
int _defaultRowHeight;
|
||||
float _zoomFactor;
|
||||
int _rowHeight;
|
||||
int _minRowHeight;
|
||||
int _maxRowHeight{-1};
|
||||
int _numberOfRows{-1};
|
||||
int _defaultRowHeight{16};
|
||||
float _zoomFactor{2.0f};
|
||||
|
||||
double _tmin, _tmax;
|
||||
float _amin, _amax; // amplitude range
|
||||
double _tmin{0}, _tmax{0};
|
||||
|
||||
double _timeScale; // pixels per second
|
||||
double _minTimeScale;
|
||||
double _amplScale; // amplitude units per pixel
|
||||
double _timeScale{1.0 / 3.0}; // pixels per second
|
||||
double _minTimeScale{0.0};
|
||||
double _amplScale{0.0}; // amplitude units per pixel
|
||||
|
||||
bool _filtering; // the filter state
|
||||
bool _alternatingColors;
|
||||
bool _showAllRecords;
|
||||
bool _showRecordBorders;
|
||||
bool _autoInsertItems;
|
||||
bool _autoScale;
|
||||
bool _autoMaxScale;
|
||||
bool _filtering{false}; // the filter state
|
||||
bool _alternatingColors{false};
|
||||
bool _showAllRecords{false};
|
||||
bool _showRecordBorders{false};
|
||||
bool _showEngineeringValues{true};
|
||||
bool _autoInsertItems{true};
|
||||
bool _autoScale{false};
|
||||
bool _autoMaxScale{false};
|
||||
|
||||
bool _frames;
|
||||
int _frameMargin;
|
||||
int _horizontalSpacing;
|
||||
int _rowSpacing;
|
||||
bool _frames{false};
|
||||
int _frameMargin{0};
|
||||
int _horizontalSpacing{0};
|
||||
int _rowSpacing{0};
|
||||
|
||||
int _labelWidth;
|
||||
int _labelColumns;
|
||||
int _labelWidth{70};
|
||||
int _labelColumns{3};
|
||||
|
||||
RecordWidget::RecordBorderDrawMode _recordBorderDrawMode;
|
||||
|
||||
RecordWidget::Filter *_filter;
|
||||
RecordWidget::Filter *_filter{nullptr};
|
||||
|
||||
friend class RecordViewItem;
|
||||
};
|
||||
|
||||
@ -217,8 +217,10 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
};
|
||||
|
||||
enum ShadowWidgetFlags {
|
||||
Raw = 0x01,
|
||||
Filtered = 0x02
|
||||
Notify = 0x00,
|
||||
Raw = 0x01,
|
||||
Filtered = 0x02,
|
||||
Style = 0x08
|
||||
};
|
||||
|
||||
enum AxisPosition {
|
||||
@ -240,25 +242,26 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
double dyMin{0}; // Data minimum value
|
||||
double dyMax{0}; // Data maximum value
|
||||
double dOffset{0}; // Data offset
|
||||
double absMax{0};
|
||||
int pyMin{0}; //
|
||||
|
||||
double yMin{0}; // Minimum value to render
|
||||
double yMax{0}; // Maximum value to render
|
||||
double yOffset{0}; // Offset to render
|
||||
|
||||
double absMax{0}; // Maximum data amplitude
|
||||
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 dirtyData{false};
|
||||
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;
|
||||
@ -363,8 +366,8 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
//! 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);
|
||||
void setShadowWidget(RecordWidget *shadow, bool copyMarker = false,
|
||||
int flags = Raw | Style);
|
||||
|
||||
//! Returns the current shadow widget
|
||||
RecordWidget *shadowWidget() const { return _shadowWidget; }
|
||||
@ -393,7 +396,7 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
|
||||
double smin() const { return _smin; }
|
||||
double smax() const { return _smax; }
|
||||
|
||||
|
||||
Seiscomp::Core::Time alignment() { return _alignment; }
|
||||
|
||||
Seiscomp::Core::Time centerTime();
|
||||
@ -412,11 +415,11 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
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();
|
||||
@ -432,6 +435,9 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
void showScaledValues(bool enable);
|
||||
bool areScaledValuesShown() const { return _showScaledValues; }
|
||||
|
||||
void showEngineeringValues(bool enable);
|
||||
bool areEngineeringValuesShown() const { return _showEngineeringValues; }
|
||||
|
||||
//! Adds a marker to the widget. The ownership takes
|
||||
//! the widget.
|
||||
bool addMarker(RecordMarker*);
|
||||
@ -565,7 +571,7 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
void alignOnMarker(const QString& text);
|
||||
|
||||
void setAmplScale(double);
|
||||
|
||||
|
||||
void enableFiltering(bool enable);
|
||||
void setGridSpacing(double, double, double);
|
||||
void setGridVSpacing(double, double, double);
|
||||
@ -577,7 +583,6 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
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.
|
||||
@ -666,10 +671,6 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
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;
|
||||
|
||||
|
||||
@ -730,8 +731,6 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
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,
|
||||
@ -745,8 +744,16 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
int canvasWidth() const;
|
||||
int canvasHeight() const;
|
||||
|
||||
void alignTrace(Trace &trace);
|
||||
void prepareRecords(Stream *s);
|
||||
void createPolyline(Stream *s, AbstractRecordPolylinePtr &polyline,
|
||||
RecordSequence const *, double pixelPerSecond,
|
||||
double amplMin, double amplMax, double amplOffset,
|
||||
int height);
|
||||
void render(Stream *s);
|
||||
|
||||
private:
|
||||
|
||||
protected:
|
||||
typedef QVector<Stream*> StreamMap;
|
||||
|
||||
QVariant _data;
|
||||
@ -754,7 +761,7 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
RecordBorderDrawMode _recordBorderDrawMode;
|
||||
Seiscomp::Core::Time _alignment;
|
||||
bool _clipRows{true};
|
||||
|
||||
|
||||
double _tmin; // time range min
|
||||
double _tmax; // time range max
|
||||
double _smin, _smax; // selection
|
||||
@ -775,6 +782,7 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
bool _active{false};
|
||||
bool _filtering{false};
|
||||
bool _showScaledValues{false};
|
||||
bool _showEngineeringValues{true};
|
||||
|
||||
bool _drawRecords{false};
|
||||
bool _drawRecordID{true};
|
||||
@ -815,10 +823,9 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
int _margins[4];
|
||||
QString _cursorText;
|
||||
Seiscomp::Core::Time _cursorPos;
|
||||
Seiscomp::Core::Time _startDragPos;
|
||||
OPT(Seiscomp::Core::Time) _startDragPos;
|
||||
|
||||
Seiscomp::Core::TimeWindow _normalizationWindow;
|
||||
Seiscomp::Core::TimeWindow _offsetWindow;
|
||||
|
||||
RecordWidget *_shadowWidget;
|
||||
RecordWidget *_markerSourceWidget;
|
||||
@ -829,6 +836,10 @@ class SC_GUI_API RecordWidget : public QWidget {
|
||||
};
|
||||
|
||||
|
||||
inline int RecordWidget::currentRecords() const {
|
||||
return _currentSlot;
|
||||
}
|
||||
|
||||
inline const QRect &RecordWidget::canvasRect() const {
|
||||
return _canvasRect;
|
||||
}
|
||||
|
||||
@ -137,13 +137,13 @@ class SC_GUI_API Ruler : public QFrame
|
||||
|
||||
//! 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;
|
||||
QPointF r2wPos(int rx, int ry) const;
|
||||
//! Converts widget coordinates to ruler position
|
||||
QPoint w2rPos(int x, int y) const;
|
||||
QPointF 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;
|
||||
QRectF 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
|
||||
|
||||
@ -50,45 +50,42 @@ class SC_GUI_API Scheme {
|
||||
Colors();
|
||||
|
||||
struct Splash {
|
||||
Splash();
|
||||
QColor version;
|
||||
QColor message;
|
||||
QColor version{0, 104, 158,255};
|
||||
QColor message{128, 128, 128, 255};
|
||||
};
|
||||
|
||||
struct Picks {
|
||||
Picks();
|
||||
QColor manual;
|
||||
QColor automatic;
|
||||
QColor undefined;
|
||||
QColor disabled;
|
||||
QColor manual{Qt::green};
|
||||
QColor automatic{Qt::red};
|
||||
QColor undefined{Qt::gray};
|
||||
QColor disabled{Qt::gray};
|
||||
};
|
||||
|
||||
struct Arrivals {
|
||||
Arrivals();
|
||||
QColor manual;
|
||||
QColor automatic;
|
||||
QColor theoretical;
|
||||
QColor undefined;
|
||||
QColor disabled;
|
||||
QPen uncertainties;
|
||||
QPen defaultUncertainties;
|
||||
QColor manual{0, 160, 0};
|
||||
QColor automatic{160, 0, 0};
|
||||
QColor theoretical{0, 0, 160};
|
||||
QColor undefined{160, 0, 0};
|
||||
QColor disabled{Qt::gray};
|
||||
QPen uncertainties{{Qt::gray}, 0.8};
|
||||
QPen defaultUncertainties{{{128,128,128,64}}, 0.8};
|
||||
Gradient residuals;
|
||||
};
|
||||
|
||||
struct Magnitudes {
|
||||
Magnitudes();
|
||||
QColor set;
|
||||
QColor unset;
|
||||
QColor disabled;
|
||||
QColor set{0, 160, 0};
|
||||
QColor unset{Qt::transparent};
|
||||
QColor disabled{Qt::gray};
|
||||
Gradient residuals;
|
||||
};
|
||||
|
||||
struct RecordStates {
|
||||
RecordStates();
|
||||
QColor unrequested;
|
||||
QColor requested;
|
||||
QColor inProgress;
|
||||
QColor notAvailable;
|
||||
QColor unrequested{0,0,0,128};
|
||||
QColor requested{255,255,0,128};
|
||||
QColor inProgress{0,255,0,16};
|
||||
QColor notAvailable{255,0,0,128};
|
||||
};
|
||||
|
||||
struct BrushPen {
|
||||
@ -104,49 +101,46 @@ class SC_GUI_API Scheme {
|
||||
};
|
||||
|
||||
struct Records {
|
||||
Records();
|
||||
QColor alignment;
|
||||
QColor alignment{Qt::red};
|
||||
QColor background;
|
||||
QColor alternateBackground;
|
||||
QColor foreground;
|
||||
QColor alternateForeground;
|
||||
QColor spectrogram;
|
||||
QPen offset;
|
||||
QPen gridPen;
|
||||
QPen subGridPen;
|
||||
QBrush gaps;
|
||||
QBrush overlaps;
|
||||
QColor foreground{128, 128, 128};
|
||||
QColor alternateForeground{128, 128, 128};
|
||||
QColor spectrogram{Qt::black};
|
||||
QPen offset{{192,192,255}};
|
||||
QPen gridPen{{{0,0,0,32}}, 1, Qt::DashLine};
|
||||
QPen subGridPen{{{0,0,0,0}}, 1, Qt::DotLine};
|
||||
QBrush gaps{{255, 255, 0, 64}};
|
||||
QBrush overlaps{{255, 0, 255, 64}};
|
||||
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;
|
||||
QColor text{Qt::white};
|
||||
QColor associated{130, 173, 88};
|
||||
QColor selected{77, 77, 184};
|
||||
QColor triggering{Qt::red};
|
||||
QColor triggered0{0, 128, 255};
|
||||
QColor triggered1{0, 0, 255};
|
||||
QColor triggered2{0, 0, 128};
|
||||
QColor disabled{102, 102, 102, 100};
|
||||
QColor idle{102, 102, 102, 128};
|
||||
};
|
||||
|
||||
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;
|
||||
QColor delay0{0, 255, 255};
|
||||
QColor delay1{0, 255, 0};
|
||||
QColor delay2{255, 253, 0};
|
||||
QColor delay3{255, 102, 51};
|
||||
QColor delay4{255, 0, 0};
|
||||
QColor delay5{204, 204, 204};
|
||||
QColor delay6{153, 153, 153};
|
||||
QColor delay7{102, 102, 102};
|
||||
QColor qcWarning{Qt::yellow};
|
||||
QColor qcError{Qt::red};
|
||||
QColor qcOk{Qt::green};
|
||||
QColor qcNotSet{0, 0, 0};
|
||||
};
|
||||
|
||||
struct ConfigGradient {
|
||||
@ -156,67 +150,63 @@ class SC_GUI_API Scheme {
|
||||
|
||||
struct OriginSymbol {
|
||||
OriginSymbol();
|
||||
bool classic;
|
||||
bool classic{false};
|
||||
ConfigGradient depth;
|
||||
};
|
||||
|
||||
struct OriginStatus {
|
||||
OriginStatus();
|
||||
QColor automatic;
|
||||
QColor manual;
|
||||
QColor automatic{Qt::red};
|
||||
QColor manual{Qt::darkGreen};
|
||||
};
|
||||
|
||||
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;
|
||||
QColor gmNotSet{0, 0, 0};
|
||||
QColor gm0{0, 0, 255};
|
||||
QColor gm1{0, 0, 255};
|
||||
QColor gm2{0, 167, 255};
|
||||
QColor gm3{0, 238, 255};
|
||||
QColor gm4{0, 255, 0};
|
||||
QColor gm5{255, 255, 0};
|
||||
QColor gm6{255, 210, 0};
|
||||
QColor gm7{255, 160, 0};
|
||||
QColor gm8{255, 0, 0};
|
||||
QColor gm9{160, 0, 60};
|
||||
};
|
||||
|
||||
struct RecordView {
|
||||
RecordView();
|
||||
QColor selectedTraceZoom;
|
||||
QColor selectedTraceZoom{192, 192, 255, 192};
|
||||
};
|
||||
|
||||
struct Map {
|
||||
Map();
|
||||
QColor lines;
|
||||
QColor outlines;
|
||||
QPen directivity;
|
||||
QPen grid;
|
||||
QColor stationAnnotations;
|
||||
QColor cityLabels;
|
||||
QColor cityOutlines;
|
||||
QColor cityCapital;
|
||||
QColor cityNormal;
|
||||
QColor lines{255, 255, 255, 64};
|
||||
QColor outlines{255, 255, 255};
|
||||
QPen directivity{{255 ,160, 0}};
|
||||
QPen grid{Qt::white, 1, Qt::DotLine};
|
||||
QColor stationAnnotations{Qt::red};
|
||||
QColor cityLabels{Qt::black};
|
||||
QColor cityOutlines{Qt::black};
|
||||
QColor cityCapital{255, 160, 122};
|
||||
QColor cityNormal{Qt::white};
|
||||
QColor cityHalo{Qt::white};
|
||||
|
||||
struct {
|
||||
QPen normalText;
|
||||
QPen normalBorder;
|
||||
QBrush normalBackground;
|
||||
QPen normalText{{192,192,192}};
|
||||
QPen normalBorder{{160,160,164}};
|
||||
QBrush normalBackground{{32,32,32,192}};
|
||||
|
||||
QPen highlightedText;
|
||||
QPen highlightedBorder;
|
||||
QBrush highlightedBackground;
|
||||
QPen highlightedText{{0,0,0}};
|
||||
QPen highlightedBorder{{160,160,164}};
|
||||
QBrush highlightedBackground{{255,255,255,192}};
|
||||
|
||||
int textSize;
|
||||
int textSize{9};
|
||||
} annotations;
|
||||
};
|
||||
|
||||
struct Legend {
|
||||
Legend();
|
||||
QColor background;
|
||||
QColor border;
|
||||
QColor text;
|
||||
QColor headerText;
|
||||
QColor background{255, 255, 255, 224};
|
||||
QColor border{160, 160, 160};
|
||||
QColor text{64, 64, 64};
|
||||
QColor headerText{0, 0, 0};
|
||||
};
|
||||
|
||||
public:
|
||||
@ -239,7 +229,6 @@ class SC_GUI_API Scheme {
|
||||
};
|
||||
|
||||
struct Fonts {
|
||||
Fonts();
|
||||
void setBase(const QFont& f);
|
||||
|
||||
QFont base;
|
||||
@ -257,85 +246,82 @@ class SC_GUI_API Scheme {
|
||||
};
|
||||
|
||||
struct Splash {
|
||||
Splash();
|
||||
|
||||
struct Pos {
|
||||
QPoint pos;
|
||||
int align;
|
||||
};
|
||||
|
||||
Pos version;
|
||||
Pos message;
|
||||
Pos version{{390, 145}, Qt::AlignRight | Qt::AlignTop};
|
||||
Pos message{{200, 260}, Qt::AlignHCenter | Qt::AlignBottom};
|
||||
};
|
||||
|
||||
struct Map {
|
||||
Map();
|
||||
enum class StationSymbol {
|
||||
Triangle,
|
||||
Diamond,
|
||||
Box
|
||||
};
|
||||
|
||||
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;
|
||||
int stationSize{12};
|
||||
StationSymbol stationSymbol{StationSymbol::Triangle};
|
||||
int originSymbolMinSize{9};
|
||||
double originSymbolMinMag{1.2};
|
||||
double originSymbolScaleMag{4.9};
|
||||
bool vectorLayerAntiAlias{true};
|
||||
bool bilinearFilter{true};
|
||||
bool showGrid{true};
|
||||
bool showLayers{true};
|
||||
bool showCities{true};
|
||||
bool showLegends{false};
|
||||
int cityPopulationWeight{150};
|
||||
int cityHaloWidth{0};
|
||||
bool toBGR{false};
|
||||
int polygonRoughness{3};
|
||||
std::string projection;
|
||||
int maxZoom{24};
|
||||
};
|
||||
|
||||
struct Marker {
|
||||
Marker();
|
||||
|
||||
int lineWidth;
|
||||
int lineWidth{1};
|
||||
};
|
||||
|
||||
struct RecordBorders {
|
||||
RecordBorders();
|
||||
|
||||
Gui::RecordWidget::RecordBorderDrawMode drawMode;
|
||||
Gui::RecordWidget::RecordBorderDrawMode drawMode{Gui::RecordWidget::Box};
|
||||
};
|
||||
|
||||
struct Records {
|
||||
Records();
|
||||
|
||||
int lineWidth;
|
||||
bool antiAliasing;
|
||||
bool optimize;
|
||||
int lineWidth{1};
|
||||
bool antiAliasing{true};
|
||||
bool optimize{true};
|
||||
bool showEngineeringValues{true};
|
||||
RecordBorders recordBorders;
|
||||
};
|
||||
|
||||
struct Precision {
|
||||
Precision();
|
||||
|
||||
int depth;
|
||||
int distance;
|
||||
int location;
|
||||
int magnitude;
|
||||
int originTime;
|
||||
int pickTime;
|
||||
int traceValues;
|
||||
int rms;
|
||||
int uncertainties;
|
||||
int depth{0};
|
||||
int distance{1};
|
||||
int location{2};
|
||||
int magnitude{1};
|
||||
int originTime{0};
|
||||
int pickTime{1};
|
||||
int traceValues{1};
|
||||
int rms{1};
|
||||
int uncertainties{0};
|
||||
};
|
||||
|
||||
struct Unit {
|
||||
Unit();
|
||||
|
||||
bool distanceInKM;
|
||||
bool distanceInKM{false};
|
||||
};
|
||||
|
||||
struct DateTime {
|
||||
DateTime();
|
||||
|
||||
bool useLocalTime;
|
||||
bool useLocalTime{false};
|
||||
};
|
||||
|
||||
public:
|
||||
bool showMenu;
|
||||
bool showStatusBar;
|
||||
int tabPosition;
|
||||
bool showMenu{true};
|
||||
bool showStatusBar{true};
|
||||
int tabPosition{-1};
|
||||
bool distanceHypocentral{false};
|
||||
|
||||
Splash splash;
|
||||
Colors colors;
|
||||
|
||||
@ -116,6 +116,7 @@ class SC_GUI_API SpectrogramRenderer {
|
||||
void setTransferFunction(Math::Restitution::FFT::TransferFunction *tf);
|
||||
|
||||
bool isDirty() const { return _dirty; }
|
||||
bool isAmplitudeRangeDirty() const { return _updatedAmplitudeRange; }
|
||||
|
||||
//! Creates the spectrogram. This is usually done in render if the
|
||||
//! spectrogram is dirty but can called from outside.
|
||||
@ -131,7 +132,8 @@ class SC_GUI_API SpectrogramRenderer {
|
||||
int paddingOuter = 6, int paddingInner = 0,
|
||||
bool stretch = false);
|
||||
|
||||
QPair<double,double> range() const;
|
||||
QPair<double,double> amplitudeRange() const;
|
||||
QPair<double,double> frequencyRange() const;
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -211,7 +213,7 @@ class SC_GUI_API SpectrogramRenderer {
|
||||
|
||||
QImage::Format _imageFormat;
|
||||
TransferFunctionPtr _transferFunction;
|
||||
Core::TimeWindow _timeWindow;
|
||||
OPT(Core::TimeWindow) _timeWindow;
|
||||
Core::Time _alignment;
|
||||
double _tmin, _tmax;
|
||||
double _scale;
|
||||
@ -227,12 +229,17 @@ class SC_GUI_API SpectrogramRenderer {
|
||||
bool _logarithmic;
|
||||
bool _smoothTransform;
|
||||
bool _dirty;
|
||||
bool _updatedAmplitudeRange;
|
||||
double _renderedFmin;
|
||||
double _renderedFmax;
|
||||
};
|
||||
|
||||
|
||||
inline QPair<double,double> SpectrogramRenderer::range() const {
|
||||
inline QPair<double,double> SpectrogramRenderer::amplitudeRange() const {
|
||||
return QPair<double,double>(_normalizationAmpRange[0], _normalizationAmpRange[1]);
|
||||
}
|
||||
|
||||
inline QPair<double,double> SpectrogramRenderer::frequencyRange() const {
|
||||
return QPair<double,double>(_renderedFmin, _renderedFmax);
|
||||
}
|
||||
|
||||
|
||||
51
include/seiscomp/gui/core/spectrogramsettings.h
Normal file
51
include/seiscomp/gui/core/spectrogramsettings.h
Normal file
@ -0,0 +1,51 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) gempa GmbH *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* 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. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef SEISCOMP_GUI_CORE_SPECTROGRAMSETTINGS
|
||||
#define SEISCOMP_GUI_CORE_SPECTROGRAMSETTINGS
|
||||
|
||||
|
||||
#include <seiscomp/system/application.h>
|
||||
#ifndef Q_MOC_RUN
|
||||
#include <seiscomp/gui/core/recordview.h>
|
||||
#endif
|
||||
#include <QWidget>
|
||||
|
||||
#include <seiscomp/gui/core/ui_spectrogramsettings.h>
|
||||
|
||||
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
|
||||
class SpectrogramSettings : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SpectrogramSettings(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
public:
|
||||
void init(const System::Application *app, const std::string &prefix);
|
||||
|
||||
signals:
|
||||
void apply();
|
||||
|
||||
public:
|
||||
Ui::SpectrogramSettings ui;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
78
include/seiscomp/gui/core/spinninglabel.h
Normal file
78
include/seiscomp/gui/core/spinninglabel.h
Normal file
@ -0,0 +1,78 @@
|
||||
/***************************************************************************
|
||||
* 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_SPINNINGLABEL_H
|
||||
#define SEISCOMP_GUI_CORE_SPINNINGLABEL_H
|
||||
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVariantAnimation>
|
||||
|
||||
#include <seiscomp/gui/qt.h>
|
||||
|
||||
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
|
||||
class SC_GUI_API SpinningLabel : public QLabel {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int duration READ duration WRITE setDuration)
|
||||
Q_PROPERTY(QEasingCurve easingCurve READ easingCurve WRITE setEasingCurve)
|
||||
|
||||
public:
|
||||
explicit SpinningLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Starts the spinning animation if the label is shown or visible.
|
||||
* This is the default state.
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* @brief Stops the spinning animation if the label is shown or visible.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
int duration() const;
|
||||
void setDuration(int msecs);
|
||||
|
||||
QEasingCurve easingCurve() const;
|
||||
void setEasingCurve(const QEasingCurve &easing);
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void hideEvent(QHideEvent *event) override;
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private slots:
|
||||
void animationChanged(const QVariant &);
|
||||
|
||||
protected:
|
||||
QVariantAnimation _animation;
|
||||
double _angle;
|
||||
bool _shouldRun{true};
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@ -28,15 +28,15 @@
|
||||
#define REPAINT_WITHOUT_ERASE FALSE
|
||||
#define REPAINT_AFTER_ERASE TRUE
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace Gui {
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
class SC_GUI_API TimeScale : public Ruler {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TimeScale(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(), Position pos = Bottom);
|
||||
~TimeScale(){}
|
||||
TimeScale(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags(),
|
||||
Position pos = Bottom);
|
||||
~TimeScale() override = default;
|
||||
|
||||
void setTimeRange(double tmin, double tmax) {
|
||||
setRange(tmin, tmax);
|
||||
@ -53,9 +53,9 @@ class SC_GUI_API TimeScale : public Ruler {
|
||||
void setAbsoluteTimeEnabled(bool absoluteTime, bool absoluteDate = true);
|
||||
|
||||
protected:
|
||||
bool getTickText(double pos, double lastPos,
|
||||
int line, QString &str) const;
|
||||
void updateIntervals();
|
||||
bool getTickText(double pos, double lastPos, int line,
|
||||
QString &str) const override;
|
||||
void updateIntervals() override;
|
||||
|
||||
protected:
|
||||
Core::Time _alignment;
|
||||
@ -67,7 +67,6 @@ class SC_GUI_API TimeScale : public Ruler {
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
@ -30,10 +30,10 @@ public:
|
||||
QTabWidget *tabWidget;
|
||||
QWidget *tab;
|
||||
QGridLayout *gridLayout;
|
||||
QLabel *label_3;
|
||||
QLabel *labelVersion;
|
||||
QLabel *label_6;
|
||||
QLabel *label_7;
|
||||
QLabel *label_3;
|
||||
QLabel *label_6;
|
||||
QLabel *label;
|
||||
QLabel *label_5;
|
||||
QLabel *label_4;
|
||||
@ -71,25 +71,25 @@ public:
|
||||
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);
|
||||
gridLayout->addWidget(label_7, 1, 1, 1, 1);
|
||||
|
||||
label_3 = new QLabel(tab);
|
||||
label_3->setObjectName(QString::fromUtf8("label_3"));
|
||||
|
||||
gridLayout->addWidget(label_3, 2, 1, 1, 1);
|
||||
|
||||
label_6 = new QLabel(tab);
|
||||
label_6->setObjectName(QString::fromUtf8("label_6"));
|
||||
|
||||
gridLayout->addWidget(label_6, 4, 1, 1, 1);
|
||||
|
||||
label = new QLabel(tab);
|
||||
label->setObjectName(QString::fromUtf8("label"));
|
||||
@ -169,10 +169,10 @@ public:
|
||||
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_3->setText(QCoreApplication::translate("AboutWidget", "GFZ Potsdam", nullptr));
|
||||
label_6->setText(QCoreApplication::translate("AboutWidget", "German Research Centre for Geosciences", 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));
|
||||
|
||||
@ -10,7 +10,6 @@
|
||||
#define UI_INSPECTOR_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
@ -47,8 +46,6 @@ public:
|
||||
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);
|
||||
|
||||
|
||||
193
include/seiscomp/gui/core/ui_processmanager.h
Normal file
193
include/seiscomp/gui/core/ui_processmanager.h
Normal file
@ -0,0 +1,193 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'processmanager.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_PROCESSMANAGER_H
|
||||
#define UI_PROCESSMANAGER_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QFrame>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QHeaderView>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QSplitter>
|
||||
#include <QtWidgets/QTabWidget>
|
||||
#include <QtWidgets/QTableView>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_ProcessManager
|
||||
{
|
||||
public:
|
||||
QWidget *centralwidget;
|
||||
QHBoxLayout *layoutMain;
|
||||
QSplitter *splitter;
|
||||
QFrame *frame;
|
||||
QVBoxLayout *layoutLeft;
|
||||
QTableView *table;
|
||||
QHBoxLayout *layoutButtons;
|
||||
QSpacerItem *spacerButtons;
|
||||
QPushButton *btnStop;
|
||||
QPushButton *btnContinue;
|
||||
QPushButton *btnTerminate;
|
||||
QPushButton *btnKill;
|
||||
QPushButton *btnRemove;
|
||||
QPushButton *btnClear;
|
||||
QTabWidget *twOutput;
|
||||
QWidget *tabStdout;
|
||||
QVBoxLayout *layoutStdout;
|
||||
QWidget *tabStderr;
|
||||
QVBoxLayout *layoutStderr;
|
||||
QWidget *tabProcessLog;
|
||||
QVBoxLayout *layoutLog;
|
||||
|
||||
void setupUi(QMainWindow *ProcessManager)
|
||||
{
|
||||
if (ProcessManager->objectName().isEmpty())
|
||||
ProcessManager->setObjectName(QString::fromUtf8("ProcessManager"));
|
||||
ProcessManager->resize(1024, 768);
|
||||
centralwidget = new QWidget(ProcessManager);
|
||||
centralwidget->setObjectName(QString::fromUtf8("centralwidget"));
|
||||
layoutMain = new QHBoxLayout(centralwidget);
|
||||
layoutMain->setObjectName(QString::fromUtf8("layoutMain"));
|
||||
splitter = new QSplitter(centralwidget);
|
||||
splitter->setObjectName(QString::fromUtf8("splitter"));
|
||||
splitter->setOrientation(Qt::Orientation::Horizontal);
|
||||
frame = new QFrame(splitter);
|
||||
frame->setObjectName(QString::fromUtf8("frame"));
|
||||
frame->setFrameShape(QFrame::Shape::StyledPanel);
|
||||
frame->setFrameShadow(QFrame::Shadow::Raised);
|
||||
layoutLeft = new QVBoxLayout(frame);
|
||||
layoutLeft->setObjectName(QString::fromUtf8("layoutLeft"));
|
||||
table = new QTableView(frame);
|
||||
table->setObjectName(QString::fromUtf8("table"));
|
||||
|
||||
layoutLeft->addWidget(table);
|
||||
|
||||
layoutButtons = new QHBoxLayout();
|
||||
layoutButtons->setObjectName(QString::fromUtf8("layoutButtons"));
|
||||
spacerButtons = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
layoutButtons->addItem(spacerButtons);
|
||||
|
||||
btnStop = new QPushButton(frame);
|
||||
btnStop->setObjectName(QString::fromUtf8("btnStop"));
|
||||
btnStop->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnStop);
|
||||
|
||||
btnContinue = new QPushButton(frame);
|
||||
btnContinue->setObjectName(QString::fromUtf8("btnContinue"));
|
||||
btnContinue->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnContinue);
|
||||
|
||||
btnTerminate = new QPushButton(frame);
|
||||
btnTerminate->setObjectName(QString::fromUtf8("btnTerminate"));
|
||||
btnTerminate->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnTerminate);
|
||||
|
||||
btnKill = new QPushButton(frame);
|
||||
btnKill->setObjectName(QString::fromUtf8("btnKill"));
|
||||
btnKill->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnKill);
|
||||
|
||||
btnRemove = new QPushButton(frame);
|
||||
btnRemove->setObjectName(QString::fromUtf8("btnRemove"));
|
||||
btnRemove->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnRemove);
|
||||
|
||||
btnClear = new QPushButton(frame);
|
||||
btnClear->setObjectName(QString::fromUtf8("btnClear"));
|
||||
btnClear->setEnabled(false);
|
||||
|
||||
layoutButtons->addWidget(btnClear);
|
||||
|
||||
|
||||
layoutLeft->addLayout(layoutButtons);
|
||||
|
||||
splitter->addWidget(frame);
|
||||
twOutput = new QTabWidget(splitter);
|
||||
twOutput->setObjectName(QString::fromUtf8("twOutput"));
|
||||
tabStdout = new QWidget();
|
||||
tabStdout->setObjectName(QString::fromUtf8("tabStdout"));
|
||||
layoutStdout = new QVBoxLayout(tabStdout);
|
||||
layoutStdout->setObjectName(QString::fromUtf8("layoutStdout"));
|
||||
twOutput->addTab(tabStdout, QString());
|
||||
tabStderr = new QWidget();
|
||||
tabStderr->setObjectName(QString::fromUtf8("tabStderr"));
|
||||
layoutStderr = new QVBoxLayout(tabStderr);
|
||||
layoutStderr->setObjectName(QString::fromUtf8("layoutStderr"));
|
||||
twOutput->addTab(tabStderr, QString());
|
||||
tabProcessLog = new QWidget();
|
||||
tabProcessLog->setObjectName(QString::fromUtf8("tabProcessLog"));
|
||||
layoutLog = new QVBoxLayout(tabProcessLog);
|
||||
layoutLog->setObjectName(QString::fromUtf8("layoutLog"));
|
||||
twOutput->addTab(tabProcessLog, QString());
|
||||
splitter->addWidget(twOutput);
|
||||
|
||||
layoutMain->addWidget(splitter);
|
||||
|
||||
ProcessManager->setCentralWidget(centralwidget);
|
||||
|
||||
retranslateUi(ProcessManager);
|
||||
|
||||
twOutput->setCurrentIndex(2);
|
||||
|
||||
|
||||
QMetaObject::connectSlotsByName(ProcessManager);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QMainWindow *ProcessManager)
|
||||
{
|
||||
ProcessManager->setWindowTitle(QCoreApplication::translate("ProcessManager", "Manage processes", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnStop->setToolTip(QCoreApplication::translate("ProcessManager", "Stop execution of selected processes by sending SIGSTOP. Execution may be continued later on.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnStop->setText(QCoreApplication::translate("ProcessManager", "Stop", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnContinue->setToolTip(QCoreApplication::translate("ProcessManager", "Continue execution of selected processes by sending SIGCONT.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnContinue->setText(QCoreApplication::translate("ProcessManager", "Continue", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnTerminate->setToolTip(QCoreApplication::translate("ProcessManager", "Terminate selected processes by sending SIGTERM.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnTerminate->setText(QCoreApplication::translate("ProcessManager", "Terminate", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnKill->setToolTip(QCoreApplication::translate("ProcessManager", "Kill selected processes by sending SIGKILL.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnKill->setText(QCoreApplication::translate("ProcessManager", "Kill", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnRemove->setToolTip(QCoreApplication::translate("ProcessManager", "Remove selected processes which have terminated.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnRemove->setText(QCoreApplication::translate("ProcessManager", "Remove", nullptr));
|
||||
#if QT_CONFIG(tooltip)
|
||||
btnClear->setToolTip(QCoreApplication::translate("ProcessManager", "Remove all stopped processes which have terminated.", nullptr));
|
||||
#endif // QT_CONFIG(tooltip)
|
||||
btnClear->setText(QCoreApplication::translate("ProcessManager", "Clear", nullptr));
|
||||
twOutput->setTabText(twOutput->indexOf(tabStdout), QCoreApplication::translate("ProcessManager", "Stdout", nullptr));
|
||||
twOutput->setTabText(twOutput->indexOf(tabStderr), QCoreApplication::translate("ProcessManager", "Stderr", nullptr));
|
||||
twOutput->setTabText(twOutput->indexOf(tabProcessLog), QCoreApplication::translate("ProcessManager", "Process Log", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class ProcessManager: public Ui_ProcessManager {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_PROCESSMANAGER_H
|
||||
273
include/seiscomp/gui/core/ui_spectrogramsettings.h
Normal file
273
include/seiscomp/gui/core/ui_spectrogramsettings.h
Normal file
@ -0,0 +1,273 @@
|
||||
/********************************************************************************
|
||||
** Form generated from reading UI file 'spectrogramsettings.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_SPECTROGRAMSETTINGS_H
|
||||
#define UI_SPECTROGRAMSETTINGS_H
|
||||
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtWidgets/QDoubleSpinBox>
|
||||
#include <QtWidgets/QFrame>
|
||||
#include <QtWidgets/QGridLayout>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QSpacerItem>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class Ui_SpectrogramSettings
|
||||
{
|
||||
public:
|
||||
QVBoxLayout *verticalLayout;
|
||||
QFrame *frame;
|
||||
QGridLayout *gridLayout;
|
||||
QLabel *label_9;
|
||||
QLabel *label;
|
||||
QCheckBox *cbSmoothing;
|
||||
QLabel *label_2;
|
||||
QCheckBox *cbLogScale;
|
||||
QLabel *label_3;
|
||||
QLabel *label_4;
|
||||
QDoubleSpinBox *spinMinAmp;
|
||||
QLabel *label_5;
|
||||
QDoubleSpinBox *spinMaxAmp;
|
||||
QLabel *label_6;
|
||||
QDoubleSpinBox *spinTimeWindow;
|
||||
QLabel *label_7;
|
||||
QDoubleSpinBox *spinOverlap;
|
||||
QLabel *label_8;
|
||||
QCheckBox *cbShowAxis;
|
||||
QLabel *label_10;
|
||||
QDoubleSpinBox *spinMinFrequency;
|
||||
QDoubleSpinBox *spinMaxFrequency;
|
||||
QComboBox *cbNormalization;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QSpacerItem *horizontalSpacer;
|
||||
QPushButton *btnApply;
|
||||
QSpacerItem *verticalSpacer;
|
||||
|
||||
void setupUi(QWidget *SpectrogramSettings)
|
||||
{
|
||||
if (SpectrogramSettings->objectName().isEmpty())
|
||||
SpectrogramSettings->setObjectName(QString::fromUtf8("SpectrogramSettings"));
|
||||
SpectrogramSettings->resize(541, 503);
|
||||
verticalLayout = new QVBoxLayout(SpectrogramSettings);
|
||||
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
|
||||
frame = new QFrame(SpectrogramSettings);
|
||||
frame->setObjectName(QString::fromUtf8("frame"));
|
||||
frame->setFrameShape(QFrame::StyledPanel);
|
||||
frame->setFrameShadow(QFrame::Raised);
|
||||
gridLayout = new QGridLayout(frame);
|
||||
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
|
||||
label_9 = new QLabel(frame);
|
||||
label_9->setObjectName(QString::fromUtf8("label_9"));
|
||||
label_9->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_9, 6, 0, 1, 1);
|
||||
|
||||
label = new QLabel(frame);
|
||||
label->setObjectName(QString::fromUtf8("label"));
|
||||
QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
sizePolicy.setHorizontalStretch(0);
|
||||
sizePolicy.setVerticalStretch(0);
|
||||
sizePolicy.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
|
||||
label->setSizePolicy(sizePolicy);
|
||||
label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label, 0, 0, 1, 1);
|
||||
|
||||
cbSmoothing = new QCheckBox(frame);
|
||||
cbSmoothing->setObjectName(QString::fromUtf8("cbSmoothing"));
|
||||
QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||
sizePolicy1.setHorizontalStretch(0);
|
||||
sizePolicy1.setVerticalStretch(0);
|
||||
sizePolicy1.setHeightForWidth(cbSmoothing->sizePolicy().hasHeightForWidth());
|
||||
cbSmoothing->setSizePolicy(sizePolicy1);
|
||||
|
||||
gridLayout->addWidget(cbSmoothing, 0, 1, 1, 1);
|
||||
|
||||
label_2 = new QLabel(frame);
|
||||
label_2->setObjectName(QString::fromUtf8("label_2"));
|
||||
label_2->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_2, 1, 0, 1, 1);
|
||||
|
||||
cbLogScale = new QCheckBox(frame);
|
||||
cbLogScale->setObjectName(QString::fromUtf8("cbLogScale"));
|
||||
|
||||
gridLayout->addWidget(cbLogScale, 1, 1, 1, 1);
|
||||
|
||||
label_3 = new QLabel(frame);
|
||||
label_3->setObjectName(QString::fromUtf8("label_3"));
|
||||
label_3->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_3, 2, 0, 1, 1);
|
||||
|
||||
label_4 = new QLabel(frame);
|
||||
label_4->setObjectName(QString::fromUtf8("label_4"));
|
||||
label_4->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_4, 4, 0, 1, 1);
|
||||
|
||||
spinMinAmp = new QDoubleSpinBox(frame);
|
||||
spinMinAmp->setObjectName(QString::fromUtf8("spinMinAmp"));
|
||||
spinMinAmp->setMinimum(-99.989999999999995);
|
||||
spinMinAmp->setValue(-15.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinMinAmp, 4, 1, 1, 1);
|
||||
|
||||
label_5 = new QLabel(frame);
|
||||
label_5->setObjectName(QString::fromUtf8("label_5"));
|
||||
label_5->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_5, 5, 0, 1, 1);
|
||||
|
||||
spinMaxAmp = new QDoubleSpinBox(frame);
|
||||
spinMaxAmp->setObjectName(QString::fromUtf8("spinMaxAmp"));
|
||||
spinMaxAmp->setMinimum(-99.989999999999995);
|
||||
spinMaxAmp->setValue(-5.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinMaxAmp, 5, 1, 1, 1);
|
||||
|
||||
label_6 = new QLabel(frame);
|
||||
label_6->setObjectName(QString::fromUtf8("label_6"));
|
||||
label_6->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_6, 8, 0, 1, 1);
|
||||
|
||||
spinTimeWindow = new QDoubleSpinBox(frame);
|
||||
spinTimeWindow->setObjectName(QString::fromUtf8("spinTimeWindow"));
|
||||
spinTimeWindow->setMinimum(0.100000000000000);
|
||||
spinTimeWindow->setMaximum(600.000000000000000);
|
||||
spinTimeWindow->setValue(20.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinTimeWindow, 8, 1, 1, 1);
|
||||
|
||||
label_7 = new QLabel(frame);
|
||||
label_7->setObjectName(QString::fromUtf8("label_7"));
|
||||
label_7->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_7, 9, 0, 1, 1);
|
||||
|
||||
spinOverlap = new QDoubleSpinBox(frame);
|
||||
spinOverlap->setObjectName(QString::fromUtf8("spinOverlap"));
|
||||
spinOverlap->setMinimum(0.000000000000000);
|
||||
spinOverlap->setMaximum(99.000000000000000);
|
||||
spinOverlap->setValue(50.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinOverlap, 9, 1, 1, 1);
|
||||
|
||||
label_8 = new QLabel(frame);
|
||||
label_8->setObjectName(QString::fromUtf8("label_8"));
|
||||
label_8->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_8, 3, 0, 1, 1);
|
||||
|
||||
cbShowAxis = new QCheckBox(frame);
|
||||
cbShowAxis->setObjectName(QString::fromUtf8("cbShowAxis"));
|
||||
|
||||
gridLayout->addWidget(cbShowAxis, 3, 1, 1, 1);
|
||||
|
||||
label_10 = new QLabel(frame);
|
||||
label_10->setObjectName(QString::fromUtf8("label_10"));
|
||||
label_10->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
|
||||
gridLayout->addWidget(label_10, 7, 0, 1, 1);
|
||||
|
||||
spinMinFrequency = new QDoubleSpinBox(frame);
|
||||
spinMinFrequency->setObjectName(QString::fromUtf8("spinMinFrequency"));
|
||||
spinMinFrequency->setMaximum(10000.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinMinFrequency, 6, 1, 1, 1);
|
||||
|
||||
spinMaxFrequency = new QDoubleSpinBox(frame);
|
||||
spinMaxFrequency->setObjectName(QString::fromUtf8("spinMaxFrequency"));
|
||||
spinMaxFrequency->setMaximum(10000.000000000000000);
|
||||
|
||||
gridLayout->addWidget(spinMaxFrequency, 7, 1, 1, 1);
|
||||
|
||||
cbNormalization = new QComboBox(frame);
|
||||
cbNormalization->addItem(QString());
|
||||
cbNormalization->addItem(QString());
|
||||
cbNormalization->addItem(QString());
|
||||
cbNormalization->setObjectName(QString::fromUtf8("cbNormalization"));
|
||||
|
||||
gridLayout->addWidget(cbNormalization, 2, 1, 1, 1);
|
||||
|
||||
|
||||
verticalLayout->addWidget(frame);
|
||||
|
||||
horizontalLayout = new QHBoxLayout();
|
||||
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
|
||||
horizontalSpacer = new QSpacerItem(558, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
|
||||
horizontalLayout->addItem(horizontalSpacer);
|
||||
|
||||
btnApply = new QPushButton(SpectrogramSettings);
|
||||
btnApply->setObjectName(QString::fromUtf8("btnApply"));
|
||||
|
||||
horizontalLayout->addWidget(btnApply);
|
||||
|
||||
|
||||
verticalLayout->addLayout(horizontalLayout);
|
||||
|
||||
verticalSpacer = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
|
||||
verticalLayout->addItem(verticalSpacer);
|
||||
|
||||
|
||||
retranslateUi(SpectrogramSettings);
|
||||
|
||||
QMetaObject::connectSlotsByName(SpectrogramSettings);
|
||||
} // setupUi
|
||||
|
||||
void retranslateUi(QWidget *SpectrogramSettings)
|
||||
{
|
||||
SpectrogramSettings->setWindowTitle(QCoreApplication::translate("SpectrogramSettings", "Spectrogram Settings", nullptr));
|
||||
label_9->setText(QCoreApplication::translate("SpectrogramSettings", "Min. frequency:", nullptr));
|
||||
label->setText(QCoreApplication::translate("SpectrogramSettings", "Smoothing:", nullptr));
|
||||
cbSmoothing->setText(QString());
|
||||
label_2->setText(QCoreApplication::translate("SpectrogramSettings", "Log scale:", nullptr));
|
||||
cbLogScale->setText(QString());
|
||||
label_3->setText(QCoreApplication::translate("SpectrogramSettings", "Normalization:", nullptr));
|
||||
label_4->setText(QCoreApplication::translate("SpectrogramSettings", "Min. amplitude:", nullptr));
|
||||
spinMinAmp->setSuffix(QCoreApplication::translate("SpectrogramSettings", " log10(amp^2)", nullptr));
|
||||
label_5->setText(QCoreApplication::translate("SpectrogramSettings", "Max. amplitude:", nullptr));
|
||||
spinMaxAmp->setSuffix(QCoreApplication::translate("SpectrogramSettings", " log10(amp^2)", nullptr));
|
||||
label_6->setText(QCoreApplication::translate("SpectrogramSettings", "Time window:", nullptr));
|
||||
spinTimeWindow->setSuffix(QCoreApplication::translate("SpectrogramSettings", "s", nullptr));
|
||||
label_7->setText(QCoreApplication::translate("SpectrogramSettings", "Overlap:", nullptr));
|
||||
spinOverlap->setSuffix(QCoreApplication::translate("SpectrogramSettings", "%", nullptr));
|
||||
label_8->setText(QCoreApplication::translate("SpectrogramSettings", "Show axis:", nullptr));
|
||||
cbShowAxis->setText(QString());
|
||||
label_10->setText(QCoreApplication::translate("SpectrogramSettings", "Max. frequency:", nullptr));
|
||||
spinMinFrequency->setSpecialValueText(QString());
|
||||
spinMinFrequency->setSuffix(QCoreApplication::translate("SpectrogramSettings", " Hz", nullptr));
|
||||
spinMaxFrequency->setSpecialValueText(QCoreApplication::translate("SpectrogramSettings", "Auto", nullptr));
|
||||
spinMaxFrequency->setSuffix(QCoreApplication::translate("SpectrogramSettings", " Hz", nullptr));
|
||||
cbNormalization->setItemText(0, QCoreApplication::translate("SpectrogramSettings", "Fixed", nullptr));
|
||||
cbNormalization->setItemText(1, QCoreApplication::translate("SpectrogramSettings", "Frequency", nullptr));
|
||||
cbNormalization->setItemText(2, QCoreApplication::translate("SpectrogramSettings", "Time", nullptr));
|
||||
|
||||
btnApply->setText(QCoreApplication::translate("SpectrogramSettings", "Apply", nullptr));
|
||||
} // retranslateUi
|
||||
|
||||
};
|
||||
|
||||
namespace Ui {
|
||||
class SpectrogramSettings: public Ui_SpectrogramSettings {};
|
||||
} // namespace Ui
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UI_SPECTROGRAMSETTINGS_H
|
||||
@ -26,39 +26,92 @@
|
||||
#include <seiscomp/gui/qt.h>
|
||||
#include <seiscomp/core/datetime.h>
|
||||
#include <seiscomp/core/defs.h>
|
||||
|
||||
#include <QIcon>
|
||||
#include <QWidget>
|
||||
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class QLabel;
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace Gui {
|
||||
namespace Seiscomp::Gui {
|
||||
|
||||
|
||||
struct AuxiliaryChannelProfile {
|
||||
QString name;
|
||||
std::vector<std::string> patterns;
|
||||
double minimumDistance{0};
|
||||
double maximumDistance{1000};
|
||||
bool visible{true};
|
||||
};
|
||||
|
||||
using AuxiliaryChannelProfiles = std::vector<AuxiliaryChannelProfile>;
|
||||
|
||||
|
||||
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 bool fromString(QColor &value, std::string_view 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,
|
||||
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 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 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 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 QString numberToEngineering(double value, int precision = 1);
|
||||
|
||||
/**
|
||||
* @brief Derives the hypocentral distance from an epicentral distance
|
||||
* and the source depth and the target elevation.
|
||||
* @param epicentral Epicentral distance in degrees.
|
||||
* @param depth Source depth in km.
|
||||
* @param elev Target elevation in meters.
|
||||
* @return The hypocentral distance in degrees.
|
||||
*/
|
||||
SC_GUI_API double hypocentralDistance(double epicentral, double depth,
|
||||
double elev);
|
||||
|
||||
/**
|
||||
* @brief Computes the distance in degrees according to the scheme setting.
|
||||
* This is either the epicentral or hypocentral distance.
|
||||
* @param lat1 Source latitude.
|
||||
* @param lon1 Source longitude.
|
||||
* @param depth1 Source depth in km.
|
||||
* @param lat2 Target latitude.
|
||||
* @param lon2 Target longitude.
|
||||
* @param elev2 Target elevation in meters.
|
||||
* @param az The output azimuth from source to target.
|
||||
* @param baz The output back-azimuth from target to source.
|
||||
* @param epicentral The output epicentral distance.
|
||||
* @return Distance in degrees.
|
||||
*/
|
||||
SC_GUI_API double computeDistance(double lat1, double lon1, double depth1,
|
||||
double lat2, double lon2, double elev2,
|
||||
double *az = nullptr, double *baz = nullptr,
|
||||
double *epicentral = nullptr);
|
||||
|
||||
SC_GUI_API void setMaxWidth(QWidget *w, int numCharacters);
|
||||
SC_GUI_API void fixWidth(QWidget *w, int numCharacters);
|
||||
@ -84,14 +137,84 @@ class SC_GUI_API EllipsisDrawer : public QObject {
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Constructs an icon from a file path, application resource file or
|
||||
* fontawsome identifier. Supported schemes:
|
||||
* - qrc: Application resource read from qrc file
|
||||
* - file: File path
|
||||
* - fa: Fontawesome symbol, regular style
|
||||
* - far: Fontawesome symbol, regular style
|
||||
* - fas: Fontawesome symbol, solid style
|
||||
* - fa6: Fontawesome6 symbol, regular style
|
||||
* - far6: Fontawesome6 symbol, regular style
|
||||
* - fas6: Fontawesome6 symbol, solid style
|
||||
*
|
||||
* If the URL contains no scheme the default QIcon(QString) constructor is
|
||||
* used.
|
||||
*
|
||||
* Examples:
|
||||
* file:/path/to/file.png File path
|
||||
* /path/to/file.png File path, same as above
|
||||
* qrc:images/images/connect_no.png Application resource read from qrc file
|
||||
* :images/images/connect_no.png Application resource, same as above
|
||||
* fa:ballon Fontawesome ballon, regular
|
||||
* fas:ballon Fontawesome ballon, solid
|
||||
*
|
||||
* @param url Icon URL string.
|
||||
* @return QIcon instanance.
|
||||
*/
|
||||
SC_GUI_API QIcon iconFromURL(const QString &url);
|
||||
|
||||
|
||||
template <typename T>
|
||||
class ObjectChangeList : public std::vector<std::pair<typename Core::SmartPointer<T>::Impl, bool> > {
|
||||
using ObjectChangeList = std::vector<std::pair<Core::SmartPointer<T>, bool>>;
|
||||
|
||||
|
||||
class ColorTheme {
|
||||
private:
|
||||
/**
|
||||
* @brief Private constructor
|
||||
* This avoids static instances in custom code and maintains binary compatibility
|
||||
* if more attributes are added as the only interface is via pointers.
|
||||
*/
|
||||
ColorTheme() = default;
|
||||
|
||||
/**
|
||||
* @brief Private copy constructor
|
||||
* This avoids static instances in custom code and maintains binary compatibility
|
||||
* if more attributes are added as the only interface is via pointers.
|
||||
*/
|
||||
ColorTheme(const ColorTheme &) = default;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Figure if Dark Mode has been set.
|
||||
* @return true if dark mode, false otherwise.
|
||||
*/
|
||||
static bool IsDarkMode();
|
||||
|
||||
/**
|
||||
* @brief Returns the current color theme based on mode (light or dark).
|
||||
* @return A constant pointer to the current instance.
|
||||
*/
|
||||
static const ColorTheme *Current();
|
||||
|
||||
public:
|
||||
QColor backgroundConfirm;
|
||||
QColor foregroundConfirm;
|
||||
QColor green;
|
||||
QColor orange;
|
||||
QColor petrol;
|
||||
QColor blue;
|
||||
QColor red;
|
||||
QColor lightRed;
|
||||
QColor white;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // ns Seiscomp::Gui
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
71
include/seiscomp/gui/core/vruler.h
Normal file
71
include/seiscomp/gui/core/vruler.h
Normal file
@ -0,0 +1,71 @@
|
||||
/***************************************************************************
|
||||
* 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_VRULER_H
|
||||
#define SEISCOMP_GUI_CORE_VRULER_H
|
||||
|
||||
|
||||
#include <seiscomp/gui/core/ruler.h>
|
||||
|
||||
|
||||
namespace Seiscomp {
|
||||
namespace Gui {
|
||||
|
||||
|
||||
class RecordWidget;
|
||||
|
||||
|
||||
/**
|
||||
* @brief The VRuler class implements a vertical ruler and adds support for
|
||||
* updating its limits from a RecordWidget.
|
||||
*/
|
||||
class VRuler : public Ruler {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
VRuler(QWidget *p = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
|
||||
|
||||
public:
|
||||
void setAnnotation(QString annotation);
|
||||
const QString &annotation() const;
|
||||
|
||||
virtual bool getTickText(double pos, double lastPos,
|
||||
int line, QString &str) const;
|
||||
|
||||
|
||||
public slots:
|
||||
void updateScale(Seiscomp::Gui::RecordWidget*);
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) override;
|
||||
|
||||
|
||||
private:
|
||||
QString _annotation;
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user