| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using SAGA.GplotRelationComputerManage;
- using SAGA.Models;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SAGA.GplotManage
- {
- public class ElectricalRelationUploader : RelationUploader
- {
- public ElectricalRelationUploader(string relationType, string relationDisplay) : base(relationType, relationDisplay)
- {
- CurrentHandler = ElectricalRelationHandlerFactory.Create(relationType);
- }
- public IElectricalRelationHandler CurrentHandler { get; private set; }
- public override void Upload()
- {
- //计算数据
- if (CurrentHandler == null)
- return;
- //加载数据
- var data = CurrentHandler.GetComputeData(new PowerComputerContext()); ;
- //使用数据
- Upload(data);
- }
- public override void Upload(object loadData)
- {
- List<DataNode> dataNodes = loadData as List<DataNode>;
- if (dataNodes == null)
- {
- return;
- }
- //上传数据处理
- }
- #region 数据上传方法
- private void CreateGraph(DataNode dn, List<ReleateData> data)
- {
- if (dn.Childrens.Count > 0)
- {
- foreach (var n in dn.Childrens)
- {
- // data.Add(GetReleateData(dn.EId, n.EId));
- CreateGraph(n, data);
- }
- }
- }
- #endregion
- }
- }
|