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
8ac29be6
Commit
8ac29be6
authored
8 years ago
by
Debolskiy Andrey
Browse files
Options
Downloads
Patches
Plain Diff
line output added to the map
parent
50d71634
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MES_Wind/frmMain.cs
+25
-8
25 additions, 8 deletions
MES_Wind/frmMain.cs
with
25 additions
and
8 deletions
MES_Wind/frmMain.cs
+
25
−
8
View file @
8ac29be6
...
...
@@ -84,15 +84,14 @@ namespace MES_Wind
string
file_path
=
System
.
IO
.
Directory
.
GetParent
(
System
.
IO
.
Directory
.
GetParent
(
curDir
).
FullName
).
FullName
+
pathToTests
;
string
test
=
file_path
+
"u_test.asc"
;
map1
.
AddLayer
(
file_path
+
"powerstations.shp"
);
map1
.
AddLayer
(
file_path
+
"u_test.asc"
);
map1
.
AddLayer
(
file_path
+
"v_test.asc"
);
map1
.
AddLayer
(
file_path
+
"clim5_test.asc"
);
map1
.
AddLayer
(
file_path
+
"clim10_test.asc"
);
map1
.
AddLayer
(
file_path
+
"clim15_test.asc"
);
map1
.
AddLayer
(
file_path
+
"powerlines.shp"
);
map1
.
AddLayer
(
file_path
+
"powerstations.shp"
);
map1
.
ZoomToMaxExtent
();
//map1.ZoomToMaxExtent();
}
private
void
btnCalcStress_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -245,18 +244,36 @@ namespace MES_Wind
disabledPointSet
.
AddFeature
(
disabledPointFeature
);
}
//add result layer to the map
IMapPointLayer
resultPointLayer
=
default
(
MapPointLayer
)
;
IMapPointLayer
resultPointLayer
=
(
MapPointLayer
)
map1
.
Layers
.
Add
(
disabledPointSet
);
PointSymbolizer
symbol
=
new
PointSymbolizer
(
'a'
,
"serif"
,
Color
.
Blue
,
4
);
resultPointLayer
.
Symbolizer
=
symbol
;
resultPointLayer
.
LegendText
=
"Disabled TransStations"
;
resultPointLayer
=
(
MapPointLayer
)
map1
.
Layers
.
Add
(
disabledPointSet
);
//New FeatureSet
foreach
(
WindStressPRM
.
Powerline
diabledLine
in
output
.
disabledLines
)
//New FeatureSet for disabled powerlines
IFeatureSet
disabledLineSet
=
new
FeatureSet
(
FeatureType
.
Line
);
disabledLineSet
.
Projection
=
map1
.
Projection
;
DataColumn
lineIDcolumn
=
new
DataColumn
(
"ID"
);
disabledLineSet
.
DataTable
.
Columns
.
Add
(
lineIDcolumn
);
int
lineID
=
0
;
foreach
(
WindStressPRM
.
Powerline
disabledLine
in
output
.
disabledLines
)
{
List
<
Coordinate
>
lineArray
=
new
List
<
Coordinate
>();
foreach
(
WindStressPRM
.
Coordinate
prmcoordinate
in
disabledLine
.
coords
)
{
Coordinate
lineVerticeCoords
=
new
Coordinate
(
prmcoordinate
.
X
,
prmcoordinate
.
Y
);
lineArray
.
Add
(
lineVerticeCoords
);
}
LineString
lineGeometry
=
new
LineString
(
lineArray
);
IFeature
lineFeature
=
disabledLineSet
.
AddFeature
(
lineGeometry
);
lineID
=
disabledLine
.
identifier
;
lineFeature
.
DataRow
[
"ID"
]
=
lineID
;
}
//add resulting layer to the map
IMapLineLayer
disabledLineLayer
=
(
MapLineLayer
)
map1
.
Layers
.
Add
(
disabledLineSet
);
LineSymbolizer
lineSymbol
=
new
LineSymbolizer
(
Color
.
Red
,
3
);
disabledLineLayer
.
Symbolizer
=
lineSymbol
;
disabledLineLayer
.
LegendText
=
"Disabled Lines"
;
// new FeatureSet for resulting broken powerlines
...
...
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