예제 #1
0
        public List <CalcLocation> MakeCalcLocations([NotNull][ItemNotNull] List <CalcLocationDto> locations,
                                                     [NotNull] DtoCalcLocationDict locdict, CalcRepo calcRepo)
        {
            var locs = new List <CalcLocation>();

            foreach (var t in locations)
            {
                // loc anlegen
                var cloc = new CalcLocation(t.Name, t.Guid);
                foreach (var locdev in t.LightDevices)
                {
                    var deviceLoads = CalcDeviceFactory.MakeCalcDeviceLoads(locdev, _calcLoadTypeDict);
                    var deviceName  = CalcAffordanceFactory.FixAffordanceName(locdev.Name, _calcRepo.CalcParameters.CSVCharacter);
                    locdev.Name = deviceName;
                    var clightdevice = new CalcDevice(deviceLoads,
                                                      cloc, locdev, calcRepo);
                    cloc.AddLightDevice(clightdevice);
                }
                //deviceLocationDict.Add(cloc, new List<IAssignableDevice>());
                locs.Add(cloc);
                locdict.LocationDtoDict.Add(t, cloc);
            }
            return(locs);
        }