Files
CSI-Z420-Tablet-Multi-Funct…/Views/MainWindow.xaml.cs
2026-05-15 15:50:48 +08:00

47 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace TabletTester2025
{
public partial class MainWindow : Window
{
// 硬度测试的ViewModel实例
public MainWindow()
{
InitializeComponent();
}
//硬度测试
// 启动测试按钮点击事件
private async void btnStartTest_Click(object sender, RoutedEventArgs e)
{
}
// 模拟PLC读取硬度值实际项目替换为你的ReadFloatAsync调用
private async Task<float> ReadPlcHardnessAsync()
{
await Task.Delay(100); // 模拟通信延迟
// 这里可以直接用你之前写好的PLC读取方法
// return await _plc.ReadFloatAsync((ushort)你的硬度地址);
return new Random().Next(80, 120) + (float)new Random().NextDouble() * 10;
}
// 复位按钮点击事件
private void btnReset_Click(object sender, RoutedEventArgs e)
{
}
// 梁杆上升按钮(示例)
private void btnUp_Click(object sender, RoutedEventArgs e)
{
}
}
}