개정판 4f359afa
SPPID Update
DTI_PID/AutoSPPID/AutoSPPID.vb | ||
---|---|---|
1 |
Imports Llama |
|
2 |
Imports Plaice |
|
3 |
|
|
4 |
|
|
5 |
Public Class AutoSPPID |
|
6 |
Dim objPlacement = New Placement |
|
7 |
Public Sub TestPipe() |
|
8 |
Dim datasource As LMADataSource |
|
9 |
datasource = objPlacement.PIDDataSource |
|
10 |
Dim PipeRunLocation As String |
|
11 |
Dim objItem As LMAItem |
|
12 |
|
|
13 |
Dim objConnector As LMConnector |
|
14 |
Dim objInputs As PlaceRunInputs |
|
15 |
Dim objSymbol As LMSymbol |
|
16 |
Dim ValveLocation As String |
|
17 |
PipeRunLocation = "\Piping\Routing\Process Lines\Primary Piping.sym" |
|
18 |
objInputs = New PlaceRunInputs |
|
19 |
objInputs.AddPoint(0.1, 0.1) |
|
20 |
objInputs.AddPoint(0.2, 0.1) |
|
21 |
objItem = objPlacement.PIDCreateItem(PipeRunLocation) |
|
22 |
objConnector = objPlacement.PIDPlaceRun(objItem, objInputs) |
|
23 |
Dim objPipeRun As LMPipeRun = datasource.GetPipeRun(objConnector.ModelItemID) |
|
24 |
|
|
25 |
objPipeRun.Attributes("OperFluidCode").Value = "AFS" |
|
26 |
objPipeRun.Attributes("InsulThick").Value = "25" |
|
27 |
objPipeRun.Attributes("NominalDiameter").Value = "6""" |
|
28 |
objPipeRun.Attributes("PipeRunClass").Value = "Piping" |
|
29 |
objPipeRun.Attributes("pipingmaterialsclass").Value = "NA1S" |
|
30 |
objPipeRun.Commit() |
|
31 |
|
|
32 |
ValveLocation = "\Piping\Valves\2 Way Common\Ball Valve.sym" |
|
33 |
objSymbol = objPlacement.PIDPlaceSymbol(ValveLocation, 0.15, 0.3, , 1.57) |
|
34 |
objInputs = New PlaceRunInputs |
|
35 |
objInputs.AddConnectorTarget(objConnector, 0.15, 0.1) |
|
36 |
objInputs.AddPoint(0.15, 0.15) |
|
37 |
objInputs.AddPoint(0.12, 0.15) |
|
38 |
objInputs.AddPoint(0.12, 0.2) |
|
39 |
objInputs.AddPoint(0.15, 0.2) |
|
40 |
objInputs.AddSymbolTarget(objSymbol, 0.15, 0.3) |
|
41 |
objItem = objPlacement.PIDCreateItem(PipeRunLocation) |
|
42 |
objConnector = objPlacement.PIDPlaceRun(objItem, objInputs) |
|
43 |
objPipeRun = datasource.GetPipeRun(objConnector.ModelItemID) |
|
44 |
objPipeRun.Attributes("flowdirection").Value = "End 1 is downstream (Outlet)" |
|
45 |
objPipeRun.Attributes("SP_JDesignMaxTemp").Value = "-273.15" |
|
46 |
objPipeRun.Attributes("SP_JAltDesignMaxTemp").Value = "-273.15" |
|
47 |
objPipeRun.Commit() |
|
48 |
|
|
49 |
objInputs = New PlaceRunInputs |
|
50 |
objInputs.AddSymbolTarget(objSymbol, 0.15, 0.304) |
|
51 |
' objInputs.AddPoint(0.15, 0.304) |
|
52 |
objInputs.AddPoint(0.15, 0.33) |
|
53 |
objInputs.AddPoint(0.2, 0.33) |
|
54 |
objInputs.AddPoint(0.2, 0.25) |
|
55 |
objInputs.AddSymbolTarget(objSymbol, 0.2765, 0.25) |
|
56 |
objItem = objPlacement.PIDCreateItem(PipeRunLocation) |
|
57 |
objConnector = objPlacement.PIDPlaceRun(objItem, objInputs) |
|
58 |
objPipeRun = datasource.GetPipeRun(objConnector.ModelItemID) |
|
59 |
objPipeRun.Attributes("flowdirection").Value = "End 1 is downstream (Outlet)" |
|
60 |
objPipeRun.Attributes("SP_JDesignMaxTemp").Value = "-273.15 C" |
|
61 |
objPipeRun.Attributes("SP_JAltDesignMaxTemp").Value = "-273.15 C" |
|
62 |
' objPipeRun.Attributes("SP_SP_JAltDesignMaxTempSI").Value = "-273.15 C" |
|
63 |
objPipeRun.Attributes("SP_JAltOperMaxTemp").Value = "-273.15 C" |
|
64 |
' objPipeRun.Attributes("SP_SP_JAltOperMaxTempSI").Value = "-273.15 C" |
|
65 |
objPipeRun.Attributes("SP_JDesignMaxTemp").Value = "-273.15 C" |
|
66 |
' objPipeRun.Attributes("SP_SP_JDesignMaxTempSI").Value = "-273.15 C" |
|
67 |
objPipeRun.Attributes("SP_JOperMaxTemp").Value = "-273.15 C" |
|
68 |
' objPipeRun.Attributes("SP_SP_JOperMaxTempSI").Value = "-273.15 C" |
|
69 |
objPipeRun.Attributes("SP_JTestMaxTemp").Value = "-273.15 C" |
|
70 |
' objPipeRun.Attributes("SP_SP_JTestMaxTempSI").Value = "-273.15 C" |
|
71 |
objPipeRun.Commit() |
|
72 |
|
|
73 |
End Sub |
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
End Class |
DTI_PID/AutoSPPID/AutoSPPID.vbproj | ||
---|---|---|
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>{9D098ED7-D6D2-4762-8A2D-E5824E191039}</ProjectGuid> |
|
8 |
<OutputType>Library</OutputType> |
|
9 |
<RootNamespace>AutoSPPID</RootNamespace> |
|
10 |
<AssemblyName>AutoSPPID</AssemblyName> |
|
11 |
<FileAlignment>512</FileAlignment> |
|
12 |
<MyType>Windows</MyType> |
|
13 |
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> |
|
14 |
</PropertyGroup> |
|
15 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
|
16 |
<DebugSymbols>true</DebugSymbols> |
|
17 |
<DebugType>full</DebugType> |
|
18 |
<DefineDebug>true</DefineDebug> |
|
19 |
<DefineTrace>true</DefineTrace> |
|
20 |
<OutputPath>bin\Debug\</OutputPath> |
|
21 |
<DocumentationFile>AutoSPPID.xml</DocumentationFile> |
|
22 |
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> |
|
23 |
</PropertyGroup> |
|
24 |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
|
25 |
<DebugType>pdbonly</DebugType> |
|
26 |
<DefineDebug>false</DefineDebug> |
|
27 |
<DefineTrace>true</DefineTrace> |
|
28 |
<Optimize>true</Optimize> |
|
29 |
<OutputPath>bin\Release\</OutputPath> |
|
30 |
<DocumentationFile>AutoSPPID.xml</DocumentationFile> |
|
31 |
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> |
|
32 |
</PropertyGroup> |
|
33 |
<PropertyGroup> |
|
34 |
<OptionExplicit>On</OptionExplicit> |
|
35 |
</PropertyGroup> |
|
36 |
<PropertyGroup> |
|
37 |
<OptionCompare>Binary</OptionCompare> |
|
38 |
</PropertyGroup> |
|
39 |
<PropertyGroup> |
|
40 |
<OptionStrict>Off</OptionStrict> |
|
41 |
</PropertyGroup> |
|
42 |
<PropertyGroup> |
|
43 |
<OptionInfer>On</OptionInfer> |
|
44 |
</PropertyGroup> |
|
45 |
<ItemGroup> |
|
46 |
<Reference Include="System" /> |
|
47 |
<Reference Include="System.Data" /> |
|
48 |
<Reference Include="System.Xml" /> |
|
49 |
<Reference Include="System.Core" /> |
|
50 |
<Reference Include="System.Xml.Linq" /> |
|
51 |
<Reference Include="System.Data.DataSetExtensions" /> |
|
52 |
<Reference Include="System.Net.Http" /> |
|
53 |
</ItemGroup> |
|
54 |
<ItemGroup> |
|
55 |
<Import Include="Microsoft.VisualBasic" /> |
|
56 |
<Import Include="System" /> |
|
57 |
<Import Include="System.Collections" /> |
|
58 |
<Import Include="System.Collections.Generic" /> |
|
59 |
<Import Include="System.Data" /> |
|
60 |
<Import Include="System.Diagnostics" /> |
|
61 |
<Import Include="System.Linq" /> |
|
62 |
<Import Include="System.Xml.Linq" /> |
|
63 |
<Import Include="System.Threading.Tasks" /> |
|
64 |
</ItemGroup> |
|
65 |
<ItemGroup> |
|
66 |
<Compile Include="AutoSPPID.vb" /> |
|
67 |
<Compile Include="My Project\AssemblyInfo.vb" /> |
|
68 |
<Compile Include="My Project\Application.Designer.vb"> |
|
69 |
<AutoGen>True</AutoGen> |
|
70 |
<DependentUpon>Application.myapp</DependentUpon> |
|
71 |
</Compile> |
|
72 |
<Compile Include="My Project\Resources.Designer.vb"> |
|
73 |
<AutoGen>True</AutoGen> |
|
74 |
<DesignTime>True</DesignTime> |
|
75 |
<DependentUpon>Resources.resx</DependentUpon> |
|
76 |
</Compile> |
|
77 |
<Compile Include="My Project\Settings.Designer.vb"> |
|
78 |
<AutoGen>True</AutoGen> |
|
79 |
<DependentUpon>Settings.settings</DependentUpon> |
|
80 |
<DesignTimeSharedInput>True</DesignTimeSharedInput> |
|
81 |
</Compile> |
|
82 |
</ItemGroup> |
|
83 |
<ItemGroup> |
|
84 |
<EmbeddedResource Include="My Project\Resources.resx"> |
|
85 |
<Generator>VbMyResourcesResXFileCodeGenerator</Generator> |
|
86 |
<LastGenOutput>Resources.Designer.vb</LastGenOutput> |
|
87 |
<CustomToolNamespace>My.Resources</CustomToolNamespace> |
|
88 |
<SubType>Designer</SubType> |
|
89 |
</EmbeddedResource> |
|
90 |
</ItemGroup> |
|
91 |
<ItemGroup> |
|
92 |
<None Include="My Project\Application.myapp"> |
|
93 |
<Generator>MyApplicationCodeGenerator</Generator> |
|
94 |
<LastGenOutput>Application.Designer.vb</LastGenOutput> |
|
95 |
</None> |
|
96 |
<None Include="My Project\Settings.settings"> |
|
97 |
<Generator>SettingsSingleFileGenerator</Generator> |
|
98 |
<CustomToolNamespace>My</CustomToolNamespace> |
|
99 |
<LastGenOutput>Settings.Designer.vb</LastGenOutput> |
|
100 |
</None> |
|
101 |
</ItemGroup> |
|
102 |
<ItemGroup> |
|
103 |
<COMReference Include="ISPClientData3"> |
|
104 |
<Guid>{A32983E1-A1BD-11D3-BBEE-0800363EAF03}</Guid> |
|
105 |
<VersionMajor>2</VersionMajor> |
|
106 |
<VersionMinor>0</VersionMinor> |
|
107 |
<Lcid>0</Lcid> |
|
108 |
<WrapperTool>tlbimp</WrapperTool> |
|
109 |
<Isolated>False</Isolated> |
|
110 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
111 |
</COMReference> |
|
112 |
<COMReference Include="ISPPropertyInf"> |
|
113 |
<Guid>{E0356D80-06B4-11D2-B793-080036EEB703}</Guid> |
|
114 |
<VersionMajor>1</VersionMajor> |
|
115 |
<VersionMinor>1</VersionMinor> |
|
116 |
<Lcid>0</Lcid> |
|
117 |
<WrapperTool>tlbimp</WrapperTool> |
|
118 |
<Isolated>False</Isolated> |
|
119 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
120 |
</COMReference> |
|
121 |
<COMReference Include="Llama"> |
|
122 |
<Guid>{425D14E8-A0C1-4F4A-9FB8-4D7CA982F144}</Guid> |
|
123 |
<VersionMajor>6</VersionMajor> |
|
124 |
<VersionMinor>0</VersionMinor> |
|
125 |
<Lcid>0</Lcid> |
|
126 |
<WrapperTool>tlbimp</WrapperTool> |
|
127 |
<Isolated>False</Isolated> |
|
128 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
129 |
</COMReference> |
|
130 |
<COMReference Include="NEWENUMWRAPPERLib"> |
|
131 |
<Guid>{58B86513-1FA4-4928-9D79-1076AC6F69EF}</Guid> |
|
132 |
<VersionMajor>1</VersionMajor> |
|
133 |
<VersionMinor>0</VersionMinor> |
|
134 |
<Lcid>0</Lcid> |
|
135 |
<WrapperTool>tlbimp</WrapperTool> |
|
136 |
<Isolated>False</Isolated> |
|
137 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
138 |
</COMReference> |
|
139 |
<COMReference Include="PIDCacheAccessInfLib"> |
|
140 |
<Guid>{CB6C022D-D17C-4E18-9B36-3A0D8B3282A2}</Guid> |
|
141 |
<VersionMajor>1</VersionMajor> |
|
142 |
<VersionMinor>0</VersionMinor> |
|
143 |
<Lcid>0</Lcid> |
|
144 |
<WrapperTool>tlbimp</WrapperTool> |
|
145 |
<Isolated>False</Isolated> |
|
146 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
147 |
</COMReference> |
|
148 |
<COMReference Include="PidObjectManagerInf"> |
|
149 |
<Guid>{534174BA-6991-4F8B-8DD0-FE2E46B6A67C}</Guid> |
|
150 |
<VersionMajor>2</VersionMajor> |
|
151 |
<VersionMinor>0</VersionMinor> |
|
152 |
<Lcid>0</Lcid> |
|
153 |
<WrapperTool>tlbimp</WrapperTool> |
|
154 |
<Isolated>False</Isolated> |
|
155 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
156 |
</COMReference> |
|
157 |
<COMReference Include="Plaice"> |
|
158 |
<Guid>{0CD9BF08-A064-44F4-8A5E-9A39006613FE}</Guid> |
|
159 |
<VersionMajor>5</VersionMajor> |
|
160 |
<VersionMinor>0</VersionMinor> |
|
161 |
<Lcid>0</Lcid> |
|
162 |
<WrapperTool>tlbimp</WrapperTool> |
|
163 |
<Isolated>False</Isolated> |
|
164 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
165 |
</COMReference> |
|
166 |
<COMReference Include="VBA"> |
|
167 |
<Guid>{000204EF-0000-0000-C000-000000000046}</Guid> |
|
168 |
<VersionMajor>6</VersionMajor> |
|
169 |
<VersionMinor>0</VersionMinor> |
|
170 |
<Lcid>9</Lcid> |
|
171 |
<WrapperTool>tlbimp</WrapperTool> |
|
172 |
<Isolated>False</Isolated> |
|
173 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
|
174 |
</COMReference> |
|
175 |
</ItemGroup> |
|
176 |
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> |
|
177 |
</Project> |
DTI_PID/AutoSPPID/My Project/Application.Designer.vb | ||
---|---|---|
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 |
Option Strict On |
|
12 |
Option Explicit On |
|
13 |
|
DTI_PID/AutoSPPID/My Project/Application.myapp | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
|
3 |
<MySubMain>false</MySubMain> |
|
4 |
<SingleInstance>false</SingleInstance> |
|
5 |
<ShutdownMode>0</ShutdownMode> |
|
6 |
<EnableVisualStyles>true</EnableVisualStyles> |
|
7 |
<AuthenticationMode>0</AuthenticationMode> |
|
8 |
<ApplicationType>1</ApplicationType> |
|
9 |
<SaveMySettingsOnExit>true</SaveMySettingsOnExit> |
|
10 |
</MyApplicationData> |
DTI_PID/AutoSPPID/My Project/AssemblyInfo.vb | ||
---|---|---|
1 |
Imports System |
|
2 |
Imports System.Reflection |
|
3 |
Imports System.Runtime.InteropServices |
|
4 |
|
|
5 |
' 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해 |
|
6 |
' 제어됩니다. 어셈블리와 관련된 정보를 수정하려면 |
|
7 |
' 이러한 특성 값을 변경하세요. |
|
8 |
|
|
9 |
' 어셈블리 특성 값을 검토합니다. |
|
10 |
|
|
11 |
<Assembly: AssemblyTitle("AutoSPPID")> |
|
12 |
<Assembly: AssemblyDescription("")> |
|
13 |
<Assembly: AssemblyCompany("")> |
|
14 |
<Assembly: AssemblyProduct("AutoSPPID")> |
|
15 |
<Assembly: AssemblyCopyright("Copyright © 2018")> |
|
16 |
<Assembly: AssemblyTrademark("")> |
|
17 |
|
|
18 |
<Assembly: ComVisible(False)> |
|
19 |
|
|
20 |
'이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다. |
|
21 |
<Assembly: Guid("c692d11c-ab58-410d-8d2b-6a1124163ba1")> |
|
22 |
|
|
23 |
' 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다. |
|
24 |
' |
|
25 |
' 주 버전 |
|
26 |
' 부 버전 |
|
27 |
' 빌드 번호 |
|
28 |
' 수정 버전 |
|
29 |
' |
|
30 |
' 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호가 자동으로 |
|
31 |
' 지정되도록 할 수 있습니다. |
|
32 |
' <Assembly: AssemblyVersion("1.0.*")> |
|
33 |
|
|
34 |
<Assembly: AssemblyVersion("1.0.0.0")> |
|
35 |
<Assembly: AssemblyFileVersion("1.0.0.0")> |
DTI_PID/AutoSPPID/My Project/Resources.Designer.vb | ||
---|---|---|
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 |
Option Strict On |
|
12 |
Option Explicit On |
|
13 |
|
|
14 |
|
|
15 |
Namespace My.Resources |
|
16 |
|
|
17 |
'This class was auto-generated by the StronglyTypedResourceBuilder |
|
18 |
'class via a tool like ResGen or Visual Studio. |
|
19 |
'To add or remove a member, edit your .ResX file then rerun ResGen |
|
20 |
'with the /str option, or rebuild your VS project. |
|
21 |
'''<summary> |
|
22 |
''' A strongly-typed resource class, for looking up localized strings, etc. |
|
23 |
'''</summary> |
|
24 |
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ |
|
25 |
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ |
|
26 |
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ |
|
27 |
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ |
|
28 |
Friend Module Resources |
|
29 |
|
|
30 |
Private resourceMan As Global.System.Resources.ResourceManager |
|
31 |
|
|
32 |
Private resourceCulture As Global.System.Globalization.CultureInfo |
|
33 |
|
|
34 |
'''<summary> |
|
35 |
''' Returns the cached ResourceManager instance used by this class. |
|
36 |
'''</summary> |
|
37 |
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ |
|
38 |
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager |
|
39 |
Get |
|
40 |
If Object.ReferenceEquals(resourceMan, Nothing) Then |
|
41 |
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("AutoSPPID.Resources", GetType(Resources).Assembly) |
|
42 |
resourceMan = temp |
|
43 |
End If |
|
44 |
Return resourceMan |
|
45 |
End Get |
|
46 |
End Property |
|
47 |
|
|
48 |
'''<summary> |
|
49 |
''' Overrides the current thread's CurrentUICulture property for all |
|
50 |
''' resource lookups using this strongly typed resource class. |
|
51 |
'''</summary> |
|
52 |
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ |
|
53 |
Friend Property Culture() As Global.System.Globalization.CultureInfo |
|
54 |
Get |
|
55 |
Return resourceCulture |
|
56 |
End Get |
|
57 |
Set(ByVal value As Global.System.Globalization.CultureInfo) |
|
58 |
resourceCulture = value |
|
59 |
End Set |
|
60 |
End Property |
|
61 |
End Module |
|
62 |
End Namespace |
DTI_PID/AutoSPPID/My Project/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/AutoSPPID/My Project/Settings.Designer.vb | ||
---|---|---|
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 |
Option Strict On |
|
12 |
Option Explicit On |
|
13 |
|
|
14 |
|
|
15 |
Namespace My |
|
16 |
|
|
17 |
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ |
|
18 |
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _ |
|
19 |
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ |
|
20 |
Partial Friend NotInheritable Class MySettings |
|
21 |
Inherits Global.System.Configuration.ApplicationSettingsBase |
|
22 |
|
|
23 |
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) |
|
24 |
|
|
25 |
#Region "My.Settings Auto-Save Functionality" |
|
26 |
#If _MyType = "WindowsForms" Then |
|
27 |
Private Shared addedHandler As Boolean |
|
28 |
|
|
29 |
Private Shared addedHandlerLockObject As New Object |
|
30 |
|
|
31 |
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ |
|
32 |
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) |
|
33 |
If My.Application.SaveMySettingsOnExit Then |
|
34 |
My.Settings.Save() |
|
35 |
End If |
|
36 |
End Sub |
|
37 |
#End If |
|
38 |
#End Region |
|
39 |
|
|
40 |
Public Shared ReadOnly Property [Default]() As MySettings |
|
41 |
Get |
|
42 |
|
|
43 |
#If _MyType = "WindowsForms" Then |
|
44 |
If Not addedHandler Then |
|
45 |
SyncLock addedHandlerLockObject |
|
46 |
If Not addedHandler Then |
|
47 |
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings |
|
48 |
addedHandler = True |
|
49 |
End If |
|
50 |
End SyncLock |
|
51 |
End If |
|
52 |
#End If |
|
53 |
Return defaultInstance |
|
54 |
End Get |
|
55 |
End Property |
|
56 |
End Class |
|
57 |
End Namespace |
|
58 |
|
|
59 |
Namespace My |
|
60 |
|
|
61 |
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ |
|
62 |
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ |
|
63 |
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ |
|
64 |
Friend Module MySettingsProperty |
|
65 |
|
|
66 |
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ |
|
67 |
Friend ReadOnly Property Settings() As Global.AutoSPPID.My.MySettings |
|
68 |
Get |
|
69 |
Return Global.AutoSPPID.My.MySettings.Default |
|
70 |
End Get |
|
71 |
End Property |
|
72 |
End Module |
|
73 |
End Namespace |
DTI_PID/AutoSPPID/My Project/Settings.settings | ||
---|---|---|
1 |
<?xml version='1.0' encoding='utf-8'?> |
|
2 |
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true"> |
|
3 |
<Profiles> |
|
4 |
<Profile Name="(Default)" /> |
|
5 |
</Profiles> |
|
6 |
<Settings /> |
|
7 |
</SettingsFile> |
DTI_PID/DTI_PID.sln | ||
---|---|---|
1 | 1 |
|
2 | 2 |
Microsoft Visual Studio Solution File, Format Version 12.00 |
3 | 3 |
# Visual Studio 15 |
4 |
VisualStudioVersion = 15.0.26730.3
|
|
4 |
VisualStudioVersion = 15.0.26430.14
|
|
5 | 5 |
MinimumVisualStudioVersion = 10.0.40219.1 |
6 | 6 |
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "DTI_PID", "DTI_PID\DTI_PID.pyproj", "{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}" |
7 | 7 |
EndProject |
8 |
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SPPIDConverter", "SPPIDConverter\SPPIDConverter.vbproj", "{60285A68-977E-4CBE-BD3E-5224BFA9D799}" |
|
9 |
EndProject |
|
8 | 10 |
Global |
9 | 11 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
10 | 12 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
13 | 15 |
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
14 | 16 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
15 | 17 |
{7C2E55A3-2B16-4B4F-867F-F16E2EF6F2F0}.Release|Any CPU.ActiveCfg = Release|Any CPU |
18 |
{60285A68-977E-4CBE-BD3E-5224BFA9D799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
19 |
{60285A68-977E-4CBE-BD3E-5224BFA9D799}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
20 |
{60285A68-977E-4CBE-BD3E-5224BFA9D799}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|
21 |
{60285A68-977E-4CBE-BD3E-5224BFA9D799}.Release|Any CPU.Build.0 = Release|Any CPU |
|
16 | 22 |
EndGlobalSection |
17 | 23 |
GlobalSection(SolutionProperties) = preSolution |
18 | 24 |
HideSolutionNode = FALSE |
DTI_PID/DTI_PID/DTI_PID.pyproj | ||
---|---|---|
1 |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> |
|
1 |
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
|
2 | 2 |
<PropertyGroup> |
3 | 3 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
4 | 4 |
<SchemaVersion>2.0</SchemaVersion> |
... | ... | |
38 | 38 |
<SubType>Code</SubType> |
39 | 39 |
</Compile> |
40 | 40 |
<Compile Include="DTI_PID.py" /> |
41 |
<Compile Include="DTI_PID_UI.py" /> |
|
41 | 42 |
<Compile Include="potrace.py" /> |
42 | 43 |
<Compile Include="QcImageViewer.py"> |
43 | 44 |
<SubType>Code</SubType> |
... | ... | |
45 | 46 |
<Compile Include="QtImageViewer.py"> |
46 | 47 |
<SubType>Code</SubType> |
47 | 48 |
</Compile> |
49 |
<Compile Include="Recognition_UI.py" /> |
|
48 | 50 |
<Compile Include="symbol.py"> |
49 | 51 |
<SubType>Code</SubType> |
50 | 52 |
</Compile> |
DTI_PID/DTI_PID/DTI_PID_UI.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Form implementation generated from reading ui file 'DTI__PID.ui' |
|
4 |
# |
|
5 |
# Created by: PyQt5 UI code generator 5.6 |
|
6 |
# |
|
7 |
# WARNING! All changes made in this file will be lost! |
|
8 |
|
|
9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
10 |
|
|
11 |
class Ui_MainWindow(object): |
|
12 |
def setupUi(self, MainWindow): |
|
13 |
MainWindow.setObjectName("MainWindow") |
|
14 |
MainWindow.resize(1031, 855) |
|
15 |
font = QtGui.QFont() |
|
16 |
font.setFamily("맑은 고딕") |
|
17 |
font.setBold(True) |
|
18 |
font.setWeight(75) |
|
19 |
MainWindow.setFont(font) |
|
20 |
self.centralwidget = QtWidgets.QWidget(MainWindow) |
|
21 |
self.centralwidget.setObjectName("centralwidget") |
|
22 |
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget) |
|
23 |
self.gridLayout.setObjectName("gridLayout") |
|
24 |
self.verticalLayout = QtWidgets.QVBoxLayout() |
|
25 |
self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetMaximumSize) |
|
26 |
self.verticalLayout.setObjectName("verticalLayout") |
|
27 |
self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) |
|
28 |
MainWindow.setCentralWidget(self.centralwidget) |
|
29 |
self.menubar = QtWidgets.QMenuBar(MainWindow) |
|
30 |
self.menubar.setGeometry(QtCore.QRect(0, 0, 1031, 21)) |
|
31 |
self.menubar.setObjectName("menubar") |
|
32 |
self.menu = QtWidgets.QMenu(self.menubar) |
|
33 |
self.menu.setObjectName("menu") |
|
34 |
MainWindow.setMenuBar(self.menubar) |
|
35 |
self.statusbar = QtWidgets.QStatusBar(MainWindow) |
|
36 |
self.statusbar.setObjectName("statusbar") |
|
37 |
MainWindow.setStatusBar(self.statusbar) |
|
38 |
self.toolBar = QtWidgets.QToolBar(MainWindow) |
|
39 |
font = QtGui.QFont() |
|
40 |
font.setFamily("맑은 고딕") |
|
41 |
font.setBold(True) |
|
42 |
font.setWeight(75) |
|
43 |
self.toolBar.setFont(font) |
|
44 |
self.toolBar.setObjectName("toolBar") |
|
45 |
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
46 |
self.dockWidget = QtWidgets.QDockWidget(MainWindow) |
|
47 |
self.dockWidget.setObjectName("dockWidget") |
|
48 |
self.dockWidgetContents = QtWidgets.QWidget() |
|
49 |
self.dockWidgetContents.setObjectName("dockWidgetContents") |
|
50 |
self.dockWidget.setWidget(self.dockWidgetContents) |
|
51 |
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(2), self.dockWidget) |
|
52 |
self.actionOpen = QtWidgets.QAction(MainWindow) |
|
53 |
font = QtGui.QFont() |
|
54 |
font.setFamily("맑은 고딕") |
|
55 |
self.actionOpen.setFont(font) |
|
56 |
self.actionOpen.setObjectName("actionOpen") |
|
57 |
self.actionClose = QtWidgets.QAction(MainWindow) |
|
58 |
font = QtGui.QFont() |
|
59 |
font.setFamily("맑은 고딕") |
|
60 |
self.actionClose.setFont(font) |
|
61 |
self.actionClose.setObjectName("actionClose") |
|
62 |
self.actionRecognition = QtWidgets.QAction(MainWindow) |
|
63 |
self.actionRecognition.setObjectName("actionRecognition") |
|
64 |
self.menu.addAction(self.actionOpen) |
|
65 |
self.menu.addSeparator() |
|
66 |
self.menu.addAction(self.actionClose) |
|
67 |
self.menubar.addAction(self.menu.menuAction()) |
|
68 |
self.toolBar.addAction(self.actionOpen) |
|
69 |
self.toolBar.addAction(self.actionRecognition) |
|
70 |
self.toolBar.addSeparator() |
|
71 |
|
|
72 |
self.retranslateUi(MainWindow) |
|
73 |
QtCore.QMetaObject.connectSlotsByName(MainWindow) |
|
74 |
|
|
75 |
def retranslateUi(self, MainWindow): |
|
76 |
_translate = QtCore.QCoreApplication.translate |
|
77 |
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) |
|
78 |
self.menu.setTitle(_translate("MainWindow", "파일")) |
|
79 |
self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar")) |
|
80 |
self.actionOpen.setText(_translate("MainWindow", "열기")) |
|
81 |
self.actionClose.setText(_translate("MainWindow", "종료")) |
|
82 |
self.actionRecognition.setText(_translate("MainWindow", "인식")) |
|
83 |
self.actionRecognition.setToolTip(_translate("MainWindow", "인식")) |
|
84 |
|
|
85 |
|
|
86 |
if __name__ == "__main__": |
|
87 |
import sys |
|
88 |
app = QtWidgets.QApplication(sys.argv) |
|
89 |
MainWindow = QtWidgets.QMainWindow() |
|
90 |
ui = Ui_MainWindow() |
|
91 |
ui.setupUi(MainWindow) |
|
92 |
MainWindow.show() |
|
93 |
sys.exit(app.exec_()) |
|
94 |
|
DTI_PID/DTI_PID/Recognition_UI.py | ||
---|---|---|
1 |
# -*- coding: utf-8 -*- |
|
2 |
|
|
3 |
# Form implementation generated from reading ui file 'UI/dlgRecognition.ui' |
|
4 |
# |
|
5 |
# Created by: PyQt5 UI code generator 5.10.1 |
|
6 |
# |
|
7 |
# WARNING! All changes made in this file will be lost! |
|
8 |
|
|
9 |
from PyQt5 import QtCore, QtGui, QtWidgets |
|
10 |
|
|
11 |
class Ui_Recognition(object): |
|
12 |
def setupUi(self, Recognition): |
|
13 |
Recognition.setObjectName("Recognition") |
|
14 |
Recognition.setWindowModality(QtCore.Qt.WindowModal) |
|
15 |
Recognition.resize(845, 300) |
|
16 |
font = QtGui.QFont() |
|
17 |
font.setFamily("맑은 고딕") |
|
18 |
Recognition.setFont(font) |
|
19 |
self.gridLayout = QtWidgets.QGridLayout(Recognition) |
|
20 |
self.gridLayout.setObjectName("gridLayout") |
|
21 |
self.buttonBox = QtWidgets.QDialogButtonBox(Recognition) |
|
22 |
self.buttonBox.setEnabled(False) |
|
23 |
self.buttonBox.setOrientation(QtCore.Qt.Horizontal) |
|
24 |
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok) |
|
25 |
self.buttonBox.setObjectName("buttonBox") |
|
26 |
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1) |
|
27 |
self.listWidget = QtWidgets.QListWidget(Recognition) |
|
28 |
self.listWidget.setObjectName("listWidget") |
|
29 |
self.gridLayout.addWidget(self.listWidget, 0, 0, 1, 1) |
|
30 |
|
|
31 |
self.retranslateUi(Recognition) |
|
32 |
self.buttonBox.accepted.connect(Recognition.accept) |
|
33 |
self.buttonBox.rejected.connect(Recognition.reject) |
|
34 |
QtCore.QMetaObject.connectSlotsByName(Recognition) |
|
35 |
|
|
36 |
def retranslateUi(self, Recognition): |
|
37 |
_translate = QtCore.QCoreApplication.translate |
|
38 |
Recognition.setWindowTitle(_translate("Recognition", "설계정보 인식 중...")) |
|
39 |
|
|
40 |
|
|
41 |
if __name__ == "__main__": |
|
42 |
import sys |
|
43 |
app = QtWidgets.QApplication(sys.argv) |
|
44 |
Recognition = QtWidgets.QDialog() |
|
45 |
ui = Ui_Recognition() |
|
46 |
ui.setupUi(Recognition) |
|
47 |
Recognition.show() |
|
48 |
sys.exit(app.exec_()) |
|
49 |
|
DTI_PID/SPPIDConverter/App.config | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<configuration> |
|
3 |
<configSections> |
|
4 |
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> |
|
5 |
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> |
|
6 |
</configSections> |
|
7 |
<startup> |
|
8 |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /> |
|
9 |
</startup> |
|
10 |
<entityFramework> |
|
11 |
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> |
|
12 |
<providers> |
|
13 |
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> |
|
14 |
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" /> |
|
15 |
</providers> |
|
16 |
</entityFramework> |
|
17 |
<system.data> |
|
18 |
<DbProviderFactories> |
|
19 |
<remove invariant="System.Data.SQLite.EF6" /> |
|
20 |
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" /> |
|
21 |
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories> |
|
22 |
</system.data> |
|
23 |
</configuration> |
DTI_PID/SPPIDConverter/Main.Designer.vb | ||
---|---|---|
1 |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ |
|
2 |
Partial Class Main |
|
3 |
Inherits System.Windows.Forms.Form |
|
4 |
|
|
5 |
'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다. |
|
6 |
<System.Diagnostics.DebuggerNonUserCode()> _ |
|
7 |
Protected Overrides Sub Dispose(ByVal disposing As Boolean) |
|
8 |
Try |
|
9 |
If disposing AndAlso components IsNot Nothing Then |
|
10 |
components.Dispose() |
|
11 |
End If |
|
12 |
Finally |
|
13 |
MyBase.Dispose(disposing) |
|
14 |
End Try |
|
15 |
End Sub |
|
16 |
|
|
17 |
'Windows Form 디자이너에 필요합니다. |
|
18 |
Private components As System.ComponentModel.IContainer |
|
19 |
|
|
20 |
'참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다. |
|
21 |
'수정하려면 Windows Form 디자이너를 사용하십시오. |
|
22 |
'코드 편집기에서는 수정하지 마세요. |
|
23 |
<System.Diagnostics.DebuggerStepThrough()> _ |
|
24 |
Private Sub InitializeComponent() |
|
25 |
Me.Txt_FolderPath = New System.Windows.Forms.TextBox() |
|
26 |
Me.Tree_XMLFiles = New System.Windows.Forms.TreeView() |
|
27 |
Me.Status_Main = New System.Windows.Forms.StatusStrip() |
|
28 |
Me.Txt_Status = New System.Windows.Forms.ToolStripStatusLabel() |
|
29 |
Me.ToolStripProgressBar1 = New System.Windows.Forms.ToolStripProgressBar() |
|
30 |
Me.Group_Command = New System.Windows.Forms.GroupBox() |
|
31 |
Me.Btn_Converting = New System.Windows.Forms.Button() |
|
32 |
Me.Btn_FolderPath = New System.Windows.Forms.Button() |
|
33 |
Me.Label1 = New System.Windows.Forms.Label() |
|
34 |
Me.Status_Main.SuspendLayout() |
|
35 |
Me.Group_Command.SuspendLayout() |
|
36 |
Me.SuspendLayout() |
|
37 |
' |
|
38 |
'Txt_FolderPath |
|
39 |
' |
|
40 |
Me.Txt_FolderPath.Location = New System.Drawing.Point(96, 29) |
|
41 |
Me.Txt_FolderPath.Name = "Txt_FolderPath" |
|
42 |
Me.Txt_FolderPath.Size = New System.Drawing.Size(416, 21) |
|
43 |
Me.Txt_FolderPath.TabIndex = 0 |
|
44 |
' |
|
45 |
'Tree_XMLFiles |
|
46 |
' |
|
47 |
Me.Tree_XMLFiles.CheckBoxes = True |
|
48 |
Me.Tree_XMLFiles.Dock = System.Windows.Forms.DockStyle.Fill |
|
49 |
Me.Tree_XMLFiles.Location = New System.Drawing.Point(0, 70) |
|
50 |
Me.Tree_XMLFiles.Name = "Tree_XMLFiles" |
|
51 |
Me.Tree_XMLFiles.Size = New System.Drawing.Size(654, 379) |
|
52 |
Me.Tree_XMLFiles.TabIndex = 1 |
|
53 |
' |
|
54 |
'Status_Main |
|
55 |
' |
|
56 |
Me.Status_Main.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Txt_Status, Me.ToolStripProgressBar1}) |
|
57 |
Me.Status_Main.Location = New System.Drawing.Point(0, 449) |
|
58 |
Me.Status_Main.Name = "Status_Main" |
|
59 |
Me.Status_Main.Size = New System.Drawing.Size(654, 26) |
|
60 |
Me.Status_Main.TabIndex = 2 |
|
61 |
Me.Status_Main.Text = "StatusStrip1" |
|
62 |
' |
|
63 |
'Txt_Status |
|
64 |
' |
|
65 |
Me.Txt_Status.Name = "Txt_Status" |
|
66 |
Me.Txt_Status.Size = New System.Drawing.Size(40, 21) |
|
67 |
Me.Txt_Status.Text = "Status" |
|
68 |
' |
|
69 |
'ToolStripProgressBar1 |
|
70 |
' |
|
71 |
Me.ToolStripProgressBar1.Name = "ToolStripProgressBar1" |
|
72 |
Me.ToolStripProgressBar1.Size = New System.Drawing.Size(200, 20) |
|
73 |
' |
|
74 |
'Group_Command |
|
75 |
' |
|
76 |
Me.Group_Command.Controls.Add(Me.Btn_Converting) |
|
77 |
Me.Group_Command.Controls.Add(Me.Btn_FolderPath) |
|
78 |
Me.Group_Command.Controls.Add(Me.Label1) |
|
79 |
Me.Group_Command.Controls.Add(Me.Txt_FolderPath) |
|
80 |
Me.Group_Command.Dock = System.Windows.Forms.DockStyle.Top |
|
81 |
Me.Group_Command.Location = New System.Drawing.Point(0, 0) |
|
82 |
Me.Group_Command.Name = "Group_Command" |
|
83 |
Me.Group_Command.Size = New System.Drawing.Size(654, 70) |
|
84 |
Me.Group_Command.TabIndex = 3 |
|
85 |
Me.Group_Command.TabStop = False |
|
86 |
' |
|
87 |
'Btn_Converting |
|
88 |
' |
|
89 |
Me.Btn_Converting.Location = New System.Drawing.Point(564, 12) |
|
90 |
Me.Btn_Converting.Name = "Btn_Converting" |
|
91 |
Me.Btn_Converting.Size = New System.Drawing.Size(76, 54) |
|
92 |
Me.Btn_Converting.TabIndex = 4 |
|
93 |
Me.Btn_Converting.Text = "Converting" |
|
94 |
Me.Btn_Converting.UseVisualStyleBackColor = True |
|
95 |
' |
|
96 |
'Btn_FolderPath |
|
97 |
' |
|
98 |
Me.Btn_FolderPath.Location = New System.Drawing.Point(518, 27) |
|
99 |
Me.Btn_FolderPath.Name = "Btn_FolderPath" |
|
100 |
Me.Btn_FolderPath.Size = New System.Drawing.Size(34, 23) |
|
101 |
Me.Btn_FolderPath.TabIndex = 2 |
|
102 |
Me.Btn_FolderPath.Text = "..." |
|
103 |
Me.Btn_FolderPath.UseVisualStyleBackColor = True |
|
104 |
' |
|
105 |
'Label1 |
|
106 |
' |
|
107 |
Me.Label1.AutoSize = True |
|
108 |
Me.Label1.Location = New System.Drawing.Point(12, 32) |
|
109 |
Me.Label1.Name = "Label1" |
|
110 |
Me.Label1.Size = New System.Drawing.Size(69, 12) |
|
111 |
Me.Label1.TabIndex = 1 |
|
112 |
Me.Label1.Text = "Folder Path" |
|
113 |
' |
|
114 |
'Main |
|
115 |
' |
|
116 |
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!) |
|
117 |
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font |
|
118 |
Me.ClientSize = New System.Drawing.Size(654, 475) |
|
119 |
Me.Controls.Add(Me.Tree_XMLFiles) |
|
120 |
Me.Controls.Add(Me.Status_Main) |
|
121 |
Me.Controls.Add(Me.Group_Command) |
|
122 |
Me.Name = "Main" |
|
123 |
Me.ShowIcon = False |
|
124 |
Me.Text = "Converter" |
|
125 |
Me.Status_Main.ResumeLayout(False) |
|
126 |
Me.Status_Main.PerformLayout() |
|
127 |
Me.Group_Command.ResumeLayout(False) |
|
128 |
Me.Group_Command.PerformLayout() |
|
129 |
Me.ResumeLayout(False) |
|
130 |
Me.PerformLayout() |
|
131 |
|
|
132 |
End Sub |
|
133 |
|
|
134 |
Friend WithEvents Txt_FolderPath As TextBox |
|
135 |
Friend WithEvents Tree_XMLFiles As TreeView |
|
136 |
Friend WithEvents Status_Main As StatusStrip |
|
137 |
Friend WithEvents ToolStripProgressBar1 As ToolStripProgressBar |
|
138 |
Friend WithEvents Group_Command As GroupBox |
|
139 |
Friend WithEvents Btn_FolderPath As Button |
|
140 |
Friend WithEvents Label1 As Label |
|
141 |
Friend WithEvents Btn_Converting As Button |
|
142 |
Friend WithEvents Txt_Status As ToolStripStatusLabel |
|
143 |
End Class |
DTI_PID/SPPIDConverter/Main.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 |
<metadata name="Status_Main.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
|
121 |
<value>17, 17</value> |
|
122 |
</metadata> |
|
123 |
</root> |
DTI_PID/SPPIDConverter/Main.vb | ||
---|---|---|
1 |
Imports System.IO |
|
2 |
Imports System.Data.SqlClient |
|
3 |
Imports System.Data.SQLite |
|
4 |
Imports Plaice |
|
5 |
Imports Llama |
|
6 |
Imports PidA |
|
7 |
Public Class Main |
|
8 |
|
|
9 |
Dim _DB As DataTable = New DataTable() |
|
10 |
Dim _Placement As New Placement |
|
11 |
Dim _DWG_X = 0.84 '0.695 '1 ' |
|
12 |
Dim _DWG_Y = 0.594 '0.585 '0.8 ' |
|
13 |
|
|
14 |
Dim _IMG_X = 0 |
|
15 |
Dim _IMG_Y = 0 |
|
16 |
|
|
17 |
Private Sub Main_Load(sender As Object, e As EventArgs) Handles MyBase.Load |
|
18 |
Dim sDBPath As String = "C:\Users\kyusu\Desktop\Auto SPPID 변환 프로젝트\PID.db" |
|
19 |
LoadDB(sDBPath) |
|
20 |
End Sub |
|
21 |
|
|
22 |
Private Sub Btn_FolderPath_Click(sender As Object, e As EventArgs) Handles Btn_FolderPath.Click |
|
23 |
Dim oOpenFolderDlg = New FolderBrowserDialog() |
|
24 |
Dim result As DialogResult = oOpenFolderDlg.ShowDialog() |
|
25 |
Dim sFolderName As String = "" |
|
26 |
|
|
27 |
If (result = DialogResult.OK) Then |
|
28 |
sFolderName = oOpenFolderDlg.SelectedPath |
|
29 |
InitXMLTree(sFolderName) |
|
30 |
End If |
|
31 |
|
|
32 |
End Sub |
|
33 |
|
|
34 |
Private Sub InitXMLTree(ByVal sFolderPath As String) |
|
35 |
Tree_XMLFiles.Nodes.Clear() |
|
36 |
Dim oRootNode As TreeNode = Tree_XMLFiles.Nodes.Add("XML") |
|
37 |
'.XML 만 로드 |
|
38 |
Dim sfileEntries As String() = Directory.GetFiles(sFolderPath, "*.xml") |
|
39 |
' Process the list of files found in the directory. |
|
40 |
Dim sfileName As String |
|
41 |
For Each sfileName In sfileEntries |
|
42 |
oRootNode.Nodes.Add(sfileName) |
|
43 |
Next sfileName |
|
44 |
oRootNode.ExpandAll() |
|
45 |
End Sub |
|
46 |
|
|
47 |
Private Function CreateDwg(ByVal oDwgName As String, ByVal sUnit As String, ByVal sTemplateFileName As String) As Boolean |
|
48 |
Try |
|
49 |
Dim datasource As LMADataSource |
|
50 |
Dim objPIDAutoApp As Object |
|
51 |
Dim objPIDADrawing As Object |
|
52 |
Dim PlantGroupName As String |
|
53 |
Dim TemplateFileName As String |
|
54 |
Dim DrawingNumber As String |
|
55 |
Dim DrawingName As String |
|
56 |
|
|
57 |
Dim extension As String = Path.GetExtension(oDwgName) |
|
58 |
oDwgName = oDwgName.Replace(extension, "") |
|
59 |
datasource = New LMADataSource |
|
60 |
objPIDAutoApp = CreateObject("PIDAutomation.Application") |
|
61 |
PlantGroupName = sUnit |
|
62 |
'considering accessing T_OptinSetting to read the template files path, which will be more flexible |
|
63 |
TemplateFileName = sTemplateFileName |
|
64 |
DrawingNumber = oDwgName |
|
65 |
DrawingName = oDwgName |
|
66 |
objPIDADrawing = objPIDAutoApp.Drawings.Add(PlantGroupName, TemplateFileName, DrawingNumber, DrawingName) |
|
67 |
If Not objPIDADrawing Is Nothing Then |
|
68 |
'이미 오픈 |
|
69 |
objPIDADrawing.CloseDrawing |
|
70 |
End If |
|
71 |
objPIDAutoApp.Quit |
|
72 |
objPIDAutoApp = Nothing |
|
73 |
objPIDADrawing = Nothing |
|
74 |
Return True |
|
75 |
Catch ex As Exception |
|
76 |
Return False |
|
77 |
End Try |
|
78 |
|
|
79 |
End Function |
|
80 |
|
|
81 |
#Region "Load Pipe" |
|
82 |
Private Function LoadPipe_DT() As DataTable |
|
83 |
Dim oDt As New DataTable |
|
84 |
oDt.Columns.Add("start_x") |
|
85 |
oDt.Columns.Add("start_y") |
|
86 |
oDt.Columns.Add("end_x") |
|
87 |
oDt.Columns.Add("end_y") |
|
88 |
oDt.Columns.Add("Symbol") |
|
89 |
Return oDt |
|
90 |
|
|
91 |
End Function |
|
92 |
|
|
93 |
#End Region |
|
94 |
|
|
95 |
#Region "Load Symbol" |
|
96 |
Private Function LoadSymbol_DT() As DataTable |
|
97 |
Dim oDt As New DataTable |
|
98 |
oDt.Columns.Add("Name") |
|
99 |
oDt.Columns.Add("x") |
|
100 |
oDt.Columns.Add("y") |
|
101 |
oDt.Columns.Add("Angle") |
|
102 |
oDt.Columns.Add("Symbol") |
|
103 |
oDt.Columns.Add("Text") |
|
104 |
Return oDt |
|
105 |
End Function |
|
106 |
|
|
107 |
#End Region |
|
108 |
|
|
109 |
Private Function GetSymbolMapping(ByVal oSymbolName As String) As String |
|
110 |
Dim oSystemPath As String = "" |
|
111 |
Dim oSelectRow() As DataRow = _DB.Select("[pid_symbolname] = '" + oSymbolName + "'") |
|
112 |
If oSelectRow.Length = 1 Then |
|
113 |
oSystemPath = oSelectRow(0).Item("sppid_systempath").ToString() |
|
114 |
End If |
|
115 |
Return oSystemPath |
|
116 |
End Function |
|
117 |
|
|
118 |
Private Function LoadSymbolInXml(ByVal sXmlPath As String) As DataTable |
|
119 |
Dim oDt As DataTable = LoadSymbol_DT() |
|
120 |
Dim oElement As XElement = XElement.Load(sXmlPath) |
|
121 |
If oElement IsNot Nothing Then |
|
122 |
For Each symbols As Object In oElement.Elements("SYMBOLS") |
|
123 |
For Each page As Object In symbols.Elements("SYMBOL") |
|
124 |
Dim oAddrow As DataRow = oDt.NewRow() |
|
125 |
Dim oObj As XElement = page.Element("NAME") |
|
126 |
Dim oSymbol = oObj.Value |
|
127 |
|
|
128 |
|
|
129 |
oObj = page.Element("TEXT") |
|
130 |
Dim oText = oObj.Value |
|
131 |
oObj = page.Element("CLASS") |
|
132 |
Dim oClass = oObj.Value |
|
133 |
oObj = page.Element("TYPE") |
|
134 |
Dim oType = oObj.Value |
|
135 |
oObj = page.Element("ITEM") |
|
136 |
Dim oItem = oObj.Value |
|
137 |
|
|
138 |
' Dim oSymbolPath As String = "\" + oSymbol + "\" + oClass + "\" + oType + "\" + oItem + ".sym" |
|
139 |
Dim oSymbolPath As String = GetSymbolMapping(oItem) |
|
140 |
|
|
141 |
|
|
142 |
oObj = page.Element("ORIGINALPOINT") |
|
143 |
Dim sOriginPoint = oObj.Value |
|
144 |
|
|
145 |
oObj = page.Element("ANGLE") |
|
146 |
Dim oAngle = oObj.Value |
|
147 |
|
|
148 |
Dim oSplitPos As String() = sOriginPoint.Split(",") |
|
149 |
Dim oX As Double = 0.0 |
|
150 |
Dim oY As Double = 0.0 |
|
151 |
If IsNumeric(oSplitPos(0)) Then |
|
152 |
oX = Double.Parse(oSplitPos(0)) |
|
153 |
End If |
|
154 |
If IsNumeric(oSplitPos(1)) Then |
|
155 |
oY = Double.Parse(oSplitPos(1)) |
|
156 |
End If |
|
157 |
|
|
158 |
ConvertPoint(oX, oY, _DWG_X, _DWG_Y) |
|
159 |
oAddrow("X") = oX '+ 0.05 |
|
160 |
oAddrow("Y") = oY |
|
161 |
oAddrow("Angle") = oAngle |
|
162 |
oAddrow("Symbol") = oSymbolPath |
|
163 |
oAddrow("Text") = oText |
|
164 |
oAddrow("Name") = oSymbol |
|
165 |
|
|
166 |
oDt.Rows.Add(oAddrow) |
|
167 |
|
|
168 |
|
|
169 |
Next |
|
170 |
Next |
|
171 |
|
|
172 |
End If |
|
173 |
End Function |
|
174 |
|
|
175 |
|
|
176 |
|
|
177 |
Private Function LoadPipeInXml(ByVal sXmlPath As String) As DataTable |
|
178 |
Try |
|
179 |
Dim oDt As DataTable = LoadPipe_DT() |
|
180 |
Dim oElement As XElement = XElement.Load(sXmlPath) |
|
181 |
If oElement IsNot Nothing Then |
|
182 |
Dim DWGElement As XElement = oElement.Element("DWGNAME") |
|
183 |
Dim DWGNAME = DWGElement.Value |
|
184 |
Dim sXY As XElement = oElement.Element("SIZE") |
|
185 |
Dim sSize = sXY.Value |
|
186 |
Dim oSplitDWGPos As String() = sSize.Split(",") |
|
187 |
|
|
188 |
If IsNumeric(oSplitDWGPos(0)) Then |
|
189 |
_IMG_X = Double.Parse(oSplitDWGPos(0)) |
|
190 |
End If |
|
191 |
If IsNumeric(oSplitDWGPos(1)) Then |
|
192 |
_IMG_Y = Double.Parse(oSplitDWGPos(1)) |
|
193 |
End If |
|
194 |
|
|
195 |
For Each pipes As Object In oElement.Elements("IMGLINES") |
|
196 |
For Each pipe As Object In pipes.Elements("IMGLINE") |
|
197 |
Dim oAddrow As DataRow = oDt.NewRow() |
|
198 |
Dim oObj As XElement = pipe.Element("ITEM") |
|
199 |
Dim oItem = oObj.Value |
|
200 |
' Dim oSymbolPath As String = "\" + oSymbol + "\" + oClass + "\" + oType + "\" + oItem + ".sym" |
|
201 |
Dim oSymbolPath As String = GetSymbolMapping(oItem) |
|
202 |
oObj = pipe.Element("START") |
|
203 |
Dim oStartPoint = oObj.Value |
|
204 |
Dim oSplitPos As String() = oStartPoint.Split(",") |
|
205 |
Dim oStartpos_X As Double = 0.0 |
|
206 |
Dim oStartpos_Y As Double = 0.0 |
|
207 |
If IsNumeric(oSplitPos(0)) Then |
|
208 |
oStartpos_X = Double.Parse(oSplitPos(0)) |
|
209 |
End If |
|
210 |
If IsNumeric(oSplitPos(1)) Then |
|
211 |
oStartpos_Y = Double.Parse(oSplitPos(1)) |
|
212 |
End If |
|
213 |
|
|
214 |
ConvertPoint(oStartpos_X, oStartpos_Y, _DWG_X, _DWG_Y) |
|
215 |
oObj = pipe.Element("END") |
|
216 |
Dim oEndPoint = oObj.Value |
|
217 |
oSplitPos = oEndPoint.Split(",") |
|
218 |
Dim oEndpos_X As Double = 0.0 |
|
219 |
Dim oEndpos_Y As Double = 0.0 |
|
220 |
If IsNumeric(oSplitPos(0)) Then |
|
221 |
oEndpos_X = Double.Parse(oSplitPos(0)) |
|
222 |
End If |
|
223 |
If IsNumeric(oSplitPos(1)) Then |
|
224 |
oEndpos_Y = Double.Parse(oSplitPos(1)) |
|
225 |
End If |
|
226 |
ConvertPoint(oEndpos_X, oEndpos_Y, _DWG_X, _DWG_Y) |
|
227 |
|
|
228 |
oAddrow("start_x") = oStartpos_X '+ 0.05 |
|
229 |
oAddrow("start_y") = oStartpos_Y |
|
230 |
oAddrow("end_x") = oEndpos_X |
|
231 |
oAddrow("end_y") = oEndpos_Y |
|
232 |
oAddrow("Symbol") = oSymbolPath |
|
233 |
oDt.Rows.Add(oAddrow) |
|
234 |
|
|
235 |
|
|
236 |
Next |
|
237 |
Next |
|
238 |
|
|
239 |
End If |
|
240 |
|
|
241 |
|
|
242 |
Return oDt |
|
243 |
Catch ex As Exception |
|
244 |
Return Nothing |
|
245 |
End Try |
|
246 |
End Function |
|
247 |
|
|
248 |
|
|
249 |
Private Sub ConvertPoint(ByRef dX As Double, ByRef dY As Double, ByVal dDwgX As Double, ByVal dDwgY As Double) |
|
250 |
|
|
251 |
Dim calcx As Double = 0 |
|
252 |
Dim calcy As Double = 0 |
|
253 |
calcx = (dX * _DWG_X) / dDwgX 'Math.Round((dX * _DWG_X) / dDwgX, 2) |
|
254 |
calcy = _DWG_Y - (dY * _DWG_Y) / dDwgY '_DWG_Y - Math.Round((dY * _DWG_Y) / dDwgY, 2) |
|
255 |
dX = calcx |
|
256 |
dY = calcy |
|
257 |
End Sub |
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
Private Sub Btn_Converting_Click(sender As Object, e As EventArgs) Handles Btn_Converting.Click |
|
263 |
If Tree_XMLFiles.Nodes.Count > 0 Then |
|
264 |
Dim oRootNode As TreeNode = Tree_XMLFiles.Nodes(0) |
|
265 |
For Each oNode As TreeNode In oRootNode.Nodes |
|
266 |
Dim sDwgName = oNode.Text |
|
267 |
Dim sUnit As String = "" |
|
268 |
Dim sTemplateName As String = "" |
|
269 |
Dim oPipe_Dt As DataTable = LoadPipeInXml(sDwgName) |
|
270 |
Dim oSymbol_Dt As DataTable = LoadSymbolInXml(sDwgName) |
|
271 |
'도면 생성 |
|
272 |
If CreateDwg(sDwgName, sUnit, sTemplateName) Then |
|
273 |
'AutoConverting |
|
274 |
AutoConverting(oPipe_Dt, oSymbol_Dt) |
|
275 |
End If |
|
276 |
Next |
|
277 |
End If |
|
278 |
End Sub |
|
279 |
|
|
280 |
|
|
281 |
Private Function AutoConverting(ByVal oPipe_Dt As DataTable, ByVal oSymbol_Dt As DataTable) As Boolean |
|
282 |
Dim iSymbolcount = 0 |
|
283 |
Dim datasource As LMADataSource |
|
284 |
datasource = _Placement.PIDDataSource |
|
285 |
Dim iPipecnt As Integer = 0 |
|
286 |
|
|
287 |
For Each oRow As DataRow In oPipe_Dt.Rows |
|
288 |
Dim oposition As String = oRow("position").ToString() |
|
289 |
Dim oSymbol As String = oRow("Symbol").ToString() |
|
290 |
Dim oSplitStr As String() = Split(oposition, " ") |
|
291 |
Dim objConnector As LMConnector |
|
292 |
Dim objInputs As PlaceRunInputs |
|
293 |
objInputs = New PlaceRunInputs |
|
294 |
Dim oDwg_x As Double = 9933 |
|
295 |
Dim oDwg_y As Double = 7016 |
|
296 |
For Each sposition As String In oSplitStr |
|
297 |
Dim opointstr As String() = Split(sposition, ",") |
|
298 |
|
|
299 |
If (opointstr.Length > 1) Then |
|
300 |
If IsNumeric(opointstr(0)) And IsNumeric(opointstr(1)) Then |
|
301 |
Dim ox As Double = opointstr(0) |
|
302 |
Dim oy As Double = opointstr(1) |
|
303 |
ConvertPoint(ox, oy, oDwg_x, oDwg_y) |
|
304 |
objInputs.AddPoint(ox, oy) |
|
305 |
End If |
|
306 |
End If |
|
307 |
Next |
|
308 |
Dim objItem As LMAItem |
|
309 |
objItem = _Placement.PIDCreateItem(oSymbol) |
|
310 |
objConnector = _Placement.PIDPlaceRun(objItem, objInputs) |
|
311 |
|
|
312 |
'Dim objPipeRun As LMPipeRun = datasource.GetPipeRun(objConnector.ModelItemID) |
|
313 |
'objPipeRun.Attributes("OperFluidCode").Value = "AFS" |
|
314 |
'objPipeRun.Commit() |
|
315 |
iPipecnt = iPipecnt + 1 |
|
316 |
|
|
317 |
Next |
|
318 |
|
|
319 |
|
|
320 |
For Each oRow As DataRow In oSymbol_Dt.Rows |
|
321 |
|
|
322 |
Dim oSymbol As String = oRow("Symbol").ToString() |
|
323 |
Dim oType As String = oRow("Name").ToString() |
|
324 |
Dim oText As String = oRow("Text").ToString() |
|
325 |
Dim oX As Double = 0.0 |
|
326 |
Dim oY As Double = 0.0 |
|
327 |
If IsNumeric(oRow("x").ToString()) Then |
|
328 |
oX = Double.Parse(oRow("x").ToString()) |
|
329 |
End If |
|
330 |
If IsNumeric(oRow("y").ToString()) Then |
|
331 |
oY = Double.Parse(oRow("y").ToString()) |
내보내기 Unified diff