1 Commits
test1 ... new

Author SHA1 Message Date
529c0a008b test 2026-05-04 14:28:31 +08:00
9 changed files with 0 additions and 1716 deletions

View File

@@ -7,234 +7,6 @@ namespace 头罩视野.Services
{ {
class GetArea class GetArea
{ {
//public const double standardArea = 140;
/// <summary>有效亮度阈值:区分有效视野和噪声/遮挡的门槛设备标定经验值≥12判定为有效视野</summary>
public const int threshold = 12;
/// <summary>异常值差值阈值:过滤孤立尖峰噪声当前点与前后点差值均>30时判定为异常值并插值修正</summary>
public const int OutlierDiffThreshold = 30;
/// <summary>灯条通道总数360°圆周采样点数量对应每点5°360° ÷ 72 = 5°/点符合国标GB2890-2022要求</summary>
public const int lightNum = 72;
/// <summary>设备最大检测半径理论上的最大视野半径单位mm用来计算理论圆面积</summary> 这个是我们自己的设备值
public const int maxRadius_mm = 330;
/// <summary>单眼标准标定面积:无面罩空标准头模的单眼实测面积 国标视野保存率计算的基准值单位cm²</summary>
public const double standardArea = 5180;
/// <summary>双目标准标定总面积无面罩空标准头模的双目总实测面积国标总视野保存率计算的基准值单位cm²</summary>
public const double StandardTotal = 10360;
// 补充:用半径计算的单眼理论圆面积(供参考) 公式:π × 半径²单位cm²
public static readonly double standardAreaOus = Math.PI * maxRadius_mm * maxRadius_mm / 100;
//双目重叠标准
public static double StandardBinocular = 4150;
// 剔除异常值,用相邻数据插值
public static List<dynamic> RemoveOutliers(List<dynamic> data)
{
for (int i = 3; i < data.Count - 1; i++)
{
if (Math.Abs(data[i] - data[i - 1]) > OutlierDiffThreshold && Math.Abs(data[i] - data[i + 1]) > OutlierDiffThreshold)
{
data[i] = (dynamic)((data[i - 1] + data[i + 1]) / 2);
}
//过滤无效信号
if (data[i] < threshold)
{
data[i] = 0;
}
}
return data;
}
/// <summary>
/// 计算单眼视野面积
/// </summary>
/// <param name="groupData">20组数据每组lightNum个通道</param>
/// <param name="threshold">有效亮度阈值如12</param>
/// <param name="standardArea">如140</param>
/// <returns>计算好的面积</returns>
///
public static double CalculateEyeArea(List<dynamic> groupData)
{
double[] avg = new double[lightNum];
for (int c = 0; c < lightNum; c++)
{
double sum = 0;
foreach (var g in groupData) sum += g[c];
avg[c] = sum / groupData.Count;
}
int valid = avg.Count(v => v >= threshold);
return (valid / lightNum) * standardArea;
}
//计算双目视野面积
/// <summary>
/// 计算双目视野面积(左右眼同时可见)
/// </summary>
public static double CalcBinocularArea(
List<dynamic> leftGroups,
List<dynamic> rightGroups
)
{
// 1. 左眼平均数据
double[] leftAvg = GetEyeAvgArray(leftGroups);
// 2. 右眼平均数据
double[] rightAvg = GetEyeAvgArray(rightGroups);
// 3. 双目同时有效点数(左右都亮才算)
int biValid = 0;
for (int i = 0; i < lightNum; i++)
{
if (leftAvg[i] >= threshold && rightAvg[i] >= threshold)
biValid++;
}
// 4. 双目视野面积
return (biValid / lightNum) * standardArea;
}
//下方视野角度
/// <summary>
/// GB2890-2022 计算 单眼下方视野角度
/// eyeData单眼lightNum路平均数据数组
/// threshold有效亮度阈值
/// </summary>
public static double CalcLowerAngle(double[] eyeData, double perAngle)
{
// 总lightNum点 每点5°
int totalPoint = lightNum;
// 国标最下方起始点位第54号开始为正下方
int startDownIndex = 54;
int validCount = 0;
// 从最下方向上 连续检测有效点
for (int i = 0; i < lightNum / 2; i++)
{
int idx = (startDownIndex + i) % totalPoint;
if (eyeData[idx] >= threshold)
{
validCount++;
}
else
{
// 断开直接停止
break;
}
}
// 下方视野角度 = 有效点数 × 单步角度
return validCount * perAngle;
}
/// <summary>
/// 计算单眼lightNum点通道平均值数组
/// </summary>
/// <param name="eyeGroups">多组采样数据集合</param>
/// <returns>lightNum点通道平均值数组</returns>
public static double[] GetEyeAvgArray(List<dynamic> eyeGroups)
{
if (eyeGroups == null || eyeGroups.Count == 0)
return new double[lightNum]; // 无数据时返回全0数组
double[] avg = new double[lightNum];
for (int i = 0; i < lightNum; i++)
{
double sum = 0;
foreach (var group in eyeGroups)
{
sum += group[i];
}
avg[i] = sum / eyeGroups.Count;
}
return avg;
}
//视野保存率
//double totalSaveRate = (总视野面积 / 标准总视野面积) * 100;
public static class VisionCalculator
{
/// <summary>
/// 计算视野保存率
/// </summary>
/// <param name="actualArea">实测面积</param>
/// <param name="standardArea">标准面积</param>
/// <returns>保存率 %</returns>
public static double CalculateVisionSaveRate(double actualArea)
{
return (actualArea / standardArea) * 100;
}
}
//===== 2. 传入你采集的实测面积 =====
// leftArea左眼实测 rightArea右眼实测 binArea双目重叠实测
public static double CalcVisionRate(double leftArea, double rightArea)
{
// 总视野实测 = 左+右
double totalSi = leftArea + rightArea;
// 1. 总视野保存率
double ratioTotal = totalSi / StandardTotal;
double gammaTotal = GetVisionGamma(ratioTotal);
double totalRate = gammaTotal * ratioTotal * 100;
return (totalRate);
}
/// <summary>
/// GB2890-2022 自动获取 总视野/双目视野 校正系数γ
/// </summary>
/// <param name="ratio">实测面积/标准面积 比值(0~1)</param>
/// <returns>校正系数 γ</returns>
public static double GetVisionGamma(double ratio)
{
// X视野残存率 Si/S0
double[] xData = { 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0 };
// 总视野 γ 对应值
double[] gammaTotal = { 1.22, 1.18, 1.14, 1.10, 1.06, 1.03, 1.02, 1.01, 1.00 };
double[] yData = gammaTotal;
// 边界限制
if (ratio <= xData[0]) return yData[0];
if (ratio >= xData.Last()) return 1.0;
// 线性插值
for (int i = 0; i < xData.Length - 1; i++)
{
if (ratio >= xData[i] && ratio <= xData[i + 1])
{
double t = (ratio - xData[i]) / (xData[i + 1] - xData[i]);
return yData[i] + t * (yData[i + 1] - yData[i]);
}
}
return 1.0;
}
// 设备固定参数 // 设备固定参数
private static double R = 330; // 半球半径 private static double R = 330; // 半球半径
@@ -350,15 +122,6 @@ namespace 头罩视野.Services
//
//private static System.Drawing.Point GetLightPoint(int m, int n)
//{
// double radH = m * angleStep * Math.PI / 180;
// double radV = n * angleStep * Math.PI / 180;
// double x = R * Math.Tan(radH);
// double y = R * Math.Tan(radV);
// return new System.Drawing.Point((int)x, (int)y);
//}
} }

View File

@@ -1,244 +0,0 @@
<Page x:Class="头罩视野.Views.RecordDate"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:头罩视野.Views"
mc:Ignorable="d"
d:DesignHeight="768" d:DesignWidth="1024"
Background="#F5F7FA"
Title="RecordDate" Loaded="Page_Loaded" Unloaded="Page_Unloaded">
<Page.Resources>
<!-- 标题样式 -->
<Style x:Key="MainTitleStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="28"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="#2C3E50"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,15,0,15"/>
</Style>
<!-- DataGrid 样式 -->
<Style x:Key="DataGridStyle" TargetType="DataGrid">
<Setter Property="Background" Value="#FFFFFF"/>
<Setter Property="BorderBrush" Value="#E5E8E8"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="GridLinesVisibility" Value="Horizontal"/>
<Setter Property="HorizontalGridLinesBrush" Value="#ECF0F1"/>
<Setter Property="VerticalGridLinesBrush" Value="#ECF0F1"/>
<Setter Property="HeadersVisibility" Value="Column"/>
<Setter Property="CanUserAddRows" Value="False"/>
<Setter Property="CanUserDeleteRows" Value="False"/>
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="SelectionMode" Value="Single"/>
<Setter Property="SelectionUnit" Value="FullRow"/>
<Setter Property="RowHeight" Value="36"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="#2C3E50"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
</Style>
<!-- DataGrid 列头样式 -->
<Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#E5E5E5"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Height" Value="40"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="BorderBrush" Value="#E5E5E5"/>
<Setter Property="BorderThickness" Value="0,0,1,0"/>
</Style>
<!-- DataGrid 行样式 -->
<Style x:Key="DataGridRowStyle" TargetType="DataGridRow">
<Setter Property="Background" Value="White"/>
<Style.Triggers>
<!-- 斑马线效果 -->
<Trigger Property="AlternationIndex" Value="0">
<Setter Property="Background" Value="#FFFFFF"/>
</Trigger>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="#F8F9F9"/>
</Trigger>
<!-- 鼠标悬停效果 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#EBF5FB"/>
</Trigger>
<!-- 选中效果 -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#D6EAF8"/>
<Setter Property="BorderBrush" Value="#3498DB"/>
<Setter Property="BorderThickness" Value="1"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- DataGrid 单元格样式 -->
<Style x:Key="DataGridCellStyle" TargetType="DataGridCell">
<Setter Property="BorderBrush" Value="#ECF0F1"/>
<Setter Property="BorderThickness" Value="0,0,1,1"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="True">
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#3498DB"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Foreground" Value="#fff"/>
<Setter Property="Height" Value="70"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderBrush" Value="#fff"/>
</Style>
</Page.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- 顶部标题栏 -->
<Grid Grid.Row="0" Margin="0 0 0 10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="2" Style="{StaticResource MainTitleStyle}" Text="数据记录"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
<Grid Grid.Row="1">
<TextBlock Text="左眼" FontSize="16" Margin="0,0,0,5"/>
</Grid>
<!--表格1-->
<Grid Grid.Row="2" Margin="0 0 0 10">
<DataGrid x:Name="dataGrid1"
Height="190"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
HeadersVisibility="Column"
GridLinesVisibility="All"
Style="{StaticResource DataGridStyle}"
AlternationCount="2"
ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}"
RowStyle="{StaticResource DataGridRowStyle}"
CellStyle="{StaticResource DataGridCellStyle}"
>
<!-- 表格列(你要的 6 列) -->
<DataGrid.Columns>
<DataGridTextColumn Header="编号" Binding="{Binding Id}" Width="60"/>
<DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="120"/>
<DataGridTextColumn Header="日期" Binding="{Binding Date}" Width="120"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<Grid Grid.Row="3">
<TextBlock Text="右眼" FontSize="16" Margin="0,10,0,5"/>
<Button Content="保存" FontSize="18"
Width="120" Height="50" Background="#3498DB" Foreground="White" HorizontalAlignment="Left" Margin="850,0,0,5" Click="btnSaveLeft_Click" />
</Grid>
<!--表格2-->
<Grid Grid.Row="4" Margin="0 0 0 10">
<DataGrid x:Name="dataGrid2"
Height="190"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
AutoGenerateColumns="False"
CanUserAddRows="False"
IsReadOnly="True"
HeadersVisibility="Column"
GridLinesVisibility="All"
Style="{StaticResource DataGridStyle}"
AlternationCount="2"
ColumnHeaderStyle="{StaticResource DataGridColumnHeaderStyle}"
RowStyle="{StaticResource DataGridRowStyle}"
CellStyle="{StaticResource DataGridCellStyle}"
>
<!-- 表格列(你要的 6 列) -->
<DataGrid.Columns>
<DataGridTextColumn Header="编号" Binding="{Binding Id}" Width="80"/>
<DataGridTextColumn Header="时间" Binding="{Binding Time}" Width="120"/>
<DataGridTextColumn Header="日期" Binding="{Binding Date}" Width="120"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<!--按钮-->
<Grid Grid.Row="5" >
<!-- 停止 -->
<Button Content="保存" FontSize="18"
Width="120" Height="50" Background="#3498DB" Foreground="White" HorizontalAlignment="Left" Margin="850,0,0,0" Click="btnSaveRight_Click"/>
<Button Content="清除" FontSize="18"
Width="120" Height="50" Background="White" BorderBrush="red" Foreground="red" HorizontalAlignment="Left" Margin="14,0,0,0" PreviewMouseLeftButtonDown ="btnClear_MouseDown" PreviewMouseLeftButtonUp ="btnClear_MouseUp" />
<TextBlock HorizontalAlignment="Left" Foreground="red"
FontSize="18"
Width="142" Margin="148,25,0,23" RenderTransformOrigin="0.5,0.5">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="-0.614"/>
<RotateTransform/>
<TranslateTransform Y="-0.739"/>
</TransformGroup>
</TextBlock.RenderTransform><Run Language="zh-cn" Text="备注: 清除长按"/></TextBlock>
</Grid>
<!-- 底部导航栏 -->
<Grid Grid.Row="6" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="0" Content="主页"
Click="GoHome" />
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="1" Content="测试界面"
Click="GoTest" />
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="2" Content="数据记录"
Click="GoRecord" />
<Button Style="{StaticResource TabButtonStyle}" Grid.Column="3" Content="记录画面"
Click="GoView" />
</Grid>
</Grid>
</Page>

View File

@@ -1,355 +0,0 @@
using Microsoft.Win32;
using Modbus.Device;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Timers;
using System.Windows;
using System.Windows.Controls;
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 .Services;
using .Services.Data;
using static .TestDataStore;
namespace .Views
{
/// <summary>
/// RecordDate.xaml 的交互逻辑
/// </summary>
///
public partial class RecordDate : Page
{
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
private System.Timers.Timer? _plcReadTimer;
// 表跟数据存储列表
public List<dynamic> LeftEyeDataList = new List<dynamic>();
public List<dynamic> RightEyeDataList = new List<dynamic>();
public List<dynamic> CalLeftData = new List<dynamic>();
public List<dynamic> CalRightData = new List<dynamic>();
// 配置和你PLC地址完全对应 左目
private const int LeftEyeStartAddress = 1362; // D1362
private const int ChannelCount = 72; // 72个通道
private const int RegistersPerChannel = 1; // 每个通道2个寄存器Float
//右目
private const int RightEyeStartAddress = 1218; // D1218
//// 长按清除用
private bool _isClearPressed = false;
private Thread _clearThread;
public RecordDate()
{
InitializeComponent();
DynamicHeader();
// 2. 调用(名字和上面的变量一致)
// 2. 启动定时器定时读取数据每100ms读一次
StartPlcReadTimer(1000);
//// 判断连接
if (!ModbusHelper.IsConnected)
{
MessageBox.Show("未连接");
return;
}
}
//动态生成表头
void DynamicHeader()
{
// 2. 循环生成 72 个 ch 列
for (int i = 1; i <= ChannelCount; i++)
{
dataGrid1.Columns.Add(new DataGridTextColumn
{
Header = $"ch.{i}",
Binding = new System.Windows.Data.Binding($"Ch{i}")
});
dataGrid2.Columns.Add(new DataGridTextColumn
{
Header = $"ch.{i}",
Binding = new System.Windows.Data.Binding($"Ch{i}")
});
}
}
public void StopPlcTimer()
{
if (_plcReadTimer != null)
{
_plcReadTimer.Stop();
_plcReadTimer.Dispose();
_plcReadTimer = null;
}
}
//定时读取 PLC 数据
public void StartPlcReadTimer(int intervalMs)
{
// 防止重复创建
if (_plcReadTimer != null && _plcReadTimer.Enabled)
return;
_plcReadTimer = new System.Timers.Timer(intervalMs);
_plcReadTimer.Elapsed += ReadPlcData;
_plcReadTimer.Start();
}
private void ReadPlcData(object? sender, ElapsedEventArgs e)
{
// 左通道
ReadPlcDataGeneric(
slaveAddress: 1,
startAddress: LeftEyeStartAddress,
count: 72,
dataList: LeftEyeDataList,
dataGrid: dataGrid1);
//// 右通道
//ReadPlcDataGeneric(
// slaveAddress: 1,
// startAddress: RightEyeStartAddress,
// count: (ushort)(ChannelCount * RegistersPerChannel),
// dataList: RightEyeDataList,
// dataGrid: dataGrid2);
}
/// <summary>
/// 读取PLC HoldingRegisters 并更新到列表和DataGrid
/// <param name="slaveAddress">设备站号一般是1</param>
/// <param name="startAddress">起始地址</param>
/// <param name="count">寄存器总数</param>
/// <param name="dataList">数据缓存列表</param>
/// <param name="dataGrid">要更新的DataGrid控件</param>
/// 通用PLC读取方法左右通道通用
/// </summary>
private void ReadPlcDataGeneric(
byte slaveAddress,
ushort startAddress,
ushort count,
List<dynamic> dataList,
DataGrid dataGrid)
{
if (_modbusMaster == null || !ModbusHelper.TcpClient.Connected)
return;
try
{
// 读取寄存器
ushort[] registers = _modbusMaster.ReadHoldingRegisters(
slaveAddress: slaveAddress,
startAddress: startAddress,
numberOfPoints: (ushort)count);
uint[] data32 = ConvertRegistersToUInt32(registers, true);
// 先把变量存为局部变量,解决闭包问题
var regCopy = data32;
var listCopy = dataList;
var gridCopy = dataGrid;
// 交给UI线程更新数据和表格
Dispatcher.Invoke(() =>
{
AddPlcDataRow(regCopy, listCopy, gridCopy);
});
System.Diagnostics.Debug.WriteLine("读取寄存器数据" );
}
catch (Exception ex)
{
Console.WriteLine($"PLC读取失败: {ex.Message}");
}
}
private uint[] ConvertRegistersToUInt32(ushort[] registers, bool isLittleEndian)
{
if (registers == null || registers.Length % 2 != 0)
throw new ArgumentException("寄存器数量必须是偶数");
uint[] result = new uint[registers.Length / 2];
for (int i = 0; i < result.Length; i++)
{
ushort low = registers[i * 2];
ushort high = registers[i * 2 + 1];
if (isLittleEndian)
result[i] = (uint)(low | (high << 16));
else
result[i] = (uint)(high | (low << 16));
}
return result;
}
/// <summary>
/// 把PLC数据添加到动态表格
private int _rowIndex = 1;
private void AddPlcDataRow(uint[] registers, List<dynamic> dataList, DataGrid dg)
{
// 1. 先清空临时列表,不影响历史数据
//dataList.Clear();
// 2. 构建一次采集的单行数据(包含所有通道)
dynamic newRow = new System.Dynamic.ExpandoObject();
var dict = (IDictionary<string, object>)newRow;
// 固定列:编号、时间、日期(每次采集的这一行)
dict["Id"] = _rowIndex++;
dict["Time"] = DateTime.Now.ToString("HH:mm:ss");
dict["Date"] = DateTime.Now.ToString("yyyy-MM-dd");
// 关键:循环给所有通道赋值,一行里包含所有通道值
for (int i = 0; i < registers.Length; i++)
{
// 字段名和你界面列绑定的名称必须完全一致,比如 ch.1 / Ch1
dict[$"Ch{i + 1}"] = registers[i];
//dict[$"ch.{i + 1}"] = registers[i];
}
// 3. 把这一行加到历史列表,实现“读多行”
dataList.Add(newRow);
// 4. 强制刷新DataGrid让界面显示多行
dg.Dispatcher.Invoke(() =>
{
dg.ItemsSource = null;
dg.ItemsSource = dataList;
dg.Items.Refresh(); // 强制刷新视图,避免不渲染
});
}
//面积的计算方法
public void getAllData(List<dynamic> leftEyeDataList, List<dynamic> RightEyeDataList, int perAngle)
{
// 1. 先去除异常值,生成新列表(不修改原列表)
var filteredLeft = GetArea.RemoveOutliers(leftEyeDataList);
var filteredRight = GetArea.RemoveOutliers(RightEyeDataList);
//左目视野面积
GlobalData.LeftEyeArea = GetArea.CalculateEyeArea(filteredLeft);
//右目视野面积
GlobalData.RightEyeArea = GetArea.CalculateEyeArea(filteredRight);
//双目视野面积
GlobalData.BinocularArea = GetArea.CalcBinocularArea(filteredLeft, filteredRight);
//// 总视野面积
GlobalData.TotalEyeArea = GlobalData.LeftEyeArea + GlobalData.RightEyeArea - GlobalData.BinocularArea;
//// 空白视野面积
GlobalData.BlankArea = GetArea.StandardTotal - GlobalData.TotalEyeArea;
//视野保存率
// 左眼平均值数组
double[] leftAvg = GetArea.GetEyeAvgArray(filteredLeft);
// 右眼平均值数组
double[] rightAvg = GetArea.GetEyeAvgArray(RightEyeDataList);
double leftLowerAngle = GetArea.CalcLowerAngle(leftAvg, perAngle);
double rightLowerAngle = GetArea.CalcLowerAngle(rightAvg, perAngle);
//下方视野
GlobalData.LowerVision = Math.Min(leftLowerAngle, rightLowerAngle);
//视野保存率
GlobalData.VisionRetentionRate = GetArea.CalcVisionRate(GlobalData.LeftEyeArea, GlobalData.RightEyeArea);
//打印数值显示在系统上面
System.Diagnostics.Debug.WriteLine("左目视野面积" + GlobalData.LeftEyeArea);
System.Diagnostics.Debug.WriteLine("右目视野面积" + GlobalData.RightEyeArea);
System.Diagnostics.Debug.WriteLine("双目视野面积" + GlobalData.BinocularArea);
System.Diagnostics.Debug.WriteLine("总视野面积" + GlobalData.TotalEyeArea);
System.Diagnostics.Debug.WriteLine("下方视野" + GlobalData.LowerVision);
System.Diagnostics.Debug.WriteLine("视野保存率" + GlobalData.VisionRetentionRate);
}
//#endregion
// 保存左眼
private void btnSaveLeft_Click(object sender, RoutedEventArgs e)
{
//SaveToCsv(LeftEyeDataList, $"左眼数据_{DateTime.Now:yyyyMMddHHmmss}.csv");
ModbusHelper.SaveToCsv(LeftEyeDataList, $"左眼数据_{DateTime.Now:yyyyMMddHHmmss}.csv");
}
// 保存右眼
private void btnSaveRight_Click(object sender, RoutedEventArgs e)
{
ModbusHelper.SaveToCsv(RightEyeDataList,$"右眼数据_{DateTime.Now:yyyyMMddHHmmss}.csv");
}
//清除
private void btnClear_MouseDown(object sender, MouseButtonEventArgs e)
{
//_isClearPressed = true;
//_clearThread = new Thread(() =>
//{
// Thread.Sleep(500); // 长按1秒触发
// if (_isClearPressed)
// {
// Application.Current.Dispatcher.Invoke(() => ClearAllData());
// }
//});
//_clearThread.Start();
_plcReadTimer?.Stop();
}
// 清除所有数据
private void ClearAllData()
{
LeftEyeDataList.Clear();
dataGrid1.Items.Clear();
RightEyeDataList.Clear();
dataGrid2.Items.Clear();
MessageBox.Show("数据已清除");
}
private void btnClear_MouseUp(object sender, MouseButtonEventArgs e)
{
_isClearPressed = false;
_clearThread?.Join(100); // 等待线程结束最多100毫秒然后强制结束
}
private void Page_Unloaded(object sender, RoutedEventArgs e)
{
_plcReadTimer?.Stop();
_plcReadTimer?.Dispose();
//_modbusMaster?.Dispose();
//ModbusHelper.TcpClient?.Close();
}
private void Page_Loaded(object sender, RoutedEventArgs e)
{
}
private void GoHome(object s, RoutedEventArgs e) => NavigationService.Content = null;
private void GoTest(object s, RoutedEventArgs e) => NavigationService.Content = new Views.PageTest();
private void GoRecord(object s, RoutedEventArgs e) => NavigationService.Content = new Views.RecordDate();
private void GoView(object s, RoutedEventArgs e) => NavigationService.Content = new Views.RecordPage();
//NavigationService.Navigate(new Views.RecordDate()); 页面相互跳转
}
}

View File

@@ -1,84 +0,0 @@
#pragma checksum "..\..\..\App.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "69F410B786DB1725D40721B4BFA0AF24ADE0F02A"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using ;
namespace {
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
#line 5 "..\..\..\App.xaml"
this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
#line default
#line hidden
System.Uri resourceLocater = new System.Uri("/头罩视野;component/app.xaml", System.UriKind.Relative);
#line 1 "..\..\..\App.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public static void Main() {
.App app = new .App();
app.InitializeComponent();
app.Run();
}
}
}

