Commit c715a52e authored by allens's avatar allens

added Qwt support to the gui

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@28504 18c085ea-50e0-402c-830e-de6fd14e8384
parent 43067dab
......@@ -808,6 +808,7 @@ VISIT_3RDPARTY_VAR(OPENGL_DIR "Path containing the OpenGL library's include a
VISIT_3RDPARTY_VAR(NETCDF_DIR "Path containing the NETCDF library's include and lib")
VISIT_3RDPARTY_DEP(NETCDF_LIBDEP "NETCDF library dependencies")
VISIT_3RDPARTY_VAR(PYSIDE_DIR "Path containing the PySide installation")
VISIT_3RDPARTY_VAR(QWT_DIR "Path containing the Qwt library's include and lib")
VISIT_3RDPARTY_VAR(R_DIR "Path containing the R library's include and lib")
VISIT_3RDPARTY_VAR(SILO_DIR "Path containing the Silo library's include and lib")
VISIT_3RDPARTY_DEP(SILO_LIBDEP "Silo library dependencies")
......@@ -1063,6 +1064,11 @@ IF(BOOST_FOUND)
SET(HAVE_BOOST 1)
ENDIF(BOOST_FOUND)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindQwt.cmake)
IF(QWT_FOUND)
SET(HAVE_QWT 1)
ENDIF(QWT_FOUND)
IF( (VISIT_PYTHON_SCRIPTING OR VISIT_PYTHON_FILTERS) AND NOT VISIT_DBIO_ONLY)
INCLUDE(${VISIT_SOURCE_DIR}/CMake/FindVisItPython.cmake)
......
......@@ -434,6 +434,7 @@ Nek5000
OVERFLOW
OpenFOAM
PATRAN
PICS_Tester
PuReMD
PLOT3D
PlainText
......
......@@ -390,10 +390,11 @@ ${QT_QTOPENGL_INCLUDE_DIR}
${QT_QTNETWORK_INCLUDE_DIR}
${QT_QTXML_INCLUDE_DIR}
${QT_QTUITOOLS_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_DIRECTORY}
${QT_SHAREDLIB_DIR} ${QT_LIBRARY_DIR}
${QT_SHAREDLIB_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR}
)
SET(GUI_QT_LIBS
......@@ -402,7 +403,7 @@ ${QT_QTOPENGL_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTCORE_LIBRARY}
)
IF(VISIT_STATIC)
SET(GUI_QT_LIBS
......@@ -431,6 +432,7 @@ mdserverproxy
avtdbatts
winutil
${GUI_QT_LIBS}
${QWT_LIBRARY}
)
IF(APPLE)
......
This diff is collapsed.
......@@ -70,6 +70,8 @@ class StatusAttributes;
class avtSimulationCommandSpecification;
class SimulationUIValues;
class QwtPlot;
// ****************************************************************************
// Class: QvisSimulationWindow
//
......@@ -130,13 +132,19 @@ private:
QString GetUIFileDirectory() const;
QString GetUIFile(const QString &key) const;
void CreateCommandUI();
// void UpdateSimulationUI(const avtDatabaseMetaData *md);
// void UpdateCustomUI (const avtDatabaseMetaData *md);
void UpdateUIComponent(QWidget *window, const QString &name, const QString &value, bool e);
void ViewerSendCMD ( int simIndex, QString cmd);
QColor getColor(const QString &color) const;
void getTableCMD( const char *cmd,
unsigned int &row, unsigned int &column, char *name );
void getTableCMD( const char *cmd, char *name, char *var,
double &x, double &y );
std::string getNextString( std::string &cmd, const std::string delimiter );
public slots:
virtual void showNormal();
virtual void showMinimized();
......@@ -151,9 +159,6 @@ private slots:
void executeStartCommand(const QString &cmd);
void executeStopCommand(const QString &cmd);
void executeStepCommand(const QString &cmd);
void zoomOut();
void zoomIn();
void focus();
private:
EngineList *engines;
......@@ -176,9 +181,10 @@ private:
QWidget *DynamicCommandsWin;
QvisUiLoader *uiLoader;
QMap<int,int> simulationToEngineListMap;
QvisStripChartMgr *stripCharts;
QvisStripChartMgr *stripChartMgr;
QvisSimulationCommandWindow *simCommands;
QvisSimulationMessageWindow *simMessages;
};
QwtPlot *curvePlots;
};
#endif
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2016, Lawrence Livermore National Security, LLC
......@@ -38,126 +37,117 @@
*****************************************************************************/
#ifndef QVIS_STRIPCHART_H
#define QVIS_STRIPCHART_H
#include <QVector>
#include <QWidget>
class QScrollArea;
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#define HISTORY 50
#define MAX_STRIP_CHART_VARS 4
class Background;
// ****************************************************************************
// Class: VisItPointD
class QwtPlotCurve;
class QwtPlotZoomer;
class QwtPlotPicker;
class QwtPlotPanner;
//****************************************************************************
// Class: StripChartCurve
//
// Purpose:
// Implements a simple point with a double as the base data type.
// QT will have a QPointF in it's next release but for now I use this.
//
// Notes:
// Implements a class to hold the strip chart curve.
//
// Programmer: Shelly Prevost,
// Creation: Wed Mar 21 16:35:30 PDT 2007.
// Programmer: Allen Sanderson
// Creation: 1 May 2016
//
// Modifications:
//
// ***************************************************************************
class VisItPointD
//****************************************************************************
class StripChartCurve: public QwtPlotCurve
{
public:
VisItPointD () { p_x = 0; p_y = 0; };
VisItPointD ( double x, double y ) { p_x = x; p_y = y; };
double x() { return p_x; };
double y() { return p_y; };
void setX(double x) { p_x = x; };
void setY(double y) { p_y= y; };
private:
double p_x;
double p_y;
};
StripChartCurve( const QString &title ):
QwtPlotCurve( title )
{
setRenderHint( QwtPlotItem::RenderAntialiased );
}
typedef QVector<VisItPointD> Points;
void setColor( const QColor &color )
{
QColor c = color;
c.setAlpha( 150 );
setPen( QPen( Qt::NoPen ) );
setBrush( c );
}
};
// ****************************************************************************
// Class: VisItSimStripChart
//****************************************************************************
// Class: StripChartCurve
//
// Purpose:
// Implements a simple strip chart. It is intended
// for tracking rate of change of simulation variables.
// The strip chart will auto range ( keep the full range
// of data visible on the chart) and change the plot color
// to red if the values are outside the set limits.
// Implements a class to hold the strip chart plot.
//
// Notes:
//
// Programmer: Shelly Prevost,
// Creation: Friday Oct. 27, 2006
// Programmer: Allen Sanderson
// Creation: 1 May 2016
//
// Modifications:
// Shelly Prevost, Wed Mar 21 16:35:30 PDT 2007.
// Added Zoom In and out and focus ( center ) to controls
//
// Shelly Prevost Fri Apr 13 14:03:03 PDT 2007
// added Font variable to update font size as zoom changes. Also added variable
// zoomOutLimit for zoom checks.
//
// ****************************************************************************
//****************************************************************************
class VisItSimStripChart : public QWidget
{
class QvisStripChart : public QwtPlot
{
Q_OBJECT
public:
VisItSimStripChart( QWidget *parent=0, int winX=4000, int winY=1000 );
~VisItSimStripChart();
void setOutOfBandLimits( double minY, double miaxY );
void getOutOfBandLimits( double &minY, double &maxY );
void enableOutOfBandLimits( bool enable);
bool getEnableOutOfBandLimits();
bool addDataPoint( double x, double y );
void setEnable( bool enable );
bool getEnable();
void getMinMaxData( double &minY, double &maxY);
void zoomOut();
void zoomIn();
void reset();
void focus(QScrollArea *sc);
void setFontSize();
void setEnableLogScale( bool enable );
bool getEnableLogScale();
double getCurrentData();
int getCurrentCycle();
protected:
void paintEvent( QPaintEvent * );
void mousePressEvent( QMouseEvent *);
void mouseReleaseEvent( QMouseEvent *);
void mouseMoveEvent( QMouseEvent *);
void paintGrid(QPainter *paint);
QvisStripChart( QWidget * = 0 );
// void setEnable( bool enable ) {};
// bool getEnable() { return true; };
// void setEnableLogScale( bool enable ) {};
// bool getEnableLogScale() { return false; };
void enableZoomMode( bool );
void reset();
void clear();
void setCurveTitle( unsigned int index, const QString &newTitle);
void addDataPoint( const QwtText &var, double x, double y);
private Q_SLOTS:
void legendChecked( const QVariant &, bool on );
private:
Points points; // point array
int timeShift; // how far left to points
bool down; // TRUE if mouse down
float delta;
float vdelta;
float middle;
float maxPoint;
float minPoint;
double minYLimit;
double maxYLimit;
double minData;
double maxData;
double currentData;
int currentCycle;
int winXSize;
int winYSize;
bool enabled;
bool enableLogScale;
bool outOfBandLimitsEnabled;
float zoom;
bool center;
float zoomOutLimit;
QFont *gridFont;
int pointSize;
int currentScaledY;
void showCurve( QwtPlotItem *, bool on );
void hideCurve( QwtPlotItem *item );
void setupTimeAxis( double time, double timeStep );
void advanceDataCount( double time );
void updateSamples();
void updateAxis();
void AdjustLabelsComputeRange( double inRange[2],
double outRange[2],
double &interval,
unsigned int &nTicks );
unsigned int dataCount;
double timeData[HISTORY];
Background *bg;
QwtPlotZoomer *d_zoomer[2];
QwtPlotPicker *d_picker;
QwtPlotPanner *d_panner;
struct
{
double varData[HISTORY];
StripChartCurve *curve;
}
vars[MAX_STRIP_CHART_VARS];
};
#endif /* QVIS_STRIPCHART_MGR */
#endif
This diff is collapsed.
......@@ -37,6 +37,7 @@
*****************************************************************************/
#ifndef QVIS_STRIPCHART_MGR
#define QVIS_STRIPCHART_MGR
#include <QWidget>
#include <QGroupBox>
#include <QvisPostableWindow.h>
......@@ -85,73 +86,47 @@ public:
EngineList *engineList, int index,
QvisNotepadArea *notepad2);
virtual ~QvisStripChartMgr();
bool isStripChartWidget( QString name );
bool isStripChartTabLabel( QString name );
void setEnable( QString name, bool enable );
bool getEnable( QString name);
bool addDataPoint( QString name, double x, double y );
void update(QString name);
void getMinMaxData( QString name, double &minY, double &maxY);
void enableOutOfBandLimits(QString name, bool enabled);
void setOutOfBandLimits(QString name,double min, double max);
void setOutOfBandLimits(double min, double max);
void setLimitStripChartDataDisplay(double min, double max);
void setCurrentDataDisplay(double currentData );
void setCycleDisplay (int currentCycle);
int sendCMD(QString sig, const QObject *ui, QString value);
int sendCMD(QString cmd);
void setTabLabel( const unsigned int index, QString newLabel );
void setCurveTitle( const unsigned int tabIndex,
const unsigned int curveIndex, QString newTitle );
void setTabLabel(QString tabName, QString newLabel );
void addDataPoint( const QString name,
const QString var,
double x, double y );
virtual void CreateEntireWindow();
public slots:
void reset(QString tabName );
void pick();
void zoom();
void reset();
void zoomIn();
void zoomOut();
void focus();
void updateCurrentTabData();
void clear();
void clear( const unsigned int index );
void post();
void unpost();
protected slots:
void executeMaxLimitStripChart();
void executeMinLimitStripChart();
void setMinMaxStripChartDataDisplay (double minY, double maxY);
void executeEnableStripChartLimits();
void executeEnableLogScale();
void updateCurrentTabData();
protected:
virtual void CreateWindowContents();
private:
QvisStripChartTabWidget *stripChartTabWidget;
QCheckBox *enableStripChartLimits;
QLineEdit *maxLimitEdit;
QLabel *maxLimitLabel;
QLineEdit *minLimitEdit;
QLabel *minLimitLabel;
QLineEdit *maxEdit;
QLabel *maxLabel;
QLineEdit *minEdit;
QLabel *minLabel;
QLineEdit *curEdit;
QLabel *curLabel;
QLineEdit *cycleEdit;
QLabel *cycleLabel;
QGridLayout *chartLayout;
QPushButton *pickButton;
QPushButton *zoomButton;
QPushButton *resetButton;
QPushButton *plusButton;
QPushButton *minusButton;
QPushButton *focusButton;
QPushButton *clearButton;
QScrollArea *sc;
QCheckBox *enableLogScale;
bool posted;
bool posted;
EngineList *engines;
ViewerProxy *viewer;
int simIndex;
EngineList *engines;
ViewerProxy *viewer;
int simIndex;
};
#endif /* QVIS_STRIPCHART_MGR */
This diff is collapsed.
/*****************************************************************************
*
* Copyright (c) 2000 - 2016, Lawrence Livermore National Security, LLC
......@@ -38,28 +37,15 @@
*****************************************************************************/
#ifndef QVIS_STRIPCHART_TABWIDGET_H
#define QVIS_STRIPCHART_TABWIDGET_H
#include <QPainter>
#include <QString>
#include <QTabWidget>
#include <QVector>
#include <QWidget>
#include <QTabWidget>
class QCheckBox;
class QColor;
class QComboBox;
class QGridLayout;
class QGroupBox;
class QLabel;
class QLineEdit;
class QObject;
class QPushButton;
class QScrollArea;
class QSignal;
class QSpinBox;
class QTreeWidget;
class QVBoxLayout;
class VisItSimStripChart;
class QvisStripChart;
#define MAX_STRIP_CHARTS 5
// ****************************************************************************
// Class: SC_NamesTabsIndex
......@@ -82,17 +68,15 @@ class SC_NamesTabsIndex
{
public:
SC_NamesTabsIndex(){}
SC_NamesTabsIndex(const char *n, const char *tab, int i):name(n),tabName(tab), index(i){}
SC_NamesTabsIndex(const char *n) : name(n) {}
QString getName() const {return name;}
void setScrollView(QScrollArea *sc) {scrollView = sc;}
QScrollArea *getScrollView() {return scrollView;}
QString getTabName() const {return tabName;}
int getIndex() const {return index;}
private:
QString name;
QString tabName;
int index;
QScrollArea *scrollView;
};
......@@ -120,73 +104,37 @@ class QvisStripChartTabWidget : public QTabWidget
{
Q_OBJECT
public:
QvisStripChartTabWidget( QWidget *parent=0, QObject *mgr=NULL, int winX=4000, int winY=1000 );
QvisStripChartTabWidget( QWidget *parent=0, QObject *mgr=NULL,
int winX=4000, int winY=1000 );
~QvisStripChartTabWidget();
void setEnable(const QString &name, bool enable );
bool getEnable(const QString &name) const;
bool addDataPoint (const QString &name,double x, double y);
void update(const QString &name);
void getMinMaxData(const QString &name, double &minY, double &maxY);
void getMinMaxData(double &minY, double &maxY);
enum numStripCharts { maxStripCharts = 5 };
int nameToIndex(const QString &SC_Name) const;
int nameToTabIndex(const QString &Tab_Name) const;
bool isStripChartWidget(const QString &name) const;
bool isStripChartTabLabel(const QString &name) const;
int getCurrentPageIndex() const;
void executeEnableStripChartLimits();
QWidget *getCurrentStripChart();
void getOutOfBandLimits(double &min, double &max);
bool getEnableOutOfBandLimits();
void setEnableLogScale( bool enable );
bool getEnableLogScale();
// void setEnableLogScale( bool enable );
// bool getEnableLogScale();
void setTabLabel(int tabIndex, const QString &newLabel);
double getCurrentData();
int getCurrentCycle();
void setCurveTitle(int tabIndex, int cruveIndex, const QString &newTitle);
void addDataPoint(const QString &name,
const QString &var,
double x, double y);
public slots:
void reset( const int index );
void pick();
void zoom();
void reset();
void zoomIn();
void zoomOut();
void focus();
void clear();
void clear( const unsigned int index );
void updateCurrentTabData();
void enableOutOfBandLimits(const QString &name, bool enabled);
void enableOutOfBandLimits( bool enabled);
void setOutOfBandLimits(const QString &name,double min, double max);
void setOutOfBandLimits(double min, double max);
private:
int timeShift; // how far left to points
bool down; // TRUE if mouse down
float delta;
float vdelta;
float middle;
float maxPoint;
float minPoint;
double minYLimit;
double maxYLimit;
double minData;
double maxData;
int winXSize;
int winYSize;
bool enabled;
bool outOfBandLimitsEnabled;
float zoom;
bool center;
float zoomOutLimit;
QFont *gridFont;
int pointSize;
// index of the currently displayed strip chart
int currentStripChart;
// array of maxStripCharts
VisItSimStripChart *stripCharts[maxStripCharts];
QvisStripChart *stripCharts[MAX_STRIP_CHARTS];
SC_NamesVector SC_Info;
};
#endif /* QVISSTRIPCHARTTABWIDGET */
......@@ -116,9 +116,9 @@ int SimCommandSlots::SendCMD(QString sig, const QObject *ui, QString value)
string sim = engines->GetSimulationName()[simIndex];
QString cmd = QString("UI;%1;%2;%3;%4").arg(ui->objectName())
.arg(ui->metaObject()->className())
.arg(sig)
.arg(value);
.arg(ui->metaObject()->className())
.arg(sig)
.arg(value);
viewer->GetViewerMethods()->SendSimulationCommand(host, sim, cmd.toStdString());
......@@ -351,7 +351,7 @@ void SimCommandSlots::CellChangedHandler(int row, int col)
QString value =
QString::number(row) + " | " + QString::number(col) + " | " + tvalue;
SendCMD("cellChanged(int,int)", ui, value);
}
......
......@@ -54,22 +54,17 @@
*****************************************************************************/
#define MESSAGE_WIDGET_NAME "MessageViewerTextEdit"
#define STRIP_CHART_0_WIDGET_NAME "StripChart_0"
#define STRIP_CHART_1_WIDGET_NAME "StripChart_1"
#define STRIP_CHART_2_WIDGET_NAME "StripChart_2"
#define STRIP_CHART_3_WIDGET_NAME "StripChart_3"
#define STRIP_CHART_4_WIDGET_NAME "StripChart_4"
#define STRIP_CHART_0_TAB_NAME "StripChart_0_Tab"
#define STRIP_CHART_1_TAB_NAME "StripChart_1_Tab"
#define STRIP_CHART_2_TAB_NAME "StripChart_2_Tab"
#define STRIP_CHART_3_TAB_NAME "StripChart_3_Tab"
#define STRIP_CHART_4_TAB_NAME "StripChart_4_Tab"
#define STRIP_MAX_WIDGET_NAME "MaxEdit"
#define STRIP_MIN_WIDGET_NAME "MinEdit"
#define STRIP_CUR_WIDGET_NAME "CurEdit"
#define STRIP_CYCLE_WIDGET_NAME "CycleEdit"
#define STRIP_MAX_LIMIT_WIDGET_NAME "MaxLimitEdit"
#define STRIP_MIN_LIMIT_WIDGET_NAME "MinLimitEdit"
#endif /* SIMWIDGETNAMES */
......@@ -96,7 +96,7 @@ ${PYINCLUDES}
${VISIT_INCLUDE_DIR}/avt/Database/Ghost
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(IAMRStitchCellOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(IAMRStitchCellOperator visitcommon)
......
......@@ -93,7 +93,7 @@ ${VTK_INCLUDE_DIRS}
${PYINCLUDES}
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(IBoundaryOpOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(IBoundaryOpOperator visitcommon)
......
......@@ -93,7 +93,7 @@ ${VTK_INCLUDE_DIRS}
${PYINCLUDES}
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(IBoxOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(IBoxOperator visitcommon)
......
......@@ -93,7 +93,7 @@ ${VTK_INCLUDE_DIRS}
${PYINCLUDES}
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(ICartographicProjectionOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(ICartographicProjectionOperator visitcommon)
......
......@@ -93,7 +93,7 @@ ${VTK_INCLUDE_DIRS}
${PYINCLUDES}
)
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
LINK_DIRECTORIES(${VISIT_LIBRARY_DIR} ${QT_LIBRARY_DIR} ${QWT_LIBRARY_DIR} ${GLEW_LIBRARY_DIR} ${EAVL_LIBRARY_DIR} ${VTKM_LIBRARY_DIR} ${VTK_LIBRARY_DIRS} )
ADD_LIBRARY(IChannelCommOperator ${LIBI_SOURCES})
TARGET_LINK_LIBRARIES(IChannelCommOperator visitcommon)
......
......@@ -93,7 +93,7 @@ ${VTK_INCLUDE_DIRS}