Browse Source

fix blank board error

Robert 1 year ago
parent
commit
7a70bdc82c

+ 1 - 1
GitVersion.yml

@@ -1,6 +1,6 @@
 assembly-versioning-scheme: MajorMinorPatch
 assembly-informational-format: '{ShortSha}'
-next-version: 1.0.2
+next-version: 1.0.3
 branches: {}
 ignore:
   sha: []

+ 1 - 1
MesAdaptor/Properties/AssemblyInfo.cs

@@ -34,4 +34,4 @@ using System.Runtime.InteropServices;
 // [assembly: AssemblyVersion("1.0.2.0")]
 [assembly: AssemblyVersion("1.0.2.0")]
 [assembly: AssemblyFileVersion("1.0.2.0")]
-[assembly: AssemblyInformationalVersion("7811547")]
+[assembly: AssemblyInformationalVersion("243cda0")]

+ 18 - 7
ST-LINK_MES/MainWindow.xaml.cs

@@ -42,7 +42,7 @@ namespace ST_LINK_MES
 
         private delegate void GenericDelegate();
         //private readonly LoginWindow loginWindow;
-        private readonly ResultDialog resultDialog;
+        private ResultDialog resultDialog;
         private readonly STLinkCliPrograrmService stlinkService;
 
         public string UserId { get; internal set; }
@@ -168,9 +168,14 @@ namespace ST_LINK_MES
                 //report
                 this.Dispatcher.Invoke(() => {
                     SajetConnect.SajetTranFinishFail(errCode);
+
+
+                    resultDialog = new ResultDialog();
+                    resultDialog.Owner = this;
+
+                    resultDialog.MouseDown += ResultDialog_MouseDown;
+                    resultDialog.ShowResult(false);
                 });
-                resultDialog.MouseDown += ResultDialog_MouseDown;
-                resultDialog.ShowResult(false);
             }
 
             if (result.IsSuccess)
@@ -178,9 +183,14 @@ namespace ST_LINK_MES
                 //report
                 this.Dispatcher.Invoke(() => {
                     SajetConnect.SajetTranFinishSuccess();
+
+
+                    resultDialog = new ResultDialog();
+                    resultDialog.Owner = this;
+
+                    resultDialog.MouseDown += ResultDialog_MouseDown;
+                    resultDialog.ShowResult(true);
                 });
-                resultDialog.MouseDown += ResultDialog_MouseDown;
-                resultDialog.ShowResult(true);
             }
         }
 
@@ -208,13 +218,14 @@ namespace ST_LINK_MES
         private void ResultDialog_MouseDown(object sender, MouseButtonEventArgs e)
         {
             resultDialog.MouseDown -= ResultDialog_MouseDown;
-            this.Close();
+            resultDialog.Close();
+            //this.Close();
         }
 
         private void ResultDialog_Closing(object sender, CancelEventArgs e)
         {
             resultDialog.Closing -= ResultDialog_Closing;
-            this.Close();
+            //this.Close();
         }
 
         private bool ValidateSN()

+ 1 - 1
ST-LINK_MES/Properties/AssemblyInfo.cs

@@ -53,4 +53,4 @@ using System.Windows;
 // [assembly: AssemblyVersion("1.0.2.0")]
 [assembly: AssemblyVersion("1.0.2.0")]
 [assembly: AssemblyFileVersion("1.0.2.0")]
-[assembly: AssemblyInformationalVersion("7811547")]
+[assembly: AssemblyInformationalVersion("243cda0")]

+ 1 - 1
ST-LINK_MES/Service/STLinkCliWrapService.cs

@@ -32,7 +32,7 @@ namespace ST_LINK_MES.Service
 
         public int StartProgram(string filePath)
         {
-            return RunConsole(cliPath, $"-P \"{filePath}\"");
+            return RunConsole(cliPath, $"-P \"{filePath}\" 0x08000000");
         }
 
         public int Rest()