Explorar el Código

optimize the splash screen form

gsp hace 1 año
padre
commit
f6c635b234

+ 2 - 2
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="4">
+<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="0">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />
@@ -54,7 +54,7 @@
         <Member HoleName="7" rectDomian="-23000,0,15000,0" shape="0" />
       </Collection>
     </Member>
-    <Member strName="Apero90mm">
+    <Member strName="Apero12_90">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,90000,90000" shape="1:RECTANGLE" />
       <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
       <Collection RegName="Holes">

+ 15 - 16
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -45,7 +45,7 @@ namespace OTSMeasureApp
 
     public partial class OTSIncAMeasureAppForm : Form
     {
-        Thread th = new Thread(new ThreadStart(DoSplash));
+        Thread th ;
         public static string m_SamplespaceWindowName = "样品台";
         public static string m_MeasureStauWindowName = "测量状态";
         public static string m_MeasureRetWindowName = "测量结果";
@@ -101,10 +101,13 @@ namespace OTSMeasureApp
         }
 
         public FileSystemWatcher fileWatcher = new FileSystemWatcher(Application.StartupPath+ @"\Config\SysData");
+         Form sp;
+        
         public OTSIncAMeasureAppForm()
         {
-
+            th = new Thread(new ThreadStart(DoSplash));
             th.Start();
+           
 
             InitializeComponent();
 
@@ -167,8 +170,8 @@ namespace OTSMeasureApp
         {
             try
             {
-               
 
+               
                 ArrangWorkspaceWindow();
 
                 log = NLog.LogManager.GetCurrentClassLogger();
@@ -236,7 +239,8 @@ namespace OTSMeasureApp
             {
                 log.Error(" OTSIncAMeasureAppForm_Load:" + ex.ToString());
             }
-            th.Abort();
+           
+            sp.Close();
             this.Activate();
         }
         public void ArrangWorkspaceWindow()
@@ -264,10 +268,9 @@ namespace OTSMeasureApp
 
 
         }
-       static private void DoSplash()
+        private void DoSplash()
         {
-            try
-            {
+            
                 string path = @".\Config\SysData\OTSProgMgrParam.pmf";
                 XmlDocument xmlDocument = new XmlDocument();
                 xmlDocument.Load(path);
@@ -276,19 +279,15 @@ namespace OTSMeasureApp
                 string str = xe.GetAttribute("SysType");
                 if (str == "IncA")
                 {
-                    OTSSplashScreen_IncA sp = new OTSSplashScreen_IncA();
-                    sp.ShowDialog();
+                 sp = new OTSSplashScreen_IncA();
+                sp.ShowDialog();
                 }
                 else if (str == "CleannessA")
                 {
-                    OTSSplashScreen_Cleanness sp = new OTSSplashScreen_Cleanness();
-                    sp.ShowDialog();
+                 sp = new OTSSplashScreen_Cleanness();
+                sp.ShowDialog();
                 }
-            }
-            catch (ThreadAbortException)
-            {
-
-            }
+            
         }
 
         private void rbReport_Click(object sender, EventArgs e)

+ 4 - 2
OTSIncAMeasureApp/Program.cs

@@ -50,8 +50,10 @@ namespace OTSMeasureApp
 
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
-            OTSSplashScreen_IncA sp = new OTSSplashScreen_IncA();
-          
+            //OTSSplashScreen_IncA sp = new OTSSplashScreen_IncA();
+            //sp.Show();
+            //var f = ;
+            //f.sp = sp;
             Application.Run(new OTSIncAMeasureAppForm());
            
         }