Skip to content

Commit aaff51d

Browse files
committed
代码微调,加入元件潮流项。
1 parent 3e965a5 commit aaff51d

17 files changed

+193
-124
lines changed

NativeUnitTest1/NativeUnitTest1.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<ProjectGuid>{FE468CDF-BCD4-4583-AEED-41E4396464E0}</ProjectGuid>
2323
<Keyword>Win32Proj</Keyword>
2424
<RootNamespace>NativeUnitTest1</RootNamespace>
25+
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
2526
</PropertyGroup>
2627
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2728
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

NativeUnitTest1/unittest1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ namespace NativeUnitTest1
219219
}
220220
network2->RemoveObject(sg);
221221
network2->AutoDeleteChildren(false);
222-
auto pn = network.ToPrimitive();
222+
auto pn = network.ToPrimitive(PrimitiveNetworkOptions::ForceSetSlackNode);
223223
stringstream ss;
224224
auto PrintNetwork = [&ss](const PrimitiveNetwork& pn)
225225
{

PowerFlowSolver.sln

Lines changed: 10 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -30,116 +30,56 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "UnitTestProject1", "UnitTes
3030
EndProject
3131
Global
3232
GlobalSection(SolutionConfigurationPlatforms) = preSolution
33-
Debug|Any CPU = Debug|Any CPU
34-
Debug|Mixed Platforms = Debug|Mixed Platforms
35-
Debug|Win32 = Debug|Win32
3633
Debug|x64 = Debug|x64
3734
Debug|x86 = Debug|x86
38-
Release|Any CPU = Release|Any CPU
39-
Release|Mixed Platforms = Release|Mixed Platforms
40-
Release|Win32 = Release|Win32
4135
Release|x64 = Release|x64
4236
Release|x86 = Release|x86
4337
EndGlobalSection
4438
GlobalSection(ProjectConfigurationPlatforms) = postSolution
45-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|Any CPU.Build.0 = Debug|Any CPU
47-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
48-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|Win32.ActiveCfg = Debug|Any CPU
4939
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|x64.ActiveCfg = Debug|Any CPU
5040
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|x64.Build.0 = Debug|Any CPU
5141
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|x86.ActiveCfg = Debug|Any CPU
5242
{2FFA7467-C4D8-4226-9648-6933D535D572}.Debug|x86.Build.0 = Debug|Any CPU
53-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|Any CPU.Build.0 = Release|Any CPU
55-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
56-
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|Win32.ActiveCfg = Release|Any CPU
5743
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|x64.ActiveCfg = Release|Any CPU
5844
{2FFA7467-C4D8-4226-9648-6933D535D572}.Release|x86.ActiveCfg = Release|Any CPU
59-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|Any CPU.ActiveCfg = Debug|Win32
60-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
61-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|Mixed Platforms.Build.0 = Debug|Win32
62-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|Win32.ActiveCfg = Debug|Win32
63-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|Win32.Build.0 = Debug|Win32
6445
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|x64.ActiveCfg = Debug|x64
6546
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|x64.Build.0 = Debug|x64
6647
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|x86.ActiveCfg = Debug|Win32
6748
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Debug|x86.Build.0 = Debug|Win32
68-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|Any CPU.ActiveCfg = Release|Win32
69-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|Mixed Platforms.ActiveCfg = Release|Win32
70-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|Mixed Platforms.Build.0 = Release|Win32
71-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|Win32.ActiveCfg = Release|Win32
72-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|Win32.Build.0 = Release|Win32
73-
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|x64.ActiveCfg = Release|Win32
49+
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|x64.ActiveCfg = Release|x64
50+
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|x64.Build.0 = Release|x64
7451
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|x86.ActiveCfg = Release|Win32
7552
{F0A27E64-DFB4-4A02-94D7-04C6E66534EB}.Release|x86.Build.0 = Release|Win32
76-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
77-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|Any CPU.Build.0 = Debug|Any CPU
78-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
79-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
80-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|Win32.ActiveCfg = Debug|Any CPU
8153
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|x64.ActiveCfg = Debug|Any CPU
8254
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|x86.ActiveCfg = Debug|Any CPU
8355
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Debug|x86.Build.0 = Debug|Any CPU
84-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|Any CPU.ActiveCfg = Release|Any CPU
85-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|Any CPU.Build.0 = Release|Any CPU
86-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
87-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|Mixed Platforms.Build.0 = Release|Any CPU
88-
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|Win32.ActiveCfg = Release|Any CPU
8956
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|x64.ActiveCfg = Release|Any CPU
9057
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|x86.ActiveCfg = Release|Any CPU
9158
{C79AB260-5777-4CBE-A335-6F97B804AE85}.Release|x86.Build.0 = Release|Any CPU
92-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|Any CPU.ActiveCfg = Debug|Win32
93-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
94-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|Mixed Platforms.Build.0 = Debug|Win32
95-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|Win32.ActiveCfg = Debug|Win32
96-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|Win32.Build.0 = Debug|Win32
9759
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|x64.ActiveCfg = Debug|x64
9860
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|x64.Build.0 = Debug|x64
9961
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|x86.ActiveCfg = Debug|Win32
10062
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Debug|x86.Build.0 = Debug|Win32
101-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|Any CPU.ActiveCfg = Release|Win32
102-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|Mixed Platforms.ActiveCfg = Release|Win32
103-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|Mixed Platforms.Build.0 = Release|Win32
104-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|Win32.ActiveCfg = Release|Win32
105-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|Win32.Build.0 = Release|Win32
106-
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|x64.ActiveCfg = Release|Win32
63+
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|x64.ActiveCfg = Release|x64
64+
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|x64.Build.0 = Release|x64
10765
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|x86.ActiveCfg = Release|Win32
10866
{FE468CDF-BCD4-4583-AEED-41E4396464E0}.Release|x86.Build.0 = Release|Win32
109-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|Any CPU.ActiveCfg = Debug|Win32
110-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
111-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|Mixed Platforms.Build.0 = Debug|Win32
112-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|Win32.ActiveCfg = Debug|Win32
113-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|Win32.Build.0 = Debug|Win32
11467
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|x64.ActiveCfg = Debug|x64
11568
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|x64.Build.0 = Debug|x64
11669
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|x86.ActiveCfg = Debug|Win32
11770
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Debug|x86.Build.0 = Debug|Win32
118-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|Any CPU.ActiveCfg = Release|Win32
119-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|Mixed Platforms.ActiveCfg = Release|Win32
120-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|Mixed Platforms.Build.0 = Release|Win32
121-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|Win32.ActiveCfg = Release|Win32
122-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|Win32.Build.0 = Release|Win32
123-
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|x64.ActiveCfg = Release|Win32
71+
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|x64.ActiveCfg = Release|x64
72+
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|x64.Build.0 = Release|x64
12473
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|x86.ActiveCfg = Release|Win32
12574
{3F461A67-845B-4B5B-B941-2CAB22E2494C}.Release|x86.Build.0 = Release|Win32
126-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
127-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
128-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
129-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
130-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|Win32.ActiveCfg = Debug|Any CPU
13175
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|x64.ActiveCfg = Debug|Any CPU
13276
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|x64.Build.0 = Debug|Any CPU
13377
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|x86.ActiveCfg = Debug|Any CPU
13478
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Debug|x86.Build.0 = Debug|Any CPU
135-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
136-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|Any CPU.Build.0 = Release|Any CPU
137-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
138-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
139-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|Win32.ActiveCfg = Release|Any CPU
140-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x64.ActiveCfg = Release|Any CPU
141-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x86.ActiveCfg = Release|Any CPU
142-
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x86.Build.0 = Release|Any CPU
79+
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x64.ActiveCfg = Release|x64
80+
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x64.Build.0 = Release|x64
81+
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x86.ActiveCfg = Release|x86
82+
{F7647932-39BB-4D27-9AB7-2364BA4BD9D8}.Release|x86.Build.0 = Release|x86
14383
EndGlobalSection
14484
GlobalSection(SolutionProperties) = preSolution
14585
HideSolutionNode = FALSE

PowerSolutions.Interop/PowerFlow.cpp

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
using namespace System::Runtime::InteropServices;
77
using namespace PowerSolutions::Interop::ObjectModel;
8+
using namespace std;
89

910
namespace PowerSolutions
1011
{
@@ -14,10 +15,10 @@ namespace PowerSolutions
1415
{
1516
Solution::Solution(const _NATIVE_PF Solution& native)
1617
: m_NodeFlow(gcnew Dictionary<Bus, NodeFlowSolution>(native.NodeFlow().size())),
17-
m_ComponentFlow(gcnew Dictionary<Component, BranchFlowSolution>(native.BranchFlow().size())),
18+
m_ComponentFlow(gcnew Dictionary<Component, ComponentFlowSolution>(native.BranchFlow().size())),
1819
m_BranchFlow(gcnew Dictionary<BusPair, BranchFlowSolution>(native.ComponentFlow().size(), BusPairUnorderedComparer::Default)),
1920
m_s_NodeFlow(gcnew ReadOnlyDictionary<Bus, NodeFlowSolution>(m_NodeFlow)),
20-
m_s_ComponentFlow(gcnew ReadOnlyDictionary<Component, BranchFlowSolution>(m_ComponentFlow)),
21+
m_s_ComponentFlow(gcnew ReadOnlyDictionary<Component, ComponentFlowSolution>(m_ComponentFlow)),
2122
m_s_BranchFlow(gcnew ReadOnlyDictionary<BusPair, BranchFlowSolution>(m_BranchFlow))
2223
{
2324
//将解缓存至此实例中。
@@ -34,8 +35,8 @@ namespace PowerSolutions
3435
_INIT_PROPERTY_CACHE(SlackNode, Bus);
3536
for (auto& item : native.NodeFlow())
3637
m_NodeFlow->Add(Bus(item.first), NodeFlowSolution(item.second));
37-
//for (auto& item : native.ComponentFlow())
38-
// m_ComponentFlow->Add(Component(item.first), BranchFlowSolution(item.second));
38+
for (auto& item : native.ComponentFlow())
39+
m_ComponentFlow->Add(Component(item.first), ComponentFlowSolution(item.second));
3940
for (auto& item : native.BranchFlow())
4041
m_BranchFlow->Add(BusPair(item.first), BranchFlowSolution(item.second));
4142
}
@@ -47,6 +48,7 @@ namespace PowerSolutions
4748

4849
Solver::Solver(SolverType type)
4950
{
51+
NodeReorder = true;
5052
switch (type)
5153
{
5254
case SolverType::NewtonRaphson:
@@ -81,12 +83,15 @@ namespace PowerSolutions
8183

8284
Solution^ Solver::Solve(NetworkCase^ network)
8385
{
84-
_NATIVE_PF Solution* nativeSolution;
86+
shared_ptr<_NATIVE_PF Solution> nativeSolution;
8587
_WRAP_EXCEPTION_BOUNDARY(
86-
nativeSolution = nativeObject->Solve(network->nativeObject);
88+
shared_ptr<_NATIVE_OM PrimitiveNetwork> nativePM =
89+
network->nativeObject->ToPrimitive(NodeReorder
90+
? _NATIVE_OM PrimitiveNetworkOptions::NodeReorder
91+
: _NATIVE_OM PrimitiveNetworkOptions::None);
92+
nativeSolution = nativeObject->Solve(nativePM);
8793
);
8894
auto solution = gcnew Solution(*nativeSolution);
89-
delete nativeSolution;
9095
return solution;
9196
}
9297

@@ -124,7 +129,8 @@ namespace PowerSolutions
124129
_INIT_PROPERTY_CACHE(Voltage, MarshalComplex);
125130
_INIT_PROPERTY_CACHE(PowerGeneration, MarshalComplex);
126131
_INIT_PROPERTY_CACHE(PowerConsumption, MarshalComplex);
127-
_INIT_PROPERTY_CACHE(Degree, );
132+
//TODO Set appropriate degree
133+
//_INIT_PROPERTY_CACHE(Degree, );
128134
}
129135

130136
BranchFlowSolution::BranchFlowSolution(const _NATIVE_PF BranchFlowSolution& native)
@@ -141,6 +147,13 @@ namespace PowerSolutions
141147
PowerShunt = powerShunt;
142148
}
143149

150+
ComponentFlowSolution::ComponentFlowSolution(const _NATIVE_PF ComponentFlowSolution& native)
151+
{
152+
_INIT_PROPERTY_CACHE(PowerInjections, MarshalComplexArray);
153+
_INIT_PROPERTY_CACHE(PowerShunt, MarshalComplex);
154+
_INIT_PROPERTY_CACHE(IsUnconstrained, );
155+
}
156+
144157
IterationEventArgs::IterationEventArgs(const _NATIVE_PF IterationEventArgs& native)
145158
{
146159
_INIT_PROPERTY_CACHE(IterationCount, );

PowerSolutions.Interop/PowerFlow.h

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ namespace PowerSolutions
3333
_WRAP_PROPERTY_CACHE(PowerGeneration, Complex);
3434
// <summary>节点的总负载。</summary>
3535
_WRAP_PROPERTY_CACHE(PowerConsumption, Complex);
36-
// <summary>节点的度。</summary>
37-
_WRAP_PROPERTY_CACHE(Degree, int);
3836
internal:
3937
NodeFlowSolution(const _NATIVE_PF NodeFlowSolution& native);
4038
};
@@ -73,6 +71,19 @@ namespace PowerSolutions
7371
BranchFlowSolution(const _NATIVE_PF BranchFlowSolution& native);
7472
};
7573

74+
public value struct ComponentFlowSolution
75+
{
76+
public:
77+
/// <summary>从节点1注入的功率。</summary>
78+
_WRAP_PROPERTY_CACHE(PowerInjections, cli::array<Complex>^);
79+
/// <summary>从节点2注入的功率。</summary>
80+
_WRAP_PROPERTY_CACHE(PowerShunt, Complex);
81+
/// <summary>指示此元件自身的潮流是否为不定的。</summary>
82+
_WRAP_PROPERTY_CACHE(IsUnconstrained, bool);
83+
internal:
84+
ComponentFlowSolution(const _NATIVE_PF ComponentFlowSolution& native);
85+
};
86+
7687
public ref class IterationEventArgs : public System::EventArgs
7788
{
7889
public:
@@ -97,8 +108,8 @@ namespace PowerSolutions
97108
private:
98109
Dictionary<Bus, NodeFlowSolution>^ m_NodeFlow;
99110
ReadOnlyDictionary<Bus, NodeFlowSolution>^ m_s_NodeFlow;
100-
Dictionary<Component, BranchFlowSolution>^ m_ComponentFlow;
101-
ReadOnlyDictionary<Component, BranchFlowSolution>^ m_s_ComponentFlow;
111+
Dictionary<Component, ComponentFlowSolution>^ m_ComponentFlow;
112+
ReadOnlyDictionary<Component, ComponentFlowSolution>^ m_s_ComponentFlow;
102113
Dictionary<BusPair, BranchFlowSolution>^ m_BranchFlow;
103114
ReadOnlyDictionary<BusPair, BranchFlowSolution>^ m_s_BranchFlow;
104115
public:
@@ -118,9 +129,9 @@ namespace PowerSolutions
118129
{
119130
IDictionary<Bus, NodeFlowSolution>^ get(){ return m_s_NodeFlow; }
120131
}
121-
property IDictionary<Component, BranchFlowSolution>^ ComponentFlow
132+
property IDictionary<Component, ComponentFlowSolution>^ ComponentFlow
122133
{
123-
IDictionary<Component, BranchFlowSolution>^ get(){ return m_s_ComponentFlow; }
134+
IDictionary<Component, ComponentFlowSolution>^ get(){ return m_s_ComponentFlow; }
124135
}
125136
property IDictionary<BusPair, BranchFlowSolution>^ BranchFlow
126137
{
@@ -163,7 +174,11 @@ namespace PowerSolutions
163174
}
164175
}
165176
public:
166-
_WRAP_PROPERTY(NodeReorder, bool, );
177+
//_WRAP_PROPERTY(NodeReorder, bool, );
178+
/// <summary>
179+
/// 指示在分析网络时,是否应当启用节点重排序功能。
180+
/// </summary>
181+
property bool NodeReorder;
167182
_WRAP_PROPERTY(MaxIterations, int, );
168183
_WRAP_PROPERTY(MaxDeviationTolerance, double, );
169184
_WRAP_PROPERTY(IntelliIterations, bool, );

PowerSolutions.Interop/PowerSolutions.Interop.vcxproj

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -23,33 +23,34 @@
2323
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
2424
<Keyword>ManagedCProj</Keyword>
2525
<RootNamespace>PowerSolutions.Interop</RootNamespace>
26+
<WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
2627
</PropertyGroup>
2728
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2829
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2930
<ConfigurationType>DynamicLibrary</ConfigurationType>
3031
<UseDebugLibraries>true</UseDebugLibraries>
31-
<PlatformToolset>v120</PlatformToolset>
3232
<CLRSupport>true</CLRSupport>
3333
<CharacterSet>Unicode</CharacterSet>
34+
<PlatformToolset>v140</PlatformToolset>
3435
</PropertyGroup>
3536
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
3637
<ConfigurationType>DynamicLibrary</ConfigurationType>
3738
<UseDebugLibraries>true</UseDebugLibraries>
38-
<PlatformToolset>v120</PlatformToolset>
39+
<PlatformToolset>v140</PlatformToolset>
3940
<CLRSupport>true</CLRSupport>
4041
<CharacterSet>Unicode</CharacterSet>
4142
</PropertyGroup>
4243
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
4344
<ConfigurationType>DynamicLibrary</ConfigurationType>
4445
<UseDebugLibraries>false</UseDebugLibraries>
45-
<PlatformToolset>v120</PlatformToolset>
46+
<PlatformToolset>v140</PlatformToolset>
4647
<CLRSupport>true</CLRSupport>
4748
<CharacterSet>Unicode</CharacterSet>
4849
</PropertyGroup>
4950
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5051
<ConfigurationType>DynamicLibrary</ConfigurationType>
5152
<UseDebugLibraries>false</UseDebugLibraries>
52-
<PlatformToolset>v120</PlatformToolset>
53+
<PlatformToolset>v140</PlatformToolset>
5354
<CLRSupport>true</CLRSupport>
5455
<CharacterSet>Unicode</CharacterSet>
5556
</PropertyGroup>
@@ -71,19 +72,19 @@
7172
<PropertyGroup Label="UserMacros" />
7273
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7374
<LinkIncremental>true</LinkIncremental>
74-
<IncludePath>$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
75+
<IncludePath>$(SolutionDir)\Library;$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
7576
</PropertyGroup>
7677
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
7778
<LinkIncremental>true</LinkIncremental>
78-
<IncludePath>$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
79+
<IncludePath>$(SolutionDir)\Library;$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
7980
</PropertyGroup>
8081
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
8182
<LinkIncremental>false</LinkIncremental>
82-
<IncludePath>$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
83+
<IncludePath>$(SolutionDir)\Library;$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
8384
</PropertyGroup>
8485
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
8586
<LinkIncremental>false</LinkIncremental>
86-
<IncludePath>$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
87+
<IncludePath>$(SolutionDir)\Library;$(SolutionDir)\PowerSolutions.PowerFlow\Export;$(IncludePath)</IncludePath>
8788
</PropertyGroup>
8889
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8990
<ClCompile>

0 commit comments

Comments
 (0)