프로젝트

일반

사용자정보

개정판 aadf6821

IDaadf682142f4830c7d7148304f3572c5886feec0
상위 bca81f4c
하위 f92c8fb8, aca9a1d1

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

dev issue #000 : roll back

Change-Id: Ib0bf624151182f74f3b08a4f8136bd95288e47b6

차이점 보기:

DTI_PID/BaseModel/BaseModel.csproj
78 78
    <Reference Include="System.Xml" />
79 79
  </ItemGroup>
80 80
  <ItemGroup>
81
    <Compile Include="Model\Base.cs" />
81
    <Compile Include="Model\ChildSymbol.cs" />
82 82
    <Compile Include="Model\Other\Association.cs" />
83 83
    <Compile Include="Model\Other\Attribute.cs" />
84 84
    <Compile Include="Model\Other\Connector.cs" />
DTI_PID/BaseModel/Model/Base.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 Converter.BaseModel
8
{
9
    public class Base
10
    {
11
        public bool GROUPING { get; set; }
12
    }
13
}
DTI_PID/BaseModel/Model/Document.cs
81 81
                SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES);
82 82
                SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES);
83 83

  
84
                // Child
85
                if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
86
                {
87
                    string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
88
                    for (int i = 0; i < array.Length; i++)
89
                    {
90
                        string[] arrConn = array[i].Split(new char[] { ',' });
91
                        symbol.CONNECTORS[i].INDEX = Convert.ToInt32(arrConn[3]);
92
                    }
93
                }
84
                //// Child
85
                //if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
86
                //{
87
                //    string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
88
                //    for (int i = 0; i < array.Length; i++)
89
                //    {
90
                //        string[] arrConn = array[i].Split(new char[] { ',' });
91
                //        symbol.CONNECTORS[i].INDEX = Convert.ToInt32(arrConn[3]);
92
                //    }
93
                //}
94 94

  
95 95
                SYMBOLS.Add(symbol);
96 96
            }
DTI_PID/BaseModel/Model/Line.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class Line : Base
9
    public class Line
