/// <summary> /// Определение требования освещенности /// </summary> public InsValue CalcTimeAndGetRate(List <IIlluminationArea> illums, BuildingTypeEnum buildingType) { if (illums == null) { return(InsValue.Empty); } int maxTimeContinuosIlum = 0; int curContinuosTime = 0; int totalTime = 0; string startTime; string endTime; IIlluminationArea prev = null; foreach (var item in illums) { item.Time = CalcTime(item.AngleStartOnPlane, item.AngleEndOnPlane, out startTime, out endTime); curContinuosTime += item.Time; totalTime += item.Time; item.TimeStart = startTime; item.TimeEnd = endTime; if (prev != null) { var interval = CalcTime(prev.AngleEndOnPlane, item.AngleStartOnPlane, out startTime, out endTime); if (interval >= 10) { curContinuosTime = item.Time; } } if (curContinuosTime > maxTimeContinuosIlum) { maxTimeContinuosIlum = curContinuosTime; } prev = item; } InsRequirement req = DefineInsRequirement(maxTimeContinuosIlum, totalTime, buildingType); var insValue = new InsValue(req, maxTimeContinuosIlum, totalTime); return(insValue); }
public string GetInsValue() { return(InsValue.ToString()); }