Commit 7807280c authored by 刘乐's avatar 刘乐

1, 增加水质模拟

parent 7a2c9a7e
...@@ -2892,18 +2892,18 @@ char* getTmpName(char* fname) ...@@ -2892,18 +2892,18 @@ char* getTmpName(char* fname)
// --- if user supplied the name of a temporary directory, // --- if user supplied the name of a temporary directory,
// then make it be the prefix of the full file name // then make it be the prefix of the full file name
n = (int)strlen(TmpDir); n = (int)strlen(TmpDir);
if ( n > 0 ) //if ( n > 0 )
{ //{
strcpy(fname, TmpDir); // strcpy(fname, TmpDir);
if ( fname[n-1] != '\\' ) strcat(fname, "\\"); // if ( fname[n-1] != '\\' ) strcat(fname, "\\");
} //}
// --- otherwise, use the relative path notation as the file name //// --- otherwise, use the relative path notation as the file name
// prefix so that the file will be placed in the current directory //// prefix so that the file will be placed in the current directory
else //else
{ //{
strcpy(fname, ".\\"); // strcpy(fname, ".\\");
} //}
// --- now add the prefix to the file name // --- now add the prefix to the file name
strcat(fname, name); strcat(fname, name);
......
...@@ -121,7 +121,6 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi ...@@ -121,7 +121,6 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
return false; return false;
} }
// 根据类型 更改值 // 根据类型 更改值
errcode = ENinitH(EN_SAVE); errcode = ENinitH(EN_SAVE);
if (errcode > 0) if (errcode > 0)
...@@ -192,7 +191,7 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi ...@@ -192,7 +191,7 @@ bool CivHydrCalc::qualitySimulation(char* inpFile, char* rptFile, char* binOutFi
ENclose(); ENclose();
// 更新数据 // 更新数据
if (mResultCache.updateToDb(mDbConn)) if (!mResultCache.updateToDb(mDbConn))
return false; return false;
...@@ -214,6 +213,9 @@ bool CivHydrCalc::exportInp(char* fileName) ...@@ -214,6 +213,9 @@ bool CivHydrCalc::exportInp(char* fileName)
bool pattern = mDbConn->createTable(PATTERNTABLE, "public", CivTableTemp::PATTERN_TABLE); bool pattern = mDbConn->createTable(PATTERNTABLE, "public", CivTableTemp::PATTERN_TABLE);
bool cii = mDbConn->createTable(OPTIONTTABLE, "public", CivTableTemp::PARAMETER_TABLE); bool cii = mDbConn->createTable(OPTIONTTABLE, "public", CivTableTemp::PARAMETER_TABLE);
bool curve = mDbConn->createTable(CURVETABLE, "public", CivTableTemp::CURVE_TABLE);
bool node = mDbConn->createTable(NODERESULTTABLE, "public", CivTableTemp::NODE_TABLE);
bool link = mDbConn->createTable(PIPERESULTTABLE, "public", CivTableTemp::PIPE_TABLE);
// 获取表格 // 获取表格
Tables tables = mDbConn->getTables(mNetname); Tables tables = mDbConn->getTables(mNetname);
......
...@@ -8,9 +8,9 @@ bool DLLEXPORT simulation(char* uri, char* netName, char* flag) ...@@ -8,9 +8,9 @@ bool DLLEXPORT simulation(char* uri, char* netName, char* flag)
char rptR[256]; char rptR[256];
char outBinFile[256]; char outBinFile[256];
strcpy_s(fileName, "E:\\work\\workspace\\hydraulicModelCode\\hydraulicModel\\funcDemo\\test.inp"); strcpy_s(fileName, "test.inp");
strcpy_s(rptR, "E:\\work\\workspace\\hydraulicModelCode\\hydraulicModel\\funcDemo\\test.rpt"); strcpy_s(rptR, "test.rpt");
strcpy_s(outBinFile, "E:\\work\\workspace\\hydraulicModelCode\\hydraulicModel\\funcDemo\\test.bin"); strcpy_s(outBinFile, "test.bin");
CivHydrCalc* calc = new CivHydrCalc(uri, netName); CivHydrCalc* calc = new CivHydrCalc(uri, netName);
......
...@@ -10,4 +10,19 @@ void CivInpDirector::create(CivBuilder* builder) ...@@ -10,4 +10,19 @@ void CivInpDirector::create(CivBuilder* builder)
builder->buildPump(); builder->buildPump();
builder->buildVavle(); builder->buildVavle();
builder->buildEmitter(); builder->buildEmitter();
builder->buildPatterns();
builder->buildParamter();
builder->buildCoordnates();
builder->buildVertices();
builder->buildLabels();
builder->buildTags();
builder->buildBackDrop();
builder->buildQuality();
builder->buildSources();
builder->buildMixing();
builder->buildCurves();
builder->buildStatus();
builder->buildControls();
builder->buildRules();
builder->buildDemands();
} }
\ No newline at end of file
...@@ -109,8 +109,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems) ...@@ -109,8 +109,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
std::stringstream os; std::stringstream os;
NodeFieldName filedNames; NodeFieldName filedNames;
if (createTable(NODERESULTTABLE, "public", CivTableTemp::NODE_TABLE))
{
os << "INSERT INTO public."<< NODERESULTTABLE<<" ( "; os << "INSERT INTO public."<< NODERESULTTABLE<<" ( ";
os << filedNames.Number<<","; os << filedNames.Number<<",";
os<< filedNames.dDemand << ","; os<< filedNames.dDemand << ",";
...@@ -164,7 +163,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems) ...@@ -164,7 +163,7 @@ bool CivDbConnection::updateNode(const NodeResultItems& nodeItems)
os.str(""); os.str("");
if (!execSql(sql)) if (!execSql(sql))
return false; return false;
}
return true; return true;
} }
...@@ -177,8 +176,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems) ...@@ -177,8 +176,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
std::stringstream os; std::stringstream os;
LinkFiledName filedNames; LinkFiledName filedNames;
std::string currData = CurrentDate; std::string currData = CurrentDate;
if (createTable(PIPERESULTTABLE, "public", CivTableTemp::PIPE_TABLE))
{
os<< "INSERT INTO public."<< PIPERESULTTABLE <<"( "; os<< "INSERT INTO public."<< PIPERESULTTABLE <<"( ";
os<< filedNames.szNo<< ","; os<< filedNames.szNo<< ",";
...@@ -238,8 +235,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems) ...@@ -238,8 +235,6 @@ bool CivDbConnection::updateLink(const LinkResultItems& lineItems)
if (!execSql(sql)) if (!execSql(sql))
return false; return false;
}
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment