Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MES_Wind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debolskiy Andrey
MES_Wind
Commits
9164bf6a
Commit
9164bf6a
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Plain Diff
Merge branch 'second_round_andrey' of
http://tesla.parallel.ru/debol/MES_Wind
into anton
parents
6b8148f7
4adcb310
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MES_Wind/frmMain.cs
+5
-3
5 additions, 3 deletions
MES_Wind/frmMain.cs
WindStressPRM/WindStressPRM.cs
+7
-6
7 additions, 6 deletions
WindStressPRM/WindStressPRM.cs
with
12 additions
and
9 deletions
MES_Wind/frmMain.cs
+
5
−
3
View file @
9164bf6a
...
@@ -85,6 +85,7 @@ namespace MES_Wind
...
@@ -85,6 +85,7 @@ namespace MES_Wind
map1
.
AddLayer
(
file_path
+
"1977\\clim5_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim5_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim10_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim10_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim15_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1977\\clim15_test.asc"
);
map1
.
AddLayer
(
file_path
+
"1987\\clim25_test.asc"
);
map1
.
AddLayer
(
file_path
+
"reslines.shp"
);
map1
.
AddLayer
(
file_path
+
"reslines.shp"
);
//map1.ZoomToMaxExtent();
//map1.ZoomToMaxExtent();
}
}
...
@@ -99,6 +100,7 @@ namespace MES_Wind
...
@@ -99,6 +100,7 @@ namespace MES_Wind
IMapRasterLayer
clim5RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim5RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim10RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim10RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim15RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim15RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim25RasterLayer
=
default
(
IMapRasterLayer
);
if
(
map1
.
GetRasterLayers
().
Count
()
==
1
)
if
(
map1
.
GetRasterLayers
().
Count
()
==
1
)
{
{
MessageBox
.
Show
(
"Please add a raster layer"
);
MessageBox
.
Show
(
"Please add a raster layer"
);
...
@@ -110,6 +112,7 @@ namespace MES_Wind
...
@@ -110,6 +112,7 @@ namespace MES_Wind
clim5RasterLayer
=
map1
.
GetRasterLayers
()[
2
];
clim5RasterLayer
=
map1
.
GetRasterLayers
()[
2
];
clim10RasterLayer
=
map1
.
GetRasterLayers
()[
3
];
clim10RasterLayer
=
map1
.
GetRasterLayers
()[
3
];
clim15RasterLayer
=
map1
.
GetRasterLayers
()[
4
];
clim15RasterLayer
=
map1
.
GetRasterLayers
()[
4
];
clim25RasterLayer
=
map1
.
GetRasterLayers
()[
5
];
//get the powerline line layer
//get the powerline line layer
IMapLineLayer
pwlLayer
=
default
(
IMapLineLayer
);
IMapLineLayer
pwlLayer
=
default
(
IMapLineLayer
);
if
(
map1
.
GetLineLayers
().
Count
()
==
0
)
if
(
map1
.
GetLineLayers
().
Count
()
==
0
)
...
@@ -173,8 +176,7 @@ namespace MES_Wind
...
@@ -173,8 +176,7 @@ namespace MES_Wind
double
clim5
=
clim5RasterLayer
.
DataSet
.
Value
[
i
,
j
];
double
clim5
=
clim5RasterLayer
.
DataSet
.
Value
[
i
,
j
];
double
clim10
=
clim10RasterLayer
.
DataSet
.
Value
[
i
,
j
]
+
1
;
double
clim10
=
clim10RasterLayer
.
DataSet
.
Value
[
i
,
j
]
+
1
;
double
clim15
=
clim15RasterLayer
.
DataSet
.
Value
[
i
,
j
];
double
clim15
=
clim15RasterLayer
.
DataSet
.
Value
[
i
,
j
];
// TODO: Add clim25 layer
double
clim25
=
clim25RasterLayer
.
DataSet
.
Value
[
i
,
j
];
double
clim25
=
0
;
if
(
Math
.
Abs
(
clim5
-
RasterMissingValue
)
<
eps
)
if
(
Math
.
Abs
(
clim5
-
RasterMissingValue
)
<
eps
)
{
{
clim5
=
Double
.
NaN
;
clim5
=
Double
.
NaN
;
...
@@ -202,7 +204,7 @@ namespace MES_Wind
...
@@ -202,7 +204,7 @@ namespace MES_Wind
WindStressPRM
.
Powerline
dummyline
=
new
WindStressPRM
.
Powerline
();
WindStressPRM
.
Powerline
dummyline
=
new
WindStressPRM
.
Powerline
();
DataRow
featureData
=
feature
.
DataRow
;
DataRow
featureData
=
feature
.
DataRow
;
dummyline
.
Identifier
=
feature
.
Fid
;
dummyline
.
Identifier
=
feature
.
Fid
;
dummyline
.
Year
=
int
.
Parse
(
featureData
[
"Year"
].
ToString
());
dummyline
.
Year
=
1990
;
//
int.Parse(featureData["Year"].ToString());
dummyline
.
Height
=
double
.
Parse
(
featureData
[
"HeightOffs"
].
ToString
());
dummyline
.
Height
=
double
.
Parse
(
featureData
[
"HeightOffs"
].
ToString
());
dummyline
.
Voltage
=
int
.
Parse
(
featureData
[
"Voltage"
].
ToString
());
dummyline
.
Voltage
=
int
.
Parse
(
featureData
[
"Voltage"
].
ToString
());
dummyline
.
PointFromID
=
int
.
Parse
(
featureData
[
"PointFrom"
].
ToString
());
dummyline
.
PointFromID
=
int
.
Parse
(
featureData
[
"PointFrom"
].
ToString
());
...
...
This diff is collapsed.
Click to expand it.
WindStressPRM/WindStressPRM.cs
+
7
−
6
View file @
9164bf6a
...
@@ -145,7 +145,7 @@ namespace WindStressPRM
...
@@ -145,7 +145,7 @@ namespace WindStressPRM
double
y1
=
points
[
i
-
1
].
Y
;
double
y1
=
points
[
i
-
1
].
Y
;
double
x2
=
points
[
i
].
X
;
double
x2
=
points
[
i
].
X
;
double
y2
=
points
[
i
].
Y
;
double
y2
=
points
[
i
].
Y
;
bool
result
=
linearLineIsBroken
(
points
[
i
-
1
],
points
[
i
],
powerCurve
.
Height
,
powerCurve
.
Voltage
);
bool
result
=
linearLineIsBroken
(
points
[
i
-
1
],
points
[
i
],
powerCurve
.
Height
,
powerCurve
.
Voltage
,
powerCurve
.
Year
);
checkList
.
Add
(
result
);
checkList
.
Add
(
result
);
}
}
foreach
(
bool
chkpnt
in
checkList
)
foreach
(
bool
chkpnt
in
checkList
)
...
@@ -174,7 +174,7 @@ namespace WindStressPRM
...
@@ -174,7 +174,7 @@ namespace WindStressPRM
/// <param name="heightLine">height</param>
/// <param name="heightLine">height</param>
/// <param name="power">power for climatology switches</param>
/// <param name="power">power for climatology switches</param>
/// <returns>true if line is broken false otherwise</returns>
/// <returns>true if line is broken false otherwise</returns>
private
bool
linearLineIsBroken
(
Coordinate
coord1
,
Coordinate
coord2
,
double
heightLine
,
int
power
)
private
bool
linearLineIsBroken
(
Coordinate
coord1
,
Coordinate
coord2
,
double
heightLine
,
int
power
,
int
year
)
{
{
double
distance
=
Math
.
Sqrt
((
coord2
.
X
-
coord1
.
X
)
*
(
coord2
.
X
-
coord1
.
X
)
+
(
coord2
.
Y
-
coord1
.
Y
)
*
(
coord2
.
Y
-
coord1
.
Y
));
double
distance
=
Math
.
Sqrt
((
coord2
.
X
-
coord1
.
X
)
*
(
coord2
.
X
-
coord1
.
X
)
+
(
coord2
.
Y
-
coord1
.
Y
)
*
(
coord2
.
Y
-
coord1
.
Y
));
double
distpropD
=
distance
/
Input
.
DistThreshold
;
double
distpropD
=
distance
/
Input
.
DistThreshold
;
...
@@ -204,10 +204,11 @@ namespace WindStressPRM
...
@@ -204,10 +204,11 @@ namespace WindStressPRM
pointlist
.
Add
(
midpoint
);
pointlist
.
Add
(
midpoint
);
}
}
Func
<
ClimateCell
,
double
>
climateClosure
=
delegate
(
ClimateCell
cell
)
{
Func
<
ClimateCell
,
double
>
climateClosure
=
delegate
(
ClimateCell
cell
)
{
// if year > 1987
if
(
year
>=
1987
)
// clim type = 25
{
//
return
cell
.
Wind25
;
if
(
power
>
5
&&
power
<
330
)
}
else
if
(
power
>
5
&&
power
<
330
)
{
{
return
cell
.
Wind10
;
return
cell
.
Wind10
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment