From d1b72117058f1131046b6aa3add8e3ccfae033d8 Mon Sep 17 00:00:00 2001
From: wenxiangchao <wenxiangchao@ihengxin.com.cn>
Date: 星期一, 09 十一月 2026 10:36:07 +0800
Subject: [PATCH] docs: CAN 模拟器独立 TCP 服务进程设计规格(统一 CanDeviceDriver + 双工推送协议)
---
Plugin.DODriverControl/SingleControl.xaml.cs | 31 ++++++++++++++++++++++++-------
1 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/Plugin.DODriverControl/SingleControl.xaml.cs b/Plugin.DODriverControl/SingleControl.xaml.cs
index 0767cb0..d63d0ce 100644
--- a/Plugin.DODriverControl/SingleControl.xaml.cs
+++ b/Plugin.DODriverControl/SingleControl.xaml.cs
@@ -311,11 +311,21 @@
{
if (data.Dio == DIOType.DI)
{
- return new LightBall
+ if (data.ControlType == ControlType.BOOL)
{
- Size = 40,
- DataContext = data
- };
+ return new LightBall
+ {
+ Size = 40,
+ DataContext = data
+ };
+ }
+ else
+ {
+ return new TextBox
+ {
+ IsReadOnly = true
+ };
+ }
}
Style btnStyle = this.FindResource("PrimaryButton") as Style;
var btn = new Button
@@ -495,6 +505,7 @@
switch (data.ControlType)
{
case ControlType.BOOL:
+ case ControlType.PULSE:
if (data.Dio == DIOType.DI)
{
((LightBall)ui).Value = value == data.PressDownValue;
@@ -513,9 +524,10 @@
case ControlType.LREAL:
case ControlType.STRING:
case ControlType.WSTRING:
- ((Button)ui).Content = value;
+ ((TextBox)ui).Text = value;
break;
default:
+ ((TextBox)ui).Text = value;
break;
}
});
@@ -539,6 +551,7 @@
value = null;
return false;
}
+ string msg;
switch (data.ControlType)
{
case ControlType.BOOL:
@@ -546,11 +559,11 @@
bool res = false;
if (data.Dio == DIOType.DI)
{
- res = controller.ReadDIBool(data.Address, out val, out string msg);
+ res = controller.ReadDIBool(data.Address, out val, out msg);
}
else
{
- res = controller.ReadDOBool(data.Address, out val, out string msg);
+ res = controller.ReadDOBool(data.Address, out val, out msg);
}
if (res == true)
{
@@ -560,6 +573,10 @@
value = null;
return false;
default:
+ if (controller.ReadDIDouble(data.Address, out double? dVal, out msg))
+ {
+ value = dVal.ToString();
+ }
value = null;
return true;
}
--
Gitblit v1.9.1