通道配置修改

This commit is contained in:
Administrator
2026-07-17 09:49:00 +08:00
parent 9a31174049
commit f51db3f130
29 changed files with 73 additions and 32 deletions
+8 -3
View File
@@ -5,7 +5,7 @@ using JinYuan.DAL;
using JinYuan.Helper;
using JinYuan.MES;
using JinYuan.Models;
using JinYuan.Models.SysConfig;
using JinYuan.Models.SysCfg;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
@@ -403,6 +403,11 @@ namespace JinYuan.VirtualDataLibrary
MESGradingSet[i] = (short)channels[i].DefaultValue;
}
// For Test
//string testStr = "E63y,F63y";
//string[] mesChannels = testStr.Split(',');
//var channel = channels.FirstOrDefault(it => StrUtil.IsExist(it.Gears, mesChannels));
var isWrite1 = PlcLink.WriteValue("D2600", MESGradingSet[0], Data_Type.Short);
var isWrite2 = PlcLink.WriteValue("D2601", MESGradingSet[1], Data_Type.Short);
var isWrite3 = PlcLink.WriteValue("D2602", MESGradingSet[2], Data_Type.Short);
@@ -534,10 +539,10 @@ namespace JinYuan.VirtualDataLibrary
public static string iniFilePath = Path.Combine(System.Windows.Forms.Application.StartupPath, "ini\\Configure.ini");
public static string ChannelPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\settings.json");
public static string ChannelPath = Path.Combine(System.Windows.Forms.Application.StartupPath, "Config\\Channel.json");
#region 读取json配置
public static Models.SysConfig.ChannelConfig LoadFromJson(string filePath)
public static Models.SysCfg.ChannelConfig LoadFromJson(string filePath)
{
var json = File.ReadAllText(filePath);
return JsonConvert.DeserializeObject<ChannelConfig>(json);