개정판 0dae5645
dev issue #000 : add psn
Change-Id: I793038f7accb9b9bd15421ad0e6cdcfd972e10cd
DTI_PID/DTI_PID.sln | ||
---|---|---|
9 | 9 |
EndProject |
10 | 10 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "POSCO_Report", "POSCO_Report\POSCO_Report.csproj", "{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}" |
11 | 11 |
EndProject |
12 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ID2PSN", "ID2PSN\ID2PSN.csproj", "{202B8B3F-2070-4643-A43B-2C57B36B8D63}" |
|
13 |
EndProject |
|
12 | 14 |
Global |
13 | 15 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
14 | 16 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
55 | 57 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x64.Build.0 = Release|Any CPU |
56 | 58 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x86.ActiveCfg = Release|Any CPU |
57 | 59 |
{0B9ACE24-227C-42FF-ADAD-A7847CB91F01}.Release|x86.Build.0 = Release|Any CPU |
60 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
61 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
62 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
63 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|x64.Build.0 = Debug|Any CPU |
|
64 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
65 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Debug|x86.Build.0 = Debug|Any CPU |
|
66 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
67 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|Any CPU.Build.0 = Release|Any CPU |
|
68 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x64.ActiveCfg = Release|Any CPU |
|
69 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x64.Build.0 = Release|Any CPU |
|
70 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x86.ActiveCfg = Release|Any CPU |
|
71 |
{202B8B3F-2070-4643-A43B-2C57B36B8D63}.Release|x86.Build.0 = Release|Any CPU |
|
58 | 72 |
EndGlobalSection |
59 | 73 |
GlobalSection(SolutionProperties) = preSolution |
60 | 74 |
HideSolutionNode = FALSE |
DTI_PID/ID2PSN/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8" ?> |
|
2 |
<configuration> |
|
3 |
<startup> |
|
4 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
|
5 |
</startup> |
|
6 |
</configuration> |
DTI_PID/ID2PSN/DB.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 ID2PSN |
|
8 |
{ |
|
9 |
class DB |
|
10 |
{ |
|
11 |
|
|
12 |
} |
|
13 |
} |
DTI_PID/ID2PSN/ID2PSN.csproj | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|
3 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
|
4 |
<PropertyGroup> |
|
5 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
|
6 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
|
7 |
<ProjectGuid>{202B8B3F-2070-4643-A43B-2C57B36B8D63}</ProjectGuid> |
|
8 |
<OutputType>WinExe</OutputType> |
|
9 |
<RootNamespace>ID2PSN</RootNamespace> |
|
10 |
<AssemblyName>ID2PSN</AssemblyName> |
|
11 |
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion> |
|
12 |
<FileAlignment>512</FileAlignment> |
|
13 |
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
|
14 |
<Deterministic>true</Deterministic> |
|
15 |
</PropertyGroup> |
|
16 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
17 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
18 |
<DebugSymbols>true</DebugSymbols> |
|
19 |
<DebugType>full</DebugType> |
|
20 |
<Optimize>false</Optimize> |
|
21 |
<OutputPath>bin\Debug\</OutputPath> |
|
22 |
<DefineConstants>DEBUG;TRACE</DefineConstants> |
|
23 |
<ErrorReport>prompt</ErrorReport> |
|
24 |
<WarningLevel>4</WarningLevel> |
|
25 |
</PropertyGroup> |
|
26 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
27 |
<PlatformTarget>AnyCPU</PlatformTarget> |
|
28 |
<DebugType>pdbonly</DebugType> |
|
29 |
<Optimize>true</Optimize> |
|
30 |
<OutputPath>bin\Release\</OutputPath> |
|
31 |
<DefineConstants>TRACE</DefineConstants> |
|
32 |
<ErrorReport>prompt</ErrorReport> |
|
33 |
<WarningLevel>4</WarningLevel> |
|
34 |
</PropertyGroup> |
|
35 |
<ItemGroup> |
|
36 |
<Reference Include="System" /> |
|
37 |
<Reference Include="System.Core" /> |
|
38 |
<Reference Include="System.Xml.Linq" /> |
|
39 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
40 |
<Reference Include="Microsoft.CSharp" /> |
|
41 |
<Reference Include="System.Data" /> |
|
42 |
<Reference Include="System.Deployment" /> |
|
43 |
<Reference Include="System.Drawing" /> |
|
44 |
<Reference Include="System.Net.Http" /> |
|
45 |
<Reference Include="System.Windows.Forms" /> |
|
46 |
<Reference Include="System.Xml" /> |
|
47 |
</ItemGroup> |
|
48 |
<ItemGroup> |
|
49 |
<Compile Include="Item.cs" /> |
|
50 |
<Compile Include="MainForm.cs"> |
|
51 |
<SubType>Form</SubType> |
|
52 |
</Compile> |
|
53 |
<Compile Include="MainForm.Designer.cs"> |
|
54 |
<DependentUpon>MainForm.cs</DependentUpon> |
|
55 |
</Compile> |
|
56 |
<Compile Include="Program.cs" /> |
|
57 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
|
58 |
<Compile Include="Topology.cs" /> |
|
59 |
<EmbeddedResource Include="MainForm.resx"> |
|
60 |
<DependentUpon>MainForm.cs</DependentUpon> |
|
61 |
</EmbeddedResource> |
|
62 |
<EmbeddedResource Include="Properties\Resources.resx"> |
|
63 |
<Generator>ResXFileCodeGenerator</Generator> |
|
64 |
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
|
65 |
<SubType>Designer</SubType> |
|
66 |
</EmbeddedResource> |
|
67 |
<Compile Include="Properties\Resources.Designer.cs"> |
|
68 |
<AutoGen>True</AutoGen> |
|
69 |
<DependentUpon>Resources.resx</DependentUpon> |
|
70 |
</Compile> |
|
71 |
<None Include="Properties\Settings.settings"> |
|
72 |
<Generator>SettingsSingleFileGenerator</Generator> |
|
73 |
<LastGenOutput>Settings.Designer.cs</LastGenOutput> |
|
74 |
</None> |
|
75 |
<Compile Include="Properties\Settings.Designer.cs"> |
|
76 |
<AutoGen>True</AutoGen> |
|
77 |
<DependentUpon>Settings.settings</DependentUpon> |
|
78 |
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
|
79 |
</Compile> |
|
80 |
</ItemGroup> |
|
81 |
<ItemGroup> |
|
82 |
<None Include="App.config" /> |
|
83 |
</ItemGroup> |
|
84 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
|
85 |
</Project> |
DTI_PID/ID2PSN/Item.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 ID2PSN |
|
8 |
{ |
|
9 |
public enum ItemType |
|
10 |
{ |
|
11 |
None, |
|
12 |
Symbol, |
|
13 |
Line |
|
14 |
} |
|
15 |
public class Item |
|
16 |
{ |
|
17 |
public string UID { get; set; } |
|
18 |
public string Type { get; set; } |
|
19 |
public string Name { get; set; } |
|
20 |
public string Owner { get; set; } |
|
21 |
public List<Relation> Relations { get; set; } |
|
22 |
public List<Attribute> Attributes { get; set; } |
|
23 |
public ItemType ItemType { get; set; } |
|
24 |
} |
|
25 |
|
|
26 |
public class Relation |
|
27 |
{ |
|
28 |
public string UID { get; set; } |
|
29 |
public Item Item { get; set; } |
|
30 |
public double[] Point { get; set; } |
|
31 |
} |
|
32 |
public class Attribute |
|
33 |
{ |
|
34 |
public string UID { get; set; } |
|
35 |
public string Name { get; set; } |
|
36 |
public string DisplayName { get; set; } |
|
37 |
public string Value { get; set; } |
|
38 |
} |
|
39 |
public class LineNumber |
|
40 |
{ |
|
41 |
public string UID { get; set; } |
|
42 |
public string Name { get; set; } |
|
43 |
public List<Attribute> Attributes { get; set; } |
|
44 |
} |
|
45 |
|
|
46 |
public class RunInfo |
|
47 |
{ |
|
48 |
public RunInfo() |
|
49 |
{ |
|
50 |
Items = new List<Item>(); |
|
51 |
} |
|
52 |
public string UID { get; set; } |
|
53 |
public int Index { get; set; } |
|
54 |
public List<Item> Items { get; set; } |
|
55 |
} |
|
56 |
|
|
57 |
public class Group |
|
58 |
{ |
|
59 |
public string UID { get; set; } |
|
60 |
public List<Item> Items { get; set; } |
|
61 |
|
|
62 |
} |
|
63 |
} |
DTI_PID/ID2PSN/MainForm.Designer.cs | ||
---|---|---|
1 |
namespace ID2PSN |
|
2 |
{ |
|
3 |
partial class MainForm |
|
4 |
{ |
|
5 |
/// <summary> |
|
6 |
/// 필수 디자이너 변수입니다. |
|
7 |
/// </summary> |
|
8 |
private System.ComponentModel.IContainer components = null; |
|
9 |
|
|
10 |
/// <summary> |
|
11 |
/// 사용 중인 모든 리소스를 정리합니다. |
|
12 |
/// </summary> |
|
13 |
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param> |
|
14 |
protected override void Dispose(bool disposing) |
|
15 |
{ |
|
16 |
if (disposing && (components != null)) |
|
17 |
{ |
|
18 |
components.Dispose(); |
|
19 |
} |
|
20 |
base.Dispose(disposing); |
|
21 |
} |
|
22 |
|
|
23 |
#region Windows Form 디자이너에서 생성한 코드 |
|
24 |
|
|
25 |
/// <summary> |
|
26 |
/// 디자이너 지원에 필요한 메서드입니다. |
|
27 |
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. |
|
28 |
/// </summary> |
|
29 |
private void InitializeComponent() |
|
30 |
{ |
|
31 |
this.SuspendLayout(); |
|
32 |
// |
|
33 |
// MainForm |
|
34 |
// |
|
35 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); |
|
36 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
37 |
this.ClientSize = new System.Drawing.Size(800, 450); |
|
38 |
this.Name = "MainForm"; |
|
39 |
this.Text = "ID2 PSN"; |
|
40 |
this.Load += new System.EventHandler(this.MainForm_Load); |
|
41 |
this.ResumeLayout(false); |
|
42 |
|
|
43 |
} |
|
44 |
|
|
45 |
#endregion |
|
46 |
} |
|
47 |
} |
|
48 |
|
DTI_PID/ID2PSN/MainForm.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Data; |
|
5 |
using System.Drawing; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 |
using System.Windows.Forms; |
|
10 |
|
|
11 |
namespace ID2PSN |
|
12 |
{ |
|
13 |
public partial class MainForm : Form |
|
14 |
{ |
|
15 |
public MainForm() |
|
16 |
{ |
|
17 |
InitializeComponent(); |
|
18 |
} |
|
19 |
|
|
20 |
private void MainForm_Load(object sender, EventArgs e) |
|
21 |
{ |
|
22 |
Topology topology = new Topology(@"D:\Projects\POSCO\Temp\ADMIN_TEST.xml"); |
|
23 |
//Topology topology = new Topology(@"C:\Users\gaqhf\Desktop\TF1-2G43-9910-모형.xml"); |
|
24 |
} |
|
25 |
} |
|
26 |
} |
DTI_PID/ID2PSN/MainForm.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
</root> |
DTI_PID/ID2PSN/Program.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Threading.Tasks; |
|
5 |
using System.Windows.Forms; |
|
6 |
|
|
7 |
namespace ID2PSN |
|
8 |
{ |
|
9 |
static class Program |
|
10 |
{ |
|
11 |
/// <summary> |
|
12 |
/// 해당 애플리케이션의 주 진입점입니다. |
|
13 |
/// </summary> |
|
14 |
[STAThread] |
|
15 |
static void Main() |
|
16 |
{ |
|
17 |
Application.EnableVisualStyles(); |
|
18 |
Application.SetCompatibleTextRenderingDefault(false); |
|
19 |
Application.Run(new MainForm()); |
|
20 |
} |
|
21 |
} |
|
22 |
} |
DTI_PID/ID2PSN/Properties/AssemblyInfo.cs | ||
---|---|---|
1 |
using System.Reflection; |
|
2 |
using System.Runtime.CompilerServices; |
|
3 |
using System.Runtime.InteropServices; |
|
4 |
|
|
5 |
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 |
|
6 |
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 |
|
7 |
// 이러한 특성 값을 변경하세요. |
|
8 |
[assembly: AssemblyTitle("ID2PSN")] |
|
9 |
[assembly: AssemblyDescription("")] |
|
10 |
[assembly: AssemblyConfiguration("")] |
|
11 |
[assembly: AssemblyCompany("")] |
|
12 |
[assembly: AssemblyProduct("ID2PSN")] |
|
13 |
[assembly: AssemblyCopyright("Copyright © 2021")] |
|
14 |
[assembly: AssemblyTrademark("")] |
|
15 |
[assembly: AssemblyCulture("")] |
|
16 |
|
|
17 |
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에 |
|
18 |
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면 |
|
19 |
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요. |
|
20 |
[assembly: ComVisible(false)] |
|
21 |
|
|
22 |
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. |
|
23 |
[assembly: Guid("202b8b3f-2070-4643-a43b-2c57b36b8d63")] |
|
24 |
|
|
25 |
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. |
|
26 |
// |
|
27 |
// 주 버전 |
|
28 |
// 부 버전 |
|
29 |
// 빌드 번호 |
|
30 |
// 수정 버전 |
|
31 |
// |
|
32 |
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 |
|
33 |
// 기본값으로 할 수 있습니다. |
|
34 |
// [assembly: AssemblyVersion("1.0.*")] |
|
35 |
[assembly: AssemblyVersion("1.0.0.0")] |
|
36 |
[assembly: AssemblyFileVersion("1.0.0.0")] |
DTI_PID/ID2PSN/Properties/Resources.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// 이 코드는 도구를 사용하여 생성되었습니다. |
|
4 |
// 런타임 버전:4.0.30319.42000 |
|
5 |
// |
|
6 |
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 |
|
7 |
// 이러한 변경 내용이 손실됩니다. |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace ID2PSN.Properties |
|
12 |
{ |
|
13 |
|
|
14 |
|
|
15 |
/// <summary> |
|
16 |
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. |
|
17 |
/// </summary> |
|
18 |
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder |
|
19 |
// 클래스에서 자동으로 생성되었습니다. |
|
20 |
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여 |
|
21 |
// ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오. |
|
22 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] |
|
23 |
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
|
24 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
25 |
internal class Resources |
|
26 |
{ |
|
27 |
|
|
28 |
private static global::System.Resources.ResourceManager resourceMan; |
|
29 |
|
|
30 |
private static global::System.Globalization.CultureInfo resourceCulture; |
|
31 |
|
|
32 |
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
|
33 |
internal Resources() |
|
34 |
{ |
|
35 |
} |
|
36 |
|
|
37 |
/// <summary> |
|
38 |
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. |
|
39 |
/// </summary> |
|
40 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
41 |
internal static global::System.Resources.ResourceManager ResourceManager |
|
42 |
{ |
|
43 |
get |
|
44 |
{ |
|
45 |
if ((resourceMan == null)) |
|
46 |
{ |
|
47 |
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ID2PSN.Properties.Resources", typeof(Resources).Assembly); |
|
48 |
resourceMan = temp; |
|
49 |
} |
|
50 |
return resourceMan; |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
54 |
/// <summary> |
|
55 |
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 |
|
56 |
/// 재정의합니다. |
|
57 |
/// </summary> |
|
58 |
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
|
59 |
internal static global::System.Globalization.CultureInfo Culture |
|
60 |
{ |
|
61 |
get |
|
62 |
{ |
|
63 |
return resourceCulture; |
|
64 |
} |
|
65 |
set |
|
66 |
{ |
|
67 |
resourceCulture = value; |
|
68 |
} |
|
69 |
} |
|
70 |
} |
|
71 |
} |
DTI_PID/ID2PSN/Properties/Resources.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
64 |
<xsd:complexType> |
|
65 |
<xsd:choice maxOccurs="unbounded"> |
|
66 |
<xsd:element name="metadata"> |
|
67 |
<xsd:complexType> |
|
68 |
<xsd:sequence> |
|
69 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
70 |
</xsd:sequence> |
|
71 |
<xsd:attribute name="name" type="xsd:string" /> |
|
72 |
<xsd:attribute name="type" type="xsd:string" /> |
|
73 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
74 |
</xsd:complexType> |
|
75 |
</xsd:element> |
|
76 |
<xsd:element name="assembly"> |
|
77 |
<xsd:complexType> |
|
78 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
79 |
<xsd:attribute name="name" type="xsd:string" /> |
|
80 |
</xsd:complexType> |
|
81 |
</xsd:element> |
|
82 |
<xsd:element name="data"> |
|
83 |
<xsd:complexType> |
|
84 |
<xsd:sequence> |
|
85 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
86 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
87 |
</xsd:sequence> |
|
88 |
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> |
|
89 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
90 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
91 |
</xsd:complexType> |
|
92 |
</xsd:element> |
|
93 |
<xsd:element name="resheader"> |
|
94 |
<xsd:complexType> |
|
95 |
<xsd:sequence> |
|
96 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
97 |
</xsd:sequence> |
|
98 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
99 |
</xsd:complexType> |
|
100 |
</xsd:element> |
|
101 |
</xsd:choice> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:schema> |
|
105 |
<resheader name="resmimetype"> |
|
106 |
<value>text/microsoft-resx</value> |
|
107 |
</resheader> |
|
108 |
<resheader name="version"> |
|
109 |
<value>2.0</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="reader"> |
|
112 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="writer"> |
|
115 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
</root> |
DTI_PID/ID2PSN/Properties/Settings.Designer.cs | ||
---|---|---|
1 |
//------------------------------------------------------------------------------ |
|
2 |
// <auto-generated> |
|
3 |
// This code was generated by a tool. |
|
4 |
// Runtime Version:4.0.30319.42000 |
|
5 |
// |
|
6 |
// Changes to this file may cause incorrect behavior and will be lost if |
|
7 |
// the code is regenerated. |
|
8 |
// </auto-generated> |
|
9 |
//------------------------------------------------------------------------------ |
|
10 |
|
|
11 |
namespace ID2PSN.Properties |
|
12 |
{ |
|
13 |
|
|
14 |
|
|
15 |
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
|
16 |
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] |
|
17 |
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase |
|
18 |
{ |
|
19 |
|
|
20 |
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); |
|
21 |
|
|
22 |
public static Settings Default |
|
23 |
{ |
|
24 |
get |
|
25 |
{ |
|
26 |
return defaultInstance; |
|
27 |
} |
|
28 |
} |
|
29 |
} |
|
30 |
} |
DTI_PID/ID2PSN/Properties/Settings.settings | ||
---|---|---|
1 |
<?xml version='1.0' encoding='utf-8'?> |
|
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"> |
|
3 |
<Profiles> |
|
4 |
<Profile Name="(Default)" /> |
|
5 |
</Profiles> |
|
6 |
<Settings /> |
|
7 |
</SettingsFile> |
DTI_PID/ID2PSN/Topology.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.IO; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
using System.Xml.Linq; |
|
8 |
|
|
9 |
namespace ID2PSN |
|
10 |
{ |
|
11 |
public class Topology |
|
12 |
{ |
|
13 |
public string DrawingName { get; set; } |
|
14 |
public string FileName { get; set; } |
|
15 |
public string FilePath { get; set; } |
|
16 |
public List<Item> Items { get; set; } |
|
17 |
public List<LineNumber> LineNumbers { get; set; } |
|
18 |
public List<RunInfo> RunInfos { get; set; } |
|
19 |
|
|
20 |
public Topology(string filePath) |
|
21 |
{ |
|
22 |
FilePath = filePath; |
|
23 |
ReadFile(); |
|
24 |
SetRelationItem(); |
|
25 |
SetTopology(); |
|
26 |
} |
|
27 |
private void ReadFile() |
|
28 |
{ |
|
29 |
XElement xml = XElement.Load(FilePath); |
|
30 |
FileName = Path.GetFileNameWithoutExtension(FilePath); |
|
31 |
DrawingName = xml.Element("DWGNAME").Value; |
|
32 |
Items = new List<Item>(); |
|
33 |
LineNumbers = new List<LineNumber>(); |
|
34 |
RunInfos = new List<RunInfo>(); |
|
35 |
|
|
36 |
foreach (XElement element in xml.Element("SYMBOLS").Elements("SYMBOL")) |
|
37 |
Items.Add(GetSymbolItem(element)); |
|
38 |
foreach (XElement element in xml.Element("LINEINFOS").Elements("LINE")) |
|
39 |
Items.Add(GetLineItem(element)); |
|
40 |
foreach (XElement element in xml.Element("LINENOS").Elements("LINE_NO")) |
|
41 |
LineNumbers.Add(GetLineNumber(element)); |
|
42 |
|
|
43 |
SetRunInfo(xml); |
|
44 |
} |
|
45 |
private Item GetSymbolItem(XElement element) |
|
46 |
{ |
|
47 |
Item item = new Item(); |
|
48 |
item.UID = element.Element("UID").Value; |
|
49 |
item.Name = element.Element("NAME").Value; |
|
50 |
item.Type = element.Element("TYPE").Value; |
|
51 |
item.Owner = element.Element("OWNER").Value; |
|
52 |
|
|
53 |
item.Relations = GetRelations(element.Element("CONNECTORS")); |
|
54 |
item.Attributes = GetAttributes(element.Element("SYMBOLATTRIBUTES")); |
|
55 |
item.ItemType = ItemType.Symbol; |
|
56 |
|
|
57 |
return item; |
|
58 |
} |
|
59 |
private Item GetLineItem(XElement element) |
|
60 |
{ |
|
61 |
Item item = new Item(); |
|
62 |
item.UID = element.Element("UID").Value; |
|
63 |
item.Name = element.Element("TYPE").Value; |
|
64 |
item.Type = element.Element("TYPE").Value; |
|
65 |
item.Owner = element.Attribute("OWNER").Value; |
|
66 |
|
|
67 |
item.Relations = GetRelations(element.Element("CONNECTORS")); |
|
68 |
item.Attributes = GetAttributes(element.Element("SYMBOLATTRIBUTES")); |
|
69 |
item.ItemType = ItemType.Line; |
|
70 |
|
|
71 |
return item; |
|
72 |
} |
|
73 |
private LineNumber GetLineNumber(XElement element) |
|
74 |
{ |
|
75 |
LineNumber lineNumber = new LineNumber(); |
|
76 |
lineNumber.UID = element.Element("UID").Value; |
|
77 |
lineNumber.Name = element.Element("TEXT").Value; |
|
78 |
lineNumber.Attributes = GetAttributes(element); |
|
79 |
return lineNumber; |
|
80 |
} |
|
81 |
private List<Relation> GetRelations(XElement element) |
|
82 |
{ |
|
83 |
List<Relation> result = new List<Relation>(); |
|
84 |
foreach (XElement item in element.Elements("CONNECTOR")) |
|
85 |
{ |
|
86 |
string[] sPoint = item.Element("SCENECONNECTPOINT").Value.Split(new char[] { ',' }); |
|
87 |
result.Add(new Relation() |
|
88 |
{ |
|
89 |
UID = item.Element("CONNECTEDITEM").Value, |
|
90 |
Point = new double[] { Convert.ToDouble(sPoint[0]) , Convert.ToDouble(sPoint[1]) } |
|
91 |
}); |
|
92 |
} |
|
93 |
|
|
94 |
return result; |
|
95 |
} |
|
96 |
private List<Attribute> GetAttributes(XElement element) |
|
97 |
{ |
|
98 |
List<Attribute> result = new List<Attribute>(); |
|
99 |
foreach (XElement item in element.Elements("ATTRIBUTE")) |
|
100 |
{ |
|
101 |
result.Add(new Attribute() |
|
102 |
{ |
|
103 |
UID = item.Attribute("UID").Value, |
|
104 |
Name = item.Attribute("Attribute").Value, |
|
105 |
DisplayName = item.Attribute("DisplayAttribute").Value, |
|
106 |
Value = item.Value |
|
107 |
}); |
|
108 |
} |
|
109 |
return result; |
|
110 |
} |
|
111 |
private void SetRelationItem() |
|
112 |
{ |
|
113 |
foreach (Item item in Items) |
|
114 |
foreach (Relation relation in item.Relations) |
|
115 |
relation.Item = Items.Find(x => x.UID.Equals(relation.UID)); |
|
116 |
} |
|
117 |
private void SetTopology() |
|
118 |
{ |
|
119 |
List<Item> orderItems = Items.OrderByDescending(x => x.ItemType == ItemType.Line).ToList(); |
|
120 |
|
|
121 |
Dictionary<Item, string> groupDic = new Dictionary<Item, string>(); |
|
122 |
foreach (Item item in orderItems) |
|
123 |
groupDic.Add(item, Guid.NewGuid().ToString()); |
|
124 |
|
|
125 |
foreach (Item item in orderItems) |
|
126 |
{ |
|
127 |
string groupKey = groupDic[item]; |
|
128 |
if (item.ItemType == ItemType.Line) |
|
129 |
{ |
|
130 |
GroupingForwardLine(); |
|
131 |
GroupingBackwardLine(); |
|
132 |
} |
|
133 |
|
|
134 |
void GroupingForwardLine() |
|
135 |
{ |
|
136 |
Item connItem = item.Relations[1].Item; |
|
137 |
if (connItem != null && IsConnected(connItem, item)) |
|
138 |
{ |
|
139 |
if (connItem.ItemType == ItemType.Line && item.Equals(connItem.Relations[0].Item)) |
|
140 |
ChangeGroupID(groupDic[connItem], groupKey); |
|
141 |
else if (connItem.ItemType == ItemType.Symbol) |
|
142 |
{ |
|
143 |
List<Item> allConnItems = GetConnectedLines(connItem); |
|
144 |
allConnItems.Remove(item); |
|
145 |
List<Item> connItems = GetConnectedForwardLines(connItem); |
|
146 |
if (allConnItems.Count.Equals(1) && connItems.Count.Equals(1) && allConnItems[0].Equals(connItems[0])) |
|
147 |
{ |
|
148 |
List<Item> connSymbols = GetConnectedSymbols(connItem); |
|
149 |
foreach (Item loopItem in connSymbols) |
|
150 |
ChangeGroupID(groupDic[loopItem], groupKey); |
|
151 |
} |
|
152 |
else |
|
153 |
{ |
|
154 |
List<Item> endItems = new List<Item>(); |
|
155 |
Stack<Item> stacks = new Stack<Item>(); |
|
156 |
stacks.Push(connItem); |
|
157 |
while (stacks.Count > 0) |
|
158 |
{ |
|
159 |
Item stack = stacks.Pop(); |
|
160 |
if (endItems.Contains(stack)) |
|
161 |
continue; |
|
162 |
endItems.Add(stack); |
|
163 |
|
|
164 |
if (GetConnectedItemCount(stack) < 3) |
|
165 |
{ |
|
166 |
ChangeGroupID(groupDic[stack], groupKey); |
|
167 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
168 |
foreach (Relation relation in relations) |
|
169 |
stacks.Push(relation.Item); |
|
170 |
} |
|
171 |
else if(IsSameRun(item, stack)) |
|
172 |
{ |
|
173 |
ChangeGroupID(groupDic[stack], groupKey); |
|
174 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol && IsSameRun(item, x.Item)); |
|
175 |
foreach (Relation relation in relations) |
|
176 |
stacks.Push(relation.Item); |
|
177 |
} |
|
178 |
} |
|
179 |
} |
|
180 |
} |
|
181 |
} |
|
182 |
} |
|
183 |
void GroupingBackwardLine() |
|
184 |
{ |
|
185 |
Item connItem = item.Relations[0].Item; |
|
186 |
if (connItem != null && IsConnected(connItem, item)) |
|
187 |
{ |
|
188 |
if (connItem.ItemType == ItemType.Line && item.Equals(connItem.Relations[1].Item)) |
|
189 |
ChangeGroupID(groupDic[connItem], groupKey); |
|
190 |
else if (connItem.ItemType == ItemType.Symbol) |
|
191 |
{ |
|
192 |
List<Item> allConnItems = GetConnectedLines(connItem); |
|
193 |
allConnItems.Remove(item); |
|
194 |
List<Item> connItems = GetConnectedBackwardLines(connItem); |
|
195 |
if (allConnItems.Count.Equals(1) && connItems.Count.Equals(1) && allConnItems[0].Equals(connItems[0])) |
|
196 |
{ |
|
197 |
List<Item> connSymbols = GetConnectedSymbols(connItem); |
|
198 |
foreach (Item loopItem in connSymbols) |
|
199 |
ChangeGroupID(groupDic[loopItem], groupKey); |
|
200 |
} |
|
201 |
else |
|
202 |
{ |
|
203 |
List<Item> endItems = new List<Item>(); |
|
204 |
Stack<Item> stacks = new Stack<Item>(); |
|
205 |
stacks.Push(connItem); |
|
206 |
while (stacks.Count > 0) |
|
207 |
{ |
|
208 |
Item stack = stacks.Pop(); |
|
209 |
if (endItems.Contains(stack)) |
|
210 |
continue; |
|
211 |
endItems.Add(stack); |
|
212 |
|
|
213 |
if (GetConnectedItemCount(stack) < 3) |
|
214 |
{ |
|
215 |
ChangeGroupID(groupDic[stack], groupKey); |
|
216 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
217 |
foreach (Relation relation in relations) |
|
218 |
stacks.Push(relation.Item); |
|
219 |
} |
|
220 |
else if (IsSameRun(item, stack)) |
|
221 |
{ |
|
222 |
ChangeGroupID(groupDic[stack], groupKey); |
|
223 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol && IsSameRun(item, x.Item)); |
|
224 |
foreach (Relation relation in relations) |
|
225 |
stacks.Push(relation.Item); |
|
226 |
} |
|
227 |
} |
|
228 |
} |
|
229 |
} |
|
230 |
} |
|
231 |
} |
|
232 |
#region before |
|
233 |
//if (item.ItemType == ItemType.Line) |
|
234 |
//{ |
|
235 |
// Item startItem = item.Relations[0].Item; |
|
236 |
// Item endItem = item.Relations[1].Item; |
|
237 |
// if (startItem != null && startItem.ItemType == ItemType.Line && |
|
238 |
// startItem.Relations[1] != null && startItem.Relations[1].Item.Equals(item) && |
|
239 |
// !groupDic[startItem].Equals(groupKey)) |
|
240 |
// ChangeGroupID(groupDic[startItem], groupKey); |
|
241 |
// if (endItem != null && endItem.ItemType == ItemType.Line && |
|
242 |
// endItem.Relations[0] != null && endItem.Relations[0].Item.Equals(item) && |
|
243 |
// !groupDic[endItem].Equals(groupKey)) |
|
244 |
// ChangeGroupID(groupDic[endItem], groupKey); |
|
245 |
//} |
|
246 |
//else if (item.ItemType == ItemType.Symbol) |
|
247 |
//{ |
|
248 |
// int connCount = GetConnectedItemCount(item); |
|
249 |
// if (connCount.Equals(1)) |
|
250 |
// { |
|
251 |
// Item connItem = item.Relations.Find(x => x.Item != null).Item; |
|
252 |
// if (!groupDic[connItem].Equals(groupKey)) |
|
253 |
// ChangeGroupID(groupDic[connItem], groupKey); |
|
254 |
// } |
|
255 |
// else if (connCount < 3) |
|
256 |
// { |
|
257 |
// List<Item> connItems = item.Relations.FindAll(x => x.Item != null).Select(x => x.Item).ToList(); |
|
258 |
// foreach (Item connItem in connItems) |
|
259 |
// { |
|
260 |
// if (GetConnectedItemCount) |
|
261 |
// { |
|
262 |
|
|
263 |
// } |
|
264 |
// } |
|
265 |
// } |
|
266 |
// else |
|
267 |
// { |
|
268 |
|
|
269 |
// } |
|
270 |
//} |
|
271 |
//else |
|
272 |
// throw new Exception("logic error!"); |
|
273 |
#endregion |
|
274 |
} |
|
275 |
|
|
276 |
#region before |
|
277 |
//List<Item> endItems = new List<Item>(); |
|
278 |
//foreach (Item item in orderItems) |
|
279 |
//{ |
|
280 |
// Stack<Item> stacks = new Stack<Item>(); |
|
281 |
// stacks.Push(item); |
|
282 |
// while (stacks.Count > 0) |
|
283 |
// { |
|
284 |
// Item stack = stacks.Pop(); |
|
285 |
// if (endItems.Contains(stack)) |
|
286 |
// continue; |
|
287 |
// endItems.Add(stack); |
|
288 |
|
|
289 |
// if (stack.ItemType == ItemType.Line) |
|
290 |
// { |
|
291 |
// Item startItem = stack.Relations[0].Item; |
|
292 |
// Item endItem = stack.Relations[1].Item; |
|
293 |
// if (startItem != null && startItem.ItemType == ItemType.Line && |
|
294 |
// startItem.Relations[1] != null && startItem.Relations[1].Item.Equals(stack)) |
|
295 |
// { |
|
296 |
|
|
297 |
// } |
|
298 |
// if (endItem != null && endItem.ItemType == ItemType.Line && |
|
299 |
// endItem.Relations[0] != null && endItem.Relations[0].Item.Equals(stack)) |
|
300 |
// { |
|
301 |
|
|
302 |
// } |
|
303 |
// } |
|
304 |
// else if (stack.ItemType == ItemType.Symbol) |
|
305 |
// { |
|
306 |
// int connCount = GetConnectedItemCount(stack); |
|
307 |
// if (connCount < 3) |
|
308 |
// { |
|
309 |
|
|
310 |
// } |
|
311 |
// } |
|
312 |
// else |
|
313 |
// throw new Exception("logic error!"); |
|
314 |
// } |
|
315 |
//} |
|
316 |
#endregion |
|
317 |
|
|
318 |
int GetConnectedItemCount(Item item) |
|
319 |
{ |
|
320 |
return item.Relations.FindAll(x => x.Item != null).Count; |
|
321 |
} |
|
322 |
|
|
323 |
List<Item> GetConnectedLines(Item item) |
|
324 |
{ |
|
325 |
List<Item> result = new List<Item>(); |
|
326 |
List<Item> end = new List<Item>(); |
|
327 |
Stack<Item> stacks = new Stack<Item>(); |
|
328 |
stacks.Push(item); |
|
329 |
while (stacks.Count > 0) |
|
330 |
{ |
|
331 |
Item stack = stacks.Pop(); |
|
332 |
if (end.Contains(stack) || stack.ItemType != ItemType.Symbol) |
|
333 |
continue; |
|
334 |
end.Add(stack); |
|
335 |
|
|
336 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
337 |
foreach (Relation relation in relations) |
|
338 |
stacks.Push(relation.Item); |
|
339 |
|
|
340 |
relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Line); |
|
341 |
foreach (Relation relation in relations) |
|
342 |
{ |
|
343 |
result.Add(relation.Item); |
|
344 |
end.Add(relation.Item); |
|
345 |
} |
|
346 |
} |
|
347 |
|
|
348 |
return result; |
|
349 |
} |
|
350 |
|
|
351 |
List<Item> GetConnectedForwardLines(Item item) |
|
352 |
{ |
|
353 |
List<Item> result = new List<Item>(); |
|
354 |
List<Item> end = new List<Item>(); |
|
355 |
Stack<Item> stacks = new Stack<Item>(); |
|
356 |
stacks.Push(item); |
|
357 |
while (stacks.Count > 0) |
|
358 |
{ |
|
359 |
Item stack = stacks.Pop(); |
|
360 |
if (end.Contains(stack) || stack.ItemType != ItemType.Symbol) |
|
361 |
continue; |
|
362 |
end.Add(stack); |
|
363 |
|
|
364 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
365 |
foreach (Relation relation in relations) |
|
366 |
stacks.Push(relation.Item); |
|
367 |
|
|
368 |
relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Line); |
|
369 |
foreach (Relation relation in relations) |
|
370 |
{ |
|
371 |
if (relation.Item.Relations.FindIndex(x => x.Item != null && x.Item.Equals(stack)).Equals(0)) |
|
372 |
result.Add(relation.Item); |
|
373 |
|
|
374 |
end.Add(relation.Item); |
|
375 |
} |
|
376 |
} |
|
377 |
|
|
378 |
return result; |
|
379 |
} |
|
380 |
|
|
381 |
List<Item> GetConnectedBackwardLines(Item item) |
|
382 |
{ |
|
383 |
List<Item> result = new List<Item>(); |
|
384 |
List<Item> end = new List<Item>(); |
|
385 |
Stack<Item> stacks = new Stack<Item>(); |
|
386 |
stacks.Push(item); |
|
387 |
while (stacks.Count > 0) |
|
388 |
{ |
|
389 |
Item stack = stacks.Pop(); |
|
390 |
if (end.Contains(stack) || stack.ItemType != ItemType.Symbol) |
|
391 |
continue; |
|
392 |
end.Add(stack); |
|
393 |
|
|
394 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
395 |
foreach (Relation relation in relations) |
|
396 |
stacks.Push(relation.Item); |
|
397 |
|
|
398 |
relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Line); |
|
399 |
foreach (Relation relation in relations) |
|
400 |
{ |
|
401 |
if (relation.Item.Relations.FindIndex(x => x.Item != null && x.Item.Equals(stack)).Equals(1)) |
|
402 |
result.Add(relation.Item); |
|
403 |
|
|
404 |
end.Add(relation.Item); |
|
405 |
} |
|
406 |
} |
|
407 |
|
|
408 |
return result; |
|
409 |
} |
|
410 |
|
|
411 |
List<Item> GetConnectedSymbols(Item item) |
|
412 |
{ |
|
413 |
List<Item> result = new List<Item>(); |
|
414 |
List<Item> end = new List<Item>(); |
|
415 |
Stack<Item> stacks = new Stack<Item>(); |
|
416 |
stacks.Push(item); |
|
417 |
while (stacks.Count > 0) |
|
418 |
{ |
|
419 |
Item stack = stacks.Pop(); |
|
420 |
if (end.Contains(stack) || stack.ItemType != ItemType.Symbol) |
|
421 |
continue; |
|
422 |
end.Add(stack); |
|
423 |
result.Add(stack); |
|
424 |
List<Relation> relations = stack.Relations.FindAll(x => x.Item != null && x.Item.ItemType == ItemType.Symbol); |
|
425 |
foreach (Relation relation in relations) |
|
426 |
stacks.Push(relation.Item); |
|
427 |
} |
|
428 |
|
|
429 |
return result; |
|
430 |
} |
|
431 |
|
|
432 |
void ChangeGroupID(string from, string to) |
|
433 |
{ |
|
434 |
if (from.Equals(to)) |
|
435 |
return; |
|
436 |
|
|
437 |
List<Item> changeItems = new List<Item>(); |
|
438 |
foreach (var _item in groupDic) |
|
439 |
if (_item.Value.Equals(from)) |
|
440 |
changeItems.Add(_item.Key); |
|
441 |
foreach (var _item in changeItems) |
|
442 |
groupDic[_item] = to; |
|
443 |
} |
|
444 |
|
|
445 |
bool IsConnected(Item item1, Item item2) |
|
446 |
{ |
|
447 |
if (item1.Relations.Find(x => x.UID.Equals(item2.UID)) != null && |
|
448 |
item2.Relations.Find(x => x.UID.Equals(item1.UID)) != null) |
|
449 |
return true; |
|
450 |
else |
|
451 |
return false; |
|
452 |
} |
|
453 |
|
|
454 |
bool IsSameRun(Item item1, Item item2) |
|
455 |
{ |
|
456 |
return RunInfos.Find(x => x.Items.Contains(item1) && x.Items.Contains(item2)) != null ? true : false; |
|
457 |
} |
|
458 |
} |
|
459 |
private void SetRunInfo(XElement xml) |
|
460 |
{ |
|
461 |
foreach (XElement element in xml.Element("TRIMLINENOS").Elements("TRIM_LINE_NO")) |
|
462 |
{ |
|
463 |
string UID = element.Element("UID").Value; |
|
464 |
int index = 0; |
|
465 |
foreach (XElement run in element.Elements("RUN")) |
|
466 |
{ |
|
467 |
RunInfo runInfo = new RunInfo() { UID = UID }; |
|
468 |
runInfo.Index = index; |
|
469 |
foreach (XElement line in run.Elements("LINE")) |
|
470 |
runInfo.Items.Add(Items.Find(x => x.UID == line.Element("UID").Value)); |
|
471 |
foreach (XElement symbol in run.Elements("SYMBOL")) |
|
472 |
runInfo.Items.Add(Items.Find(x => x.UID == symbol.Element("UID").Value)); |
|
473 |
RunInfos.Add(runInfo); |
|
474 |
index++; |
|
475 |
} |
|
476 |
} |
|
477 |
} |
|
478 |
} |
|
479 |
} |
내보내기 Unified diff