StabViewDlg.h 3.89 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
/****************************************************************************

	StabViewDlg Class
	Copyright (C) 200-2010 Andre Deperrois adeperrois@xflr5.com

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*****************************************************************************/



#ifndef STABVIEWDLG_H
#define STABVIEWDLG_H

#include <QWidget>
#include <QLabel>
#include <QSlider>
#include <QDial>
#include <QRadioButton>
#include <QPushButton>
#include <QComboBox>
#include <QStackedWidget>
#include <QGroupBox>
#include <QTableView>
#include <QStandardItemModel>
#include "../misc/DoubleEdit.h"
#include "../graph/Curve.h"
#include "../misc/FloatEditDelegate.h"


class StabViewDlg : public QWidget
{
	Q_OBJECT

 friend class QMiarex;
 friend class MainFrame;

public:
    StabViewDlg(QWidget *parent);
private slots:
	void OnAnimate();
	void OnAnimateRestart();
	void OnAnimationSpeed(int val);
	void OnAnimationAmplitude(int val);
	void OnCellChanged(QWidget *pWidget);
	void OnModeSelection();
	void OnPlotStabilityGraph();
	void OnReadData();
	void OnResponseType();
	void OnAddCurve();
	void OnDeleteCurve();
	void OnRenameCurve();
	void OnSelChangeCurve(int sel);
	
private:
	void keyPressEvent(QKeyEvent *event);
	void showEvent(QShowEvent *event);
	
	void AddCurve();
	void Connect();
//	void FillControlNames();
	void FillEigenThings();
	void FillCurveList();
	double GetControlInput(const double &time);
	void SetMode(int iMode=-1);
	void SetupLayout();
	void SetControls();
	void SetTimeCurveStyle(QColor const &Color, int const&Style, int const &Width, bool const& bCurve, bool const& bPoints);
	void ReadControlModelData();
	void UpdateControlModelData();

	static void *s_pMiarex;

	QRadioButton *m_pctrlLongDynamics,*m_pctrlLatDynamics;
	QRadioButton *m_pctrlRLMode1,*m_pctrlRLMode2,*m_pctrlRLMode3,*m_pctrlRLMode4;
	QRadioButton *m_pctrlTimeMode1,*m_pctrlTimeMode2,*m_pctrlTimeMode3,*m_pctrlTimeMode4;
	QLineEdit *m_pctrlEigenValue, *m_pctrlEigenVector1, *m_pctrlEigenVector2, *m_pctrlEigenVector3, *m_pctrlEigenVector4;

	QLabel *m_pctrlModeProperties;
//	QSlider *m_pctrlAnimationSpeed, *m_pctrlAnimationAmplitude;
	QDial *m_pctrlAnimationSpeed, *m_pctrlAnimationAmplitude;
	QPushButton *m_pctrlAnimate, *m_pctrlAnimateRestart;
    DoubleEdit *m_pctrlModeStep;
	
	QLabel *m_pctrlStabLabel1, *m_pctrlStabLabel2, *m_pctrlStabLabel3;
    DoubleEdit  *m_pctrlStabVar1, *m_pctrlStabVar2, *m_pctrlStabVar3;
    DoubleEdit *m_pctrlTotalTime, *m_pctrlDeltat;
	QPushButton *m_pctrlPlotStabGraph;
	QPushButton *m_pctrlAddCurve, *m_pctrlDeleteCurve, *m_pctrlRenameCurve;
	QComboBox *m_pctrlCurveList;

	QLabel *m_pctrlUnit1, *m_pctrlUnit2, *m_pctrlUnit3;
    DoubleEdit *m_pctrlFreqN, *m_pctrlFreq1, *m_pctrlDsi;
	QStackedWidget *m_pctrlStackWidget, *m_pctrlInitialConditionsWidget, *m_pctrlModeViewType;


	QRadioButton *m_pctrlModalResponse, *m_pctrlInitCondResponse, *m_pctrlForcedResponse;

	QTableView *m_pctrlControlTable;
	QStandardItemModel *m_pControlModel;
    FloatEditDelegate *m_pCtrlDelegate;

	int m_ModeInterval;
	double m_ModeAmplitude;
	double m_vabs[4], m_phi[4];

public:
	int m_iCurrentMode;	
	Curve *m_pCurve;
	double m_Time[20], m_Amplitude[20];
};

#endif // STABVIEWDLG_H