| File was renamed from HMI.ParameterManage/Util/TestItemManager.cs |
| | |
| | | using HMI.Core.Util; |
| | | using HMI.ParameterManage.Entity; |
| | | using HMI.Core.Entity; |
| | | using HMI.Core.Util; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | |
| | | namespace HMI.ParameterManage.Util |
| | | namespace HMI.Core.Manager |
| | | { |
| | | /// <summary> |
| | | /// TODO 优化数据源,需要支持sqlite和xml |
| | |
| | | /// <returns></returns> |
| | | public static T GetTestItemByProduct<T>(string product) where T : IList<TestItemData> |
| | | { |
| | | string path = Path.Combine(TestItem.FileFolder, $"TestItem_{product}.setting"); |
| | | string path = Path.Combine(PathHelper.TestItemDataFolder, $"TestItem_{product}.setting"); |
| | | if (!File.Exists(path)) return default(T); |
| | | T datas = XmlHelper.DeserializeFromXml<T>(path); |
| | | return datas; |
| | |
| | | { |
| | | throw new Exception("不能为null"); |
| | | } |
| | | string path = Path.Combine(TestItem.FileFolder, $"TestItem_{product}.setting"); |
| | | string path = Path.Combine(PathHelper.TestItemDataFolder, $"TestItem_{product}.setting"); |
| | | XmlHelper.SerializeToXml(path, datas); |
| | | } |
| | | |