refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Newtonsoft.Json;
namespace MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Common
{
public class IOCommandReader
{
private static Dictionary<string, CommandModelConfig> _commandModelConfigDict = new Dictionary<string, CommandModelConfig>();
public static CommandModelConfig GetCommandModelConfig(string hardwarePath, string hardwareName)
{
CommandModelConfig commandModelConfig = null;
if (_commandModelConfigDict.Keys.Contains(hardwareName))
{
commandModelConfig = _commandModelConfigDict[hardwareName];
}
else
{
commandModelConfig = JsonConvert.DeserializeObject<CommandModelConfig>(File.ReadAllText(ConfigPath.HardwareUnitsPath + $"{hardwarePath}\\{hardwareName}\\IOCommands.json"));
_commandModelConfigDict.Add(hardwareName, commandModelConfig);
}
return commandModelConfig;
}
}
public class ConfigPath
{
public static string HardwareUnitsPath
{
get
{
string path = Assembly.GetExecutingAssembly().Location;
FileInfo finfo = new FileInfo(path);
return finfo.DirectoryName + @"\\HardwareUnits\";
}
}
}
}