ElectricalRelationUploader.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using SAGA.GplotRelationComputerManage;
  2. using SAGA.Models;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace SAGA.GplotManage
  9. {
  10. public class ElectricalRelationUploader : RelationUploader
  11. {
  12. public ElectricalRelationUploader(string relationType, string relationDisplay) : base(relationType, relationDisplay)
  13. {
  14. CurrentHandler=ElectricalRelationHandlerFactory.Create(relationType);
  15. }
  16. public IElectricalRelationHandler CurrentHandler { get; private set; }
  17. public override void Upload()
  18. {
  19. //计算数据
  20. if (CurrentHandler == null)
  21. return;
  22. //加载数据
  23. var data = CurrentHandler.GetComputeData(new PowerComputerContext()); ;
  24. //使用数据
  25. Upload(data);
  26. }
  27. public override void Upload(object loadData)
  28. {
  29. List<DataNode> dataNodes = loadData as List<DataNode>;
  30. if(dataNodes==null)
  31. {
  32. return;
  33. }
  34. //上传数据处理
  35. }
  36. }
  37. }