This commit is contained in:
2026-04-23 10:31:17 +08:00
parent e806b844fa
commit 75b0da86ab
4 changed files with 147 additions and 8 deletions

View File

@@ -160,8 +160,8 @@ Margin="200,0,0,0" Height="194"/>
Padding="25,20" Margin="0,0,0,15" >
<StackPanel Cursor="">
<StackPanel Orientation="Horizontal" Margin="0,0,0,15">
<TextBlock Text="左目视野面积:" Style="{StaticResource LabelStyle}"/>
<TextBox Name="zmsyarea" Text="" Style="{StaticResource TextBoxStyle}"/>
<TextBlock Text="左目视野面积:" Style="{StaticResource LabelStyle}" />
<TextBox Name="zmsyarea" Text="" Style="{StaticResource TextBoxStyle}" />
<TextBlock Text="cm²" Style="{StaticResource UnitStyle}"/>
</StackPanel>

View File

@@ -153,7 +153,7 @@ namespace 头罩视野.Views
data.VisionRetentionRate == _lastRecord.VisionRetentionRate)
{
return; // 一样就不添加
}
}
// 不一样 → 插入表格
TestDataStore.AddNewRecord(data);
_lastRecord = data;
@@ -380,17 +380,19 @@ namespace 头罩视野.Views
}
private void dqangle_GotFocus(object sender, RoutedEventArgs e)
{
ma.WriteToPLCForNew(fbspeed.Text.Trim(), 202, Function.DataType.);
ma.WriteToPLCForNew(dqangle.Text.Trim(), 202, Function.DataType.);
System.Threading.Tasks.Task.Delay(50);
fbspeed.Focus();
dqangle.Focus();
}
private void zdangle_GotFocus(object sender, RoutedEventArgs e)
{
ma.WriteToPLCForNew(fbspeed.Text.Trim(), 310, Function.DataType.);
ma.WriteToPLCForNew(zdangle.Text.Trim(), 310, Function.DataType.);
System.Threading.Tasks.Task.Delay(50);
fbspeed.Focus();
zdangle.Focus();
}
//错误信息提示
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
private void GoHome(object s, RoutedEventArgs e) => NavigationService.Content = null;

View File

@@ -135,7 +135,7 @@ namespace 头罩视野.Views
// 获取客户端
var client = ModbusHelper.TcpClient;
//进入页面是否要保留原来的数据????,
//RecordDataGrid.ItemsSource = null;
RecordDataGrid.ItemsSource = null;
RecordDataGrid.ItemsSource = TestDataStore.Records;