프로젝트

일반

사용자정보

개정판 8aa6f2db

ID8aa6f2dbb2f7f2950cd6fa9605de2c6d4cde4cef
상위 5f611a2e
하위 ec1279b0

gaqhf 이(가) 약 6년 전에 추가함

dev issue #000 : add flow direction logic

Change-Id: Ifb1915357b5b2178b0e2614169ff504e65b64b1b

차이점 보기:

DTI_PID/BaseModel/BaseModel.csproj
80 80
  <ItemGroup>
81 81
    <Compile Include="Model\ChildSymbol.cs" />
82 82
    <Compile Include="Model\Equipment.cs" />
83
    <Compile Include="Model\TrimLine.cs" />
83 84
    <Compile Include="Model\Other\Association.cs" />
84 85
    <Compile Include="Model\Other\Attribute.cs" />
85 86
    <Compile Include="Model\Other\Connector.cs" />
DTI_PID/BaseModel/Model/Document.cs
20 20
        private List<Note> _NOTES = new List<Note>();
21 21
        private List<Line> _LINES = new List<Line>();
22 22
        private List<LineNumber> _LINENUMBERS = new List<LineNumber>();
23
        private List<TrimLine> _TRIMLINES = new List<TrimLine>();
23 24
        private List<EndBreak> _EndBreaks = new List<EndBreak>();
24 25
        private List<Equipment> _Equipments = new List<Equipment>();
25 26
        private bool _Enable;
......
53 54
        }
54 55
        public double SIZE_WIDTH { get => _SIZE_WIDTH; }
55 56
        public double SIZE_HEIGHT { get => _SIZE_HEIGHT; }
56
        
57
        public List<TrimLine> TRIMLINES { get => _TRIMLINES; set => _TRIMLINES = value; }
57 58

  
58 59
        public Document(string xmlPath)
59 60
        {
......
68 69
                SetLineNumber(xml.Element("LINENOS"));
69 70
                SetText(xml.Element("TEXTINFOS"));
70 71
                SetNote(xml.Element("NOTES"));
72
                SetTrimLine(xml.Element("TRIMLINENOS"));
71 73

  
72 74
                _Enable = true;
73 75
            }
......
171 173
                        FLIP = Convert.ToInt32(item.Element("FLIP").Value),
172 174
                        CURRENTPOINTMODEINDEX = Convert.ToInt32(item.Element("CURRENTPOINTMODEINDEX").Value)
173 175
                    };
176
                    if (symbol.ANGLE == 1.57)
177
                        //ANGLE = 270 * Math.PI / 180;
178
                        symbol.ANGLE = 90 * Math.PI / 180;
179
                    else if (symbol.ANGLE == 3.14)
180
                        symbol.ANGLE = Math.PI;
181
                    else if (symbol.ANGLE == 4.71)
182
                        //ANGLE = 90 * Math.PI / 180;
183
                        symbol.ANGLE = 270 * Math.PI / 180;
184

  
174 185
                    SetAssociations(item.Element("ASSOCIATIONS"), symbol.ASSOCIATIONS);
175 186
                    SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT);
176 187
                    SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES);
......
264 275
                NOTES.Add(note);
265 276
            }
266 277
        }
267
       
278

  
279
        private void SetTrimLine(XElement node)
280
        {
281
            foreach (XElement item in node.Elements("TRIM_LINE_NO"))
282
            {
283
                TrimLine trimLine = new TrimLine()
284
                {
285
                    UID = item.Element("UID").Value,
286
                };
287
                SetLineNumberRuns(item, trimLine.RUNS);
288
                TRIMLINES.Add(trimLine);
289
            }
290
        }
291

  
268 292
        private void SetAssociations(XElement node, List<Association> associations)
269 293
        {
270 294
            foreach (XElement item in node.Elements("ASSOCIATION"))
......
342 366
            }
343 367
        }
344 368

  
345
        private void SetLineNumberRuns(XElement node, List<LineNumberRun> lineNumberRuns)
369
        private void SetLineNumberRuns(XElement node, List<LineRun> lineNumberRuns)
