hytos / DTI_PID / SPPIDConverter / BaseModel / VendorPackage.cs @ 11045d18
이력 | 보기 | 이력해설 | 다운로드 (1.42 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
using Converter.SPPID.Util; |
7 |
|
8 |
namespace Converter.BaseModel |
9 |
{ |
10 |
public class VendorPackage |
11 |
{ |
12 |
string _UID; |
13 |
string _AREA; |
14 |
string _POINT; |
15 |
public List<double[]> POINTS; |
16 |
|
17 |
private SPPIDSymbolInfo _SPPID = new SPPIDSymbolInfo(); |
18 |
|
19 |
public double[] CenterPoint; |
20 |
public string UID { get => _UID; set => _UID = value; } |
21 |
public string AREA { get => _AREA; set => _AREA = value; } |
22 |
public string POINT |
23 |
{ |
24 |
get { return _POINT; } |
25 |
set |
26 |
{ |
27 |
_POINT = value; |
28 |
string[] split = _POINT.Split(new char[] { '/' }); |
29 |
POINTS = new List<double[]>(); |
30 |
double allX = 0; |
31 |
double allY = 0; |
32 |
|
33 |
foreach (var item in split) |
34 |
{ |
35 |
string[] sPoint = item.Split(new char[] { ',' }); |
36 |
POINTS.Add(new double[] { Convert.ToDouble(sPoint[0]), Convert.ToDouble(sPoint[1]) }); |
37 |
allX += Convert.ToDouble(sPoint[0]); |
38 |
allY += Convert.ToDouble(sPoint[1]); |
39 |
} |
40 |
|
41 |
CenterPoint = new double[] { allX / POINTS.Count, allY / POINTS.Count }; |
42 |
} |
43 |
} |
44 |
public SPPIDSymbolInfo SPPID { get => _SPPID; set => _SPPID = value; } |
45 |
} |
46 |
} |