hytos / DTI_PID / SPPIDConverter / MainWrapper.cs @ cfda1fed
이력 | 보기 | 이력해설 | 다운로드 (1.58 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.ComponentModel; |
4 |
using System.Drawing; |
5 |
using System.Data; |
6 |
using System.Linq; |
7 |
using System.Text; |
8 |
using System.Threading.Tasks; |
9 |
using System.Threading; |
10 |
using System.Windows.Forms; |
11 |
using Converter.SPPID.Model; |
12 |
namespace Converter.SPPID |
13 |
{ |
14 |
public partial class MainWrapper : UserControl |
15 |
{ |
16 |
public MainWrapper() |
17 |
{ |
18 |
InitializeComponent(); |
19 |
} |
20 |
|
21 |
Thread thread; |
22 |
|
23 |
public void ShowDialog() |
24 |
{ |
25 |
ConverterForm form = new ConverterForm(); |
26 |
if (form.ShowDialog() == DialogResult.OK) |
27 |
{ |
28 |
List<SPPID_Document> documents = form.Documents; |
29 |
//dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
30 |
//dynamic newDrawing = application.Drawings.Add(sUnit, sTemplate, sDrawingNumber, sDrawingName); |
31 |
|
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(); |
51 |
} |
52 |
} |
53 |
} |
54 |
} |