View File

@@ -1,152 +0,0 @@
#pragma checksum "..\..\..\..\Views\ChangeLanguage.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "988A846E1656D700EA4630C867745AA59A3D0110"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using HandyControl.Controls;
using HandyControl.Data;
using HandyControl.Expression.Media;
using HandyControl.Expression.Shapes;
using HandyControl.Interactivity;
using HandyControl.Media.Animation;
using HandyControl.Media.Effects;
using HandyControl.Properties.Langs;
using HandyControl.Themes;
using HandyControl.Tools;
using HandyControl.Tools.Converter;
using HandyControl.Tools.Extension;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using .Views;
namespace .Views {
/// <summary>
/// ChangeLanguage
/// </summary>
public partial class ChangeLanguage : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
#line 43 "..\..\..\..\Views\ChangeLanguage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TX_1;
#line default
#line hidden
#line 47 "..\..\..\..\Views\ChangeLanguage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TX_0;
#line default
#line hidden
#line 51 "..\..\..\..\Views\ChangeLanguage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button SW_1;
#line default
#line hidden
#line 68 "..\..\..\..\Views\ChangeLanguage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBlock TX_2;
#line default
#line hidden
#line 73 "..\..\..\..\Views\ChangeLanguage.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button SW_2;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/头罩视野;component/views/changelanguage.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\ChangeLanguage.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.TX_1 = ((System.Windows.Controls.TextBlock)(target));
return;
case 2:
this.TX_0 = ((System.Windows.Controls.TextBlock)(target));
return;
case 3:
this.SW_1 = ((System.Windows.Controls.Button)(target));
#line 51 "..\..\..\..\Views\ChangeLanguage.xaml"
this.SW_1.Click += new System.Windows.RoutedEventHandler(this.BtnGoNextPage_Click);
#line default
#line hidden
return;
case 4:
this.TX_2 = ((System.Windows.Controls.TextBlock)(target));
return;
case 5:
this.SW_2 = ((System.Windows.Controls.Button)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@@ -1,76 +0,0 @@
#pragma checksum "..\..\..\..\Views\Help.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "26C55F12F75F47E87465FBE205342822ABB38A23"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using .Views;
namespace .Views {
/// <summary>
/// Help
/// </summary>
public partial class Help : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/头罩视野;component/views/help.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\Help.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
this._contentLoaded = true;
}
}
}

