diff --git a/头罩视野slove/头罩视野/Views/PageTest.xaml b/头罩视野slove/头罩视野/Views/PageTest.xaml
index 0e84344..ea357c6 100644
--- a/头罩视野slove/头罩视野/Views/PageTest.xaml
+++ b/头罩视野slove/头罩视野/Views/PageTest.xaml
@@ -243,7 +243,7 @@ Margin="200,0,0,0" Height="194"/>
PreviewMouseLeftButtonUp="Button_Click_ForUp" />
-
diff --git a/头罩视野slove/头罩视野/Views/PageTest.xaml.cs b/头罩视野slove/头罩视野/Views/PageTest.xaml.cs
index cf3ea3d..5206884 100644
--- a/头罩视野slove/头罩视野/Views/PageTest.xaml.cs
+++ b/头罩视野slove/头罩视野/Views/PageTest.xaml.cs
@@ -104,6 +104,7 @@ namespace 头罩视野.Views
}
ma.BtnClickFunction(Function.ButtonType.切换型, 1);
}
+
//反转
private async void Button_Click_ResDown(object sender, MouseButtonEventArgs e)
{
@@ -137,7 +138,7 @@ namespace 头罩视野.Views
{
ma.BtnClickFunction(Function.ButtonType.复归型, 100);
-
+ ButtonTest.Content = "测试中....";
testTimer.Start();
}
@@ -145,7 +146,7 @@ namespace 头罩视野.Views
private void Button_Click_Stop(object sender, RoutedEventArgs e)
{
ma.BtnClickFunction(Function.ButtonType.复归型, 103);
-
+ ButtonTest.Content = "测试";
testTimer.Stop();
}
diff --git a/头罩视野slove/头罩视野/Views/VisiData.xaml b/头罩视野slove/头罩视野/Views/VisiData.xaml
index 2e4892e..4f7a528 100644
--- a/头罩视野slove/头罩视野/Views/VisiData.xaml
+++ b/头罩视野slove/头罩视野/Views/VisiData.xaml
@@ -269,7 +269,7 @@ Padding="20" Margin="20,0,0,0" >
Width="120" Height="40" Background="red" Foreground="White" Margin="5" Click="Button_Click_Reset" />
-
@@ -278,7 +278,7 @@ Padding="20" Margin="20,0,0,0" >
PreviewMouseLeftButtonUp="Button_Click_ResUp" />
-
diff --git a/头罩视野slove/头罩视野/Views/VisiData.xaml.cs b/头罩视野slove/头罩视野/Views/VisiData.xaml.cs
index 4aa1cdf..e518530 100644
--- a/头罩视野slove/头罩视野/Views/VisiData.xaml.cs
+++ b/头罩视野slove/头罩视野/Views/VisiData.xaml.cs
@@ -44,74 +44,78 @@ 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)
- {
+ { // 切换文案:左眼开 ↔ 左眼关
+ 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)
{
- ((Button)sender).CaptureMouse();
-
- await Task.Run(() => {
- //重新占位写入
- _modbusMaster.WriteSingleCoilAsync(1, 10, true);
- Task.Delay(100);
- System.Diagnostics.Debug.WriteLine("stard1111");
- });
+ await _modbusMaster.WriteSingleCoilAsync(1, 10, true);
+ System.Diagnostics.Debug.WriteLine("反转开始");
}
- private void Button_Click_ResUp(object sender, MouseButtonEventArgs e)
+ private async void Button_Click_ResUp(object sender, MouseButtonEventArgs e)
{
- ((Button)sender).ReleaseMouseCapture();
- System.Diagnostics.Debug.WriteLine("end1111");
+ await _modbusMaster.WriteSingleCoilAsync(1, 10, false);
+ System.Diagnostics.Debug.WriteLine("反转结束");
}
//正转
- //private bool _isPressing1 = false;
+
private async void Button_Click_ForDown(object sender, MouseButtonEventArgs e)
{
- ((Button)sender).CaptureMouse();
- //_isPressing1 = true;
-
- await Task.Run(() => {
- //重新占位写入
- _modbusMaster.WriteSingleCoilAsync(1, 11, true);
- System.Diagnostics.Debug.WriteLine("正传start");
- Task.Delay(100);
- });
+ await _modbusMaster.WriteSingleCoilAsync(1, 11, true);
}
- private void Button_Click_ForUp(object sender, MouseButtonEventArgs e)
+ private async void Button_Click_ForUp(object sender, MouseButtonEventArgs e)
{
- ((Button)sender).ReleaseMouseCapture();
-
- System.Diagnostics.Debug.WriteLine("正传end");
+
+ await _modbusMaster.WriteSingleCoilAsync(1, 11, false);
+ //System.Diagnostics.Debug.WriteLine("正传end");
}
- //测试btn
- private void Button_Click_Test(object sender, RoutedEventArgs e)
- {
- ma.BtnClickFunction(Function.ButtonType.复归型, 101);
- }
- //停止btn
- private void Button_Click_Stop(object sender, RoutedEventArgs e)
- {
- ma.BtnClickFunction(Function.ButtonType.复归型, 103);
- }
- //读取
//读取数据
private DispatcherTimer InitDispatcherTimer()
{
diff --git a/头罩视野slove/头罩视野/面罩视野测试仪——120°版本打印已改.gxw b/头罩视野slove/头罩视野/面罩视野测试仪——120°版本打印已改.gxw
new file mode 100644
index 0000000..be1329c
Binary files /dev/null and b/头罩视野slove/头罩视野/面罩视野测试仪——120°版本打印已改.gxw differ