개정판 cfda1fed
dev issue #000 : edit
Change-Id: Ic5955a9818b10a854a99574f6a0dde96bfa2ec29
DTI_PID/BaseModel/BaseModel.csproj | ||
---|---|---|
78 | 78 |
<Reference Include="System.Xml" /> |
79 | 79 |
</ItemGroup> |
80 | 80 |
<ItemGroup> |
81 |
<Compile Include="Model\Base.cs" /> |
|
81 | 82 |
<Compile Include="Model\Other\Association.cs" /> |
82 | 83 |
<Compile Include="Model\Other\Attribute.cs" /> |
83 | 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 | ||
---|---|---|
99 | 99 |
AREA = item.Element("AREA").Value, |
100 | 100 |
THICKNESS = item.Element("THICKNESS").Value, |
101 | 101 |
}; |
102 |
SetConnectors(item.Element("CONNECTORS"), line.CONNECTOR); |
|
102 |
SetConnectors(item.Element("CONNECTORS"), line.CONNECTORS);
|
|
103 | 103 |
LINES.Add(line); |
104 | 104 |
} |
105 | 105 |
} |
DTI_PID/BaseModel/Model/Line.cs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
namespace Converter.BaseModel |
8 | 8 |
{ |
9 |
public class Line |
|
9 |
public class Line : Base
|
|
10 | 10 |
{ |
11 | 11 |
private string _OWNER; |
12 | 12 |
private string _UID; |
... | ... | |
15 | 15 |
private string _TYPE; |
16 | 16 |
private string _AREA; |
17 | 17 |
private string _THICKNESS; |
18 |
private List<Connector> _CONNECTOR = new List<Connector>(); |
|
18 |
private List<Connector> _CONNECTORS = new List<Connector>();
|
|
19 | 19 |
|
20 | 20 |
public string OWNER { get => _OWNER; set => _OWNER = value; } |
21 | 21 |
public string UID { get => _UID; set => _UID = value; } |
... | ... | |
24 | 24 |
public string TYPE { get => _TYPE; set => _TYPE = value; } |
25 | 25 |
public string AREA { get => _AREA; set => _AREA = value; } |
26 | 26 |
public string THICKNESS { get => _THICKNESS; set => _THICKNESS = value; } |
27 |
public List<Connector> CONNECTOR { get => _CONNECTOR; set => _CONNECTOR = value; }
|
|
27 |
public List<Connector> CONNECTORS { get => _CONNECTORS; set => _CONNECTORS = value; }
|
|
28 | 28 |
} |
29 | 29 |
} |
DTI_PID/BaseModel/Model/LineNumber.cs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
namespace Converter.BaseModel |
8 | 8 |
{ |
9 |
public class LineNumber |
|
9 |
public class LineNumber : Base
|
|
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 |
|
9 |
public class Note : Base
|
|
10 | 10 |
{ |
11 | 11 |
private string _UID; |
12 | 12 |
private string _ATTRIBUTEVALUE; |
DTI_PID/BaseModel/Model/Symbol.cs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
namespace Converter.BaseModel |
8 | 8 |
{ |
9 |
public class Symbol |
|
9 |
public class Symbol : Base
|
|
10 | 10 |
{ |
11 | 11 |
private string _UID; |
12 | 12 |
private string _NAME; |
DTI_PID/BaseModel/Model/Text.cs | ||
---|---|---|
6 | 6 |
|
7 | 7 |
namespace Converter.BaseModel |
8 | 8 |
{ |
9 |
public class Text |
|
9 |
public class Text : Base
|
|
10 | 10 |
{ |
11 | 11 |
private string _UID; |
12 | 12 |
private string _ATTRIBUTEVALUE; |
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Llama; |
|
7 |
using Plaice; |
|
8 |
using Converter.BaseModel; |
|
9 |
using Converter.SPPID.Model; |
|
10 |
using Converter.SPPID.Properties; |
|
11 |
using Converter.SPPID.Util; |
|
12 |
using Converter.SPPID.DB; |
|
13 |
|
|
14 |
using System.Threading; |
|
15 |
using Microsoft.VisualBasic; |
|
16 |
using Newtonsoft.Json; |
|
17 |
|
|
18 |
namespace Converter.SPPID |
|
19 |
{ |
|
20 |
public class AutoModeling |
|
21 |
{ |
|
22 |
SPPID_Document document; |
|
23 |
public AutoModeling(SPPID_Document document) |
|
24 |
{ |
|
25 |
this.document = document; |
|
26 |
} |
|
27 |
|
|
28 |
public void Run() |
|
29 |
{ |
|
30 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
31 |
dynamic newDrawing = application.Drawings.Add(document.Unit, document.Template, document.DrawingNumber, document.DrawingName); |
|
32 |
application.ActiveWindow.Fit(); |
|
33 |
Thread.Sleep(100); |
|
34 |
application.ActiveWindow.Zoom = 60; |
|
35 |
Thread.Sleep(100); |
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
} |
|
42 |
|
|
43 |
|
|
44 |
private void SymbolModeling(Symbol symbol) |
|
45 |
{ |
|
46 |
|
|
47 |
} |
|
48 |
|
|
49 |
private void LineModeling(Line line) |
|
50 |
{ |
|
51 |
|
|
52 |
} |
|
53 |
|
|
54 |
private void LineNumberModeling(LineNumber lineNumber) |
|
55 |
{ |
|
56 |
|
|
57 |
} |
|
58 |
|
|
59 |
private void TextModeling(Text text) |
|
60 |
{ |
|
61 |
|
|
62 |
} |
|
63 |
|
|
64 |
private void NoteModeling(Note note) |
|
65 |
{ |
|
66 |
|
|
67 |
} |
|
68 |
|
|
69 |
} |
|
70 |
} |
DTI_PID/SPPIDConverter/CloseOPCForm.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Runtime.InteropServices; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
using System.Threading; |
|
8 |
|
|
9 |
namespace Converter.SPPID |
|
10 |
{ |
|
11 |
class CloseOPCForm |
|
12 |
{ |
|
13 |
[DllImport("user32")] |
|
14 |
public static extern int FindWindow(string lpClassName, string lpWindowName); |
|
15 |
[DllImport("user32.dll")] |
|
16 |
public static extern int FindWindowEx(int hWnd1, int hWnd2, string lpsz1, string lpsz2); |
|
17 |
[DllImport("user32")] |
|
18 |
public static extern int SendMessage(IntPtr hWnd, int uMsg, IntPtr WParam, IntPtr LParam); |
|
19 |
|
|
20 |
static int WM_CLOSE = 0x0010; |
|
21 |
|
|
22 |
private static bool run; |
|
23 |
|
|
24 |
public static void Run() |
|
25 |
{ |
|
26 |
run = true; |
|
27 |
Thread thread = new Thread(loop => { |
|
28 |
while (run) |
|
29 |
{ |
|
30 |
CloseForm(); |
|
31 |
} |
|
32 |
}); |
|
33 |
thread.Start(); |
|
34 |
} |
|
35 |
|
|
36 |
public static void Stop() |
|
37 |
{ |
|
38 |
run = false; |
|
39 |
} |
|
40 |
|
|
41 |
public static void CloseForm() |
|
42 |
{ |
|
43 |
try |
|
44 |
{ |
|
45 |
int handle = FindWindow("ThunderRT6FormDC", "Set Stockpile Location of Partner OPC"); |
|
46 |
if (handle > 0) |
|
47 |
{ |
|
48 |
Thread.Sleep(100); |
|
49 |
SendMessage((IntPtr)handle, WM_CLOSE, (IntPtr)0, (IntPtr)0); |
|
50 |
Thread.Sleep(100); |
|
51 |
} |
|
52 |
} |
|
53 |
catch (Exception ex) |
|
54 |
{ |
|
55 |
|
|
56 |
} |
|
57 |
} |
|
58 |
} |
|
59 |
} |
DTI_PID/SPPIDConverter/MainWrapper.cs | ||
---|---|---|
6 | 6 |
using System.Linq; |
7 | 7 |
using System.Text; |
8 | 8 |
using System.Threading.Tasks; |
9 |
using System.Threading; |
|
9 | 10 |
using System.Windows.Forms; |
10 | 11 |
using Converter.SPPID.Model; |
11 |
|
|
12 | 12 |
namespace Converter.SPPID |
13 | 13 |
{ |
14 | 14 |
public partial class MainWrapper : UserControl |
... | ... | |
18 | 18 |
InitializeComponent(); |
19 | 19 |
} |
20 | 20 |
|
21 |
Thread thread; |
|
22 |
|
|
21 | 23 |
public void ShowDialog() |
22 | 24 |
{ |
23 | 25 |
ConverterForm form = new ConverterForm(); |
... | ... | |
27 | 29 |
//dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
28 | 30 |
//dynamic newDrawing = application.Drawings.Add(sUnit, sTemplate, sDrawingNumber, sDrawingName); |
29 | 31 |
|
30 |
MessageBox.Show(documents.Count.ToString() + "new"); |
|
32 |
thread = new Thread(func => |
|
33 |
{ |
|
34 |
CloseOPCForm.Run(); |
|
35 |
try |
|
36 |
{ |
|
37 |
foreach (SPPID_Document document in documents) |
|
38 |
{ |
|
39 |
AutoModeling autoModeling = new AutoModeling(document); |
|
40 |
autoModeling.Run(); |
|
41 |
} |
|
42 |
} |
|
43 |
catch (Exception ex) |
|
44 |
{ |
|
45 |
MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
46 |
} |
|
47 |
CloseOPCForm.Stop(); |
|
48 |
|
|
49 |
}); |
|
50 |
thread.Start(); |
|
31 | 51 |
} |
32 | 52 |
} |
33 | 53 |
} |
DTI_PID/SPPIDConverter/Model/Group.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.SPPID.Model |
|
8 |
{ |
|
9 |
public class Group |
|
10 |
{ |
|
11 |
private List<object> _Items = new List<object>(); |
|
12 |
private bool _Enable = true; |
|
13 |
|
|
14 |
public List<object> Items { get => _Items; set => _Items = value; } |
|
15 |
public bool Enable { get => _Enable; set => _Enable = value; } |
|
16 |
} |
|
17 |
} |
DTI_PID/SPPIDConverter/Model/SPPID_Document.cs | ||
---|---|---|
11 | 11 |
{ |
12 | 12 |
public SPPID_Document(string xmlPath) : base(xmlPath) |
13 | 13 |
{ |
14 |
|
|
14 |
|
|
15 | 15 |
} |
16 | 16 |
|
17 | 17 |
public List<SymbolMapping> SymbolMappings { get; set; } |
DTI_PID/SPPIDConverter/SPPIDConverter.csproj | ||
---|---|---|
96 | 96 |
<Reference Include="System.Xml" /> |
97 | 97 |
</ItemGroup> |
98 | 98 |
<ItemGroup> |
99 |
<Compile Include="AutoModeling\AutoModeling.cs" />
|
|
100 |
<Compile Include="AutoModeling\CloseOPCForm.cs" />
|
|
99 |
<Compile Include="AutoModeling.cs" /> |
|
100 |
<Compile Include="CloseOPCForm.cs" /> |
|
101 | 101 |
<Compile Include="DB\SPPID_DB.cs" /> |
102 | 102 |
<Compile Include="DB\SPPID_DBInfo.cs" /> |
103 | 103 |
<Compile Include="ConverterForm.cs"> |
... | ... | |
131 | 131 |
<DependentUpon>MainWrapper.cs</DependentUpon> |
132 | 132 |
</Compile> |
133 | 133 |
<Compile Include="Model\ETCSetting.cs" /> |
134 |
<Compile Include="Model\Group.cs" /> |
|
134 | 135 |
<Compile Include="Model\LineNumberMapping.cs" /> |
135 | 136 |
<Compile Include="Model\SPPID_Document.cs" /> |
136 | 137 |
<Compile Include="Model\LineMapping.cs" /> |
... | ... | |
285 | 286 |
<ItemGroup> |
286 | 287 |
<None Include="Resources\pencolor_16x16.png" /> |
287 | 288 |
</ItemGroup> |
288 |
<ItemGroup /> |
|
289 |
<ItemGroup> |
|
290 |
<Folder Include="AutoModeling\" /> |
|
291 |
</ItemGroup> |
|
289 | 292 |
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> |
290 | 293 |
</Project> |
DTI_PID/SPPIDConverter_DialogBarWrapper/SPPIDConverterWrapper.cs | ||
---|---|---|
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", 0, 0);
|
|
221 |
DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.MainWrapper", 100, 100);
|
|
222 | 222 |
dynamic userControl = dialogBarControl_UserControl.ControlDispatch; |
223 | 223 |
userControl.ShowDialog(); |
224 | 224 |
//Control control = userControl as Control; |
내보내기 Unified diff