View File

@@ -1,277 +0,0 @@
#pragma checksum "..\..\..\..\Views\SetPassWord.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "CD00A0EB8304DD1C4BC82D7B58CB962188A096F7"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using .Views;
namespace .Views {
/// <summary>
/// SetPassWord
/// </summary>
public partial class SetPassWord : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
#line 34 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_7;
#line default
#line hidden
#line 38 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_8;
#line default
#line hidden
#line 42 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_9;
#line default
#line hidden
#line 55 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_14;
#line default
#line hidden
#line 59 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_15;
#line default
#line hidden
#line 63 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_16;
#line default
#line hidden
#line 74 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_17;
#line default
#line hidden
#line 78 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_18;
#line default
#line hidden
#line 82 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_19;
#line default
#line hidden
#line 93 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_20;
#line default
#line hidden
#line 97 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_21;
#line default
#line hidden
#line 101 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_22;
#line default
#line hidden
#line 112 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_23;
#line default
#line hidden
#line 116 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_24;
#line default
#line hidden
#line 120 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_25;
#line default
#line hidden
#line 131 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox ActiveCode_Password;
#line default
#line hidden
#line 138 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.PasswordBox FullActiveCode_Password;
#line default
#line hidden
#line 144 "..\..\..\..\Views\SetPassWord.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button TS_0;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/头罩视野;component/views/setpassword.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\SetPassWord.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.NE_7 = ((System.Windows.Controls.TextBox)(target));
return;
case 2:
this.NE_8 = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
this.NE_9 = ((System.Windows.Controls.TextBox)(target));
return;
case 4:
this.NE_14 = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.NE_15 = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.NE_16 = ((System.Windows.Controls.TextBox)(target));
return;
case 7:
this.NE_17 = ((System.Windows.Controls.TextBox)(target));
return;
case 8:
this.NE_18 = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
this.NE_19 = ((System.Windows.Controls.TextBox)(target));
return;
case 10:
this.NE_20 = ((System.Windows.Controls.TextBox)(target));
return;
case 11:
this.NE_21 = ((System.Windows.Controls.TextBox)(target));
return;
case 12:
this.NE_22 = ((System.Windows.Controls.TextBox)(target));
return;
case 13:
this.NE_23 = ((System.Windows.Controls.TextBox)(target));
return;
case 14:
this.NE_24 = ((System.Windows.Controls.TextBox)(target));
return;
case 15:
this.NE_25 = ((System.Windows.Controls.TextBox)(target));
return;
case 16:
this.ActiveCode_Password = ((System.Windows.Controls.PasswordBox)(target));
return;
case 17:
this.FullActiveCode_Password = ((System.Windows.Controls.PasswordBox)(target));
return;
case 18:
this.TS_0 = ((System.Windows.Controls.Button)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@@ -1,261 +0,0 @@
#pragma checksum "..\..\..\..\Views\SetTime.xaml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "51F0FF48EEB069C6AD0669FE96AF3D2EA6F39299"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Controls.Ribbon;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using System.Windows.Media.TextFormatting;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Shell;
using .Views;
namespace .Views {
/// <summary>
/// SetTime
/// </summary>
public partial class SetTime : System.Windows.Controls.Page, System.Windows.Markup.IComponentConnector {
#line 39 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_0;
#line default
#line hidden
#line 43 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_1;
#line default
#line hidden
#line 47 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_5;
#line default
#line hidden
#line 51 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_4;
#line default
#line hidden
#line 55 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_3;
#line default
#line hidden
#line 59 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_2;
#line default
#line hidden
#line 63 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_6;
#line default
#line hidden
#line 69 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_0;
#line default
#line hidden
#line 73 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_1;
#line default
#line hidden
#line 77 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_5;
#line default
#line hidden
#line 81 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_4;
#line default
#line hidden
#line 85 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_3;
#line default
#line hidden
#line 89 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox ND_2;
#line default
#line hidden
#line 93 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.TextBox NE_7;
#line default
#line hidden
#line 96 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button TS_0;
#line default
#line hidden
#line 107 "..\..\..\..\Views\SetTime.xaml"
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
internal System.Windows.Controls.Button FK_0;
#line default
#line hidden
private bool _contentLoaded;
/// <summary>
/// InitializeComponent
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/头罩视野;component/views/settime.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\SetTime.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "10.0.6.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.NE_0 = ((System.Windows.Controls.TextBox)(target));
#line 40 "..\..\..\..\Views\SetTime.xaml"
this.NE_0.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.NE_0_TextChanged);
#line default
#line hidden
return;
case 2:
this.NE_1 = ((System.Windows.Controls.TextBox)(target));
return;
case 3:
this.NE_5 = ((System.Windows.Controls.TextBox)(target));
return;
case 4:
this.NE_4 = ((System.Windows.Controls.TextBox)(target));
return;
case 5:
this.NE_3 = ((System.Windows.Controls.TextBox)(target));
return;
case 6:
this.NE_2 = ((System.Windows.Controls.TextBox)(target));
return;
case 7:
this.NE_6 = ((System.Windows.Controls.TextBox)(target));
return;
case 8:
this.ND_0 = ((System.Windows.Controls.TextBox)(target));
return;
case 9:
this.ND_1 = ((System.Windows.Controls.TextBox)(target));
return;
case 10:
this.ND_5 = ((System.Windows.Controls.TextBox)(target));
return;
case 11:
this.ND_4 = ((System.Windows.Controls.TextBox)(target));
return;
case 12:
this.ND_3 = ((System.Windows.Controls.TextBox)(target));
return;
case 13:
this.ND_2 = ((System.Windows.Controls.TextBox)(target));
return;
case 14:
this.NE_7 = ((System.Windows.Controls.TextBox)(target));
return;
case 15:
this.TS_0 = ((System.Windows.Controls.Button)(target));
return;
case 16:
this.FK_0 = ((System.Windows.Controls.Button)(target));
return;
}
this._contentLoaded = true;
}
}
}

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="Views\Help.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\RecordDate.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\RecordPage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\SetPassWord.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\SetTime.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\ChangeLanguage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\PageTest.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\VisiData.xaml.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
</Project>