개정판 b90890eb
dev issue #1231 : add SymbolModeling
Change-Id: I4af255ad1da4196381146d000d0f493db7af4524
DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj | ||
---|---|---|
151 | 151 |
<DependentUpon>ProjectForm.cs</DependentUpon> |
152 | 152 |
</Compile> |
153 | 153 |
<Compile Include="Log.cs" /> |
154 |
<Compile Include="Model\PlantItem\Other\AvevaSymbolInfo.cs" /> |
|
154 | 155 |
<Compile Include="Model\PlantItem\Other\AvevaLineInfo.cs" /> |
155 | 156 |
<Compile Include="Model\PlantItem\EndBreak.cs" /> |
156 | 157 |
<Compile Include="Model\PlantItem\LineNumber.cs" /> |
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
99 | 99 |
} |
100 | 100 |
private void RunSymbolModeling() |
101 | 101 |
{ |
102 |
|
|
102 |
foreach (var item in document.SYMBOLS) |
|
103 |
{ |
|
104 |
if (item.Aveva.Handle == 0) |
|
105 |
SymbolModeling(item); |
|
106 |
} |
|
103 | 107 |
} |
104 | 108 |
#endregion |
105 | 109 |
|
... | ... | |
120 | 124 |
foreach (var item in groupLine) |
121 | 125 |
item.Aveva.Handle = handle; |
122 | 126 |
} |
127 |
private void SymbolModeling(Symbol symbol) |
|
128 |
{ |
|
123 | 129 |
|
130 |
} |
|
124 | 131 |
#endregion |
125 | 132 |
|
126 | 133 |
#region Drawing Method |
DTI_PID/APIDConverter/Form/APIDConverter.cs | ||
---|---|---|
167 | 167 |
return; |
168 | 168 |
} |
169 | 169 |
|
170 |
DataTable symbolMappingTable = Project_DB.GetSymbolMappingTable(); |
|
170 | 171 |
DataTable lineMappingTable = Project_DB.GetLineMappingTable(); |
171 | 172 |
DataTable tDrawing = Project_DB.SelectDrawings(); |
172 | 173 |
Documents.Clear(); |
... | ... | |
189 | 190 |
document.AvevaTemplateID = _ID; |
190 | 191 |
document.AvevaTemplateName = _TemplateName; |
191 | 192 |
// validation check |
192 |
if (document.SetAvevaInfo(lineMappingTable)) |
|
193 |
if (document.SetAvevaInfo(symbolMappingTable, lineMappingTable))
|
|
193 | 194 |
Documents.Add(document); |
194 | 195 |
} |
195 | 196 |
|
197 |
symbolMappingTable.Dispose(); |
|
196 | 198 |
lineMappingTable.Dispose(); |
197 | 199 |
|
198 | 200 |
if (Documents.Count > 0) |
DTI_PID/APIDConverter/Model/PlantItem/Document.cs | ||
---|---|---|
530 | 530 |
|
531 | 531 |
#region For Aveva |
532 | 532 |
|
533 |
public bool SetAvevaInfo(DataTable lineMappingTable) |
|
533 |
public bool SetAvevaInfo(DataTable symbolMappingTable, DataTable lineMappingTable)
|
|
534 | 534 |
{ |
535 | 535 |
bool result = true; |
536 | 536 |
foreach (var item in LINES) |
... | ... | |
554 | 554 |
} |
555 | 555 |
} |
556 | 556 |
else |
557 |
{ |
|
558 | 557 |
result = false; |
558 |
} |
|
559 |
|
|
560 |
foreach (var item in SYMBOLS) |
|
561 |
{ |
|
562 |
DataRow[] rows = symbolMappingTable.Select(string.Format("UID = '{0}'", item.DBUID)); |
|
563 |
if (rows.Length == 1 && !DBNull.Value.Equals(rows[0]["APID_SYMBOL"]) && !string.IsNullOrEmpty((string)rows[0]["APID_SYMBOL"])) |
|
564 |
{ |
|
565 |
item.Aveva = new AvevaSymbolInfo(); |
|
566 |
item.Aveva.Name = (string)rows[0]["APID_SYMBOL"]; |
|
567 |
item.Aveva.X = item.X; |
|
568 |
item.Aveva.Y = SIZE_HEIGHT - item.Y; |
|
559 | 569 |
} |
570 |
else |
|
571 |
result = false; |
|
560 | 572 |
} |
561 | 573 |
|
562 | 574 |
return result; |
DTI_PID/APIDConverter/Model/PlantItem/Other/AvevaSymbolInfo.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace AVEVA.PID.CustomizationUtility.Model |
|
8 |
{ |
|
9 |
public class AvevaSymbolInfo |
|
10 |
{ |
|
11 |
public long Handle { get; set; } |
|
12 |
public string Name { get; set; } |
|
13 |
public double X { get; set; } |
|
14 |
public double Y { get; set; } |
|
15 |
} |
|
16 |
} |
DTI_PID/APIDConverter/Model/PlantItem/Symbol.cs | ||
---|---|---|
33 | 33 |
public List<Association> ASSOCIATIONS { get => _ASSOCIATIONS; set => _ASSOCIATIONS = value; } |
34 | 34 |
public string TYPE { get => _TYPE; set => _TYPE = value; } |
35 | 35 |
public string OWNER { get => _OWNER; set => _OWNER = value; } |
36 |
public string ORIGINALPOINT { get => _ORIGINALPOINT; set => _ORIGINALPOINT = value; } |
|
36 |
public string ORIGINALPOINT |
|
37 |
{ |
|
38 |
get |
|
39 |
{ |
|
40 |
return _ORIGINALPOINT; |
|
41 |
} |
|
42 |
set |
|
43 |
{ |
|
44 |
_ORIGINALPOINT = value; |
|
45 |
double x = 0, y = 0; |
|
46 |
APIDUtils.ConvertPointBystring(_ORIGINALPOINT, ref x, ref y); |
|
47 |
X = x; |
|
48 |
Y = y; |
|
49 |
} |
|
50 |
} |
|
37 | 51 |
public List<Connector> CONNECTORS { get => _CONNECTOR; set => _CONNECTOR = value; } |
38 | 52 |
public string CONNECTIONPOINT { get => _CONNECTIONPOINT; set => _CONNECTIONPOINT = value; } |
39 | 53 |
public string LOCATION { get => _LOCATION; set => _LOCATION = value; } |
... | ... | |
69 | 83 |
public int CURRENTPOINTMODEINDEX { get => _CURRENTPOINTMODEINDEX; set => _CURRENTPOINTMODEINDEX = value; } |
70 | 84 |
public List<ChildSymbol> ChildSymbols { get => _ChildSymbols; set => _ChildSymbols = value; } |
71 | 85 |
public string DBUID { get => _DBUID; set => _DBUID = value; } |
86 |
public double X { get; set; } |
|
87 |
public double Y { get; set; } |
|
88 |
public AvevaSymbolInfo Aveva { get; set; } |
|
72 | 89 |
} |
73 | 90 |
} |
내보내기 Unified diff