编辑通信组有问题

This commit is contained in:
2026-09-16 10:46:02 +08:00
parent cf2a7c8ff1
commit f43cd123ec
2 changed files with 15 additions and 2 deletions
+1
View File
@@ -84,6 +84,7 @@ namespace JinYuan.Helper
{
EventMsg msg = (EventMsg)Marshal.PtrToStructure(lParam, typeof(EventMsg));
codes.Add(msg);
Debug.WriteLine($"scanerEvent: {codes.Result}, msg.message: {msg.message}, msg.paramH: {msg.paramH}");
if (ScanerEvent != null && msg.message == 13 && msg.paramH > 0 && !string.IsNullOrEmpty(codes.Result))
{
ScanerEvent(codes);
+14 -2
View File
@@ -177,7 +177,13 @@ namespace LargeSquareOne
{
if (e.RowIndex < 0) return;
editingConfig = TotalGroups[e.RowIndex];
// 获取当前行显示的数据
var currentRow = groupTable.Rows[e.RowIndex];
var config = (PlcGroupConfig)currentRow.DataBoundItem;
editingConfig = TotalGroups.First(g =>
g.PlcNum == config.PlcNum &&
g.GroupName == config.GroupName &&
g.Start == config.Start);
// 禁止编辑PLC编号和组名列
if (groupTable.Columns[e.ColumnIndex].Name == "PlcNum")
@@ -193,7 +199,13 @@ namespace LargeSquareOne
{
if (e.RowIndex < 0 || e.RowIndex >= TotalGroups.Count) return;
var config = TotalGroups[e.RowIndex];
// 获取当前行显示的数据
var currentRow = groupTable.Rows[e.RowIndex];
var curConfig = (PlcGroupConfig)currentRow.DataBoundItem;
var config = TotalGroups.First(g =>
g.PlcNum == curConfig.PlcNum &&
g.GroupName == curConfig.GroupName &&
g.Start == curConfig.Start);
var value = groupTable[e.ColumnIndex, e.RowIndex].Value;
try