1 #include <qapplication.h> 2 #include <qpushbutton.h> 3 #include <qlcdnumber.h> 6 #include <qstatusbar.h> 10 #include <qradiobutton.h> 11 #include <qbuttongroup.h> 12 #include <qcheckbox.h> 14 #include "ElementiGrafici.h" 15 #include "VarElementiGrafici.h" 19 Finestra(QWidget *parent=0,
const char *name=0);
21 Finestra::Finestra(QWidget *parent,
const char *name)
22 :QWidget(parent,name){
24 QPushButton *esci =
new QPushButton(
"&Esci",
this,
"Esci");
25 esci->setFont( QFont(
"Times",18,QFont::Bold) );
26 connect(esci, SIGNAL(clicked()), qApp,SLOT(quit()) );
30 QPushButton *apri =
new QPushButton(
"&Apri",
this,
"apri");
31 connect(apri, SIGNAL(clicked() ), e1,SLOT(Apri()) );
33 QLineEdit *
nomeFile =
new QLineEdit(
this,
"nomeFile");
34 connect(nomeFile,SIGNAL( textChanged(
const QString &)),e1,SLOT( NomeFile(
const QString &)) );
35 connect(e1,SIGNAL( TestoCambiato(
const QString &)),nomeFile,SLOT( setText(
const QString &)) );
37 QPushButton *segnali =
new QPushButton(
"&Segnale",
this,
"segnali");
38 connect(segnali, SIGNAL(clicked() ), e1,SLOT(PuntiSegnale()) );
40 QPushButton *distr =
new QPushButton(
"&Distr",
this,
"distr");
41 connect(distr, SIGNAL(clicked() ), e1,SLOT(PuntiDistribuzione()) );
43 QPushButton *spettro =
new QPushButton(
"&Spettro",
this,
"Spettro");
44 connect(spettro, SIGNAL(clicked() ), e1,SLOT(PuntiSpettro()) );
46 QPushButton *radice =
new QPushButton(
"&Radice",
this,
"Radice");
47 connect(radice, SIGNAL(clicked() ), e1,SLOT(PuntiRadice()) );
49 QPushButton *autocor =
new QPushButton(
"&ACcor",
this,
"autocor");
50 connect(autocor, SIGNAL(clicked() ), e1,SLOT(PuntiAutocor()) );
52 QPushButton *integrale =
new QPushButton(
"&Int",
this,
"integrale");
53 connect(integrale, SIGNAL(clicked() ), e1,SLOT(PuntiIntegrale()) );
55 QPushButton *interRett =
new QPushButton(
"&InRett",
this,
"interRett");
56 connect(interRett, SIGNAL(clicked() ), e1,SLOT(PuntiInterRett()) );
58 QPushButton *parabola =
new QPushButton(
"&Para",
this,
"parabola");
59 connect(parabola, SIGNAL(clicked() ), e1,SLOT(PuntiParabola()) );
61 QPushButton *mediaMobile =
new QPushButton(
"&mMob",
this,
"mediaMobile");
62 connect(mediaMobile, SIGNAL(clicked() ), e1,SLOT(PuntiMediaMob()) );
64 QPushButton *correlaADue =
new QPushButton(
"&Cor2",
this,
"corrADue");
65 connect(correlaADue, SIGNAL(clicked() ), e1,SLOT(PuntiCorrelaADue()) );
67 QPushButton *salva =
new QPushButton(
"&Salva",
this,
"autocor");
68 connect(salva, SIGNAL(clicked() ), e1,SLOT(Salva()) );
70 QLineEdit *
nomeSalva =
new QLineEdit(
this,
"nomeSalva");
71 connect(nomeSalva,SIGNAL( textChanged(
const QString &)),e1,SLOT( NomeSalva(
const QString &)) );
72 connect(e1,SIGNAL( SalvaCambiato(
const QString &)),nomeSalva,SLOT( setText(
const QString &)) );
74 QPushButton *ridisegna =
new QPushButton(
"&R",
this,
"ridisegna");
75 connect(ridisegna,SIGNAL(clicked() ),e1,SLOT(Ridisegna()) );
77 QRadioButton *sulSegnale =
new QRadioButton(
"Sul &segnale",
this,
"sulSegnale");
79 connect(sulSegnale,SIGNAL(toggled(
bool) ),e1,SLOT(SulSegnale(
bool)) );
80 connect(e1,SIGNAL(SegnaleGrafico(
bool) ),sulSegnale,SLOT(setChecked(
bool)) );
82 QRadioButton *sulGrafico =
new QRadioButton(
"Sul &grafico",
this,
"sulGrafico");
83 connect(sulGrafico,SIGNAL(toggled(
bool) ),e1,SLOT(SulGrafico(
bool)) );
85 QButtonGroup *cosaElabora =
new QButtonGroup(
"Elabora",
this,
"cosaElabora");
86 cosaElabora->setRadioButtonExclusive( TRUE );
87 cosaElabora->insert(sulSegnale,0);
88 cosaElabora->insert(sulGrafico,1);
89 cosaElabora->setButton(0);
91 QCheckBox *linee =
new QCheckBox(
"&Linee",
this,
"linee");
93 connect(linee,SIGNAL(clicked() ),e1,SLOT(DisegnaLinee()) );
95 QCheckBox *punti =
new QCheckBox(
"&Punti",
this,
"punti");
96 connect(punti,SIGNAL(clicked() ),e1,SLOT(DisegnaPunti()) );
98 QCheckBox *griglia =
new QCheckBox(
"&Griglia",
this,
"griglia");
99 connect(griglia,SIGNAL(clicked() ),e1,SLOT(DisegnaGriglia()) );
101 QCheckBox *LogLog =
new QCheckBox(
"&LogLog",
this,
"LogLog");
102 connect(LogLog,SIGNAL(clicked() ),e1,SLOT(DisegnaLogLog()) );
103 connect(e1,SIGNAL(LogLogCambiato(
bool) ),LogLog,SLOT(setChecked(
bool)) );
105 QButtonGroup *cosaDisegna =
new QButtonGroup(
"Disegna",
this,
"cosaDisegna");
106 cosaDisegna->insert(linee,-1);
107 cosaDisegna->insert(punti,-1);
108 cosaDisegna->insert(griglia,-1);
109 cosaDisegna->insert(LogLog,-1);
111 QStatusBar *Barra =
new QStatusBar(
this,
"Barra");
112 connect(e1,SIGNAL(Stato(
const QString &) ),Barra,SLOT( message(
const QString &)) );
114 QSpinBox *Valori =
new QSpinBox(2,100,20,
this,
"Valori");
115 connect(Valori,SIGNAL(valueChanged(
int)),e1,SLOT(ImpValori(
int)) );
116 connect(e1,SIGNAL(ValoriCambiati(
int)),Valori,SLOT(setValue(
int)) );
117 QLabel *etValori =
new QLabel(
" ",
this,
"etValori");
118 etValori->setAlignment( AlignCenter);
119 etValori->setText(
"Valori");
121 QSpinBox *NMobile =
new QSpinBox(2,100,5,
this,
"NMobile");
122 connect(NMobile,SIGNAL(valueChanged(
int)),e1,SLOT(
ImpNMobile(
int)) );
123 connect(e1,SIGNAL(NMobileCambiato(
int)),NMobile,SLOT(setValue(
int)) );
124 QLabel *etNMobile =
new QLabel(
" ",
this,
"etNMobile");
125 etNMobile->setAlignment( AlignCenter);
126 etNMobile->setText(
"Media Mobile");
128 QSpinBox *NCorrela =
new QSpinBox(2,100,2,
this,
"NCorrela");
129 connect(NCorrela,SIGNAL(valueChanged(
int)),e1,SLOT(
ImpNCorrela(
int)) );
130 connect(e1,SIGNAL(NCorrelaCambiato(
int)),NCorrela,SLOT(setValue(
int)) );
131 QLabel *etNCorrela =
new QLabel(
" ",
this,
"etNCorrela");
132 etNCorrela->setAlignment( AlignCenter);
133 etNCorrela->setText(
"Correla a due");
135 ImpostaValori *NVisMin =
new ImpostaValori(
this,
"NVisMin");
136 connect(NVisMin,SIGNAL(ValoreCambiato(
int)),e1,SLOT(
ImpNVisMin(
int)) );
137 connect(e1,SIGNAL(NVisMinCambiato(
int)),NVisMin,SLOT(ImpNumero(
int)) );
138 connect(e1,SIGNAL(InterVisCambiato(
int)),NVisMin,SLOT(ImpInter(
int)) );
140 ImpostaValori *NVisMass =
new ImpostaValori(
this,
"NVisMass");
141 connect(NVisMass,SIGNAL(ValoreCambiato(
int)),e1,SLOT(ImpNVisMass(
int)) );
142 connect(e1,SIGNAL(NVisMassCambiato(
int)),NVisMass,SLOT(ImpNumero(
int)) );
143 connect(e1,SIGNAL(InterVisCambiato(
int)),NVisMass,SLOT(ImpInter(
int)) );
145 ImpostaValori *NElMin =
new ImpostaValori(
this,
"NElMin");
146 connect(NElMin,SIGNAL(ValoreCambiato(
int)),e1,SLOT(
ImpNElMin(
int)) );
147 connect(e1,SIGNAL(NElMinCambiato(
int)),NElMin,SLOT(ImpNumero(
int)) );
148 connect(e1,SIGNAL(InterVisCambiato(
int,
int)),NElMin,SLOT(ImpInter(
int,
int)) );
150 ImpostaValori *NElMass =
new ImpostaValori(
this,
"NElMass");
151 connect(NElMass,SIGNAL(ValoreCambiato(
int)),e1,SLOT(ImpNElMass(
int)) );
152 connect(e1,SIGNAL(NElMassCambiato(
int)),NElMass,SLOT(ImpNumero(
int)) );
153 connect(e1,SIGNAL(InterVisCambiato(
int,
int)),NElMass,SLOT(ImpInter(
int,
int)) );
155 QGridLayout *grid=
new QGridLayout(
this,4,2,10);
156 grid->addWidget(esci,0,0);
157 grid->addWidget(e1,1,1);
158 grid->setColStretch(1,10);
159 grid->setRowStretch(1,10);
161 QVBoxLayout *ASinistra =
new QVBoxLayout;
162 grid->addLayout(ASinistra,1,0);
163 grid->setRowSpacing(1,400);
164 ASinistra->addWidget(Valori);
165 ASinistra->addSpacing(-10);
166 ASinistra->addWidget(etValori);
167 ASinistra->addWidget(NMobile);
168 ASinistra->addSpacing(-10);
169 ASinistra->addWidget(etNMobile);
170 ASinistra->addWidget(NCorrela);
171 ASinistra->addSpacing(-10);
172 ASinistra->addWidget(etNCorrela);
173 ASinistra->addWidget(cosaElabora);
174 ASinistra->addSpacing(5);
175 ASinistra->addWidget(sulSegnale);
176 ASinistra->addSpacing(-10);
177 ASinistra->addWidget(sulGrafico);
178 ASinistra->addWidget(apri);
179 ASinistra->addSpacing(-10);
180 ASinistra->addWidget(nomeFile);
181 ASinistra->addWidget(salva);
182 ASinistra->addSpacing(-10);
183 ASinistra->addWidget(nomeSalva);
184 ASinistra->addWidget(cosaDisegna);
185 ASinistra->addSpacing(5);
186 ASinistra->addWidget(linee);
187 ASinistra->addSpacing(-10);
188 ASinistra->addWidget(punti);
189 ASinistra->addSpacing(-10);
190 ASinistra->addWidget(griglia);
191 ASinistra->addSpacing(-10);
192 ASinistra->addWidget(LogLog);
193 QVBoxLayout *ASinistraGiu =
new QVBoxLayout;
194 grid->addLayout(ASinistraGiu,3,0);
197 QHBoxLayout *InAlto =
new QHBoxLayout;
198 grid->addLayout(InAlto,0,1);
199 InAlto->addWidget(segnali);
200 InAlto->addWidget(distr);
201 InAlto->addWidget(spettro);
202 InAlto->addWidget(radice);
203 InAlto->addWidget(autocor);
204 InAlto->addWidget(integrale);
205 InAlto->addWidget(mediaMobile);
206 InAlto->addWidget(correlaADue);
207 InAlto->addWidget(interRett);
208 InAlto->addWidget(parabola);
213 QHBoxLayout *InBasso =
new QHBoxLayout;
214 grid->addLayout(InBasso,2,1);
215 InBasso->addWidget(NElMin);
216 InBasso->addWidget(NElMass);
217 InBasso->addWidget(ridisegna);
218 InBasso->addWidget(NVisMin);
219 InBasso->addWidget(NVisMass);
221 QHBoxLayout *InBasso2 =
new QHBoxLayout;
222 grid->addLayout(InBasso2,3,1);
223 InBasso2->addWidget(Barra);
226 int main(
int argc,
char **argv){
227 QApplication::setColorSpec( QApplication::CustomColor );
228 QApplication a(argc,argv);
231 f.setGeometry(0,200,800,355);
232 a.setMainWidget( &f );
char * nomeFile
Name of the current file opened.
ElementiGrafici(QWidget *parent=0, const char *name=0)
General constructor.
void ImpNCorrela(int n)
Set the bins for the point correlation.
char * nomeSalva
Name of the output file.
void ImpNElMin(int n)
Set the minimum elaboration point.
void ImpNVisMin(int n)
Set the minimum visualisation point.
Contains the function to interacts with the data stored in VarDatFile.
void ImpNMobile(int n)
Set the bins for the running average.