11 #include <QMessageBox>
19 QString ic_dens = QFileDialog::getOpenFileName(
this, tr(
"The initial density file"), QString::null);
20 if (ic_dens.size()==0) ic_dens =
"dummy";
24 if (ic_dens.size()>0){
35 QString ic_temp = QFileDialog::getOpenFileName(
this, tr(
"The initial temperature file"), QString::null);
37 if (ic_temp.size()==0) ic_temp =
"dummy";
42 if (ic_temp.size()>0){
53 QString ic_velo = QFileDialog::getOpenFileName(
this, tr(
"The initial velocity file"), QString::null);
55 if (ic_velo.size()==0) ic_velo =
"dummy";
60 if (ic_velo.size()>0){
71 QString
ic_wind = QFileDialog::getOpenFileName(
this, tr(
"The initial wind-emitter file"), QString::null);
73 if (ic_wind.size()==0) ic_wind =
"dummy";
78 if (ic_wind.size()>0){
89 QString
ic_obstacle = QFileDialog::getOpenFileName(
this, tr(
"The initial obstacles-distribution file"), QString::null);
91 if (ic_obstacle.size()==0) ic_obstacle =
"dummy";
96 if (ic_obstacle.size()>0){
107 QString
ic_marker = QFileDialog::getOpenFileName(
this, tr(
"The initial marker-field distribution file"), QString::null);
109 if (ic_marker.size()==0) ic_marker =
"dummy";
114 if (ic_marker.size()>0){
125 QString
ic_soundemitter = QFileDialog::getOpenFileName(
this, tr(
"The initial soundemitter file"), QString::null);
127 if (ic_soundemitter.size()==0) ic_soundemitter =
"dummy";
132 if (ic_soundemitter.size()>0){
144 QString
output_path = QFileDialog::getExistingDirectory(
this, tr(
"The output directory"), QString::null);
146 if (output_path.size()==0) output_path =
"/tmp/";
148 output_path = output_path.append(
"/");
181 QFile file(filename);
182 file.open(QIODevice::ReadOnly | QIODevice::Text);
183 QTextStream in(&file);
187 QString line = in.readLine();
188 std::istringstream iss(line.toStdString());
190 if (i == 1) iss >> name >> read_x_res;
191 if (i == 2) iss >> name >> read_y_res;
192 if (i == 3) iss >> name >> read_z_res;
208 msgBox.setText(
"Attention!");
209 msgBox.setInformativeText(
"The file has a different resolution as a already loaded, plaese check the IC files.");
218 ui->
res_x->setValue(read_x_res);
219 ui->
res_y->setValue(read_y_res);
220 ui->
res_z->setValue(read_z_res);
222 if ((read_y_res==1)&&(read_z_res==1))
ui->
dimension->setCurrentIndex(0);
223 if (read_z_res ==1)
ui->
dimension->setCurrentIndex(1);
224 if ((read_y_res!=1)&&(read_z_res!=1))
ui->
dimension->setCurrentIndex(2);