10 10
    {
11 11
        private string _OWNER;
12 12
        private string _UID;
DTI_PID/BaseModel/Model/LineNumber.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class LineNumber : Base
9
    public class LineNumber
10 10
    {
11 11
        private string _UID;
12 12
        private string _TEXT;
DTI_PID/BaseModel/Model/Note.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class Note : Base
9
    public class Note
10 10
    {
11 11
        private string _UID;
12 12
        private string _ATTRIBUTEVALUE;
DTI_PID/BaseModel/Model/Other/Connector.cs
13 13
        private string _CONNECTEDITEM;
14 14
        private string _CONNECTPOINT;
15 15
        private string _SCENECONNECTPOINT;
16
        private int _INDEX;
17 16

  
18 17
        public string UID { get => _UID; set => _UID = value; }
19 18
        public int CONNECTED_AT { get => _CONNECTED_AT; set => _CONNECTED_AT = value; }
20 19
        public string CONNECTEDITEM { get => _CONNECTEDITEM; set => _CONNECTEDITEM = value; }
21 20
        public string CONNECTPOINT { get => _CONNECTPOINT; set => _CONNECTPOINT = value; }
22 21
        public string SCENECONNECTPOINT { get => _SCENECONNECTPOINT; set => _SCENECONNECTPOINT = value; }
23
        public int INDEX { get => _INDEX; set => _INDEX = value; }
24 22
    }
25 23
}
DTI_PID/BaseModel/Model/Symbol.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class Symbol : Base
9
    public class Symbol
10 10
    {
11 11
        private string _UID;
12 12
        private string _NAME;
......
27 27
        private List<Property> _PROPERTIES = new List<Property>();
28 28
        private List<Attribute> _ATTRIBUTES = new List<Attribute>();
29 29
        private int _CURRENTPOINTMODEINDEX;
30
        private List<ChildSymbol> _ChildSymbols = new List<ChildSymbol>();
30 31

  
31 32
        public string UID { get => _UID; set => _UID = value; }
32 33
        public string NAME { get => _NAME; set => _NAME = value; }
......
47 48
        public List<Property> PROPERTIES { get => _PROPERTIES; set => _PROPERTIES = value; }
48 49
        public List<Attribute> ATTRIBUTES { get => _ATTRIBUTES; set => _ATTRIBUTES = value; }
49 50
        public int CURRENTPOINTMODEINDEX { get => _CURRENTPOINTMODEINDEX; set => _CURRENTPOINTMODEINDEX = value; }
50
        
51
        public List<ChildSymbol> ChildSymbols { get => _ChildSymbols; set => _ChildSymbols = value; }
51 52
    }
52 53
}
DTI_PID/BaseModel/Model/Text.cs
6 6

  
7 7
namespace Converter.BaseModel
8 8
{
9
    public class Text : Base
9
    public class Text
10 10
    {
11 11
        private string _UID;
12 12
        private string _ATTRIBUTEVALUE;
DTI_PID/SPPIDConverter/AutoModeling.cs
34 34
            application.ActiveWindow.Zoom = 60;
35 35
            Thread.Sleep(100);
36 36

  
37
            foreach (LineNumber lineNumber in document.LINENUMBERS)
38
            {
39
                foreach (LineNumberRun run in lineNumber.RUNS)
40
                {
41
                    foreach (object item in run.RUNITEMS)
42
                    {
43

  
44

  
45
                    }
46
                }
47
            }
48 37

  
49 38
        }
50 39

  
DTI_PID/SPPIDConverter/Model/SPPID_Document.cs
12 12
    {
13 13
        public SPPID_Document(string xmlPath) : base(xmlPath)
14 14
        {
15
            SetGrouping();
15

  
16 16
        }
17 17

  
18 18
        public List<SymbolMapping> SymbolMappings { get; set; }
......
24 24
        public string DrawingNumber { get; set; }
25 25
        public string Unit { get; set; }
26 26
        public string Template { get; set; }
27

  
28

  
29
        #region Grouping Source
30
        List<object> groupingList = new List<object>();
31
        public List<Group> GROUPS = new List<Group>();
32
        private void SetGrouping()
33
        {
34
            try
35
            {
36
                // Line 기준으로 묶음
37
                foreach (Line item in LINES)
38
                    if (!item.GROUPING)
39
                        SetGroupingByItem(item);
40
                // End
41

  
42
                // Symbol 기준으로 묶음
43
                foreach (Symbol item in SYMBOLS)
44
                    if (!item.GROUPING)
45
                        SetGroupingByItem(item);
46
                // End
47
            }
48
            catch (Exception ex)
49
            {
50
                
51
            }
52
        }
53

  
54
        private void SetGroupingByItem(Base item)
55
        {
56
            try
57
            {
58
                Group group = new Group();
59
                group.Items.Add(item);
60
                bool forward = true;
61
                SetGroupingByConnectedItem(item, group.Items, ref forward);
62

  
63
                GROUPS.Add(group);
64
            }
65
            catch (Exception ex)
66
            {
67
                
68
            }
69
        }
70

  
71
        private void SetGroupingByConnectedItem(Base item, List<object> list, ref bool IsForward)
72
        {
73
            try
74
            {
75
                item.GROUPING = true;
76
                if (typeof(Line) == item.GetType())
77
                {
78
                    Line line = item as Line;
79
                    SetGroupingByConnectedItem_ConnectorsLogic(item, list, ref IsForward, line.CONNECTORS);
80
                }
81
                else if (typeof(Symbol) == item.GetType())
82
                {
83
                    Symbol symbol = item as Symbol;
84
                    // Symbol의 경우 BaseSymbol Connector가 2개 이하때 진행 / 나머지는 Grouping 종료
85
                    int baseSymbolCount = 0;
86
                    foreach (Connector symbolConnector in symbol.CONNECTORS)
87
                        if (symbolConnector.INDEX == 0)
88
                            baseSymbolCount++;
89

  
90
                    if (baseSymbolCount <= 2)
91
                        SetGroupingByConnectedItem_ConnectorsLogic(item, list, ref IsForward, symbol.CONNECTORS);
92
                }
93
                IsForward = false;
94
            }
95
            catch (Exception ex)
96
            {
97
                
98
            }
99
        }
100

  
101
        private void SetGroupingByConnectedItem_ConnectorsLogic(Base item, List<object> list, ref bool IsForward, List<Connector> connectors)
102
        {
103
            foreach (Connector connector in connectors)
104
            {
105
                // 부가 심볼일 경우 continue
106
                if (connector.INDEX > 0)
107
                    continue;
108

  
109
                Base connItem = SPPIDUtil.FindObjectByUID(this, connector.CONNECTEDITEM) as Base;
110
                if (connItem != null)
111
                {
112
                    bool result = false;
113
                    if (typeof(Line) == connItem.GetType())
114
                    {
115
                        Line connLine = connItem as Line;
116
                        // 연결되는 Item이 전부 Line일 경우 Branch, Line Type을 확인
117
                        if (item.GetType() == connLine.GetType() &&
118
                            (SPPIDUtil.IsBranchLine(((Line)item).UID, connLine) || SPPIDUtil.GetSPPIDMappingPath(this, item) != SPPIDUtil.GetSPPIDMappingPath(this, connLine)))
119
                            continue;
120

  
121
                        result = true;
122
                    }
123
                    else if (typeof(Symbol) == connItem.GetType())
124
                    {
125
                        Symbol connSymbol = connItem as Symbol;
126
                        // 연결되는 Symbol의 Connector가 부가 심볼일 경우는 result = false
127
                        foreach (Connector symbolConnector in connSymbol.CONNECTORS)
128
                        {
129
                            dynamic item2 = item;
130
                            if (symbolConnector.CONNECTEDITEM == item2.UID)
131
                            {
132
                                if (symbolConnector.INDEX == 0)
133
                                    result = true;
134
                                else
135
                                    result = false;
136
                                break;
137
                            }
138
                        }
139
                    }
140

  
141
                    if (!connItem.GROUPING && result)
142
                    {
143
                        if (IsForward)
144
                            list.Add(connItem);
145
                        else
146
                            list.Insert(0, connItem);
147
                        SetGroupingByConnectedItem(connItem, list, ref IsForward);
148
                    }
149
                }
150
            }
151
        }
152
        #endregion
153 27
    }
154 28
}
DTI_PID/SPPIDConverter/SPPIDConverter.csproj
5 5
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6 6
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7 7
    <ProjectGuid>{B6757E78-6B59-40A3-A7BB-E73E8F81B6C3}</ProjectGuid>
