34 #if QT_VERSION >= 0x050000
35 # include <QtWidgets/QLabel>
36 # include <QtWidgets/QGroupBox>
37 # include <QtWidgets/QBoxLayout>
38 # include <QtWidgets/QPushButton>
39 # include <QtWidgets/QFrame>
41 # include <QtGui/QLabel>
42 # include <QtGui/QGroupBox>
43 # include <QtGui/QBoxLayout>
44 # include <QtGui/QPushButton>
45 # include <QtGui/QFrame>
58 QBoxLayout *Layout, *SubLayout;
61 Layout =
new QVBoxLayout(
this);
63 SubLayout =
new QHBoxLayout();
64 Layout->addLayout(SubLayout);
65 SubLayout->addStretch(1);
67 QPushButton *Ok=
new QPushButton(
"OK",
this);
68 QPushButton *Cancel=
new QPushButton(
"Cancel",
this);
71 Cancel->setMinimumSize((BtnSize=Cancel->sizeHint()));
72 Ok ->setMinimumSize(BtnSize);
74 SubLayout->addWidget(Ok);
75 SubLayout->addWidget(Cancel);
77 connect(Ok, SIGNAL(clicked()), SLOT(
accept()));
78 connect(Cancel, SIGNAL(clicked()), SLOT(
reject()));
79 setWindowTitle(
"Test Dialog");
109 ": reject selected");
120 int numOfBranches = 3;
121 int numsOfRows[3] = {20, 45, 57};
123 const char* branchNames[3] = {
"Branch #1",
"Branch #2",
"Branch #3"};
127 for (
int i=0; i<numOfBranches; i++)
145 double tShifts[3] = {2.33, -1.8, 1.16};
146 double dPeriods[3] = {-0.8, 0.3, 1.1};
147 double dPhases[3] = {-3.8, 2.3, 4.7};
148 double dAmplitudes[3] = {-1.3, 2.8, 0.7};
149 for (
int i =0; i<numOfBranches; i++)
152 double t = t0 + tShifts[i];
155 for (
int j=0; j<numsOfRows[i]; j++)
159 a = 8.0 + dPhases[i] + (3.0 + dAmplitudes[i])*
160 cos(2.0*M_PI/(7.0 + dPeriods[i])*(t -
tEphem + 4.5 + dPhases[i])) +
161 2.5*dAmplitudes[i]*(((double)random())/RAND_MAX - 0.5);
164 b = 2.0 + tShifts[i] + (0.8 + dAmplitudes[i])*
165 cos(2.0*M_PI/(3.5 + dPeriods[i])*(t -
tEphem - 2.3 + dPhases[i])) +
166 1.2*dAmplitudes[i]*(((double)random())/RAND_MAX - 0.5);
168 c = 18.0 - 6.3*(t -
tEphem + dPhases[i]) +
169 4.2*dAmplitudes[i]*(t -
tEphem + dPhases[i])/(2.25 +
170 1.0*sin(2.0*M_PI/(2.3 + dPeriods[i])*(t -
tEphem + dPhases[i])));
172 ae = 4.0 + 3.3*sin(2.0*M_PI/3.0*(t-
tEphem + 3.3));
173 be = 1.5 + 1.0*sin(2.0*M_PI/7.0*(t-
tEphem));
186 int nRows=workBranch->
data()->
nRow();
190 for (
int i=0; i<nRows; i++)
206 for (
int i=0; i<numOfSpl; i++)
const SgMJD tEphem(51544.5)
SgPlot::OutputFormat getPlotterOutputFormat() const
const QString & getPath2PlotterOutput() const
QString className() const
NsTestDialog(QWidget *parent=0, Qt::WindowFlags flags=0)
double spline(double arg, int nColumn, double &r)
virtual void write(LogLevel, quint32, const QString &, bool=false)
unsigned int nRow() const
void setElement(unsigned int i, unsigned int j, double d)
double getElement(unsigned int i, unsigned int j) const
void createBranch(unsigned int numberOfRows, const QString &branchName, bool hasExtKeys=false)
QList< SgPlotBranch * > * listOfBranches()
void setNameOfColumn(unsigned int, const QString &)
void setAxisType(int columnIdx, AxisType axisType)
void setStdVarIdx(int columnIdx, int sigmaColumnIdx)
void setOutputFormat(OutputFormat fmt)
void setElement(unsigned int i, double d)
double getElement(unsigned int i) const