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
5fd1ba2a
Commit
5fd1ba2a
authored
8 years ago
by
Антон Кудряшов
Browse files
Options
Downloads
Patches
Plain Diff
- fixed spacing in main
- fixed checkers for PRM classes - getters, setters minor changes
parent
4bd177f8
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
MES_Wind/frmMain.cs
+159
-138
159 additions, 138 deletions
MES_Wind/frmMain.cs
WindStressPRM/WindStressPRM.cs
+78
-127
78 additions, 127 deletions
WindStressPRM/WindStressPRM.cs
with
237 additions
and
265 deletions
MES_Wind/frmMain.cs
+
159
−
138
View file @
5fd1ba2a
...
@@ -96,13 +96,14 @@ namespace MES_Wind
...
@@ -96,13 +96,14 @@ namespace MES_Wind
private
void
btnCalcStress_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCalcStress_Click
(
object
sender
,
EventArgs
e
)
{
{
const
double
eps
=
0.0001
;
const
double
RasterMissingValue
=
-
9999
;
//extract prognostic u layer
//extract prognostic u layer
IMapRasterLayer
uRasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
uRasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
vRasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
vRasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim5RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim5RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim10RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim10RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim15RasterLayer
=
default
(
IMapRasterLayer
);
IMapRasterLayer
clim15RasterLayer
=
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"
);
...
@@ -114,7 +115,6 @@ namespace MES_Wind
...
@@ -114,7 +115,6 @@ 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
];
//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
)
...
@@ -142,8 +142,15 @@ namespace MES_Wind
...
@@ -142,8 +142,15 @@ namespace MES_Wind
{
{
Coordinate
dummyRCoords
=
uRasterLayer
.
Bounds
.
CellCenter_ToProj
(
i
,
j
);
Coordinate
dummyRCoords
=
uRasterLayer
.
Bounds
.
CellCenter_ToProj
(
i
,
j
);
WindStressPRM
.
Coordinate
cellCoords
=
new
WindStressPRM
.
Coordinate
(
dummyRCoords
.
X
,
dummyRCoords
.
Y
);
WindStressPRM
.
Coordinate
cellCoords
=
new
WindStressPRM
.
Coordinate
(
dummyRCoords
.
X
,
dummyRCoords
.
Y
);
WindStressPRM
.
PrognosticCell
dummyPrognosticCell
=
new
WindStressPRM
.
PrognosticCell
(
cellCoords
,
uRasterLayer
.
DataSet
.
Value
[
j
,
i
],
vRasterLayer
.
DataSet
.
Value
[
j
,
i
]);
double
uValue
=
uRasterLayer
.
DataSet
.
Value
[
i
,
j
];
//WindStressPRM.PrognosticCell dummyPrognosticCell = new WindStressPRM.PrognosticCell(cellCoords, 100, 100);
double
vValue
=
vRasterLayer
.
DataSet
.
Value
[
i
,
j
];
if
(
Math
.
Abs
(
uValue
-
RasterMissingValue
)
<
eps
)
{
uValue
=
Double
.
NaN
;
}
if
(
Math
.
Abs
(
vValue
-
RasterMissingValue
)
<
eps
)
{
vValue
=
Double
.
NaN
;
}
WindStressPRM
.
PrognosticCell
dummyPrognosticCell
=
new
WindStressPRM
.
PrognosticCell
(
cellCoords
,
uValue
,
vValue
);
progWindRow
.
Add
(
dummyPrognosticCell
);
progWindRow
.
Add
(
dummyPrognosticCell
);
}
}
prognosticWind
.
Add
(
progWindRow
);
prognosticWind
.
Add
(
progWindRow
);
...
@@ -164,8 +171,22 @@ namespace MES_Wind
...
@@ -164,8 +171,22 @@ namespace MES_Wind
Coordinate
dummyCellCoords
=
clim15RasterLayer
.
Bounds
.
CellCenter_ToProj
(
i
,
j
);
Coordinate
dummyCellCoords
=
clim15RasterLayer
.
Bounds
.
CellCenter_ToProj
(
i
,
j
);
WindStressPRM
.
Coordinate
dummyClimCoords
=
new
WindStressPRM
.
Coordinate
(
dummyCellCoords
.
X
,
dummyCellCoords
.
Y
);
WindStressPRM
.
Coordinate
dummyClimCoords
=
new
WindStressPRM
.
Coordinate
(
dummyCellCoords
.
X
,
dummyCellCoords
.
Y
);
//add or substruct in range 0 - 27 to change what lines will be broken
//add or substruct in range 0 - 27 to change what lines will be broken
WindStressPRM
.
ClimateCell
dummyClim
=
new
WindStressPRM
.
ClimateCell
(
dummyClimCoords
,
clim5RasterLayer
.
DataSet
.
Value
[
j
,
i
],
clim10RasterLayer
.
DataSet
.
Value
[
j
,
i
]
-
10
,
clim15RasterLayer
.
DataSet
.
Value
[
j
,
i
]);
double
clim5
=
j
;
// clim5RasterLayer.DataSet.Value[i, j];
//WindStressPRM.ClimateCell dummyClim = new WindStressPRM.ClimateCell(dummyClimCoords, 0, 0, 0);
double
clim10
=
clim10RasterLayer
.
DataSet
.
Value
[
i
,
j
]
-
10
;
double
clim15
=
clim15RasterLayer
.
DataSet
.
Value
[
i
,
j
];
if
(
Math
.
Abs
(
clim5
-
RasterMissingValue
)
<
eps
)
{
clim5
=
Double
.
NaN
;
}
if
(
Math
.
Abs
(
clim10
-
RasterMissingValue
)
<
eps
)
{
clim10
=
Double
.
NaN
;
}
if
(
Math
.
Abs
(
clim15
-
RasterMissingValue
)
<
eps
)
{
clim15
=
Double
.
NaN
;
}
WindStressPRM
.
ClimateCell
dummyClim
=
new
WindStressPRM
.
ClimateCell
(
dummyClimCoords
,
clim5
,
clim10
,
clim15
);
climWindRow
.
Add
(
dummyClim
);
climWindRow
.
Add
(
dummyClim
);
}
}
climWind
.
Add
(
climWindRow
);
climWind
.
Add
(
climWindRow
);
...
...
This diff is collapsed.
Click to expand it.
WindStressPRM/WindStressPRM.cs
+
78
−
127
View file @
5fd1ba2a
...
@@ -13,12 +13,12 @@ namespace WindStressPRM
...
@@ -13,12 +13,12 @@ namespace WindStressPRM
/// Outer index
/// Outer index
/// Внешний индекс
/// Внешний индекс
/// </summary>
/// </summary>
public
int
Row
;
public
int
Row
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Inner index
/// Inner index
/// Внутренний индекс
/// Внутренний индекс
/// </summary>
/// </summary>
public
int
Col
;
public
int
Col
{
get
;
set
;
}
/// <summary>
/// <summary>
/// designated constructor
/// designated constructor
/// </summary>
/// </summary>
...
@@ -27,7 +27,7 @@ namespace WindStressPRM
...
@@ -27,7 +27,7 @@ namespace WindStressPRM
public
Index
(
int
Row
,
int
Col
)
public
Index
(
int
Row
,
int
Col
)
{
{
if
(
Row
<=
-
1
||
Col
<=
-
1
)
{
if
(
Row
<=
-
1
||
Col
<=
-
1
)
{
throw
new
Exception
(
"Index must be initialized with nonegative integer value"
);
throw
new
System
.
ArgumentOutOfRange
Exception
(
"Index must be initialized with nonegative integer value"
);
}
}
this
.
Row
=
Row
;
this
.
Row
=
Row
;
this
.
Col
=
Col
;
this
.
Col
=
Col
;
...
@@ -42,12 +42,12 @@ namespace WindStressPRM
...
@@ -42,12 +42,12 @@ namespace WindStressPRM
/// easting coordinate
/// easting coordinate
/// Координата по широте
/// Координата по широте
/// </summary>
/// </summary>
public
double
X
;
public
double
X
{
get
;
private
set
;}
/// <summary>
/// <summary>
/// northing coordinate
/// northing coordinate
/// Координата по долготе
/// Координата по долготе
/// </summary>
/// </summary>
public
double
Y
;
public
double
Y
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// designated constructor
/// designated constructor
/// Основной конструктор
/// Основной конструктор
...
@@ -56,15 +56,12 @@ namespace WindStressPRM
...
@@ -56,15 +56,12 @@ namespace WindStressPRM
/// <param name="Y"></param>
/// <param name="Y"></param>
public
Coordinate
(
double
X
,
double
Y
)
public
Coordinate
(
double
X
,
double
Y
)
{
{
this
.
X
=
X
;
this
.
Y
=
Y
;
if
(!(
this
.
CheckValue
()))
if
(!(
this
.
CheckValue
()))
{
{
throw
new
System
.
ArgumentException
(
"Passed coordinates are not valid!"
);
throw
new
System
.
ArgumentException
(
"Passed coordinates are not valid!"
);
}
}
else
{
this
.
X
=
X
;
this
.
Y
=
Y
;
}
}
}
/// <summary>
/// <summary>
/// Проверка на валидность значений
/// Проверка на валидность значений
...
@@ -72,15 +69,7 @@ namespace WindStressPRM
...
@@ -72,15 +69,7 @@ namespace WindStressPRM
/// <returns></returns>
/// <returns></returns>
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
true
;
return
!
Double
.
IsNaN
(
X
)
&&
!
Double
.
IsInfinity
(
X
)
&&
!
Double
.
IsNaN
(
Y
)
&&
!
Double
.
IsInfinity
(
Y
);
if
(
X
!=
null
&&
Y
!=
null
)
{
checker
=
true
;
}
else
{
checker
=
false
;
}
return
checker
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -93,17 +82,17 @@ namespace WindStressPRM
...
@@ -93,17 +82,17 @@ namespace WindStressPRM
/// U - component of wind velocity, m/s
/// U - component of wind velocity, m/s
/// U - компонента скорости ветра, м/с
/// U - компонента скорости ветра, м/с
/// </summary>
/// </summary>
public
double
VelocityX
;
public
double
VelocityX
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// V - component of wind velocity, m/s
/// V - component of wind velocity, m/s
/// V - компонента скорости ветра, м/с
/// V - компонента скорости ветра, м/с
/// </summary>
/// </summary>
public
double
VelocityY
;
public
double
VelocityY
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// Cell center coordinates
/// Cell center coordinates
/// Координаты центра ячейки
/// Координаты центра ячейки
/// </summary>
/// </summary>
public
Coordinate
Coordinate
;
public
Coordinate
Coordinate
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// designated constructor
/// designated constructor
/// </summary>
/// </summary>
...
@@ -111,16 +100,13 @@ namespace WindStressPRM
...
@@ -111,16 +100,13 @@ namespace WindStressPRM
/// <param name="vX"> U component</param>
/// <param name="vX"> U component</param>
/// <param name="vY"> V component</param>
/// <param name="vY"> V component</param>
public
PrognosticCell
(
Coordinate
coord
,
double
vX
,
double
vY
)
public
PrognosticCell
(
Coordinate
coord
,
double
vX
,
double
vY
)
{
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Prognostic wind velocities are incorrect"
);
}
else
{
{
this
.
Coordinate
=
coord
;
this
.
Coordinate
=
coord
;
this
.
VelocityX
=
vX
;
this
.
VelocityX
=
vX
;
this
.
VelocityY
=
vY
;
this
.
VelocityY
=
vY
;
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Prognostic wind velocities are incorrect"
);
}
}
}
}
/// <summary>
/// <summary>
...
@@ -129,16 +115,17 @@ namespace WindStressPRM
...
@@ -129,16 +115,17 @@ namespace WindStressPRM
/// <returns></returns>
/// <returns></returns>
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
false
;
bool
res1
=
Double
.
IsNaN
(
VelocityX
);
///Скорость ветра на высоте 10м от поверхности на Земле не может превышать 70м/c
bool
res2
=
Double
.
IsNaN
(
VelocityY
);
if
(
Math
.
Abs
(
VelocityX
)
<
70
&&
Math
.
Abs
(
VelocityY
)
<
70
)
if
(
res1
!=
res2
)
{
{
return
false
;
checker
=
true
;
}
}
else
{
// пустые данные
checker
=
false
;
if
(
res1
)
{
return
true
;
}
}
return
checker
;
///Скорость ветра на высоте 10м от поверхности на Земле не может превышать 70м/c
return
Math
.
Abs
(
Math
.
Pow
(
VelocityX
,
2
)
+
Math
.
Pow
(
VelocityY
,
2
))
<=
4900
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -156,17 +143,17 @@ namespace WindStressPRM
...
@@ -156,17 +143,17 @@ namespace WindStressPRM
/// once-in-10-years frequency wind, m/s
/// once-in-10-years frequency wind, m/s
/// скорость ветра повторяемости один раз в 10 лет, м/с
/// скорость ветра повторяемости один раз в 10 лет, м/с
/// </summary>
/// </summary>
public
double
Wind10
;
public
double
Wind10
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// once-in-15-years frequency wind, m/s
/// once-in-15-years frequency wind, m/s
/// скорость ветра повторяемости один раз в 15 лет, м/с
/// скорость ветра повторяемости один раз в 15 лет, м/с
/// </summary>
/// </summary>
public
double
Wind15
;
public
double
Wind15
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// Cell center coordinate pair
/// Cell center coordinate pair
/// Координаты центра ячейки
/// Координаты центра ячейки
/// </summary>
/// </summary>
public
Coordinate
Coordinate
;
public
Coordinate
Coordinate
{
get
;
private
set
;
}
/// <summary>
/// <summary>
/// designated constructor
/// designated constructor
/// </summary>
/// </summary>
...
@@ -175,17 +162,14 @@ namespace WindStressPRM
...
@@ -175,17 +162,14 @@ namespace WindStressPRM
/// <param name="w10"></param>
/// <param name="w10"></param>
/// <param name="w15"></param>
/// <param name="w15"></param>
public
ClimateCell
(
Coordinate
coord
,
double
w5
,
double
w10
,
double
w15
)
public
ClimateCell
(
Coordinate
coord
,
double
w5
,
double
w10
,
double
w15
)
{
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Climate wind value is not correct"
);
}
else
{
{
this
.
Coordinate
=
coord
;
this
.
Coordinate
=
coord
;
this
.
Wind5
=
w5
;
this
.
Wind5
=
w5
;
this
.
Wind10
=
w10
;
this
.
Wind10
=
w10
;
this
.
Wind15
=
w15
;
this
.
Wind15
=
w15
;
if
(!(
this
.
CheckValue
()))
{
throw
new
System
.
ArgumentException
(
"Climate wind value is not correct"
);
}
}
}
}
/// <summary>
/// <summary>
...
@@ -194,31 +178,33 @@ namespace WindStressPRM
...
@@ -194,31 +178,33 @@ namespace WindStressPRM
/// <returns></returns>
/// <returns></returns>
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
true
;
bool
c5
=
Double
.
IsNaN
(
Wind5
);
if
(
Math
.
Abs
(
Wind5
)
<
70
&&
Math
.
Abs
(
Wind10
)
<
70
&&
Math
.
Abs
(
Wind15
)
<
70
)
bool
c10
=
Double
.
IsNaN
(
Wind10
);
{
bool
c15
=
Double
.
IsNaN
(
Wind15
);
checker
=
true
;
if
(
c5
!=
c10
||
c5
!=
c15
||
c5
!=
c10
)
{
return
false
;
}
}
else
{
if
(
c5
)
{
checker
=
fals
e
;
return
tru
e
;
}
}
return
checker
;
// ветер по модулю не должен превышать 70м/с
return
Math
.
Abs
(
Wind5
)
<
70
&&
Math
.
Abs
(
Wind10
)
<
70
&&
Math
.
Abs
(
Wind15
)
<
70
;
}
}
}
}
/// <summary>
/// <summary>
/// Cell Size parameters
/// Cell Size parameters
/// Параметры ячейки (регулярной сетки)
/// Параметры ячейки (регулярной сетки)
/// </summary>
/// </summary>
public
struct
CellSize
public
class
CellSize
{
{
/// <summary>
/// <summary>
/// ширина ячейки (расстояние между соседними по широте центрами ячеек)
/// ширина ячейки (расстояние между соседними по широте центрами ячеек)
/// </summary>
/// </summary>
public
double
Width
;
public
double
Width
{
get
;
set
;
}
/// <summary>
/// <summary>
/// высота ячейки (расстояние между соседними по долготе центрами ячеек)
/// высота ячейки (расстояние между соседними по долготе центрами ячеек)
/// </summary>
/// </summary>
public
double
Height
;
public
double
Height
{
get
;
set
;
}
/// <summary>
/// <summary>
/// designated constructor
/// designated constructor
/// </summary>
/// </summary>
...
@@ -239,13 +225,7 @@ namespace WindStressPRM
...
@@ -239,13 +225,7 @@ namespace WindStressPRM
/// <returns></returns>
/// <returns></returns>
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
true
;
return
Width
>
0
&&
Height
>
0
;
if
(
Width
>
0
&&
Height
>
0
)
{
checker
=
true
;
}
else
{
checker
=
false
;
}
return
checker
;
}
}
}
}
/// <summary>
/// <summary>
...
@@ -263,17 +243,17 @@ namespace WindStressPRM
...
@@ -263,17 +243,17 @@ namespace WindStressPRM
/// year of construction
/// year of construction
/// год постройки ЛЭП
/// год постройки ЛЭП
/// </summary>
/// </summary>
public
int
Year
;
public
int
Year
{
get
;
set
;
}
/// <summary>
/// <summary>
/// average height of cable span between two poles, meters
/// average height of cable span between two poles, meters
/// средняя высота пролета, м
/// средняя высота пролета, м
/// </summary>
/// </summary>
public
double
Height
;
public
double
Height
{
get
;
set
;
}
/// <summary>
/// <summary>
/// power k
W
for switches
/// power k
V
for switches
///
Мощность
ЛЭП, кВ
т
///
Напряжение
ЛЭП, кВ
/// </summary>
/// </summary>
public
int
Power
;
public
int
Power
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Line vertices coordinate list
/// Line vertices coordinate list
/// список координат вершин ЛЭП как линейного объекта
/// список координат вершин ЛЭП как линейного объекта
...
@@ -283,23 +263,23 @@ namespace WindStressPRM
...
@@ -283,23 +263,23 @@ namespace WindStressPRM
/// assigned powerstation/pole
/// assigned powerstation/pole
/// идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)
/// идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)
/// </summary>
/// </summary>
public
int
PointFromID
;
public
int
PointFromID
{
get
;
set
;
}
/// <summary>
/// <summary>
/// assigned powerstation/pole
/// assigned powerstation/pole
/// идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)
/// идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)
/// </summary>
/// </summary>
public
int
PointToID
;
public
int
PointToID
{
get
;
set
;
}
/// <summary>
/// <summary>
/// broken/not broken switch
/// broken/not broken switch
/// сломана (true) или нет (false) линяя
/// сломана (true) или нет (false) линяя
/// </summary>
/// </summary>
public
bool
IsBroken
;
public
bool
IsBroken
{
get
;
set
;
}
/// <summary>
/// <summary>
/// power on switch
/// power on switch
/// получает (true) или нет (false) линия питание
/// получает (true) или нет (false) линия питание
/// </summary>
/// </summary>
public
bool
IsON
;
public
bool
IsON
{
get
;
set
;
}
private
int
MissingIdValue
=
-
1
;
public
Powerline
()
public
Powerline
()
{
{
//default constructor body
//default constructor body
...
@@ -338,12 +318,10 @@ namespace WindStressPRM
...
@@ -338,12 +318,10 @@ namespace WindStressPRM
/// <returns></returns>
/// <returns></returns>
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
true
;
bool
checker
=
if
(
Identifier
>=
0
&&
Math
.
Abs
(
Year
-
1985
)
<
45
&&
Math
.
Abs
(
Height
-
15
)<
15
&&
Power
>
0
&&
Power
<
1000
&&
PointFromID
>=
0
&&
PointToID
>=
0
)
Identifier
>=
0
&&
Math
.
Abs
(
Year
-
1985
)
<
45
&&
{
Math
.
Abs
(
Height
-
15
)
<
15
&&
Power
>
0
&&
Power
<
1000
&&
checker
=
true
;
PointFromID
>=
0
&&
PointToID
>=
0
;
}
else
{
checker
=
false
;
}
return
checker
;
return
checker
;
}
}
}
}
...
@@ -357,21 +335,21 @@ namespace WindStressPRM
...
@@ -357,21 +335,21 @@ namespace WindStressPRM
/// unique id
/// unique id
/// уникальный идентификатор подстанции/столба
/// уникальный идентификатор подстанции/столба
/// </summary>
/// </summary>
public
int
Identifier
;
public
int
Identifier
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Coordinates
/// Coordinates
/// </summary>
/// </summary>
public
Coordinate
Coordinate
;
public
Coordinate
Coordinate
{
get
;
set
;
}
/// <summary>
/// <summary>
/// station name field
/// station name field
/// название подстанции
/// название подстанции
/// </summary>
/// </summary>
public
string
Name
;
public
string
Name
{
get
;
set
;
}
/// <summary>
/// <summary>
/// power, kW
/// power, kW
/// мощность, кВт
/// мощность, кВт
/// </summary>
/// </summary>
public
int
Power
;
public
int
Power
{
get
;
set
;
}
/// <summary>
/// <summary>
/// type of point - trans/pole/endpoint
/// type of point - trans/pole/endpoint
/// тип станции - трансформаторная подстанция/столб/понижающая(конечная)подстанция
/// тип станции - трансформаторная подстанция/столб/понижающая(конечная)подстанция
...
@@ -383,22 +361,22 @@ namespace WindStressPRM
...
@@ -383,22 +361,22 @@ namespace WindStressPRM
/// <summary>
/// <summary>
/// тип подстанции
/// тип подстанции
/// </summary>
/// </summary>
public
StationType
Stationtype
;
public
StationType
Stationtype
{
get
;
set
;
}
/// <summary>
/// <summary>
/// is point a source?
/// is point a source?
/// является ли подстаниция источником питания (в случае ТЭЦ или питания от внешних для рассматриваемой цепи ЛЭП)
/// является ли подстаниция источником питания (в случае ТЭЦ или питания от внешних для рассматриваемой цепи ЛЭП)
/// </summary>
/// </summary>
public
bool
IsSource
;
public
bool
IsSource
{
get
;
set
;
}
/// <summary>
/// <summary>
/// power on switch
/// power on switch
/// поступает (true) или нет (false) на подстанцию питание
/// поступает (true) или нет (false) на подстанцию питание
/// </summary>
/// </summary>
public
bool
IsON
;
public
bool
IsON
{
get
;
set
;
}
/// <summary>
/// <summary>
/// asigned powerlines list
/// asigned powerlines list
/// список оканчивающихся/начинающихся на подстанции ЛЭП
/// список оканчивающихся/начинающихся на подстанции ЛЭП
/// </summary>
/// </summary>
public
List
<
Powerline
>
LineList
;
public
List
<
Powerline
>
LineList
{
get
;
set
;
}
public
PowerStation
()
public
PowerStation
()
{
{
//default constructor
//default constructor
...
@@ -425,14 +403,8 @@ namespace WindStressPRM
...
@@ -425,14 +403,8 @@ namespace WindStressPRM
}
}
public
bool
CheckValue
()
public
bool
CheckValue
()
{
{
bool
checker
=
true
;
bool
checker
=
Identifier
>=
0
&&
Power
>
0
&&
Power
<
1000
;
if
(
Identifier
>=
0
&&
Power
>
0
&&
Power
<
1000
)
{
checker
=
true
;
}
else
{
checker
=
false
;
}
return
checker
;
return
checker
;
}
}
}
}
...
@@ -502,18 +474,6 @@ namespace WindStressPRM
...
@@ -502,18 +474,6 @@ namespace WindStressPRM
return
500
;
return
500
;
}
}
}
}
/// <summary>
/// missing raster value for cells, if you haven't normal value use this one.
/// потерянное значение для растрового объекта; Если Вы не имеете данных - используйте это значение
/// </summary>
public
double
kMissingRasterValue
{
get
{
return
-
9999
;
}
}
}
}
/// <summary>
/// <summary>
/// Output
/// Output
...
@@ -724,29 +684,19 @@ namespace WindStressPRM
...
@@ -724,29 +684,19 @@ namespace WindStressPRM
Coordinate
subCoord2
=
new
Coordinate
(
coord1
.
X
+
constXdiff
,
coord1
.
Y
+
constXdiff
);
Coordinate
subCoord2
=
new
Coordinate
(
coord1
.
X
+
constXdiff
,
coord1
.
Y
+
constXdiff
);
for
(
int
j
=
0
;
j
<
distpropI
;
j
++)
for
(
int
j
=
0
;
j
<
distpropI
;
j
++)
{
{
if
(
j
==
0
)
if
(
j
>
0
)
{
{
midpoint
.
X
=
(
subCoord1
.
X
+
subCoord2
.
X
)
/
2
;
// move to next center, at the next interval
midpoint
.
Y
=
(
subCoord
1
.
Y
+
subCoord2
.
Y
)
/
2
;
subCoord1
=
new
Coordinate
(
subCoord
2
.
X
,
subCoord2
.
Y
);
pointlist
.
Add
(
midpoint
);
subCoord2
=
new
Coordinate
(
subCoord1
.
X
+
constXdiff
,
subCoord1
.
Y
+
constYdiff
);
}
}
else
midpoint
=
new
Coordinate
((
subCoord1
.
X
+
subCoord2
.
X
)
/
2
,
(
subCoord1
.
Y
+
subCoord2
.
Y
)
/
2
);
{
// move to next center
subCoord1
.
X
=
subCoord2
.
X
;
subCoord1
.
Y
=
subCoord2
.
Y
;
subCoord2
.
X
=
subCoord1
.
X
+
constXdiff
;
subCoord2
.
Y
=
subCoord1
.
Y
+
constYdiff
;
midpoint
.
X
=
(
subCoord1
.
X
+
subCoord2
.
X
)
/
2
;
midpoint
.
Y
=
(
subCoord1
.
Y
+
subCoord2
.
Y
)
/
2
;
pointlist
.
Add
(
midpoint
);
pointlist
.
Add
(
midpoint
);
}
}
}
}
}
else
else
{
{
midpoint
.
X
=
(
coord1
.
X
+
coord2
.
X
)
/
2
;
midpoint
=
new
Coordinate
(
(
coord1
.
X
+
coord2
.
X
)
/
2
,
(
coord1
.
Y
+
coord2
.
Y
)
/
2
);
midpoint
.
Y
=
(
coord1
.
Y
+
coord2
.
Y
)
/
2
;
pointlist
.
Add
(
midpoint
);
pointlist
.
Add
(
midpoint
);
}
}
FunctionType
climateType
;
FunctionType
climateType
;
...
@@ -992,10 +942,11 @@ namespace WindStressPRM
...
@@ -992,10 +942,11 @@ namespace WindStressPRM
double
valTopLeft
=
valueForFunction
(
functionType
,
rcTopLeft
);
double
valTopLeft
=
valueForFunction
(
functionType
,
rcTopLeft
);
double
valTopRight
=
valueForFunction
(
functionType
,
rcTopRight
);
double
valTopRight
=
valueForFunction
(
functionType
,
rcTopRight
);
Coordinate
origin
=
cellToProjection
(
rcBotLeft
,
functionType
);
Coordinate
origin
=
cellToProjection
(
rcBotLeft
,
functionType
);
bool
testBotLeft
=
valBotLeft
==
Input
.
kMissingRasterValue
;
bool
testBotRight
=
valBotRight
==
Input
.
kMissingRasterValue
;
bool
testBotLeft
=
Double
.
IsNaN
(
valBotLeft
);
bool
testTopLeft
=
valTopLeft
==
Input
.
kMissingRasterValue
;
bool
testBotRight
=
Double
.
IsNaN
(
valBotRight
);
bool
testTopRight
=
valTopRight
==
Input
.
kMissingRasterValue
;
bool
testTopLeft
=
Double
.
IsNaN
(
valTopLeft
);
bool
testTopRight
=
Double
.
IsNaN
(
valTopRight
);
if
(
testBotLeft
||
testBotRight
||
testTopLeft
||
testTopRight
)
if
(
testBotLeft
||
testBotRight
||
testTopLeft
||
testTopRight
)
{
{
// tests indicates that value at test-cell is missed.
// tests indicates that value at test-cell is missed.
...
...
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