public HeatProducerInfo(string name, HeatProducer heatproducer) : base(name) { _heatproducer = heatproducer; buildingInfos = new CustomAttrCollection(); substationInfos = new CustomAttrCollection(); // get all buildings either directly connecting or indirectly List <Building> buildings = new List <Building>(); if (_heatproducer.OwnMasterDistrict != null) { buildings.AddRange(_heatproducer.OwnMasterDistrict.Buildings); // direct } if (heatproducer.OwnSlaveDistrict != null) { int subtag = 1; foreach (var sub in heatproducer.OwnSlaveDistrict.SubStations) // indirect { substationInfos.Add(new SubstationInfo("热力站" + (subtag++), sub)); if (sub.OwnMasterDistrict != null) { buildings.AddRange(sub.OwnMasterDistrict.Buildings); } } } if (buildings.Count != 0) { foreach (var b in buildings) { buildingInfos.Add(new BuildingInfo("楼房" + b.BuildingNum, b)); } } }
public SolutionAttrCompareTable() { baseInfo = new BaseInfo("基本信息"); solutionInfos = new CustomAttrCollection(); foreach (var solution in HeatSourceLayoutApp.solutions) { solutionInfos.Add(new SolutionInfo(solution.SolutionName, solution)); } }
public SolutionAttrTable(Solution solution) { _solution = solution; baseInfo = new BaseInfo("基本信息"); heatInfos = new CustomAttrCollection(); int heattag = 1; if (solution != null) { if (solution.HeatProducers.Count != 0) { foreach (var heatproducer in HeatSourceLayoutApp.currentSolution.HeatProducers.Values) { heatInfos.Add(new HeatProducerInfo("热源" + (heattag++), heatproducer)); } } totalInfo = new TotoalInfo("工程总表", _solution); } }