346 370
        {
347 371
            foreach (XElement item in node.Elements("RUN"))
348 372
            {
349
                LineNumberRun run = new LineNumberRun()
373
                LineRun run = new LineRun()
350 374
                {
351 375
                    TYPE = item.Attribute("TYPE").Value
352 376
                };
DTI_PID/BaseModel/Model/LineNumber.cs
15 15
        private string _HEIGHT;
16 16
        private double _ANGLE;
17 17
        private string _AREA;
18
        private List<LineNumberRun> _RUNS = new List<LineNumberRun>();
18
        private List<LineRun> _RUNS = new List<LineRun>();
19 19
        private List<Property> _PROPERTIES = new List<Property>();
20 20
        private List<Attribute> _ATTRIBUTES = new List<Attribute>();
21 21

  
......
26 26
        public string HEIGHT { get => _HEIGHT; set => _HEIGHT = value; }
27 27
        public double ANGLE { get => _ANGLE; set => _ANGLE = value; }
28 28
        public string AREA { get => _AREA; set => _AREA = value; }
29
        public List<LineNumberRun> RUNS { get => _RUNS; set => _RUNS = value; }
29
        public List<LineRun> RUNS { get => _RUNS; set => _RUNS = value; }
30 30
        public List<Property> PROPERTIES { get => _PROPERTIES; set => _PROPERTIES = value; }
31 31
        public List<Attribute> ATTRIBUTES { get => _ATTRIBUTES; set => _ATTRIBUTES = value; }
32 32
    }
DTI_PID/BaseModel/Model/Other/LineNumberRun.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class LineNumberRun
9
    public class LineRun
10 10
    {
11 11
        private string _TYPE;
12 12
        private List<object> _RUNITEMS = new List<object>();
DTI_PID/DTI_PID.sln
13 13
EndProject
14 14
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter", "SPPIDConverter\SPPIDConverter.csproj", "{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}"
15 15
EndProject
16
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SPPIDConverter_CustomCommand", "SPPIDConverter_CustomCommand\SPPIDConverter_CustomCommand.csproj", "{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}"
17
EndProject
16 18
Global
17 19
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 20
		Debug|Any CPU = Debug|Any CPU
......
57 59
		{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}.Release|Any CPU.Build.0 = Release|Any CPU
58 60
		{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}.Release|x86.ActiveCfg = Release|x86
59 61
		{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}.Release|x86.Build.0 = Release|x86
62
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
64
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|x86.ActiveCfg = Debug|Any CPU
65
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Debug|x86.Build.0 = Debug|Any CPU
66
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
67
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|Any CPU.Build.0 = Release|Any CPU
68
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|x86.ActiveCfg = Release|Any CPU
69
		{4B35A8E9-DBE4-4D2E-8555-1CD5CB907D2D}.Release|x86.Build.0 = Release|Any CPU
60 70
	EndGlobalSection
61 71
	GlobalSection(SolutionProperties) = preSolution
62 72
		HideSolutionNode = FALSE
DTI_PID/SPPIDConverter/AutoModeling.cs
5 5
using System.Threading.Tasks;
6 6
using Llama;
7 7
using Plaice;
8
using Ingr.RAD2D.Interop.RAD2D;
9
using Ingr.RAD2D.Internal;
10
using Ingr.RAD2D.Helper;
8 11
using Converter.BaseModel;
9 12
using Converter.SPPID.Model;
10 13
using Converter.SPPID.Properties;
......
35 38
        {
36 39
            _placement = new Placement();
37 40
            dataSource = _placement.PIDDataSource;
38

  
39 41
            //dynamic application = Interaction.GetObject("", "PIDAutomation.Application");
40 42
            //dynamic newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName);
41 43
            //application.ActiveWindow.Fit();
......
50 52

  
51 53
            foreach (LineNumber lineNumber in document.LINENUMBERS)
52 54
            {
53
                foreach (LineNumberRun run in lineNumber.RUNS)
55
                foreach (LineRun run in lineNumber.RUNS)
54 56
                {
55 57
                    SymbolModelingByRun(run);
58
                }
59
            }
60

  
61

  
62
            foreach (TrimLine trimLine in document.TRIMLINES)
63
            {
64
                foreach (LineRun run in trimLine.RUNS)
65
                {
66
                    SymbolModelingByRun(run);
67
                }
68
            }
69

  
70
            foreach (LineNumber lineNumber in document.LINENUMBERS)
71
            {
72
                foreach (LineRun run in lineNumber.RUNS)
73
                {
56 74
                    LineModelingByRun(run);
75
                }
76
            }
57 77

  
58
                    //bool IsFirst = true;
59
                    //// Run 별로 Modeling
60
                    //Symbol prevSymbol = null;
61
                    //object prevItem = null;
62

  
63
                    
64

  
65
                    //// Symbol 먼저
66
                    //foreach (var item in run.RUNITEMS)
67
                    //{
68
                    //    if (item.GetType() == typeof(Symbol))
69
                    //    {
70
                    //        Symbol symbol = item as Symbol;
71
                    //        SymbolModeling(symbol, prevSymbol, prevItem, IsFirst);
72
                    //        prevSymbol = symbol;
73
                    //    }
74
                    //    IsFirst = false;
75
                    //    prevItem = item;
76
                    //}
77

  
78

  
79
                    //Line prevLine = null;
80
                    //prevSymbol = null;
81
                    //prevItem = null;
82
                    //List<Line> lines = new List<Line>();
83
                    //foreach (var item in run.RUNITEMS)
84
                    //{
85
                    //    // Line일 경우
86
                    //    if (item.GetType() == typeof(Line))
87
                    //    {
88
                    //        Line line = item as Line;
89
                    //        if (prevLine == null)
90
                    //            lines.Add(line);
91
                    //        else if (prevLine != null)
92
                    //        {
93
                    //            if (prevLine.SPPID.MAPPINGNAME == line.SPPID.MAPPINGNAME)
94
                    //                lines.Add(line);
95
                    //            else
96
                    //            {
97
                    //                LineModeling(lines);
98
                    //                lines.Clear();
99
                    //                lines.Add(line);
100
                    //            }
101
                    //        }
102

  
103
                    //        prevLine = line;
104
                    //    }
105
                    //    // Symbol 일 경우
106
                    //    else if (item.GetType() == typeof(Symbol))
107
                    //    {
108
                    //        if (lines.Count > 0)
109
                    //        {
110
                    //            LineModeling(lines);
111
                    //            lines.Clear();
112
                    //        }
113
                    //    }
114
                    //    prevItem = item;
115
                    //}
116

  
117
                    //if (lines.Count > 0)
118
                    //    LineModeling(lines);
78
            foreach (TrimLine trimLine in document.TRIMLINES)
79
            {
80
                foreach (LineRun run in trimLine.RUNS)
81
                {
82
                    LineModelingByRun(run);
119 83
                }
120 84
            }
121 85

  
......
125 89
            System.Windows.Forms.MessageBox.Show("end");
126 90
        }
127 91

  
128
        private void LineModelingByRun(LineNumberRun run)
92
        private void LineModelingByRun(LineRun run)
129 93
        {
130 94
            Line prevLine = null;
131 95
            List<Line> lines = new List<Line>();
......
166 130
                LineModeling(lines);
167 131
        }
168 132

  
169
        private void SymbolModelingByRun(LineNumberRun run)
133
        private void SymbolModelingByRun(LineRun run)
170 134
        {
171 135
            // 양끝 Symbol 검사 후 Line이 나올때까지만 Symbol Modeling
172 136
            if (run.RUNITEMS.Count > 0)
......
196 160
            }
197 161
        }
198 162

  
199
        private void SymbolModelingByRunStart(Symbol symbol, LineNumberRun run)
163
        private void SymbolModelingByRunStart(Symbol symbol, LineRun run)
200 164
        {
201 165
            foreach (var connector in symbol.CONNECTORS)
202 166
            {
......
221 185

  
222 186
        }
223 187

  
224
        private void SymbolModelingByRunEnd(Symbol symbol, LineNumberRun run)
188
        private void SymbolModelingByRunEnd(Symbol symbol, LineRun run)
225 189
        {
226 190
            foreach (var connector in symbol.CONNECTORS)
227 191
            {
......
280 244
            }
281 245
            else if (prevItem != null && prevItem.GetType() == typeof(Symbol))
282 246
                _TargetItem = dataSource.GetSymbol(((Symbol)prevItem).SPPID.RepresentationId);
283

  
247
            
284 248
            if (prevSymbol != null)
285 249
            {
286 250
                SlopeType slopeType = SPPIDUtil.CalcSlope(x, y, prevSymbol.SPPID.ORIGINAL_X, prevSymbol.SPPID.ORIGINAL_Y);
......
291 255
                    y = prevY;
292 256
                else if (slopeType == SlopeType.VERTICAL)
293 257
                    x = prevX;
294

  
258
                
295 259
                ReleaseCOMObjects(prevLMSymbol);
296 260
            }
297 261

  
DTI_PID/SPPIDConverter/ConverterForm.cs
438 438

  
439 439
            document.SetSPPIDInfo();
440 440

  
441
            if (document.SetSPPIDMapping())
441
            if (document.SetSPPIDMapping() && document.Enable)
442 442
            {
443 443
                AutoModeling modeling = new AutoModeling(document);
444 444
                modeling.Run();
DTI_PID/SPPIDConverter/MainWrapper.Designer.cs
28 28
        /// </summary>
29 29
        private void InitializeComponent()
30 30
        {
31
            components = new System.ComponentModel.Container();
31
            this.SuspendLayout();
32
            // 
33
            // MainWrapper
34
            // 
35
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
32 36
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
37
            this.Name = "MainWrapper";
38
            this.Size = new System.Drawing.Size(185, 190);
39
            this.ResumeLayout(false);
40

  
33 41
        }
34 42

  
35 43
        #endregion
DTI_PID/SPPIDConverter/SPPIDConverter.csproj
54 54
    <ErrorReport>prompt</ErrorReport>
55 55
    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
56 56
  </PropertyGroup>
57
  <PropertyGroup>
58
    <TargetZone>LocalIntranet</TargetZone>
59
  </PropertyGroup>
60
  <PropertyGroup>
61
    <GenerateManifests>false</GenerateManifests>
62
  </PropertyGroup>
63
  <PropertyGroup>
64
    <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
65
  </PropertyGroup>
57 66
  <ItemGroup>
58 67
    <Reference Include="DevExpress.Data.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
59 68
    <Reference Include="DevExpress.Dialogs.v18.2.Core, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
......
72 81
    <Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
73 82
      <HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
74 83
    </Reference>
84
    <Reference Include="Interop.RAD2D, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46d4e6504b436e2e, processorArchitecture=MSIL">
85
      <SpecificVersion>False</SpecificVersion>
86
      <EmbedInteropTypes>True</EmbedInteropTypes>
87
      <HintPath>C:\Program Files (x86)\SmartPlant\P&amp;ID Workstation\bin\Interop.RAD2D.dll</HintPath>
88
    </Reference>
75 89
    <Reference Include="Microsoft.VisualBasic" />
76 90
    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
77 91
      <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
......
175 189
    <EmbeddedResource Include="Form\UnitForm.resx">
176 190
      <DependentUpon>UnitForm.cs</DependentUpon>
177 191
    </EmbeddedResource>
192
    <EmbeddedResource Include="MainWrapper.resx">
193
      <DependentUpon>MainWrapper.cs</DependentUpon>
194
    </EmbeddedResource>
178 195
    <EmbeddedResource Include="Properties\licenses.licx" />
179 196
    <EmbeddedResource Include="Properties\Resources.resx">
180 197
      <Generator>ResXFileCodeGenerator</Generator>
......
238 255
  </ItemGroup>
239 256
  <ItemGroup>
240 257
    <None Include="packages.config" />
258
    <None Include="Properties\app.manifest" />
241 259
    <None Include="Properties\Settings.settings">
242 260
      <Generator>SettingsSingleFileGenerator</Generator>
243 261
      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterWrapper.cs
136 136

  
137 137
                        #region Set ToolBar and Menu
138 138
                        ToolBars toolBars = application.ToolBars;
139

  
139
                        //application.ActiveDocument.SelectSet.GetEnumerator();
140 140
                        bool find = true;
141 141
                        while (find)
142 142
                        {

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)