调试
This commit is contained in:
@@ -28,13 +28,14 @@ namespace 头罩视野.Views
|
||||
|
||||
private TcpClient _tcpClient => ModbusResourceManager.Instance.TcpClient;
|
||||
private IModbusMaster _modbusMaster => ModbusResourceManager.Instance.ModbusMaster;
|
||||
|
||||
DispatcherTimer _timer;
|
||||
DataChange c = new DataChange();
|
||||
Function ma;
|
||||
public PageTest()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
InitializeModbusTcp();
|
||||
_timer = InitDispatcherTimer();
|
||||
}
|
||||
|
||||
//复位btn
|
||||
@@ -53,7 +54,7 @@ namespace 头罩视野.Views
|
||||
{
|
||||
ma.BtnClickFunction(Function.ButtonType.切换型, 1);
|
||||
}
|
||||
//反转
|
||||
//反转
|
||||
private void Button_Click_Res(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ma.BtnClickFunction(Function.ButtonType.复归型, 10);
|
||||
@@ -79,7 +80,7 @@ namespace 头罩视野.Views
|
||||
|
||||
private void Button_Click_Print(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
|
||||
ma.BtnClickFunction(Function.ButtonType.复归型, 103);
|
||||
|
||||
}
|
||||
@@ -92,7 +93,7 @@ namespace 头罩视野.Views
|
||||
|
||||
}
|
||||
private void RadioButton_Unchecked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
{
|
||||
|
||||
ma.BtnClickFunction(Function.ButtonType.切换型, 41);
|
||||
|
||||
@@ -151,7 +152,7 @@ namespace 头罩视野.Views
|
||||
ShowError($"读取数据失败:{ex.Message}");
|
||||
}
|
||||
}
|
||||
// 地址, 根据格式显示字符长度 32:2 16:1 ,绑定页面的name 值,F2 保留两位小数,单位
|
||||
// 地址, 根据格式显示字符长度 32:2 16:1 ,绑定页面的name 值,F2 保留两位小数,单位
|
||||
private async Task ReadAndUpdateFloatAsync(int address, int length, System.Windows.Controls.TextBox control, string format, string unit)
|
||||
{
|
||||
try
|
||||
@@ -287,8 +288,9 @@ namespace 头罩视野.Views
|
||||
}
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
InitializeModbusTcp();
|
||||
|
||||
//InitializeModbusTcp();
|
||||
_timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user