Files
hoodFieldOfView/头罩视野slove/头罩视野/Views/PageTest.xaml.cs

563 lines
20 KiB
C#
Raw Normal View History

2026-05-04 17:42:39 +08:00
using Microsoft.Win32;
using Modbus.Device;
2026-04-18 18:14:12 +08:00
using Sunny.UI;
//using RecordDateView;
using System;
using System.Collections.Generic;
2026-04-23 17:49:59 +08:00
using System.Net;
2026-04-18 18:14:12 +08:00
using System.Net.Sockets;
using System.Text;
using System.Windows;
using System.Windows.Controls;
2026-04-23 16:02:05 +08:00
using System.Windows.Controls.Primitives;
2026-04-18 18:14:12 +08:00
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using .Services;
using .Services.Data;
2026-04-25 18:44:18 +08:00
using static .TestDataStore;
2026-04-18 18:14:12 +08:00
namespace .Views
{
public partial class PageTest : Page
{
2026-04-22 16:02:37 +08:00
/// 只加这一个变量
2026-04-25 18:32:37 +08:00
private CancellationTokenSource? _cts;
2026-04-18 18:14:12 +08:00
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
2026-04-20 14:03:01 +08:00
DispatcherTimer _timer;
2026-04-18 18:14:12 +08:00
DataChange c = new DataChange();
Function ma;
2026-04-25 18:32:37 +08:00
bool isFinished;
2026-04-21 10:19:14 +08:00
//// 定时采集用
private DispatcherTimer testTimer;
// 保存上一条数据(用于去重)
2026-04-22 14:45:50 +08:00
private TestDataStore.TestRecord? _lastRecord;
2026-04-23 14:29:33 +08:00
private object btnLeftEye;
2026-05-04 17:42:39 +08:00
// 表跟数据存储列表
public List<dynamic> DataList = new List<dynamic>();
2026-04-27 18:48:21 +08:00
2026-04-18 18:14:12 +08:00
public PageTest()
{
InitializeComponent();
2026-04-21 16:39:29 +08:00
System.Diagnostics.Debug.WriteLine("页面加载了111111111");
2026-04-20 14:03:01 +08:00
_timer = InitDispatcherTimer();
2026-04-21 10:19:14 +08:00
// 2. 初始化定时器500毫秒 执行一次
2026-04-21 10:35:43 +08:00
2026-04-21 10:19:14 +08:00
testTimer = new DispatcherTimer();
testTimer.Interval = TimeSpan.FromMilliseconds(500); // 500ms = 0.5秒
testTimer.Tick += Timer_Tick;
2026-04-21 13:36:09 +08:00
//// 判断连接
if (!ModbusHelper.IsConnected)
{
MessageBox.Show("未连接");
return;
}
2026-04-18 18:14:12 +08:00
}
2026-04-23 17:49:59 +08:00
//
// 蓝色亮(蓝色)
private void LedOn(Ellipse led)
{
led.Fill = Brushes.LightSkyBlue;
}
// 灯灭(灰色)
private void LedOff(Ellipse led)
{
led.Fill = Brushes.LightGray;
}
2026-04-18 18:14:12 +08:00
//复位btn
private void Button_Click_Reset(object sender, RoutedEventArgs e)
{
2026-04-23 14:29:33 +08:00
btnLeft.Content = "左眼开";
btnRight.Content = "右眼开";
2026-04-23 17:49:59 +08:00
LedOff(led1);
LedOff(led0);
2026-04-18 18:14:12 +08:00
ma.BtnClickFunction(Function.ButtonType., 90);
}
//左开眼
private void Button_Click_left(object sender, RoutedEventArgs e)
{
2026-04-23 17:49:59 +08:00
// 切换文案:开是关,关是开
2026-04-23 14:29:33 +08:00
if (btnLeft.Content.ToString() == "左眼开")
{
2026-04-25 18:32:37 +08:00
2026-04-23 14:29:33 +08:00
btnLeft.Content = "左眼关";
2026-04-23 17:49:59 +08:00
LedOn(led0);
2026-04-23 14:29:33 +08:00
if (btnRight.Content.ToString() == "右眼关")
{
btnRight.Content = "右眼开";
2026-04-23 17:49:59 +08:00
LedOff(led1);
2026-04-23 14:29:33 +08:00
ma.BtnClickFunction(Function.ButtonType., 1);
}
}
else
{
btnLeft.Content = "左眼开";
2026-04-23 17:49:59 +08:00
LedOff(led0);
2026-04-23 14:29:33 +08:00
}
2026-04-18 18:14:12 +08:00
ma.BtnClickFunction(Function.ButtonType., 0);
2026-04-23 17:49:59 +08:00
//LedOn(led0);
2026-04-18 18:14:12 +08:00
}
//右开眼
2026-04-25 18:32:37 +08:00
private void Button_Click_Right(object sender, RoutedEventArgs e)
2026-04-18 18:14:12 +08:00
{
2026-04-23 14:29:33 +08:00
// 切换文案:左眼开 ↔ 左眼关
if (btnRight.Content.ToString() == "右眼开")
{
btnRight.Content = "右眼关";
2026-04-23 17:49:59 +08:00
LedOn(led1);
2026-04-23 14:29:33 +08:00
if (btnLeft.Content.ToString() == "左眼关")
{
2026-04-25 18:32:37 +08:00
2026-04-23 14:29:33 +08:00
btnLeft.Content = "左眼开";
2026-04-23 17:49:59 +08:00
LedOff(led0);
2026-04-23 14:29:33 +08:00
ma.BtnClickFunction(Function.ButtonType., 0);
}
}
else
{
btnRight.Content = "右眼开";
2026-04-23 17:49:59 +08:00
LedOff(led1);
2026-04-23 14:29:33 +08:00
}
2026-04-23 17:49:59 +08:00
ma.BtnClickFunction(Function.ButtonType., 1);
//LedOn(led1);
2026-04-18 18:14:12 +08:00
}
2026-04-23 15:34:56 +08:00
2026-04-20 14:03:01 +08:00
//反转
2026-04-21 11:15:37 +08:00
private async void Button_Click_ResDown(object sender, MouseButtonEventArgs e)
2026-04-18 18:14:12 +08:00
{
2026-04-23 12:56:18 +08:00
await _modbusMaster.WriteSingleCoilAsync(1, 10, true);
System.Diagnostics.Debug.WriteLine("反转开始");
2026-04-21 11:15:37 +08:00
}
2026-04-23 12:56:18 +08:00
private async void Button_Click_ResUp(object sender, MouseButtonEventArgs e)
2026-04-21 11:15:37 +08:00
{
2026-04-23 12:56:18 +08:00
await _modbusMaster.WriteSingleCoilAsync(1, 10, false);
System.Diagnostics.Debug.WriteLine("反转结束");
2026-04-21 11:15:37 +08:00
2026-04-18 18:14:12 +08:00
}
//正转
2026-04-25 18:32:37 +08:00
2026-04-21 11:15:37 +08:00
private async void Button_Click_ForDown(object sender, MouseButtonEventArgs e)
{
2026-04-23 12:56:18 +08:00
await _modbusMaster.WriteSingleCoilAsync(1, 11, true);
2026-04-21 11:15:37 +08:00
}
2026-04-18 18:14:12 +08:00
2026-04-23 12:56:18 +08:00
private async void Button_Click_ForUp(object sender, MouseButtonEventArgs e)
2026-04-18 18:14:12 +08:00
{
2026-04-25 18:32:37 +08:00
2026-04-23 12:56:18 +08:00
await _modbusMaster.WriteSingleCoilAsync(1, 11, false);
//System.Diagnostics.Debug.WriteLine("正传end");
2026-04-18 18:14:12 +08:00
}
2026-04-24 15:43:33 +08:00
// 在 PageTest 类里面
private RecordDate? GetRecordDatePage()
{
// 拿到主窗口
var mainWin = Application.Current.MainWindow;
// 假设你全局切换页面的 Frame 名字叫 MainFrame
var frame = mainWin.FindName("MainFrame") as Frame;
// 返回 RecordDate 实例
return frame?.Content as RecordDate;
}
2026-05-05 10:26:44 +08:00
//停止btn
private void Button_Click_Stop(object sender, RoutedEventArgs e)
{
ma.BtnClickFunction(Function.ButtonType., 103);
ButtonTest.Content = "测试";
testTimer.Stop();
2026-04-21 11:15:37 +08:00
2026-05-05 10:26:44 +08:00
}
2026-04-21 10:19:14 +08:00
//测试btn 测试按钮:读取数据,存入共享列表
2026-04-24 15:43:33 +08:00
private void Button_Click_Test(object sender, RoutedEventArgs e)
2026-04-21 10:19:14 +08:00
2026-04-18 18:14:12 +08:00
{
2026-04-23 12:56:18 +08:00
ma.BtnClickFunction(Function.ButtonType., 100);
2026-04-23 15:34:56 +08:00
ButtonTest.Content = "测试中....";
2026-04-21 10:19:14 +08:00
testTimer.Start();
2026-04-24 15:43:33 +08:00
2026-05-05 10:20:03 +08:00
// 1. 读取输入框
double stepAngle = double.Parse(fbspeed.Text); // 分辨角度 例10
2026-05-05 11:02:31 +08:00
if (double.TryParse(fbspeed.Text, out double step))
{
// 直接赋值给计算页面的静态变量
GetArea.angleStep = step;
}
2026-05-05 10:20:03 +08:00
//double speed = double.Parse(zdangle.Text); // 转动速度
int[] lightData = DataList.Cast<int>().ToArray(); // 1. 把DataListList<dynamic>转成方法需要的int[]
// 1. 定义总和变量初始为0
double totalArea = 0;//总面积
2026-05-05 11:14:25 +08:00
double maxBottomViewAngle = 0; ;//记录所有姿态里的最大下方视野
2026-05-05 10:20:03 +08:00
// 2. 从0转到180每 stepAngle 执行一次
for (double current = stepAngle; current <= 180; current += stepAngle)
{
_ = ReadLightBarData();
//开始计算视野面积
double area = GetArea.CalculateEllipseArea(lightData, _lightPositions);
totalArea += area;
2026-05-05 11:14:25 +08:00
// 单次计算下方视野角度
2026-05-05 11:02:31 +08:00
double bottomViewAngle = GetArea.CalculateBottomViewAngle(lightData, _lightPositions);
2026-05-05 11:14:25 +08:00
// 记录所有姿态里的最大/最小值
if (bottomViewAngle > maxBottomViewAngle)
{
maxBottomViewAngle = bottomViewAngle;
}
// 如果你要取最小值,用下面这段
// if (bottomViewAngle < minBottomViewAngle && bottomViewAngle > 0)
// {
// minBottomViewAngle = bottomViewAngle;
// }
2026-05-05 10:20:03 +08:00
}
2026-05-05 11:02:31 +08:00
isFinished = _modbusMaster.ReadCoils(1, 102, 1)[0];
if (isFinished)
{
Button_Click_Stop(null, null);
2026-05-05 11:14:25 +08:00
UpdateVisionResults(totalArea, maxBottomViewAngle);
2026-05-05 11:02:31 +08:00
}
2026-05-05 10:20:03 +08:00
}
//页面渲染值
public void UpdateVisionResults(double area, double BotViAn)
{
// 2. 根据按钮状态,把当前面积更新到对应的文本框
if (btnRight.Content.ToString() == "右眼开" && btnLeft.Content.ToString() == "左眼关")
{
zmsyarea.Text = area.ToString("0.00"); // 左目
}
else if (btnRight.Content.ToString() == "右眼关" && btnLeft.Content.ToString() == "左眼开")
{
ymsyarea.Text = area.ToString("0.00"); // 右目
}
else if (btnRight.Content.ToString() == "右眼关" && btnLeft.Content.ToString() == "左眼关")
{
smsyarea.Text = area.ToString("0.00"); // 双目
}
// 3. 计算空白区视野面积(双目时才有效)
if (double.TryParse(smsyarea.Text, out double binocularTotalArea))
{
double blankArea = GetArea.GetBlankViewArea(binocularTotalArea);
kbsyarea.Text = blankArea.ToString("0.00"); // 空白视野面积
}
//// 4. 计算下方视野面积
2026-05-05 11:02:31 +08:00
int botViAnInt = (int)Math.Round(BotViAn);
xfsyarea.Text = botViAnInt.ToString("0.0"); // 下方视野
2026-05-05 10:20:03 +08:00
// 5. 计算视野保存率(双目)
if (double.TryParse(smsyarea.Text, out double totalAreaForRate))
{
double binocularRate = GetArea.CalcVisionRate(totalAreaForRate);
sybhl.Text = binocularRate.ToString("0.00"); // 视野保存率
}
2026-04-18 18:14:12 +08:00
}
2026-05-05 10:26:44 +08:00
//读取灯泡的数据
private async Task ReadLightBarData()
2026-04-23 12:56:18 +08:00
{
2026-05-05 10:26:44 +08:00
// 无连接直接返回
if (_modbusMaster == null || !ModbusHelper.TcpClient.Connected)
return;
2026-04-23 12:56:18 +08:00
2026-05-05 10:26:44 +08:00
try
{
// 读取灯条寄存器地址350长度15
ushort[] registers = await _modbusMaster.ReadHoldingRegistersAsync(1, 350, 15);
// 每个 ushort 是16位低位在前
foreach (ushort reg in registers)
{
for (int bit = 0; bit < 16; bit++)
{
// 取第bit位的值0或1
int lightBit = (reg & (1 << bit)) != 0 ? 1 : 0;
DataList.Add(lightBit);
}
}
// 调试:打印转换后的数据长度
System.Diagnostics.Debug.WriteLine($"灯条二进制数据总长度:{DataList.Count}");
}
catch (Exception ex)
{
Console.WriteLine($"灯条数据读取失败:{ex.Message}");
//DataList.Clear(); // 出错时清空数据
}
2026-04-23 12:56:18 +08:00
}
2026-04-21 10:19:14 +08:00
private async void Timer_Tick(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("定时器触发了!" + DateTime.Now);
// 调用你原来的读取方
//await ReadAddr262DataAsync();
// 组装当前数据
var data = new TestDataStore.TestRecord
{
Date = DateTime.Now.ToString("yyyy-MM-dd"),
Time = DateTime.Now.ToString("HH:mm:ss"),
LeftEyeArea = double.TryParse(zmsyarea.Text, out var l) ? l : 0,
RightEyeArea = double.TryParse(ymsyarea.Text, out var r) ? r : 0,
BinocularArea = double.TryParse(smsyarea.Text, out var b) ? b : 0,
2026-04-23 12:56:18 +08:00
LowerVision = double.TryParse(xfsyarea.Text, out var lv) ? lv : 0,
2026-04-21 10:19:14 +08:00
VisionRetentionRate = double.TryParse(sybhl.Text, out var vr) ? vr : 0
};
// ==================== 去重判断 ====================
if (_lastRecord != null &&
data.LeftEyeArea == _lastRecord.LeftEyeArea &&
data.RightEyeArea == _lastRecord.RightEyeArea &&
data.BinocularArea == _lastRecord.BinocularArea &&
data.LowerVision == _lastRecord.LowerVision &&
data.VisionRetentionRate == _lastRecord.VisionRetentionRate)
{
return; // 一样就不添加
2026-04-25 18:32:37 +08:00
}
2026-04-23 13:41:26 +08:00
//原来存的数据清空 切换页面会清空
//TestDataStore.Records.Clear();
2026-04-21 10:19:14 +08:00
// 不一样 → 插入表格
TestDataStore.AddNewRecord(data);
_lastRecord = data;
}
2026-04-21 16:39:29 +08:00
2026-04-18 18:14:12 +08:00
//打印
private void Button_Click_Print(object sender, RoutedEventArgs e)
{
2026-04-20 14:03:01 +08:00
2026-04-18 18:14:12 +08:00
ma.BtnClickFunction(Function.ButtonType., 103);
}
//试样测试
2026-04-23 16:02:05 +08:00
private void TbTest_Checked(object sender, RoutedEventArgs e)
2026-04-20 14:03:01 +08:00
{
2026-04-23 16:02:05 +08:00
// 选中 → 试样测试
2026-04-25 18:32:37 +08:00
2026-04-23 17:49:59 +08:00
tbTest.Content = "空白测试";
tbTest.Background = System.Windows.Media.Brushes.LightSkyBlue;
System.Diagnostics.Debug.WriteLine($"1232312312");
2026-04-23 16:11:54 +08:00
_modbusMaster.WriteSingleCoilAsync(1, 41, true);
2026-04-23 16:02:05 +08:00
}
2026-04-18 18:14:12 +08:00
2026-04-23 16:02:05 +08:00
private void TbTest_Unchecked(object sender, RoutedEventArgs e)
{
// 取消 → 空白测试
2026-04-23 17:49:59 +08:00
tbTest.Content = "试样测试";
tbTest.Background = System.Windows.Media.Brushes.LightGray;
2026-04-23 16:11:54 +08:00
_modbusMaster.WriteSingleCoilAsync(1, 41, false);
2026-04-18 18:14:12 +08:00
}
private void Button_Click_home(object sender, RoutedEventArgs e)
{
NavigationService.Content = null;
}
//读取数据
private DispatcherTimer InitDispatcherTimer()
{
var timer = new DispatcherTimer
{
2026-04-21 16:39:29 +08:00
Interval = TimeSpan.FromMilliseconds(500)
2026-04-18 18:14:12 +08:00
};
timer.Tick += async (s, e) =>
{
if (_modbusMaster != null)
{
try
{
await ReadAddr262DataAsync();
}
catch { }
}
};
return timer;
}
2026-05-04 17:42:39 +08:00
private List<(int m, int n)> _lightPositions;
2026-04-18 18:14:12 +08:00
private async System.Threading.Tasks.Task ReadAddr262DataAsync()
{
try
{
// 创建任务列表
var tasks = new List<Task>
{
2026-04-21 16:39:29 +08:00
//ReadAndUpdateFloatAsync(200, 2, fbspeed, "F2", "°"),
//ReadAndUpdateFloatAsync(202, 2, dqangle, "F2", "°"),
//ReadAndUpdateFloatAsync(204, 2, zmsyarea, "F2", "cm²"),
//ReadAndUpdateFloatAsync(206 ,2, xfsyarea, "F2", " "),
//ReadAndUpdateFloatAsync(208, 2, smsyarea, "F2", "cm²"),
//ReadAndUpdateFloatAsync(210 ,2, ymsyarea, "F2", " "),
ReadAndUpdateFloatRangeAsync(200, 12, "F2", "°"),
2026-04-25 18:32:37 +08:00
//ReadAndUpdateFloatAsync(424 ,2, kbsyarea, "F2", "cm²"),
2026-04-21 16:39:29 +08:00
ReadAndUpdateFloatAsync(310, 2, zdangle, "F2", "°/S"),
2026-04-25 18:32:37 +08:00
//ReadAndUpdateFloatAsync(430 ,2, sybhl, "F2", " "),
2026-04-18 18:14:12 +08:00
2026-04-25 18:32:37 +08:00
//前1从站地址后1是长度
2026-05-04 17:42:39 +08:00
2026-05-05 10:20:03 +08:00
};
2026-05-04 17:42:39 +08:00
2026-04-18 18:14:12 +08:00
await Task.WhenAll(tasks);
}
catch (Exception ex)
{
ShowError($"读取数据失败:{ex.Message}");
}
}
2026-04-20 14:03:01 +08:00
// 地址, 根据格式显示字符长度 322 161 绑定页面的name 值F2 保留两位小数,单位
2026-04-18 18:14:12 +08:00
private async Task ReadAndUpdateFloatAsync(int address, int length, System.Windows.Controls.TextBox control, string format, string unit)
{
try
2026-04-22 16:02:37 +08:00
{ // 1. 页面销毁时直接退出,不执行
if (_cts?.IsCancellationRequested == true) return;
// 2. 关键:判断对象为空就直接返回,不执行
if (_modbusMaster == null) return;
2026-04-18 18:14:12 +08:00
ushort[] registers = await Task.Run(async () =>
2026-04-22 15:03:14 +08:00
await _modbusMaster!.ReadHoldingRegistersAsync(1, (ushort)address, (ushort)length)
2026-04-18 18:14:12 +08:00
);
if (registers != null && registers.Length >= 2)
{
float value = c.UshortToFloat(registers[1], registers[0]);
Dispatcher.Invoke(() => control.Text = value.ToString(format) + unit);
}
else if (registers != null && registers.Length >= 1)
{
int value = registers[0];
Dispatcher.Invoke(() => control.Text = value.ToString(format) + unit);
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"读取地址{address}失败:{ex.Message}");
}
}
2026-04-21 16:39:29 +08:00
private async Task ReadAndUpdateFloatRangeAsync(int address, int length, string format, string unit)
{
try
{
ushort[] registers = await Task.Run(async () =>
2026-04-22 15:03:14 +08:00
await _modbusMaster!.ReadHoldingRegistersAsync(1, (ushort)address, (ushort)length)
2026-04-21 16:39:29 +08:00
);
if (registers != null && registers.Length >= 2)
{
float value = c.UshortToFloat(registers[1], registers[0]);
float value2 = c.UshortToFloat(registers[3], registers[2]);
float value3 = c.UshortToFloat(registers[5], registers[4]);
2026-04-25 18:32:37 +08:00
//float value4 = c.UshortToFloat(registers[7], registers[6]);
//float value5 = c.UshortToFloat(registers[9], registers[8]);
//float value6 = c.UshortToFloat(registers[11], registers[10]);
2026-04-21 16:39:29 +08:00
Dispatcher.Invoke(() =>
{
fbspeed.Text = value.ToString(format) + unit;
dqangle.Text = value2.ToString(format) + unit;
2026-04-25 18:32:37 +08:00
//zmsyarea.Text = value3.ToString(format) + unit;
//xfsyarea.Text = value4.ToString(format) + unit;
//smsyarea.Text = value5.ToString(format) + unit;
//ymsyarea.Text = value6.ToString(format) + unit;
2026-04-21 16:39:29 +08:00
//control.Text = value.ToString(format) + unit);
});
}
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine($"读取地址{address}失败:{ex.Message}");
}
}
2026-04-18 18:14:12 +08:00
//写入
private void fbspeed_GotFocus(object sender, RoutedEventArgs e)
{
ma.WriteToPLCForNew(fbspeed.Text.Trim(), 200, Function.DataType.);
//程序等待50s 在进行
System.Threading.Tasks.Task.Delay(50);
fbspeed.Focus();
}
private void dqangle_GotFocus(object sender, RoutedEventArgs e)
{
2026-04-23 10:31:17 +08:00
ma.WriteToPLCForNew(dqangle.Text.Trim(), 202, Function.DataType.);
2026-04-18 18:14:12 +08:00
System.Threading.Tasks.Task.Delay(50);
2026-04-23 10:31:17 +08:00
dqangle.Focus();
2026-04-18 18:14:12 +08:00
}
private void zdangle_GotFocus(object sender, RoutedEventArgs e)
{
2026-04-23 10:31:17 +08:00
ma.WriteToPLCForNew(zdangle.Text.Trim(), 310, Function.DataType.);
2026-04-18 18:14:12 +08:00
System.Threading.Tasks.Task.Delay(50);
2026-04-23 10:31:17 +08:00
zdangle.Focus();
2026-04-18 18:14:12 +08:00
}
//错误信息提示
private void ShowError(string msg) => MessageBox.Show(msg, "错误", MessageBoxButton.OK, MessageBoxImage.Error);
private void GoHome(object s, RoutedEventArgs e) => NavigationService.Content = null;
2026-04-21 16:39:29 +08:00
private void GoTest(object s, RoutedEventArgs e)
{
_timer.Stop();
NavigationService.Content = new Views.PageTest();
}
2026-04-18 18:14:12 +08:00
private void GoRecord(object s, RoutedEventArgs e) => NavigationService.Content = new Views.RecordDate();
private void GoView(object s, RoutedEventArgs e) => NavigationService.Content = new Views.RecordPage();
2026-04-21 16:39:29 +08:00
2026-04-18 18:14:12 +08:00
private void Page_Loaded(object sender, RoutedEventArgs e)
{
2026-04-25 18:32:37 +08:00
2026-04-21 16:39:29 +08:00
System.Diagnostics.Debug.WriteLine("页面加载了112222222");
2026-04-20 14:03:01 +08:00
_timer.Start();
2026-04-21 11:15:37 +08:00
ma = new Function(_modbusMaster);
c = new DataChange();
2026-04-21 16:39:29 +08:00
2026-04-23 13:41:26 +08:00
//zmsyarea.Text = "4.00"; // 左目
//smsyarea.Text = "5.00"; // 双目
//kbsyarea.Text = "6.00"; // 空白
//ymsyarea.Text = "7.00"; // 右目
//xfsyarea.Text = "8.00"; // 下方
//sybhl.Text = "9.00"; // 视野保存率
2026-04-18 18:14:12 +08:00
}
2026-04-22 16:02:37 +08:00
private void Page_Unloaded(object sender, RoutedEventArgs e)
{
testTimer?.Stop();
_timer?.Stop();
_cts?.Cancel();
_cts = null;
}
2026-05-04 17:42:39 +08:00
2026-05-05 10:20:03 +08:00
2026-05-05 10:26:44 +08:00
2026-04-18 18:14:12 +08:00
}
}