Skip to content

Commit

Permalink
Merge pull request #26 from pmackenz/master
Browse files Browse the repository at this point in the history
fixing export of controlDict file
  • Loading branch information
pmackenz authored Jul 9, 2019
2 parents 5451003 + 5f4e1e5 commit 2fb54c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions Inflow/inflowparameterwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,14 @@ void InflowParameterWidget::exportUFile(QString fileName)
UFile.close();
}

void InflowParameterWidget::exportControlDictFile(QString fileName)
void InflowParameterWidget::exportControlDictFile(QString origFileName, QString fileName)
{
// file handle for the controlDict file
QFile CDictIn(origFileName);
CDictIn.open(QFile::ReadOnly);
CDictContents = CDictIn.readAll();
CDictIn.close();

QFile CDict(fileName);
CDict.open(QFile::WriteOnly);
QTextStream out(&CDict);
Expand Down Expand Up @@ -1039,7 +1044,7 @@ void InflowParameterWidget::on_btn_export_clicked()
qDebug() << "move" << newFile << origFile;

// update controlDict file
this->exportControlDictFile(newFile);
this->exportControlDictFile(origFile, newFile);
}

void InflowParameterWidget::on_RemoteFilesChanged(QString uFilePath, QString controlDictPath)
Expand Down Expand Up @@ -1200,7 +1205,7 @@ bool InflowParameterWidget::copyFiles(QString &dirName)
qDebug() << "move" << newFile << origFile;

// update controlDict file
this->exportControlDictFile(newFile);
this->exportControlDictFile(origFile, newFile);

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Inflow/inflowparameterwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private slots:
void setExponentialTurbulent(void);
void exportInflowParameterFile(QString);
void exportUFile(QString);
void exportControlDictFile(QString);
void exportControlDictFile(QString, QString);
void clearBoundaryMap(void);
bool readUfile(QString);
bool readControlDict(QString);
Expand Down

0 comments on commit 2fb54c3

Please sign in to comment.