|
@@ -42,6 +42,7 @@ namespace ST_CUBE_MES
|
|
|
this.resultDialog = new ResultDialog();
|
|
|
|
|
|
Loaded += MainWindow_Loaded;
|
|
|
+ KeyDown += MainWindow_KeyDown;
|
|
|
}
|
|
|
|
|
|
private delegate void GenericDelegate();
|
|
@@ -91,6 +92,18 @@ namespace ST_CUBE_MES
|
|
|
uxBinFilePath.IsEnabled = false;
|
|
|
uxBinFileBtn.IsEnabled = false;
|
|
|
}
|
|
|
+
|
|
|
+ uxSN.Focus();
|
|
|
+ }
|
|
|
+
|
|
|
+ private async void MainWindow_KeyDown(object sender, KeyEventArgs e)
|
|
|
+ {
|
|
|
+ if (e.Key != Key.Enter)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ await StartRun();
|
|
|
}
|
|
|
|
|
|
private void uxBinFileBtn_Click(object sender, RoutedEventArgs e)
|
|
@@ -108,6 +121,16 @@ namespace ST_CUBE_MES
|
|
|
|
|
|
private async void uxRunBtn_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
+ await StartRun();
|
|
|
+ }
|
|
|
+
|
|
|
+ private async Task StartRun()
|
|
|
+ {
|
|
|
+ if (uxRunBtn.IsEnabled == false)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
uxRunBtn.IsEnabled = false;
|
|
|
try
|
|
|
{
|
|
@@ -207,7 +230,7 @@ namespace ST_CUBE_MES
|
|
|
resultDialog = new ResultDialog();
|
|
|
resultDialog.Owner = this;
|
|
|
|
|
|
- resultDialog.MouseDown += ResultDialog_MouseDown;
|
|
|
+ resultDialog.OnAnyInput += ResultDialog_OnAnyInput;
|
|
|
resultDialog.ShowResult(false);
|
|
|
});
|
|
|
}
|
|
@@ -222,7 +245,7 @@ namespace ST_CUBE_MES
|
|
|
resultDialog = new ResultDialog();
|
|
|
resultDialog.Owner = this;
|
|
|
|
|
|
- resultDialog.MouseDown += ResultDialog_MouseDown;
|
|
|
+ resultDialog.OnAnyInput += ResultDialog_OnAnyInput;
|
|
|
resultDialog.ShowResult(true);
|
|
|
});
|
|
|
}
|
|
@@ -249,11 +272,21 @@ namespace ST_CUBE_MES
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void ResultDialog_MouseDown(object sender, MouseButtonEventArgs e)
|
|
|
+ private void ResultDialog_OnAnyInput(object sender, EventArgs e)
|
|
|
+ {
|
|
|
+ CloseResultDialog();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void CloseResultDialog()
|
|
|
{
|
|
|
- resultDialog.MouseDown -= ResultDialog_MouseDown;
|
|
|
+ resultDialog.OnAnyInput -= ResultDialog_OnAnyInput;
|
|
|
resultDialog.Close();
|
|
|
//this.Close();
|
|
|
+
|
|
|
+ if (resultDialog.IsSuccess)
|
|
|
+ {
|
|
|
+ uxSN.Text = string.Empty;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void ResultDialog_Closing(object sender, CancelEventArgs e)
|