LIN Schedule
This commit is contained in:
@@ -4,7 +4,7 @@ namespace CapMachine.Model.CANLIN
|
||||
{
|
||||
/// <summary>
|
||||
/// 调度表的配置
|
||||
/// 其实这些调度表是在DBC中有的,但是图莫斯的驱动没有读取到这些信息
|
||||
/// 其实这些调度表是在LDF中有的,但是图莫斯的驱动没有读取到这些信息
|
||||
/// 那么我们在系统层面进行操作和保存这些信息
|
||||
/// </summary>
|
||||
[Table(Name = "LINScheduleConfig")]
|
||||
@@ -17,11 +17,23 @@ namespace CapMachine.Model.CANLIN
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息名称
|
||||
/// 是否启用
|
||||
/// </summary>
|
||||
[Column(Name = "IsActive")]
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息名称/帧名称
|
||||
/// </summary>
|
||||
[Column(Name = "MsgName")]
|
||||
public string? MsgName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息名称/帧名称的Index
|
||||
/// </summary>
|
||||
[Column(Name = "MsgNameIndex")]
|
||||
public int MsgNameIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 消息的周期
|
||||
/// </summary>
|
||||
@@ -40,7 +52,7 @@ namespace CapMachine.Model.CANLIN
|
||||
/// LDF中可能有多个调度器名称
|
||||
/// </summary>
|
||||
[Column(Name = "SchTabName")]
|
||||
public int SchTabName { get; set; }
|
||||
public string? SchTabName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -846,7 +846,7 @@ namespace CapMachine.Wpf.CanDrive
|
||||
/// <summary>
|
||||
/// 定时更新时间
|
||||
/// </summary>
|
||||
private int UpdateCycle = 100;
|
||||
private int UpdateCycle { get; set; } = 100;
|
||||
|
||||
/// <summary>
|
||||
/// CNA 调度表的配置信息
|
||||
@@ -1121,7 +1121,6 @@ namespace CapMachine.Wpf.CanDrive
|
||||
// Console.WriteLine($"Update CAN Schedule Error ret = {ret} -- SchTabIndex:{(byte)itemMsgSchConfig.SchTabIndex} -- MsgIndex:{(byte)(itemMsgSchConfig.MsgIndex)}");
|
||||
// //return;
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
using CapMachine.Model.CANLIN;
|
||||
using Prism.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CapMachine.Wpf.Dtos
|
||||
{
|
||||
@@ -15,6 +10,16 @@ namespace CapMachine.Wpf.Dtos
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
private bool _IsActive;
|
||||
/// <summary>
|
||||
/// 是否激活
|
||||
/// </summary>
|
||||
public bool IsActive
|
||||
{
|
||||
get { return _IsActive; }
|
||||
set { _IsActive = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
private string? _MsgName;
|
||||
/// <summary>
|
||||
/// 消息名称/帧名称
|
||||
@@ -25,6 +30,16 @@ namespace CapMachine.Wpf.Dtos
|
||||
set { _MsgName = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
private int _MsgNameIndex;
|
||||
/// <summary>
|
||||
/// 消息名称/帧名称的Index
|
||||
/// </summary>
|
||||
public int MsgNameIndex
|
||||
{
|
||||
get { return _MsgNameIndex; }
|
||||
set { _MsgNameIndex = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
private int _Cycle;
|
||||
/// <summary>
|
||||
/// 周期
|
||||
@@ -35,7 +50,6 @@ namespace CapMachine.Wpf.Dtos
|
||||
set { _Cycle = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
private int _SchTabIndex;
|
||||
/// <summary>
|
||||
/// 调度表的Index序列
|
||||
@@ -56,12 +70,11 @@ namespace CapMachine.Wpf.Dtos
|
||||
set { _SchTabName = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 在更新调度表数据时,我们有一个整体的帧数据指令集合,但是这些帧数据集合,分属于不同的调度表,
|
||||
/// 这个在开始时生成整体的帧数据指令集合才会把这个MsgIndex分配上,这个不需要保存到数据库中,对接使用
|
||||
/// </summary>
|
||||
public int MsgIndex { get; set; }
|
||||
///// <summary>
|
||||
///// 在更新调度表数据时,我们有一个整体的帧数据指令集合,但是这些帧数据集合,分属于不同的调度表,
|
||||
///// 这个在开始时生成整体的帧数据指令集合才会把这个MsgIndex分配上,这个不需要保存到数据库中,对接使用
|
||||
///// </summary>
|
||||
//public int MsgIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 程序的ID
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CapMachine.Wpf.CanDrive;
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.CanDrive;
|
||||
using CapMachine.Wpf.Services;
|
||||
using ImTools;
|
||||
using Microsoft.VisualBasic;
|
||||
@@ -379,16 +380,6 @@ namespace CapMachine.Wpf.LinDrive
|
||||
}
|
||||
|
||||
IsReviceOk = true;
|
||||
|
||||
//StringBuilder ValueStr = new StringBuilder(64);
|
||||
//LDFParser.LDF_ExeFrameToBus(LDFHandle, new StringBuilder("ID_DATA"), 1);
|
||||
//LDFParser.LDF_GetSignalValueStr(LDFHandle, new StringBuilder("ID_DATA"), new StringBuilder("Supplier_ID"), ValueStr);
|
||||
//Console.WriteLine("ID_DATA.Supplier_ID={0}", ValueStr);
|
||||
//LDFParser.LDF_GetSignalValueStr(LDFHandle, new StringBuilder("ID_DATA"), new StringBuilder("Machine_ID"), ValueStr);
|
||||
//Console.WriteLine("ID_DATA.Machine_ID={0}", ValueStr);
|
||||
//LDFParser.LDF_GetSignalValueStr(LDFHandle, new StringBuilder("ID_DATA"), new StringBuilder("Chip_ID"), ValueStr);
|
||||
//Console.WriteLine("ID_DATA.Chip_ID={0}", ValueStr);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -666,6 +657,7 @@ namespace CapMachine.Wpf.LinDrive
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 调度器发送报文
|
||||
|
||||
private bool _SchEnable;
|
||||
@@ -682,11 +674,61 @@ namespace CapMachine.Wpf.LinDrive
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 调度表数量
|
||||
/// </summary>
|
||||
public int SchCount { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取LIN的LINScheduleConfig
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<LINScheduleConfig> GetLINScheduleConfigs()
|
||||
{
|
||||
List<LINScheduleConfig> LINScheduleConfigs = new List<LINScheduleConfig>();
|
||||
SchCount = GetSchCount();
|
||||
for (int i = 0; i < SchCount; i++)
|
||||
{
|
||||
var SchName = GetSchName(i);
|
||||
var FrameCount = GetSchFrameCount(SchName);
|
||||
for (int j = 0; j < FrameCount; j++)
|
||||
{
|
||||
LINScheduleConfigs.Add(new LINScheduleConfig()
|
||||
{
|
||||
SchTabName = GetSchName(i),
|
||||
SchTabIndex = i,
|
||||
MsgName = GetSchFrameName(SchName, j),
|
||||
MsgNameIndex = j,
|
||||
Cycle = 10,
|
||||
IsActive = false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return LINScheduleConfigs;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取调度的帧的信号个数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int GetSchFrameCount(string SchName)
|
||||
{
|
||||
return LDFParser.LDF_GetSchFrameQuantity(LDFHandle, new StringBuilder(SchName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取调度的帧的名称
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSchFrameName(string SchName, int FrameIndex)
|
||||
{
|
||||
StringBuilder FrameName = new StringBuilder();
|
||||
LDFParser.LDF_GetSchFrameName(LDFHandle, new StringBuilder(SchName), FrameIndex, FrameName);
|
||||
return FrameName.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取调度表数量
|
||||
@@ -699,6 +741,62 @@ namespace CapMachine.Wpf.LinDrive
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取调度表数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetSchName(int index)
|
||||
{
|
||||
StringBuilder pSchName = new StringBuilder();
|
||||
var SchResult = LDFParser.LDF_GetSchName(LDFHandle, index, pSchName);
|
||||
return pSchName.ToString();
|
||||
}
|
||||
|
||||
Random Random=new Random();
|
||||
|
||||
/// <summary>
|
||||
/// 开始调度表执行
|
||||
/// </summary>
|
||||
public void StartSchedule()
|
||||
{
|
||||
if (CmdData.Count() == 0) return;
|
||||
|
||||
//防止有多个不同的消息名称/帧,每个帧单独处理发送
|
||||
var GroupMsg = CmdData.GroupBy(x => x.MsgName);
|
||||
foreach (var itemMsg in GroupMsg)
|
||||
{
|
||||
foreach (var itemSignal in itemMsg)
|
||||
{
|
||||
if (itemSignal.ConfigName.Contains("速"))
|
||||
{
|
||||
itemSignal.SignalCmdValue = Random.NextDouble() * 1000;
|
||||
}
|
||||
//主机写操作,发送数据给从机
|
||||
LDFParser.LDF_SetSignalValue(LDFHandle, new StringBuilder(itemMsg.Key), new StringBuilder(itemSignal.SignalName), itemSignal.SignalCmdValue);
|
||||
}
|
||||
|
||||
////【0】参数注意
|
||||
//LDFParser.LDF_ExeFrameToBus(LDFHandle, new StringBuilder(itemMsg.Key), 0);
|
||||
|
||||
//读取当前的指令帧数据,LDF_ExeFrameToBus执行后就可以读取本身的数据
|
||||
foreach (var item in ListLinLdfModel)
|
||||
{
|
||||
if (CmdData.Any(a => a.MsgName == item.MsgName))
|
||||
{
|
||||
LDFParser.LDF_GetSignalValueStr(LDFHandle, new StringBuilder(item.MsgName), new StringBuilder(item.SignalName), ReadValueStr);
|
||||
item.SignalRtValueSb = ReadValueStr;
|
||||
}
|
||||
}
|
||||
|
||||
LDFParser.LDF_ExeSchToBus(LDFHandle, new StringBuilder(itemMsg.Key),1);
|
||||
LDFParser.LDF_SetSchToTable(LDFHandle, new StringBuilder(itemMsg.Key),1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void LinTest()
|
||||
{
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
using AutoMapper;
|
||||
using AutoMapper;
|
||||
using CapMachine.Core;
|
||||
using CapMachine.Model.CANLIN;
|
||||
using CapMachine.Wpf.Dtos;
|
||||
using CapMachine.Wpf.Services;
|
||||
using Prism.Commands;
|
||||
using Prism.Services.Dialogs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
public class DialogLINSchConfigViewModel:DialogViewModel
|
||||
public class DialogLINSchConfigViewModel : DialogViewModel
|
||||
{
|
||||
public DialogLINSchConfigViewModel(IFreeSql freeSql, IMapper mapper)
|
||||
public DialogLINSchConfigViewModel(IFreeSql freeSql, IMapper mapper, LinDriveService linDriveService)
|
||||
{
|
||||
Title = "调度表 LIN 配置";
|
||||
FreeSql = freeSql;
|
||||
Mapper = mapper;
|
||||
LinDriveService = linDriveService;
|
||||
|
||||
//默认只能用1号调度器
|
||||
SchTabIndexCbxItems = new ObservableCollection<CbxItems>()
|
||||
@@ -47,10 +44,14 @@ namespace CapMachine.Wpf.ViewModels
|
||||
//},
|
||||
};
|
||||
|
||||
// 初始化树结构集合
|
||||
SchTabTree = new ObservableCollection<LinSchTabNode>();
|
||||
|
||||
}
|
||||
|
||||
public IFreeSql FreeSql { get; }
|
||||
public IMapper Mapper { get; }
|
||||
public LinDriveService LinDriveService { get; }
|
||||
|
||||
private string name;
|
||||
/// <summary>
|
||||
@@ -113,6 +114,174 @@ namespace CapMachine.Wpf.ViewModels
|
||||
set { _CurSelectedItem = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
//================ TreeView 数据源与选择逻辑 ================
|
||||
// 说明:
|
||||
// 1) SchTabTree 为 XAML 中 TreeView 的 ItemsSource,父节点为调度表 LinSchTabNode,子节点为 LinMsgNode。
|
||||
// 2) 仅允许“单选”一个调度表(父节点)。父节点上的 CheckBox 为 TwoWay 绑定 ViewModel 模型的 IsSelected 属性。
|
||||
// 3) 我们在 BuildTree() 完成后,通过 AttachNodeHandlers() 给父节点订阅 PropertyChanged,
|
||||
// 当 IsSelected 变化时,统一走 OnSelectSchTab() 做单选互斥与子节点联动,避免在 XAML 上用行为触发器造成递归。
|
||||
private ObservableCollection<LinSchTabNode> _SchTabTree;
|
||||
/// <summary>
|
||||
/// 调度表-消息 树结构数据源(父:SchTabName,子:消息/帧)
|
||||
/// </summary>
|
||||
public ObservableCollection<LinSchTabNode> SchTabTree
|
||||
{
|
||||
get { return _SchTabTree; }
|
||||
set { _SchTabTree = value; RaisePropertyChanged(); }
|
||||
}
|
||||
|
||||
// 防止选择联动时的递归重入。
|
||||
// 在 OnSelectSchTab() 中统一设置 _isUpdatingSelection = true,
|
||||
// 以避免模型属性变化再次触发 Node_PropertyChanged() / OnSelectSchTab() 形成递归导致 StackOverflow。
|
||||
private bool _isUpdatingSelection = false;
|
||||
|
||||
private DelegateCommand<LinSchTabNode> _SelectSchTabCmd;
|
||||
/// <summary>
|
||||
/// 选择/激活 调度表命令(单选),联动选中其下所有消息
|
||||
/// </summary>
|
||||
public DelegateCommand<LinSchTabNode> SelectSchTabCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SelectSchTabCmd == null)
|
||||
{
|
||||
_SelectSchTabCmd = new DelegateCommand<LinSchTabNode>(OnSelectSchTab);
|
||||
}
|
||||
return _SelectSchTabCmd;
|
||||
}
|
||||
set { _SelectSchTabCmd = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 激活选中的调度表(父节点单选),并联动:
|
||||
/// 1) 取消其它调度表的选中;
|
||||
/// 2) 让当前选中调度表的子节点全部选中(仅显示语义,不编辑);
|
||||
/// 3) 同步底层 ListLINScheduleConfigDto 的 IsActive(只允许一个调度表 Active)。
|
||||
/// 通过 _isUpdatingSelection 防重入,避免模型 -> 视图 -> 模型 的递归通知。
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
private void OnSelectSchTab(LinSchTabNode node)
|
||||
{
|
||||
if (node == null) return;
|
||||
if (_isUpdatingSelection) return;
|
||||
try
|
||||
{
|
||||
_isUpdatingSelection = true;
|
||||
|
||||
// 单选:当前节点选中时,取消其它调度表选中
|
||||
if (node.IsSelected)
|
||||
{
|
||||
foreach (var n in SchTabTree)
|
||||
{
|
||||
bool isTarget = ReferenceEquals(n, node);
|
||||
n.IsSelected = isTarget;
|
||||
foreach (var c in n.Children)
|
||||
{
|
||||
c.IsSelected = isTarget; // 子节点选中与父保持一致
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 取消选中:其子节点也全部取消
|
||||
foreach (var c in node.Children) c.IsSelected = false;
|
||||
}
|
||||
|
||||
// 同步 DTO 激活状态:按当前树中第一个被选中的调度表名写回
|
||||
var active = SchTabTree?.FirstOrDefault(n => n.IsSelected);
|
||||
foreach (var dto in ListLINScheduleConfigDto)
|
||||
{
|
||||
dto.IsActive = active != null && string.Equals(dto.SchTabName, active.SchTabName, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isUpdatingSelection = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基于当前 ListLINScheduleConfigDto 构建树结构。
|
||||
/// - 将 DTO 以 SchTabName 分组,生成父节点;
|
||||
/// - 子节点为每条消息/帧(MsgName, MsgNameIndex),IsSelected 与 DTO.IsActive 同步;
|
||||
/// - 若出现多个分组均被标记 IsActive,则仅保留第一个为选中,其它重置为未选中(保证单选约束);
|
||||
/// - 构建完成后调用 AttachNodeHandlers() 订阅父节点的 PropertyChanged,实现勾选即联动。
|
||||
/// </summary>
|
||||
private void BuildTree()
|
||||
{
|
||||
var newTree = new ObservableCollection<LinSchTabNode>();
|
||||
if (ListLINScheduleConfigDto != null && ListLINScheduleConfigDto.Any())
|
||||
{
|
||||
var groups = ListLINScheduleConfigDto
|
||||
.GroupBy(x => x.SchTabName ?? string.Empty)
|
||||
.OrderBy(g => g.Key);
|
||||
|
||||
foreach (var g in groups)
|
||||
{
|
||||
var node = new LinSchTabNode
|
||||
{
|
||||
SchTabName = g.Key,
|
||||
IsSelected = g.Any(x => x.IsActive),
|
||||
Children = new ObservableCollection<LinMsgNode>(
|
||||
g.Select(x => new LinMsgNode
|
||||
{
|
||||
MsgName = x.MsgName ?? string.Empty,
|
||||
MsgNameIndex = x.MsgNameIndex,
|
||||
IsSelected = x.IsActive
|
||||
}))
|
||||
};
|
||||
newTree.Add(node);
|
||||
}
|
||||
|
||||
// 如果没有任何 IsActive,确保默认不选;若存在多个组被标记,保持第一个,其他置为 false
|
||||
var activeOnes = newTree.Where(n => n.IsSelected).ToList();
|
||||
if (activeOnes.Count > 1)
|
||||
{
|
||||
var keep = activeOnes.First();
|
||||
foreach (var n in activeOnes.Skip(1)) n.IsSelected = false;
|
||||
foreach (var dto in ListLINScheduleConfigDto)
|
||||
{
|
||||
dto.IsActive = string.Equals(dto.SchTabName, keep.SchTabName, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
SchTabTree = newTree;
|
||||
|
||||
// 绑定节点属性变化事件:
|
||||
// - 父节点 IsSelected 变化 -> Node_PropertyChanged() -> OnSelectSchTab()
|
||||
// 这样可以不依赖 XAML EventTrigger,减少 UI 侧的递归触发风险。
|
||||
AttachNodeHandlers(SchTabTree);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 订阅父节点集合的 PropertyChanged。
|
||||
/// 注意:子节点当前仅用于显示,不处理其 PropertyChanged。
|
||||
/// </summary>
|
||||
private void AttachNodeHandlers(IEnumerable<LinSchTabNode> nodes)
|
||||
{
|
||||
if (nodes == null) return;
|
||||
foreach (var n in nodes)
|
||||
{
|
||||
n.PropertyChanged -= Node_PropertyChanged;
|
||||
n.PropertyChanged += Node_PropertyChanged;
|
||||
if (n.Children != null && n.Children.Any())
|
||||
{
|
||||
// 子节点目前仅做显示,不处理其 PropertyChanged
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 父节点属性变更回调:当 IsSelected 变化时,统一交由 OnSelectSchTab() 处理单选与联动。
|
||||
/// </summary>
|
||||
private void Node_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName == nameof(LinSchTabNode.IsSelected))
|
||||
{
|
||||
OnSelectSchTab(sender as LinSchTabNode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private DelegateCommand<object> _GridSelectionChangedCmd;
|
||||
/// <summary>
|
||||
@@ -169,26 +338,25 @@ namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
switch (Par)
|
||||
{
|
||||
case "Add":
|
||||
ListLINScheduleConfigDto.Add(new LINScheduleConfigDto
|
||||
{
|
||||
CanLinConfigProId = SelectCanLinConfigProId,
|
||||
Cycle = 100,
|
||||
SchTabIndex = 0,
|
||||
});
|
||||
break;
|
||||
case "Delete":
|
||||
if (CurSelectedItem != null)
|
||||
{
|
||||
//直接删除掉,如果没有ID的话,这就不需要删除了
|
||||
FreeSql.Delete<LINScheduleConfig>(CurSelectedItem.Id).ExecuteAffrows();
|
||||
ListLINScheduleConfigDto.Remove(CurSelectedItem);
|
||||
// 禁止新增/删除:来自 LDF 的数据不允许变更
|
||||
case "LoadSch":
|
||||
|
||||
CurSelectedItem = null;
|
||||
//通过CAN驱动加载调度表
|
||||
if (ListLINScheduleConfigDto != null && ListLINScheduleConfigDto.Count > 0)
|
||||
{
|
||||
var messageBoxResult = MessageBox.Show("检测到当前存在数据,下载后将要覆盖当前数据,请你确认?", "提示", MessageBoxButton.OKCancel, MessageBoxImage.Hand);
|
||||
if (messageBoxResult == MessageBoxResult.OK)
|
||||
{
|
||||
LoadSch();
|
||||
}
|
||||
else
|
||||
{
|
||||
//不动作
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("请选中后再进行【删除】操作?", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
|
||||
LoadSch();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -196,6 +364,27 @@ namespace CapMachine.Wpf.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载调度表
|
||||
/// </summary>
|
||||
private void LoadSch()
|
||||
{
|
||||
var ListLINScheduleConfig = LinDriveService.ToomossLinDrive.GetLINScheduleConfigs();
|
||||
ListLINScheduleConfigDto.Clear();
|
||||
//先清空
|
||||
FreeSql.Delete<LINScheduleConfig>()
|
||||
.Where(a => a.CanLinConfigProId == SelectCanLinConfigProId)
|
||||
.ExecuteAffrows();
|
||||
|
||||
foreach (var item in ListLINScheduleConfig)
|
||||
{
|
||||
ListLINScheduleConfigDto.Add(Mapper.Map<LINScheduleConfigDto>(item));
|
||||
}
|
||||
// 重新构建树
|
||||
BuildTree();
|
||||
}
|
||||
|
||||
|
||||
private DelegateCommand saveCmd;
|
||||
/// <summary>
|
||||
/// 保存命令
|
||||
@@ -231,32 +420,35 @@ namespace CapMachine.Wpf.ViewModels
|
||||
MessageBox.Show("请确认消息名称是否正确", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
|
||||
return;
|
||||
}
|
||||
if (item.Cycle == 0)
|
||||
{
|
||||
MessageBox.Show("请确认周期是否正确", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
|
||||
return;
|
||||
}
|
||||
//if (item.Cycle == 0)
|
||||
//{
|
||||
// MessageBox.Show("请确认周期是否正确", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
|
||||
// return;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
//发送的控制帧都放到同一个调度表中,不需要检查了
|
||||
////检查重复设置问题
|
||||
//bool isRepeat = ListLINScheduleConfigDto.GroupBy(i => i.MsgName).Any(g => g.Count() > 1);
|
||||
//if (isRepeat)
|
||||
//{
|
||||
// MessageBox.Show("请确认是否重复设置", "提示", MessageBoxButton.OK, MessageBoxImage.Hand);
|
||||
// return;
|
||||
//}
|
||||
// 保存前:根据树中选中的调度表更新 DTO 的 IsActive,确保只保留一个激活调度表
|
||||
var activeNode = SchTabTree?.FirstOrDefault(n => n.IsSelected);
|
||||
foreach (var dto in ListLINScheduleConfigDto)
|
||||
{
|
||||
dto.IsActive = activeNode != null && string.Equals(dto.SchTabName, activeNode.SchTabName, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
//检查数据是否正常
|
||||
//检查数据是否正常并持久化(结构来自 LDF,不允许新增/删除,仅更新激活状态与周期等)
|
||||
foreach (var item in ListLINScheduleConfigDto)
|
||||
{
|
||||
item.CanLinConfigProId = SelectCanLinConfigProId;
|
||||
|
||||
FreeSql.InsertOrUpdate<LINScheduleConfig>()
|
||||
.SetSource(Mapper.Map<LINScheduleConfig>(item)).
|
||||
ExecuteAffrows();
|
||||
.SetSource(Mapper.Map<LINScheduleConfig>(item))
|
||||
.ExecuteAffrows();
|
||||
}
|
||||
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(Mapper.Map<List<LINScheduleConfigDto>>(FreeSql.Select<LINScheduleConfig>().Where(a => a.CanLinConfigProId == SelectCanLinConfigProId).ToList()));
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(
|
||||
Mapper.Map<List<LINScheduleConfigDto>>(FreeSql.Select<LINScheduleConfig>().Where(a => a.CanLinConfigProId == SelectCanLinConfigProId).ToList()));
|
||||
// 重新构建树,反映保存结果
|
||||
BuildTree();
|
||||
|
||||
DialogParameters pars = new DialogParameters
|
||||
{
|
||||
@@ -315,8 +507,11 @@ namespace CapMachine.Wpf.ViewModels
|
||||
//防止返回的数据为空,就无法增加了
|
||||
if (ListLINScheduleConfigDto == null) ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>();
|
||||
//Name = parameters.GetValue<string>("Name");
|
||||
|
||||
|
||||
SelectCanLinConfigProId = parameters.GetValue<long>("SelectCanLinConfigProId");
|
||||
|
||||
// 初次打开时构建树,并根据已有 IsActive 状态渲染
|
||||
BuildTree();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ namespace CapMachine.Wpf.ViewModels
|
||||
/// </summary>
|
||||
public IDialogService DialogService { get; }
|
||||
|
||||
|
||||
private ObservableCollection<CbxItems> _WriteRuleCbxItems;
|
||||
/// <summary>
|
||||
/// 写入的规格集合
|
||||
@@ -232,10 +231,14 @@ namespace CapMachine.Wpf.ViewModels
|
||||
}
|
||||
|
||||
//调度表配置信息
|
||||
if (SelectCanLinConfigPro.CanScheduleConfigs != null && SelectCanLinConfigPro.CanScheduleConfigs.Count() > 0)
|
||||
if (SelectCanLinConfigPro.LinScheduleConfigs != null && SelectCanLinConfigPro.LinScheduleConfigs.Count() > 0)
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(Mapper.Map<List<LINScheduleConfigDto>>(SelectCanLinConfigPro.LinScheduleConfigs));
|
||||
}
|
||||
else
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>();
|
||||
}
|
||||
|
||||
//匹配选中的SelectCanLinConfigPro.CanLinConfigContents和ListLinLdfModel
|
||||
MatchSeletedAndLinLdfModel();
|
||||
@@ -601,7 +604,7 @@ namespace CapMachine.Wpf.ViewModels
|
||||
SelectCanLinConfigProConfigName = SelectCanLinConfigPro.ConfigName;
|
||||
|
||||
//调度表配置信息
|
||||
if (SelectCanLinConfigPro.CanScheduleConfigs != null && SelectCanLinConfigPro.CanScheduleConfigs.Count() > 0)
|
||||
if (SelectCanLinConfigPro.LinScheduleConfigs != null && SelectCanLinConfigPro.LinScheduleConfigs.Count() > 0)
|
||||
{
|
||||
ListLINScheduleConfigDto = new ObservableCollection<LINScheduleConfigDto>(Mapper.Map<List<LINScheduleConfigDto>>(SelectCanLinConfigPro.LinScheduleConfigs));
|
||||
}
|
||||
@@ -1235,8 +1238,6 @@ namespace CapMachine.Wpf.ViewModels
|
||||
InitLoadLinConfigPro();
|
||||
}
|
||||
|
||||
|
||||
|
||||
break;
|
||||
case "Delete":
|
||||
if (SelectedWriteCanLinRWConfigDto != null)
|
||||
@@ -1257,41 +1258,41 @@ namespace CapMachine.Wpf.ViewModels
|
||||
break;
|
||||
case "WriteSch"://调度表
|
||||
|
||||
LinDriveService.ToomossLinDrive.LinTest();
|
||||
//LinDriveService.ToomossLinDrive.LinTest();
|
||||
|
||||
LinDriveService.ToomossLinDrive.StartSchedule();
|
||||
break;
|
||||
//
|
||||
if (LinDriveService.ToomossLinDrive.OpenState)
|
||||
{
|
||||
//弹窗
|
||||
DialogService.ShowDialog("DialogLINSchConfigView", new DialogParameters() {
|
||||
{"ListMsg", LinDriveService.CmdData.GroupBy(a=>a.MsgName).Select(a=>a.Key).ToList() },
|
||||
{ "ListLINScheduleConfigDto",ListLINScheduleConfigDto},
|
||||
{ "SelectCanLinConfigProId",SelectCanLinConfigPro.Id},
|
||||
|
||||
//var data = LinDriveService.CmdData.GroupBy(a => a.MsgName).Select(a => a.Key).ToList();
|
||||
}, (par) =>
|
||||
{
|
||||
if (par.Result == ButtonResult.OK)
|
||||
{
|
||||
////程序名称
|
||||
ListLINScheduleConfigDto = par.Parameters.GetValue<ObservableCollection<LINScheduleConfigDto>>("ReturnValue");
|
||||
//把更新后的最新值给当前的主集合中
|
||||
SelectCanLinConfigPro.LinScheduleConfigs = Mapper.Map<List<LINScheduleConfig>>(ListLINScheduleConfigDto.ToList());
|
||||
|
||||
//if (data != null && data.Count > 0)
|
||||
//{
|
||||
// //弹窗
|
||||
// DialogService.ShowDialog("DialogLINSchConfigView", new DialogParameters() {
|
||||
// {"ListMsg", LinDriveService.CmdData.GroupBy(a=>a.MsgName).Select(a=>a.Key).ToList() },
|
||||
// { "ListLINScheduleConfigDto",ListLINScheduleConfigDto},
|
||||
// { "SelectCanLinConfigProId",SelectCanLinConfigPro.Id},
|
||||
}
|
||||
else if (par.Result == ButtonResult.Cancel)
|
||||
{
|
||||
//取消
|
||||
|
||||
// }, (par) =>
|
||||
// {
|
||||
// if (par.Result == ButtonResult.OK)
|
||||
// {
|
||||
// ////程序名称
|
||||
// ListLINScheduleConfigDto = par.Parameters.GetValue<ObservableCollection<LINScheduleConfigDto>>("ReturnValue");
|
||||
// //把更新后的最新值给当前的主集合中
|
||||
// SelectCanLinConfigPro.LinScheduleConfigs = Mapper.Map<List<LINScheduleConfig>>(ListLINScheduleConfigDto.ToList());
|
||||
}
|
||||
|
||||
// }
|
||||
// else if (par.Result == ButtonResult.Cancel)
|
||||
// {
|
||||
// //取消
|
||||
|
||||
// }
|
||||
|
||||
// });
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// System.Windows.MessageBox.Show("未发现写入的执行的命令数据,无法配置?", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
//}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Windows.MessageBox.Show("未发现写入的执行的命令数据,无法配置?", "提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Hand);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
89
CapMachine.Wpf/ViewModels/LinTreeNodes.cs
Normal file
89
CapMachine.Wpf/ViewModels/LinTreeNodes.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using Prism.Mvvm;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
namespace CapMachine.Wpf.ViewModels
|
||||
{
|
||||
/// <summary>
|
||||
/// 调度表节点(父节点)。
|
||||
/// 与 XAML 中父级 <TreeView> 的 <HierarchicalDataTemplate> 绑定:
|
||||
/// - 显示字段:<see cref="SchTabName"/>
|
||||
/// - 选择字段:<see cref="IsSelected"/>(TwoWay 绑定至 CheckBox)
|
||||
/// - 子集合:<see cref="Children"/>(用于展开显示消息/帧子节点)
|
||||
///
|
||||
/// 使用 Prism 的 <see cref="BindableBase.SetProperty{T}(ref T, T, string?)"/>
|
||||
/// 以避免值未发生变化时重复触发 PropertyChanged 引起的联动递归。
|
||||
/// </summary>
|
||||
public class LinSchTabNode : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 调度表名称(父节点标题)。
|
||||
/// </summary>
|
||||
private string _SchTabName;
|
||||
public string SchTabName
|
||||
{
|
||||
get => _SchTabName;
|
||||
set => SetProperty(ref _SchTabName, value);
|
||||
}
|
||||
|
||||
private bool _IsSelected;
|
||||
/// <summary>
|
||||
/// 是否被激活/选中(父节点单选)。
|
||||
/// 该属性与 XAML 中父节点的 CheckBox 进行 TwoWay 绑定,
|
||||
/// 其变更由 ViewModel 监听并处理“单选联动”和“子节点跟随”。
|
||||
/// </summary>
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _IsSelected;
|
||||
set => SetProperty(ref _IsSelected, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 子节点集合(消息/帧条目)。
|
||||
/// </summary>
|
||||
private ObservableCollection<LinMsgNode> _Children = new ObservableCollection<LinMsgNode>();
|
||||
public ObservableCollection<LinMsgNode> Children
|
||||
{
|
||||
get => _Children;
|
||||
set => SetProperty(ref _Children, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息/帧 节点(子节点)。
|
||||
/// 与 XAML 中父级 <HierarchicalDataTemplate.ItemTemplate> 绑定:
|
||||
/// - 显示字段:<see cref="MsgName"/> / <see cref="MsgNameIndex"/>
|
||||
/// - 选择字段:<see cref="IsSelected"/>(当前设计作为“显示联动”,非编辑入口)
|
||||
/// </summary>
|
||||
public class LinMsgNode : BindableBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 消息/帧名称。
|
||||
/// </summary>
|
||||
private string _MsgName;
|
||||
public string MsgName
|
||||
{
|
||||
get => _MsgName;
|
||||
set => SetProperty(ref _MsgName, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 消息/帧 Index。
|
||||
/// </summary>
|
||||
private int _MsgNameIndex;
|
||||
public int MsgNameIndex
|
||||
{
|
||||
get => _MsgNameIndex;
|
||||
set => SetProperty(ref _MsgNameIndex, value);
|
||||
}
|
||||
|
||||
private bool _IsSelected;
|
||||
/// <summary>
|
||||
/// 是否被选中(随父节点联动显示)。
|
||||
/// </summary>
|
||||
public bool IsSelected
|
||||
{
|
||||
get => _IsSelected;
|
||||
set => SetProperty(ref _IsSelected, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<UserControl
|
||||
<UserControl
|
||||
x:Class="CapMachine.Wpf.Views.DialogLINSchConfigView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:localEx="clr-namespace:CapMachine.Wpf"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:vm="clr-namespace:CapMachine.Wpf.ViewModels"
|
||||
Width="1000"
|
||||
Height="800"
|
||||
mc:Ignorable="d">
|
||||
@@ -31,7 +32,7 @@
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<!--<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding OpCmd}"
|
||||
@@ -52,7 +53,8 @@
|
||||
Text="新增" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<!--<Button
|
||||
-->
|
||||
<!--<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding CopyCmd}"
|
||||
FontWeight="Bold"
|
||||
@@ -71,6 +73,7 @@
|
||||
Text="复制" />
|
||||
</StackPanel>
|
||||
</Button>-->
|
||||
<!--
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding OpCmd}"
|
||||
@@ -92,13 +95,35 @@
|
||||
Text="删除" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</StackPanel>-->
|
||||
|
||||
<StackPanel
|
||||
Margin="30,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock
|
||||
<Button
|
||||
Margin="10,0"
|
||||
Command="{Binding OpCmd}"
|
||||
CommandParameter="LoadSch"
|
||||
FontWeight="Bold"
|
||||
Foreground="Green"
|
||||
Style="{StaticResource MaterialDesignFlatAccentBgButton}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
FontSize="14"
|
||||
Foreground="Green"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="下载" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
|
||||
<!--<TextBlock
|
||||
Margin="10,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="/Assets/Fonts/#iconfont"
|
||||
@@ -116,75 +141,50 @@
|
||||
FontSize="20"
|
||||
ItemsSource="{Binding SendOrderCbxItems}"
|
||||
SelectedValue="{Binding CurSendOrder, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key" />
|
||||
SelectedValuePath="Key" />-->
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<DataGrid
|
||||
x:Name="MainDatagrid"
|
||||
<Border
|
||||
Margin="5"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
HeadersVisibility="Column"
|
||||
ItemsSource="{Binding ListLINScheduleConfigDto}"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow">
|
||||
<DataGrid.Columns>
|
||||
<!--<DataGridTextColumn
|
||||
Binding="{Binding Index}"
|
||||
Header="序号"
|
||||
IsReadOnly="True" />-->
|
||||
|
||||
<DataGridTemplateColumn Width="260" Header="消息名">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
DisplayMemberPath="Text"
|
||||
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.MsgCbxItems}"
|
||||
SelectedValue="{Binding MsgName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding Cycle}"
|
||||
Header="周期" />
|
||||
|
||||
<!--<DataGridTemplateColumn Width="200" Header="发送方式">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
DisplayMemberPath="Text"
|
||||
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.SendOrderCbxItems}"
|
||||
SelectedValue="{Binding OrderSend, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
|
||||
<DataGridTemplateColumn Width="160" Header="调度器序号">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
DisplayMemberPath="Text"
|
||||
ItemsSource="{Binding Source={StaticResource Proxy}, Path=Data.SchTabIndexCbxItems}"
|
||||
SelectedValue="{Binding SchTabIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedValuePath="Key" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<!--<DataGridCheckBoxColumn Binding="{Binding IsEnable}" Header="是否启用" />-->
|
||||
</DataGrid.Columns>
|
||||
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<prism:InvokeCommandAction Command="{Binding GridSelectionChangedCmd}" CommandParameter="{Binding ElementName=MainDatagrid, Path=SelectedItem}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</DataGrid>
|
||||
Padding="6"
|
||||
BorderBrush="#D0D0D0"
|
||||
BorderThickness="1"
|
||||
CornerRadius="4">
|
||||
<TreeView ItemsSource="{Binding SchTabTree}">
|
||||
<TreeView.ItemTemplate>
|
||||
<!-- 父节点模板:不使用 DataType,避免类型解析 -->
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBlock Text=" " />
|
||||
<TextBlock
|
||||
FontSize="20"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding SchTabName}" />
|
||||
</StackPanel>
|
||||
<!-- 子节点模板:文本显示 -->
|
||||
<HierarchicalDataTemplate.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
FontSize="16"
|
||||
Foreground="DimGray"
|
||||
Text="• " />
|
||||
<TextBlock FontSize="16" Foreground="DimGray">
|
||||
<Run Text="{Binding MsgName}" />
|
||||
<Run Text=" (Index: " />
|
||||
<Run Text="{Binding MsgNameIndex}" />
|
||||
<Run Text=")" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</HierarchicalDataTemplate.ItemTemplate>
|
||||
</HierarchicalDataTemplate>
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<StackPanel
|
||||
|
||||
Reference in New Issue
Block a user