This commit is contained in:
@@ -204,7 +204,7 @@ namespace 头罩视野.Views
|
|||||||
if (_leftFinalData != null &&
|
if (_leftFinalData != null &&
|
||||||
_leftFinalData.Count > 0
|
_leftFinalData.Count > 0
|
||||||
&& _rightFinalData != null
|
&& _rightFinalData != null
|
||||||
&& _rightFinalData.Count > 0&& _leftTotalArea!=0&& _rightTotalArea!=0)
|
&& _rightFinalData.Count > 0 && _leftTotalArea != 0 && _rightTotalArea != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
// ✅ 传值调用:把左右眼最终数据传给方法
|
// ✅ 传值调用:把左右眼最终数据传给方法
|
||||||
@@ -325,9 +325,8 @@ namespace 头罩视野.Views
|
|||||||
// return;
|
// return;
|
||||||
if (_modbusMaster == null)
|
if (_modbusMaster == null)
|
||||||
return;
|
return;
|
||||||
await _modbusMaster.ReadCoilsAsync(1, 1, 1);
|
|
||||||
|
|
||||||
var ret = await _modbusMaster.ReadCoilsAsync(1, 1, 1);
|
var ret = await _modbusMaster.ReadCoilsAsync(1, 1, 2);
|
||||||
if (ret != null && ret.Length > 0)
|
if (ret != null && ret.Length > 0)
|
||||||
{ //左眼开
|
{ //左眼开
|
||||||
if (ret[0])
|
if (ret[0])
|
||||||
@@ -338,15 +337,14 @@ namespace 头罩视野.Views
|
|||||||
btnLeft.Content = "左眼开";
|
btnLeft.Content = "左眼开";
|
||||||
btnRight.Content = "右眼关";
|
btnRight.Content = "右眼关";
|
||||||
}
|
}
|
||||||
else
|
else if (ret[1])
|
||||||
{
|
|
||||||
if ()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
LedOn(led0);
|
LedOn(led0);
|
||||||
LedOff(led1);
|
LedOff(led1);
|
||||||
btnLeft.Content = "左眼关";
|
btnLeft.Content = "左眼关";
|
||||||
btnRight.Content = "右眼开";
|
btnRight.Content = "右眼开";
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user