This commit is contained in:
@@ -1078,7 +1078,7 @@
|
|||||||
FontSize="12"
|
FontSize="12"
|
||||||
Foreground="#666666"/>
|
Foreground="#666666"/>
|
||||||
<TextBlock x:Name="txtBalanceCondition2"
|
<TextBlock x:Name="txtBalanceCondition2"
|
||||||
Text="三通道<2℃/10min"
|
Text="漂移<2℃/10min"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
Foreground="#27AE60"/>
|
Foreground="#27AE60"/>
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace 建材不燃性试验炉
|
|||||||
#region 私有字段
|
#region 私有字段
|
||||||
private DispatcherTimer _statusTimer;
|
private DispatcherTimer _statusTimer;
|
||||||
private DispatcherTimer _testTimer;
|
private DispatcherTimer _testTimer;
|
||||||
private TimeSpan _testElapsedTime = TimeSpan.Zero;
|
|
||||||
private bool _isTestRunning = false;
|
private bool _isTestRunning = false;
|
||||||
private bool _isCalibrating = false;
|
private bool _isCalibrating = false;
|
||||||
private BackgroundWorker _calibrationWorker;
|
private BackgroundWorker _calibrationWorker;
|
||||||
@@ -267,53 +267,37 @@ namespace 建材不燃性试验炉
|
|||||||
private void btnStop_Click(object sender, RoutedEventArgs e)
|
private void btnStop_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
EndTest();
|
EndTest();
|
||||||
StopTest();
|
|
||||||
|
|
||||||
var result = MessageBox.Show("确定要停止实验吗?",
|
var result = MessageBox.Show("确定要停止实验吗?",
|
||||||
"停止实验", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
"停止实验", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
if (result == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
// 手动停止实验并保 SaveTestDataToReport();存数据
|
// 手动停止实验并保存数据
|
||||||
_calculator.StopExperiment(false, "手动停止");
|
_calculator.StopExperiment(false, "手动停止");
|
||||||
//SaveTestDataToReport();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StopTest()
|
//private void StopTest()
|
||||||
{
|
//{
|
||||||
_isTestRunning = false;
|
// _isTestRunning = false;
|
||||||
|
|
||||||
// 更新系统状态
|
// // 更新系统状态
|
||||||
txtSystemStatus.Text = "试验结束";
|
// txtSystemStatus.Text = "试验结束";
|
||||||
statusIndicator2.Fill = new SolidColorBrush(Colors.Green);
|
// statusIndicator2.Fill = new SolidColorBrush(Colors.Green);
|
||||||
|
|
||||||
// 检查是否已进行后称重
|
// // 提醒进行后称重
|
||||||
string finalText = txtFinalWeight.Text;
|
// Dispatcher.Invoke(() =>
|
||||||
bool hasAfterWeight = false;
|
// {
|
||||||
|
// var result = MessageBox.Show("试验已结束。\n\n请进行后称重,并将结果输入到'试验后重量'文本框中。",
|
||||||
|
// "后称重提醒",
|
||||||
|
// MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
// });
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(finalText) && finalText != "请输入试验后重量(g)")
|
// UpdateStatusBar("试验结束");
|
||||||
{
|
//}
|
||||||
if (double.TryParse(finalText, out double afterWeight) && afterWeight >= 0.1)
|
|
||||||
{
|
|
||||||
hasAfterWeight = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!hasAfterWeight)
|
|
||||||
{
|
|
||||||
// 提醒进行后称重
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show("试验已结束。\n\n请进行后称重,并将结果输入到'试验后重量'文本框中。",
|
|
||||||
"后称重提醒",
|
|
||||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
UpdateStatusBar("试验结束");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnStartDevice_Click(object sender, RoutedEventArgs e)
|
private void btnStartDevice_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1025,14 +1009,6 @@ namespace 建材不燃性试验炉
|
|||||||
weightStatusBorder.Background = Brushes.Gray;
|
weightStatusBorder.Background = Brushes.Gray;
|
||||||
|
|
||||||
|
|
||||||
// 停止试验
|
|
||||||
if (_isTestRunning)
|
|
||||||
{
|
|
||||||
StopTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置试验时间
|
|
||||||
_testElapsedTime = TimeSpan.Zero;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//测试风机
|
//测试风机
|
||||||
@@ -2153,11 +2129,7 @@ namespace 建材不燃性试验炉
|
|||||||
txtFinalBalanceTime.Text = $"{e.FinalBalanceTime}min";
|
txtFinalBalanceTime.Text = $"{e.FinalBalanceTime}min";
|
||||||
txtFinalBalanceTime.Foreground = Brushes.Green;
|
txtFinalBalanceTime.Foreground = Brushes.Green;
|
||||||
|
|
||||||
// 实验达到平衡时保存数据到报表
|
|
||||||
Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
//SaveTestDataToReport();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else if (e.IsExperimentRunning)
|
else if (e.IsExperimentRunning)
|
||||||
{
|
{
|
||||||
@@ -2259,14 +2231,18 @@ namespace 建材不燃性试验炉
|
|||||||
Dispatcher.Invoke(() =>
|
Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
string message = isBalanced ?
|
string message = isBalanced ?
|
||||||
"实验完成!已达到温度平衡条件。" :
|
"实验完成!已达到温度平衡条件,请输入测试后样品重量。" :
|
||||||
"实验结束!未达到温度平衡条件。";
|
"实验结束!未达到温度平衡条件,请输入测试后样品重量。";
|
||||||
|
|
||||||
|
txtSystemStatus.Text = "试验结束";
|
||||||
|
statusIndicator2.Fill = new SolidColorBrush(Colors.Green);
|
||||||
|
|
||||||
|
EndTest();
|
||||||
|
|
||||||
MessageBox.Show(message, "实验完成", MessageBoxButton.OK,
|
MessageBox.Show(message, "实验完成", MessageBoxButton.OK,
|
||||||
isBalanced ? MessageBoxImage.Information : MessageBoxImage.Warning);
|
isBalanced ? MessageBoxImage.Information : MessageBoxImage.Warning);
|
||||||
|
|
||||||
// 实验完成时保存数据到报表
|
|
||||||
//SaveTestDataToReport();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -2316,7 +2292,7 @@ namespace 建材不燃性试验炉
|
|||||||
txtCalculationCount.Text = "第1次";
|
txtCalculationCount.Text = "第1次";
|
||||||
txtExperimentPhase.Text = "前30分钟";
|
txtExperimentPhase.Text = "前30分钟";
|
||||||
txtBalanceStatus.Text = "未平衡";
|
txtBalanceStatus.Text = "未平衡";
|
||||||
txtBalanceCondition2.Text = "三通道<2℃/10min";
|
txtBalanceCondition2.Text = "漂移<2℃/10min";
|
||||||
txtFinalBalanceTime.Text = "未达到";
|
txtFinalBalanceTime.Text = "未达到";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user