개정판 7e680366
dev issue #507 : fix JoinRun
Change-Id: I261087f9c65fa83b75a8b306486606a19a4eb0f4
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
3230 | 3230 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
3231 | 3231 |
} |
3232 | 3232 |
else if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() == "Active") |
3233 |
survivorId = null; |
|
3233 |
{ |
|
3234 |
int model1Cnt = GetConnectorCount(modelId1); |
|
3235 |
int model2Cnt = GetConnectorCount(modelId2); |
|
3236 |
if (model1Cnt == 0) |
|
3237 |
{ |
|
3238 |
beforeID = modelItem1.Id; |
|
3239 |
afterID = modelItem2.Id; |
|
3240 |
survivorId = afterID; |
|
3241 |
LMAAttribute attribute = modelItem2.Attributes["FlowDirection"]; |
|
3242 |
if (attribute != null) |
|
3243 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
|
3244 |
} |
|
3245 |
else if (model2Cnt == 0) |
|
3246 |
{ |
|
3247 |
beforeID = modelItem2.Id; |
|
3248 |
afterID = modelItem1.Id; |
|
3249 |
survivorId = afterID; |
|
3250 |
LMAAttribute attribute = modelItem1.Attributes["FlowDirection"]; |
|
3251 |
if (attribute != null) |
|
3252 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
|
3253 |
} |
|
3254 |
else |
|
3255 |
survivorId = null; |
|
3256 |
} |
|
3234 | 3257 |
else |
3235 | 3258 |
{ |
3236 | 3259 |
Log.Write("잘못된 경우"); |
... | ... | |
3770 | 3793 |
return result; |
3771 | 3794 |
} |
3772 | 3795 |
|
3796 |
|
|
3797 |
private int GetConnectorCount(string modelItemID) |
|
3798 |
{ |
|
3799 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
3800 |
int result = 0; |
|
3801 |
if (modelItem != null) |
|
3802 |
{ |
|
3803 |
foreach (LMRepresentation rep in modelItem.Representations) |
|
3804 |
{ |
|
3805 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
3806 |
result++; |
|
3807 |
ReleaseCOMObjects(rep); |
|
3808 |
} |
|
3809 |
ReleaseCOMObjects(modelItem); |
|
3810 |
} |
|
3811 |
|
|
3812 |
return result; |
|
3813 |
} |
|
3814 |
|
|
3773 | 3815 |
public List<string> GetRepresentations(string modelItemID) |
3774 | 3816 |
{ |
3775 | 3817 |
List<string> result = new List<string>(); ; |
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
7 | 7 |
using System.Xml.Linq; |
8 | 8 |
using System.Windows.Forms; |
9 | 9 |
using Converter.SPPID.Util; |
10 |
using System.Data; |
|
10 | 11 |
|
11 | 12 |
namespace Converter.BaseModel |
12 | 13 |
{ |
... | ... | |
31 | 32 |
private bool _MappingValidation; |
32 | 33 |
private string _ValidationMessage = string.Empty; |
33 | 34 |
bool validationResult = false; |
35 |
private DataTable ID2SymbolTypeDT; |
|
34 | 36 |
|
35 | 37 |
public string ValidationMessage { get => _ValidationMessage; set => _ValidationMessage = value; } |
36 | 38 |
|
... | ... | |
71 | 73 |
|
72 | 74 |
StringBuilder validationStringBuilder = new StringBuilder(); |
73 | 75 |
|
74 |
public Document(string xmlPath) |
|
76 |
public Document(string xmlPath, DataTable ID2SymbolTypeDT)
|
|
75 | 77 |
{ |
78 |
this.ID2SymbolTypeDT = ID2SymbolTypeDT; |
|
76 | 79 |
validationStringBuilder.AppendLine("Document Path : " + xmlPath); |
77 | 80 |
validationStringBuilder.AppendLine(""); |
78 | 81 |
try |
... | ... | |
112 | 115 |
foreach (XElement item in node.Elements("SYMBOL")) |
113 | 116 |
{ |
114 | 117 |
string sType = item.Element("TYPE").Value; |
118 |
|
|
119 |
DataRow[] rows = ID2SymbolTypeDT.Select(string.Format("Type = '{0}'", sType.Replace("'", "''"))); |
|
120 |
string sCategory = rows[0]["Category"].ToString(); |
|
121 |
|
|
115 | 122 |
if (sType == "Segment Breaks") |
116 | 123 |
{ |
117 | 124 |
SpecBreak specBreak = new SpecBreak() |
... | ... | |
169 | 176 |
|
170 | 177 |
EndBreaks.Add(endBreak); |
171 | 178 |
} |
172 |
else if (sType == "Black Box System" || |
|
173 |
sType == "GGO_Equipment" || |
|
174 |
sType == "Heat Transfer Equipment" || |
|
175 |
sType == "Mechanical" || |
|
176 |
sType == "Other Equipment" || |
|
177 |
sType == "Vessels") |
|
179 |
else if (sCategory == "Equipment" || |
|
180 |
sCategory == "Equipment Components") |
|
178 | 181 |
{ |
179 | 182 |
Equipment equipment = new Equipment() |
180 | 183 |
{ |
DTI_PID/SPPIDConverter/ConverterForm.cs | ||
---|---|---|
206 | 206 |
_ID2SymbolTable = null; |
207 | 207 |
} |
208 | 208 |
_ID2SymbolTable = Project_DB.SelectID2SymbolTable(); |
209 |
|
|
210 |
if (_ID2SymbolTypeDT != null) |
|
211 |
{ |
|
212 |
_ID2SymbolTypeDT.Dispose(); |
|
213 |
_ID2SymbolTypeDT = null; |
|
214 |
} |
|
215 |
_ID2SymbolTypeDT = Project_DB.SelectSymbolType(); |
|
209 | 216 |
InitID2Symbol(); |
210 | 217 |
InitID2Line(); |
211 | 218 |
InitID2LineNumber(); |
... | ... | |
484 | 491 |
{ |
485 | 492 |
foreach (string fileName in xtraOpenFileDialog.FileNames) |
486 | 493 |
{ |
487 |
SPPID_Document document = new SPPID_Document(fileName); |
|
494 |
SPPID_Document document = new SPPID_Document(fileName, _ID2SymbolTypeDT);
|
|
488 | 495 |
|
489 | 496 |
document.SymbolTable = _ID2SymbolTable; |
490 | 497 |
document.SymbolMappings = symbolMappings; |
... | ... | |
702 | 709 |
foreach (DataRow row in _ConverterDT.Rows) |
703 | 710 |
{ |
704 | 711 |
string fileName = row["colDrawingFilePath"].ToString(); |
705 |
SPPID_Document document = new SPPID_Document(fileName); |
|
712 |
SPPID_Document document = new SPPID_Document(fileName, _ID2SymbolTypeDT);
|
|
706 | 713 |
document.SymbolTable = _ID2SymbolTable; |
707 | 714 |
document.SymbolMappings = symbolMappings; |
708 | 715 |
document.ChildSymbolMappings = childSymbolMappings; |
DTI_PID/SPPIDConverter/DB/Project_DB.cs | ||
---|---|---|
618 | 618 |
|
619 | 619 |
return dt; |
620 | 620 |
} |
621 |
|
|
622 |
public static DataTable SelectSymbolType() |
|
623 |
{ |
|
624 |
DataTable dt = new DataTable(); |
|
625 |
Project_Info projectInfo = Project_Info.GetInstance(); |
|
626 |
using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath))) |
|
627 |
{ |
|
628 |
try |
|
629 |
{ |
|
630 |
connection.Open(); |
|
631 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
|
632 |
{ |
|
633 |
cmd.CommandText = string.Format("SELECT * FROM {0}", SymbolType_TABLE); |
|
634 |
using (SQLiteDataReader dr = cmd.ExecuteReader()) |
|
635 |
dt.Load(dr); |
|
636 |
} |
|
637 |
connection.Close(); |
|
638 |
} |
|
639 |
catch (Exception ex) |
|
640 |
{ |
|
641 |
|
|
642 |
} |
|
643 |
finally |
|
644 |
{ |
|
645 |
connection.Dispose(); |
|
646 |
} |
|
647 |
} |
|
648 |
|
|
649 |
return dt; |
|
650 |
} |
|
651 |
|
|
621 | 652 |
public static DataTable SelectDrawingInfo() |
622 | 653 |
{ |
623 | 654 |
DataTable dt = new DataTable(); |
DTI_PID/SPPIDConverter/SPPIDModel/SPPID_Document.cs | ||
---|---|---|
11 | 11 |
{ |
12 | 12 |
public class SPPID_Document : Document |
13 | 13 |
{ |
14 |
public SPPID_Document(string xmlPath) : base(xmlPath)
|
|
14 |
public SPPID_Document(string xmlPath, DataTable ID2SymbolTypeDT) : base(xmlPath, ID2SymbolTypeDT)
|
|
15 | 15 |
{ |
16 | 16 |
|
17 | 17 |
} |
... | ... | |
22 | 22 |
public List<LineNumberMapping> LineNumberMappings; |
23 | 23 |
public List<AttributeMapping> AttributeMappings; |
24 | 24 |
public ETCSetting ETCSetting; |
25 |
|
|
25 | 26 |
public DataTable SymbolTable { get; set; } |
26 | 27 |
|
27 | 28 |
public List<Group> GROUPS = new List<Group>(); |
내보내기 Unified diff