Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hydraulicModel
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘乐
hydraulicModel
Commits
50cbba70
Commit
50cbba70
authored
Dec 21, 2020
by
刘乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1, 优化调度接口bug修改
parent
bb927ba0
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
85 additions
and
31 deletions
+85
-31
CivHydrTest.cpp
funcDemo/CivHydrTest.cpp
+4
-2
GenAlg.cpp
pandaAlgorithm/GenAlg.cpp
+3
-2
CivOptSchedEngine.cpp
pandaAnalysis/CivOptSchedEngine.cpp
+4
-3
CivPumpHelper.cpp
pandaDbManager/CivPumpHelper.cpp
+14
-1
CivInpExporter.h
pandaInpCore/CivInpExporter.h
+2
-1
CivInpImpoter.cpp
pandaInpCore/CivInpImpoter.cpp
+7
-7
CivInpImpoter.h
pandaInpCore/CivInpImpoter.h
+2
-1
CivInpObserver.h
pandaInpCore/CivInpObserver.h
+4
-2
main.cpp
pandaInpCore/main.cpp
+16
-0
pandaInpCore.vcxproj
pandaInpCore/pandaInpCore.vcxproj
+4
-3
pandaInpCore.vcxproj.filters
pandaInpCore/pandaInpCore.vcxproj.filters
+3
-0
MainFrameWnd.h
pandaWater/MainFrameWnd.h
+2
-0
CivAttributeTable.h
pandaWaterCore/CivAttributeTable.h
+2
-1
CivAttributes.h
pandaWaterCore/CivAttributes.h
+2
-1
CivFeature.h
pandaWaterCore/CivFeature.h
+3
-2
CivGeometry.h
pandaWaterCore/CivGeometry.h
+6
-2
CivMetaType.h
pandaWaterCore/CivMetaType.h
+2
-1
CivPoint.h
pandaWaterCore/CivPoint.h
+2
-1
CivVariant.h
pandaWaterCore/CivVariant.h
+2
-1
pandaWaterCore.h
pandaWaterCore/pandaWaterCore.h
+1
-0
No files found.
funcDemo/CivHydrTest.cpp
View file @
50cbba70
...
...
@@ -11,8 +11,10 @@ CivHydrTest::~CivHydrTest()
// 优化调度测试
void
CivOptSchedulingTest
::
test
(
char
*
uri
)
{
std
::
string
condtionMap
=
"{
\"
JD0000159
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000324
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000416
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000422
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000457
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000532
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000538
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000582
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000648
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000652
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000665
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000703
\"
:{
\"
min
\"
:20,
\"
max
\"
:48},
\"
JD0000724
\"
:{
\"
min
\"
:20,
\"
max
\"
:48}}"
;
int
time
=
9
;
std
::
string
condtionMap
=
"{
\"
bcdd358e-1925-47be-8e20-d93999e33c1c
\"
:{
\"
min
\"
:30,
\"
max
\"
: 40}, \
\"
fd605205-c10e-4f7e-81a4-89c88166e763
\"
: {
\"
min
\"
:50,
\"
max
\"
: 60},
\"
c446cc2c-4110-406a-bda1-4f9544e38cb4
\"
: {
\"
min
\"
:70,
\"
max
\"
: 80}}"
;
// std::string condtionMap = "{\"JD0000159\":{\"min\":20,\"max\":48},\"JD0000324\":{\"min\":20,\"max\":48},\"JD0000416\":{\"min\":20,\"max\":48},\"JD0000422\":{\"min\":20,\"max\":48},\"JD0000457\":{\"min\":20,\"max\":48},\"JD0000532\":{\"min\":20,\"max\":48},\"JD0000538\":{\"min\":20,\"max\":48},\"JD0000582\":{\"min\":20,\"max\":48},\"JD0000648\":{\"min\":20,\"max\":48},\"JD0000652\":{\"min\":20,\"max\":48},\"JD0000665\":{\"min\":20,\"max\":48},\"JD0000703\":{\"min\":20,\"max\":48},\"JD0000724\":{\"min\":20,\"max\":48}}";
int
time
=
17
;
char
*
condition
=
const_cast
<
char
*>
(
condtionMap
.
c_str
());
...
...
pandaAlgorithm/GenAlg.cpp
View file @
50cbba70
...
...
@@ -209,7 +209,8 @@ double GenAlg::fitnessfunction(float cost, map<string, double>& monitorValues)
{
// 计算适应
double
objVal
=
mOptScheduling
->
objectiveFunction
(
cost
,
monitorValues
);
return
objVal
;
return
objVal
>
0
?
objVal
:
0.0
;
}
void
GenAlg
::
decoding
(
vector
<
map
<
string
,
float
>>&
genVals
)
...
...
@@ -235,7 +236,7 @@ void GenAlg::updateGenomeFitNess(int index, double fitNess)
if
(
index
<
0
||
index
>=
vecPop
.
size
())
return
;
vecPop
[
index
].
fitness
=
fitNess
;
vecPop
[
index
].
fitness
=
fitNess
>
0
?
fitNess
:
0.0
;
}
void
GenAlg
::
crossover
(
const
vector
<
Genome
>&
parent
,
vector
<
Genome
>&
son
)
...
...
pandaAnalysis/CivOptSchedEngine.cpp
View file @
50cbba70
...
...
@@ -216,14 +216,15 @@ void CivOptSchedEngine::schedulingResultToJson(string& json)
if
(
monitorIter
!=
mMonitorsSnMap
.
end
())
{
monitorName
=
monitorIter
->
second
;
}
json
.
append
(
"
\"
"
+
monitorName
+
"
\"
:["
);
json
.
append
(
"
\"
"
+
monitorName
+
"
\"
:["
);
json
.
append
(
to_string
(
beforeMonitorVal
));
json
.
append
(
","
);
json
.
append
(
to_string
(
afterMonitorvVal
));
json
.
append
(
"],"
);
}
}
json
=
json
.
substr
(
0
,
json
.
length
()
-
1
);
json
.
append
(
"}"
);
...
...
pandaDbManager/CivPumpHelper.cpp
View file @
50cbba70
...
...
@@ -134,7 +134,19 @@ void CivPumpHelper::getMonitors(vector<string>& monitors,map<string,string>& mon
map
<
string
,
string
>
tempMap
=
tempMapVec
[
i
];
string
szNo
=
tempMap
.
find
(
"本点号"
)
->
second
;
string
code
=
tempMap
.
find
(
"code"
)
->
second
;
monitors
.
push_back
(
szNo
);
auto
mIter
=
std
::
find
(
monitors
.
begin
(),
monitors
.
end
(),
szNo
);
if
(
mIter
!=
monitors
.
end
())
{
monitorMap
.
insert
(
pair
<
string
,
string
>
(
szNo
,
code
));
}
mIter
=
std
::
find
(
monitors
.
begin
(),
monitors
.
end
(),
code
);
if
(
mIter
!=
monitors
.
end
())
{
monitorMap
.
insert
(
pair
<
string
,
string
>
(
szNo
,
code
));
}
}
}
\ No newline at end of file
pandaInpCore/CivInpExporter.h
View file @
50cbba70
#pragma once
#include "pandaInpCore.h"
/**
inpļ
*/
class
CivInpExporter
class
PANDAINPCORE_API
CivInpExporter
{
public
:
CivInpExporter
();
...
...
pandaInpCore/CivInpImpoter.cpp
View file @
50cbba70
#include "CivInpImpoter.h"
#include "CivSysLog.h"
//
#include "CivSysLog.h"
#include <stdio.h>
CivInpImpoter
::
CivInpImpoter
()
...
...
@@ -14,7 +14,7 @@ CivInpImpoter::~CivInpImpoter()
int
CivInpImpoter
::
handleline
(
int
linenum
,
char
*
text
)
{
printf
(
"line[%d]=
[%s]
\n
"
,
linenum
,
text
);
printf
(
"line[%d]=
%s
\n
"
,
linenum
,
text
);
return
0
;
}
...
...
@@ -23,13 +23,13 @@ bool CivInpImpoter::load(const std::string& inppath)
FILE
*
fp
;
int
linenum
;
char
*
p
,
buf
[
1024
];
CivSysLog
::
getInstance
()
->
info
(
"开始解析:"
+
inppath
,
"CivInpImpoter"
,
__FUNCTION__
);
//
CivSysLog::getInstance()->info("开始解析:"+inppath, "CivInpImpoter", __FUNCTION__);
// 打开文件
fp
=
fopen
(
inppath
.
c_str
(),
"r"
);
if
(
fp
==
NULL
)
{
std
::
string
errInfo
=
"打开文件: "
+
inppath
+
"失败!"
;
CivSysLog
::
getInstance
()
->
error
(
errInfo
,
"CivInpImpoter"
,
__FUNCTION__
);
/*
std::string errInfo = "打开文件: " + inppath + "失败!";
CivSysLog::getInstance()->error(errInfo, "CivInpImpoter", __FUNCTION__);
*/
return
false
;
}
...
...
@@ -55,8 +55,8 @@ bool CivInpImpoter::load(const std::string& inppath)
// 处理解析的行数据
if
(
handleline
(
linenum
,
p
)
!=
0
)
{
std
::
string
errInfo
=
"不能解析第:"
+
std
::
to_string
(
linenum
)
+
"行,跳过"
;
CivSysLog
::
getInstance
()
->
warning
(
errInfo
,
"CivInpImpoter"
,
__FUNCTION__
);
/*
std::string errInfo = "不能解析第:" + std::to_string(linenum) + "行,跳过";
CivSysLog::getInstance()->warning(errInfo, "CivInpImpoter", __FUNCTION__);
*/
continue
;
}
}
...
...
pandaInpCore/CivInpImpoter.h
View file @
50cbba70
#pragma once
#include "pandaInpCore.h"
#include <string>
/**
inp文件导入类
*/
class
CivInpImpoter
class
PANDAINPCORE_API
CivInpImpoter
{
public
:
CivInpImpoter
();
...
...
pandaInpCore/CivInpObserver.h
View file @
50cbba70
#pragma once
#include "CivInpSubject.h"
#include "pandaInpCore.h"
#include <list>
class
CivInpSubject
;
...
...
@@ -13,13 +15,13 @@ public:
virtual
~
CivInpObserver
();
/**
*@brief 状态更新,具体子类实现
*
@brief 状态更新,具体子类实现
* @param [sub] 给观察者
*/
virtual
void
update
(
CivInpSubject
*
sub
)
=
0
;
/**
*@brief 登记被观察的对象
*
@brief 登记被观察的对象
* @param [subject] 具体的被观察者
*/
void
subject
(
CivInpSubject
*
subject
);
...
...
pandaInpCore/main.cpp
0 → 100644
View file @
50cbba70
#include <iostream>
#include "CivInpImpoter.h"
int
main
(
char
*
argc
,
char
**
argv
)
{
CivInpImpoter
importer
;
if
(
!
importer
.
load
(
"D:
\\
work
\\
hydr
\\
hModelProgram
\\
Program
\\
test.inp"
))
{
}
getchar
();
return
0
;
}
\ No newline at end of file
pandaInpCore/pandaInpCore.vcxproj
View file @
50cbba70
...
...
@@ -47,7 +47,7 @@
<CharacterSet>
Unicode
</CharacterSet>
</PropertyGroup>
<PropertyGroup
Condition=
"'$(Configuration)|$(Platform)'=='Release|x64'"
Label=
"Configuration"
>
<ConfigurationType>
DynamicLibrary
</ConfigurationType>
<ConfigurationType>
Application
</ConfigurationType>
<UseDebugLibraries>
false
</UseDebugLibraries>
<PlatformToolset>
v142
</PlatformToolset>
<WholeProgramOptimization>
true
</WholeProgramOptimization>
...
...
@@ -131,7 +131,7 @@
<FunctionLevelLinking>
true
</FunctionLevelLinking>
<IntrinsicFunctions>
true
</IntrinsicFunctions>
<SDLCheck>
true
</SDLCheck>
<PreprocessorDefinitions>
NDEBUG;_CONSOLE;PANDAINPCORE_DLL;PANDAINPCORE_EXPORTS;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<PreprocessorDefinitions>
NDEBUG;_CONSOLE;PANDAINPCORE_DLL;PANDAINPCORE_EXPORTS;
_CRT_SECURE_NO_WARNINGS;
%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<ConformanceMode>
true
</ConformanceMode>
<AdditionalIncludeDirectories>
$(OUTDIR)..\include;%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
</ClCompile>
...
...
@@ -140,7 +140,7 @@
<EnableCOMDATFolding>
true
</EnableCOMDATFolding>
<OptimizeReferences>
true
</OptimizeReferences>
<GenerateDebugInformation>
true
</GenerateDebugInformation>
<AdditionalDependencies>
pandaLog.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalDependencies>
%(AdditionalDependencies)
</AdditionalDependencies>
<ImportLibrary>
$(OutDir)..\lib\$(TargetName).lib
</ImportLibrary>
</Link>
</ItemDefinitionGroup>
...
...
@@ -159,6 +159,7 @@
<ClCompile
Include=
"CivInpObserver.cpp"
/>
<ClCompile
Include=
"CivInpSubject.cpp"
/>
<ClCompile
Include=
"CivInpVector.cpp"
/>
<ClCompile
Include=
"main.cpp"
/>
</ItemGroup>
<Import
Project=
"$(VCTargetsPath)\Microsoft.Cpp.targets"
/>
<ImportGroup
Label=
"ExtensionTargets"
>
...
...
pandaInpCore/pandaInpCore.vcxproj.filters
View file @
50cbba70
...
...
@@ -30,6 +30,9 @@
<ClCompile
Include=
"CivInpExporter.cpp"
>
<Filter>
源文件
</Filter>
</ClCompile>
<ClCompile
Include=
"main.cpp"
>
<Filter>
头文件
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"CivInpExporter.h"
>
...
...
pandaWater/MainFrameWnd.h
View file @
50cbba70
...
...
@@ -12,10 +12,12 @@ public:
virtual
void
OnFinalMessage
(
HWND
hWnd
);
virtual
void
InitWindow
();
virtual
LRESULT
ResponseDefaultKeyEvent
(
WPARAM
wParam
);
virtual
CDuiString
GetSkinFile
();
virtual
CDuiString
GetSkinFolder
();
virtual
UILIB_RESOURCETYPE
GetResourceType
()
const
;
virtual
CControlUI
*
CreateControl
(
LPCTSTR
pstrClass
);
virtual
LRESULT
OnSysCommand
(
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
&
bHandled
);
virtual
LRESULT
HandleCustomMessage
(
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
&
bHandled
);
virtual
LRESULT
OnClose
(
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
&
bHandled
);
...
...
pandaWaterCore/CivAttributeTable.h
View file @
50cbba70
#pragma once
#include "pandaWaterCore.h"
class
CivConnection
;
/**
属性表类
*/
class
CivAttributeTable
class
PANDAWATERCORELIB_API
CivAttributeTable
{
public
:
// 属性表类型
...
...
pandaWaterCore/CivAttributes.h
View file @
50cbba70
...
...
@@ -2,6 +2,7 @@
#include <string>
#include <map>
#include "CivVariant.h"
#include "pandaWaterCore.h"
using
namespace
std
;
...
...
@@ -10,7 +11,7 @@ class CivVariant;
/**
属性类
*/
class
CivAttributes
class
PANDAWATERCORELIB_API
CivAttributes
{
public
:
typedef
pair
<
string
,
CivVariant
>
Pair
;
...
...
pandaWaterCore/CivFeature.h
View file @
50cbba70
...
...
@@ -2,16 +2,17 @@
#include "CivAttributes.h"
#include "CivGeometry.h"
#include "pandaWaterCore.h"
/**
要素类
*/
class
CivFeature
class
PANDAWATERCORELIB_API
CivFeature
{
public
:
typedef
int
FeatureId
;
CivFeature
(
const
CivGeometry
&
geom
);
explicit
CivFeature
(
const
CivGeometry
&
geom
);
CivFeature
()
=
default
;
~
CivFeature
();
/**
...
...
pandaWaterCore/CivGeometry.h
View file @
50cbba70
...
...
@@ -4,12 +4,13 @@
#include <map>
#include "CivPoint.h"
#include "pandaWaterCore.h"
typedef
std
::
string
String
;
/**
空间几何体对象
*/
class
CivGeometry
class
PANDAWATERCORELIB_API
CivGeometry
{
public
:
// 几何体类型
...
...
@@ -33,7 +34,10 @@ public:
// 几何体类型
GeometryType
type
()
const
{
return
mGeometryType
;
}
/*几何体对象序列化*/
/**
* @brief 几何体对象序列化
* @param [text] 根据文本文件生成集合体对象
*/
String
toJson
()
const
;
private
:
...
...
pandaWaterCore/CivMetaType.h
View file @
50cbba70
#pragma once
#include "pandaWaterCore.h"
/**
Ԫ
*/
class
CivMetaType
{
class
PANDAWATERCORELIB_API
CivMetaType
{
public
:
enum
Type
{
...
...
pandaWaterCore/CivPoint.h
View file @
50cbba70
#pragma once
#include "pandaWaterCore.h"
/**
*/
class
CivPoint
class
PANDAWATERCORELIB_API
CivPoint
{
public
:
/**
...
...
pandaWaterCore/CivVariant.h
View file @
50cbba70
#pragma once
#include "CivMetaType.h"
#include "pandaWaterCore.h"
/**
ԭ
*/
class
CivVariant
class
PANDAWATERCORELIB_API
CivVariant
{
public
:
typedef
CivMetaType
::
Type
Type
;
...
...
pandaWaterCore/pandaWaterCore.h
View file @
50cbba70
#pragma once
# if defined(PANDAWATERCORELIB_EXPORTS)
# if defined(_MSC_VER)
# define PANDAWATERCORELIB_API __declspec(dllexport)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment