CAN的数据UI更新更改

This commit is contained in:
2025-01-07 10:09:42 +08:00
parent 7181643cb8
commit 152c25912c
5 changed files with 59 additions and 20 deletions

View File

@@ -52,7 +52,14 @@ namespace CapMachine.Wpf.CanDrive
public string? SignalRtValue
{
get { return _SignalRtValue; }
set { _SignalRtValue = value; RaisePropertyChanged(); }
set
{
if (_SignalRtValue != value)
{
_SignalRtValue = value;
RaisePropertyChanged();
}
}
}
private StringBuilder _SignalRtValueSb = new StringBuilder(10);
@@ -64,11 +71,11 @@ namespace CapMachine.Wpf.CanDrive
get { return _SignalRtValueSb; }
set
{
if (_SignalRtValueSb != value)
{
SignalRtValue = value.ToString();
_SignalRtValueSb = value;
}
//if (_SignalRtValueSb != value)
//{
SignalRtValue = value.ToString();
_SignalRtValueSb = value;
//}
}
}

View File

@@ -17,10 +17,7 @@ namespace CapMachine.Wpf.Services
/// </summary>
public class CanDriveService : BindableBase
{
/// <summary>
/// 当前选中的CanLinConfigPro 程序
/// </summary>
public CanLinConfigPro SelectedCanLinConfigPro { get; set; }
public HighSpeedDataService HighSpeedDataService { get; }
/// <summary>
@@ -35,6 +32,12 @@ namespace CapMachine.Wpf.Services
//ToomossCanDrive.StartCanDrive();
}
/// <summary>
/// 当前选中的CanLinConfigPro 程序
/// </summary>
public CanLinConfigPro SelectedCanLinConfigPro { get; set; }
/// <summary>
/// 图莫斯 CAN Drive
/// ToomossCanDrive

View File

@@ -181,6 +181,9 @@ namespace CapMachine.Wpf.Services
//TagManger.AddTag(new Tag<short>("通讯PTC模块温度", "通讯PTC模块温度[℃]", "ComPTCMdTemp", "程序", "VW15082", 100, 0, 10, "℃", new ShortTagValue(), false) { DecimalPoint = 1 });
//【SongZhi】
#region SongZhi
TagManger.AddTag(new Tag<short>(new ShortTagValue())
{
Name = "转速[rpm]",//名称带单位
@@ -762,6 +765,8 @@ namespace CapMachine.Wpf.Services
Index = "",
});
#region
//TagManger.AddTag(new Tag<short>("OCR", "OCR[%]", "OCR", "程序", "VW15014", 100, 0, 10, "%", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag<short>("HV[V]", "HV[V]", "HV", "程序", "VW15016", 100, 0, 10, "V", new ShortTagValue(), true) { DecimalPoint = 1 });
//TagManger.AddTag(new Tag<short>("HV[A]", "HV[A]", "HVCur", "程序", "VW15018", 100, 0, 1, "A", new ShortTagValue(), false) { DecimalPoint = 1 });

View File

@@ -58,14 +58,15 @@ namespace CapMachine.Wpf.ViewModels
new CbxItems(){ Key="使能",Text="使能"},
new CbxItems(){ Key="Anti_Sleep",Text="Anti_Sleep"},
};
ReadNameCbxItems = new ObservableCollection<CbxItems>()
{
new CbxItems(){ Key="实际转速",Text="实际转速"},
new CbxItems(){ Key="输入电压",Text="输入电压"},
new CbxItems(){ Key="输入电流",Text="输入电流"},
new CbxItems(){ Key="输入功率",Text="输入功率"},
new CbxItems(){ Key="相电流",Text="相电流"},
new CbxItems(){ Key="ECU温度",Text="ECU温度"},
new CbxItems(){ Key="通讯转速",Text="通讯转速"},
new CbxItems(){ Key="通讯母线电压",Text="通讯母线电压"},
new CbxItems(){ Key="通讯母线电流",Text="通讯母线电流"},
new CbxItems(){ Key="通讯相电流",Text="通讯相电流"},
new CbxItems(){ Key="通信功率",Text="通信功率"},
new CbxItems(){ Key="通讯芯片温度",Text="通讯芯片温度"},
};
InitLoadCanConfigPro();

View File

@@ -485,8 +485,7 @@
<Button
Margin="5,0"
Command="{Binding CanOpCmd}"
CommandParameter="CycleSend"
Content="循环发送">
CommandParameter="CycleSend">
<Button.Style>
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
<Style.Triggers>
@@ -501,12 +500,24 @@
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="2,0"
VerticalAlignment="Center"
FontFamily="/Assets/Fonts/#iconfont"
FontSize="18"
Text="&#xe8bf;" />
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Text="循环发送" />
</StackPanel>
</Button>
<Button
Margin="5,0"
Command="{Binding CanOpCmd}"
CommandParameter="CycleRecive"
Content="循环接收">
CommandParameter="CycleRecive">
<Button.Style>
<Style BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}" TargetType="Button">
<Style.Triggers>
@@ -521,6 +532,18 @@
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel Orientation="Horizontal">
<TextBlock
Margin="2,0"
VerticalAlignment="Center"
FontFamily="/Assets/Fonts/#iconfont"
FontSize="18"
Text="&#xe9c8;" />
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Text="循环接收" />
</StackPanel>
</Button>