diff --git a/Correlator/Dialog/CheckResponseDialog.xaml b/Correlator/Dialog/CheckResponseDialog.xaml
index c27ec65..f9d63ef 100644
--- a/Correlator/Dialog/CheckResponseDialog.xaml
+++ b/Correlator/Dialog/CheckResponseDialog.xaml
@@ -76,18 +76,13 @@
+ hc:BorderElement.CornerRadius="22"
+ Content="检查"
+ FontSize="18"
+ IsEnabled="False"
+ Style="{StaticResource FunctionButtonStyle}" />
@@ -113,12 +108,13 @@
+ Style="{StaticResource FunctionButtonStyle}" />
+ Style="{StaticResource FunctionButtonStyle}" />
-
-
-
-
-
+ hc:BorderElement.CornerRadius="22"
+ Content="检查"
+ FontSize="18"
+ IsEnabled="False"
+ Style="{StaticResource FunctionButtonStyle}" />
@@ -113,12 +108,13 @@
+ Style="{StaticResource FunctionButtonStyle}" />
+ Style="{StaticResource FunctionButtonStyle}" />
LazyDataBase =
- new Lazy(() => new DataBaseManager());
+ private static readonly Lazy LazyDataBase = new Lazy(
+ () => new DataBaseManager()
+ );
private bool _isCheckRedSensor;
private bool _isCheckBlueSensor;
@@ -309,7 +310,18 @@
//关闭窗口
_checkResponseTimer.Stop();
- _eventAggregator.GetEvent().Publish(new DialogResult(ButtonResult.OK));
+ //再次检查数据是否收集完整
+ DialogResult dialogResult;
+ if (IsDataCollectedCompleted())
+ {
+ dialogResult = new DialogResult(ButtonResult.OK);
+ }
+ else
+ {
+ dialogResult = new DialogResult(ButtonResult.Abort);
+ }
+
+ _eventAggregator.GetEvent().Publish(dialogResult);
}
};
@@ -359,5 +371,19 @@
}
};
}
+
+ ///
+ /// 判断数据是否收集完整
+ ///
+ ///
+ private bool IsDataCollectedCompleted()
+ {
+ return RedResponsePanel.Children
+ .Cast()
+ .All(child => child.Fill != new SolidColorBrush(Colors.LightGray)) &&
+ BlueResponsePanel.Children
+ .Cast()
+ .All(child => child.Fill != new SolidColorBrush(Colors.LightGray));
+ }
}
}
\ No newline at end of file