DeviceOfPartDataProxy.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using UnityEngine;
  5. public class DeviceOfPartDataProxy : DataProxy
  6. {
  7. public string m_TableName;
  8. public List<PartDataInfo> m_PartInfos;
  9. public override void OnRegister()
  10. {
  11. }
  12. public PartDataInfo GetPartInfoByPartName(string partName)
  13. {
  14. return m_PartInfos.Find(t => t.partName == partName);
  15. }
  16. /// <summary>
  17. /// 从Excel文件读取流程信息
  18. /// </summary>
  19. /// <param name="tableName">表明</param>
  20. /// <param name="headCount">表头</param>
  21. /// <returns></returns>
  22. public List<PartDataInfo> ReadStepMsgInfoFromTable(string tableName)
  23. {
  24. m_TableName = tableName + GlobalConfig.excelSuffix;
  25. m_PartInfos = new List<PartDataInfo>();
  26. string tmpPath = System.IO.Path.Combine(GlobalConfig.partTablePath, m_TableName);
  27. if (File.Exists(tmpPath))
  28. {
  29. m_PartInfos = ExcelHelper.ReadInfoFromExcel<PartDataInfo>(tmpPath, 1);
  30. }
  31. return m_PartInfos;
  32. }
  33. }