FlowSettingDict.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace FurnaceUI.Views.ParameterSC
  8. {
  9. class FlowSettingDict
  10. {
  11. public Dictionary<string, Dictionary<string, string>> FlowSettings { get; set; } = new Dictionary<string, Dictionary<string, string>>();
  12. IEnumerable<string> Generate()
  13. {
  14. for (char c = 'A'; c <= 'Z'; c++)
  15. yield return new string(c, 1);
  16. }
  17. public FlowSettingDict()
  18. {
  19. GetSCValue();
  20. }
  21. public void GetSCValue()
  22. {
  23. FlowSettings.Clear();
  24. var tempConfigs = SystemConfigProvider.Instance.GetValuesByNode($"PM1.RecipeEditParameter.FlowSetting");
  25. var temp = Generate();
  26. foreach (var item in tempConfigs)
  27. {
  28. Dictionary<string, string> mfcSetting = new Dictionary<string, string>();
  29. foreach (var subitem in temp)
  30. {
  31. mfcSetting[subitem] = SystemConfigProvider.Instance.GetValueByName($"PM1.RecipeEditParameter.FlowSetting.{item}.{subitem}");
  32. }
  33. FlowSettings[item] = mfcSetting;
  34. }
  35. }
  36. }
  37. }