左右眼文案调整

This commit is contained in:
2026-04-23 14:29:33 +08:00
parent a3f1baef39
commit 29016704f6
2 changed files with 38 additions and 4 deletions

View File

@@ -225,7 +225,7 @@ Margin="200,0,0,0" Height="194"/>
Width="120" Height="50" Background="#FF87CEFA" Foreground="White" Margin="5" Click="Button_Click_Reset" />
<!-- 左眼开 -->
<Button Grid.Row="0" Grid.Column="1" Content="左眼开" FontSize="18"
<Button Grid.Row="0" Name="btnLeft" Grid.Column="1" Content="左眼开" FontSize="18"
Width="120" Height="50" Background="#FF87CEFA" Foreground="White" Margin="5" Click="Button_Click_left" />
<!-- 反转 -->
@@ -234,7 +234,7 @@ Margin="200,0,0,0" Height="194"/>
PreviewMouseLeftButtonUp="Button_Click_ResUp" />
<!-- 右眼开 -->
<Button Grid.Row="1" Grid.Column="1" Content="右眼开" FontSize="18"
<Button Grid.Row="1" Name="btnRight" Grid.Column="1" Content="右眼开" FontSize="18"
Width="120" Height="50" Background="#FF87CEFA" Foreground="White" Margin="5" Click="Button_Click_Right" />
<!-- 正转 -->

View File

@@ -33,6 +33,7 @@ namespace 头罩视野.Views
private DispatcherTimer testTimer;
// 保存上一条数据(用于去重)
private TestDataStore.TestRecord? _lastRecord;
private object btnLeftEye;
public PageTest()
{
@@ -58,17 +59,50 @@ namespace 头罩视野.Views
//复位btn
private void Button_Click_Reset(object sender, RoutedEventArgs e)
{
btnLeft.Content = "左眼开";
btnRight.Content = "右眼开";
ma.BtnClickFunction(Function.ButtonType., 90);
}
//左开眼
private void Button_Click_left(object sender, RoutedEventArgs e)
{
// 切换文案:左眼开 ↔ 左眼关
if (btnLeft.Content.ToString() == "左眼开")
{
btnLeft.Content = "左眼关";
if (btnRight.Content.ToString() == "右眼关")
{
btnRight.Content = "右眼开";
ma.BtnClickFunction(Function.ButtonType., 1);
}
}
else
{
btnLeft.Content = "左眼开";
}
ma.BtnClickFunction(Function.ButtonType., 0);
}
//右开眼
private void Button_Click_Right(object sender, RoutedEventArgs e)
private void Button_Click_Right(object sender, RoutedEventArgs e)
{
ma.BtnClickFunction(Function.ButtonType., 1);
// 切换文案:左眼开 ↔ 左眼关
if (btnRight.Content.ToString() == "右眼开")
{
btnRight.Content = "右眼关";
if (btnLeft.Content.ToString() == "左眼关")
{
btnLeft.Content = "左眼开";
ma.BtnClickFunction(Function.ButtonType., 0);
}
}
else
{
btnRight.Content = "右眼开";
}
ma.BtnClickFunction(Function.ButtonType., 1);
}
//反转
private async void Button_Click_ResDown(object sender, MouseButtonEventArgs e)