8
    <OutputType>WinExe</OutputType>
8
    <OutputType>Library</OutputType>
9 9
    <AppDesignerFolder>Properties</AppDesignerFolder>
10 10
    <RootNamespace>Converter.SPPID</RootNamespace>
11 11
    <AssemblyName>SPPIDConverter</AssemblyName>
......
137 137
    <Compile Include="Model\LineMapping.cs" />
138 138
    <Compile Include="Model\AssociationMapping.cs" />
139 139
    <Compile Include="Model\SymbolMapping.cs" />
140
    <Compile Include="Program.cs" />
141 140
    <Compile Include="Properties\AssemblyInfo.cs" />
142 141
    <Compile Include="Properties\Msg.Designer.cs">
143 142
      <AutoGen>True</AutoGen>
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterWrapper.cs
147 147
                                {
148 148
                                    foreach (ToolbarControl item in toolBars["Main"].Controls)
149 149
                                    {
150
                                        if (item.DLLName.Contains("SPPIDConverter"))
150
                                        if (item.DLLName.Contains("SPPIDConverter_Wrapper.dll"))
151 151
                                        {
152 152
                                            item.Delete();
153 153
                                            find = true;
......
218 218
                            DialogBar dlgBar = application.DialogBars.Add(DialogBarName, DockingFlagsConstants.igDockableOnLeft, DockingLocationConstants.igDockOnLeft,
219 219
                                 DialogBarStyleConstants.igDialogBarStyleShowCaption | DialogBarStyleConstants.igDialogBarStyleStretchToFitHorizontal | DialogBarStyleConstants.igDialogBarStyleStretchToFitVertical | DialogBarStyleConstants.igDialogBarStyleNoBorder, 0, 0);
220 220
                            //DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(wrapperDllPath, "SPPIDConverter_AutoModeling.MainControl", 733, 900);
221
                            DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.MainWrapper", 100, 100);
221
                            DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.MainWrapper", 0, 0);
222 222
                            dynamic userControl = dialogBarControl_UserControl.ControlDispatch;
223 223
                            userControl.ShowDialog();
224 224
                            //Control control = userControl as Control;

내보내기 Unified diff

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