// Переименование марок АР панелей в соответствии с индексами архитекторов (Э2_Яр1) private void RenamePanelsToArchitectIndex(List <MarkSb> marksSB) { // Определение этажа панели. _storeys = Storey.IdentificationStoreys(marksSB, StartOptions.NumberFirstFloor); // Определение индексов окон var alphanumComparer = new AcadLib.Comparers.AlphanumComparator(); var groupWindows = marksSB.GroupBy(m => m.MarkSbClean).Where(g => g.Skip(1).Any()); foreach (var win in groupWindows) { var winSorted = win.Where(w => !string.IsNullOrEmpty(w.WindowName)).OrderBy(w => w.WindowName, alphanumComparer); int i = 1; foreach (var markSbWin in winSorted) { markSbWin.WindowIndex = i++; } } // Маркировка Марок АР по архитектурному индексу foreach (var markSB in marksSB) { markSB.DefineArchitectMarks(); } }
public async Task <IHttpActionResult> PostKnnTrainingFile() { StoreysHandler SH = new StoreysHandler(db); SpacesHandler SpH = new SpacesHandler(db); KnnsHandler KH = new KnnsHandler(db); var provider = new MultipartMemoryStreamProvider(); await Request.Content.ReadAsMultipartAsync(provider); var file = provider.Contents[0]; string filename = file.Headers.ContentDisposition.FileName.Trim('\"'); //Bytes from the binary reader stored in BlobValue array byte[] TrainingSet = file.ReadAsByteArrayAsync().Result; //reader.ReadBytes((int)file.Length); string trainingString = System.Text.Encoding.UTF8.GetString(TrainingSet); //KVP<LabelMap, knnByte>,First label ID> KeyValuePair <KeyValuePair <byte[], byte[]>, string> LabelMapKnn = KnnGenerate.GenerateTemplateTrainingFile(trainingString); //Generate the files from the generate template method within the template method. save those 3 to db //Storey storey = BC.GetBeaconStorey(BeaconID); //Knn knn = new Knn(); //Once trainingSets generated, Space Guid will be saved in the LabelMapKnn string. Guid storeyId = SpH.GetSpaceStorey(Guid.Parse(LabelMapKnn.Value)).ID; Storey storey = SH.GetStorey(storeyId); byte[] LabelMap = LabelMapKnn.Key.Value; byte[] Knn = LabelMapKnn.Key.Key; Knn knn = new Knn(storey, TrainingSet, LabelMap, Knn); KH.PostKnn(knn); return(Ok(storey)); }
public void DefineStorey(List <Storey> storeysNumbersTypeInAllFacades) { try { var storey = new Storey(BlRefName); if (storey.Type == EnumStorey.Number) { // поиск в общем списке этажей. Номерные этажи всех фасадов должны быть на одном уровне var storeyAllFacades = storeysNumbersTypeInAllFacades?.Find(s => s.Number == storey.Number); if (storeyAllFacades == null) { storeysNumbersTypeInAllFacades?.Add(storey); } else { storey = storeyAllFacades; } //Height = Settings.Default.FacadeFloorHeight; } Storey = storey; } catch (Exception ex) { // ошибка определения номера этажа монтажки - это не чердак (Ч), не парапет (П), и не // просто число Inspector.AddError(ex.Message + BlRefName, IdBlRefMounting, icon: System.Drawing.SystemIcons.Error); Logger.Log.Error(ex, "Floor - DefineStorey()"); } }
public ActionResult AddStorey(Storey storey) { if (storey.Label != null) { _context.Stories.Add(storey); _context.SaveChanges(); } return(RedirectToAction("Index")); }
public async Task <bool> setStoreyNull(Storey storey) { var beacons = from b in db.Beacons where b.Storey.ID == storey.ID select b; if (beacons.Any()) { foreach (Beacon beacon in beacons) { beacon.Storey = null; db.Entry(beacon).State = EntityState.Modified; } } return(true); }
public async Task <bool> setStoreyNull(Storey storey) { var knns = db.Knn.Where(x => x.Storey.ID == storey.ID); if (knns.Any()) { foreach (Knn knn in knns) { knn.Storey = null; db.Entry(knn).State = EntityState.Modified; } } return(true); }
public void DownloadIfc(JsonObject JsonData) { JsonObject y = new JsonObject(); y.h1 = JsonData.h1; y.h2 = JsonData.h2; y.span = JsonData.span; y.Mybays = JsonData.Mybays; double[] spacing = new double[y.Mybays.Count + 1]; double cumulative = 0; for (int b = 0; b < spacing.Length; b++) { spacing[b] = cumulative; if (b < spacing.Length - 1) { cumulative += (y.Mybays[b].Width) * 1000; } } string Path = @"C:\Users\Ahmed Alaa\Desktop\tempAmrIsThatYou"; Model model = Model.Create(Path); IFC.Base.Project project = IFC.Base.Project.Create(model); Site site = Site.Create(model); project.AddSite(site); Building build = Building.Create(model); site.AddBuilding(build); Storey storey2 = Storey.Create(model, 3000); build.AddStorey(storey2); Point pointcol1 = Point.Create(model, 0, 0, 0); // double[] y = new double[] { 0.0, 5000.0, 8000.0, 12000.0, 15000.0, 18000.0, 20000.0, 25000.0 }; Program.DrawFactory(model, storey2, y.h2, y.h1, y.span, pointcol1, spacing); model.Save(/*Path + $"{"Amr"}" + ".ifc"*/); }
public async Task <bool> DeleteStorey(Storey storey) { var spaces = db.Spaces.Where(x => x.Storey.ID == storey.ID); foreach (Space space in spaces) { SpacesHandler SH = new SpacesHandler(db); await SH.DeleteSpace(space); } BeaconsHandler BH = new BeaconsHandler(db); await BH.setStoreyNull(storey); KnnsHandler KH = new KnnsHandler(db); await KH.setStoreyNull(storey); db.Entry(storey).State = EntityState.Deleted; return(true); }
public async Task <IHttpActionResult> PostStoreyKnn() { Guid storeyID = JsonConvert.DeserializeObject <Guid>(Request.Content.ReadAsStringAsync().Result); StoreysHandler SH = new StoreysHandler(db); SpacesHandler SpH = new SpacesHandler(db); TrackersHandler TH = new TrackersHandler(db); TrainingValuesHandler TVH = new TrainingValuesHandler(db); KnnsHandler KH = new KnnsHandler(db); IQueryable <TrainingValue> values = TVH.GetTrainingValuesFromStorey(storeyID); KeyValuePair <KeyValuePair <byte[], byte[]>, string> LabelMapKnn = KnnGenerate.GenerateTemplateTrainingValues(values); Storey storey = SH.GetStorey(storeyID); byte[] LabelMap = LabelMapKnn.Key.Value; byte[] Knn = LabelMapKnn.Key.Key; Knn knn = new Knn(storey, LabelMap, Knn); KH.PostKnn(knn); return(Ok()); }
public ActionResult Save(Storey storey) { var obj = new { code = "0000", msg = "" }; if (storey.action == "editStorey") { //修改楼层信息 dbContext.Entry(storey).State = System.Data.Entity.EntityState.Modified; dbContext.SaveChanges(); } else { //新增楼层信息 dbContext.Storey.Add(storey); dbContext.SaveChanges(); } //返回结果 return(Json(obj)); }
public bool IsEqualMountingStorey(Storey storey) { bool res = false; if (storey.Type == StoreyType) { if (storey.Type == EnumStorey.Number) { if (StoreyNumbers.Contains(storey.Number)) { res = true; } } else { res = true; } } return(res); }
public bool PutStorey(Storey s) { if (db.Storeys.Find(s.ID) == null) { return(false); } Storey storey = db.Storeys.Find(s.ID); storey.Name = s.Name; db.Entry(storey).State = EntityState.Modified; try { db.SaveChanges(); } catch (System.Data.Entity.Infrastructure.DbUpdateConcurrencyException) { throw; } return(true); }
public House(Basement basement, Roof roof, Storey storey) { this.Basement = basement; this.Roof = roof; this.Storey = storey; }
public void BuildStorey() { this._storey = new Storey(); Console.WriteLine("Этаж построен"); }
public FloorRow(Storey storey, double maxH) { Storey = storey; HeightMax = maxH; }
public FloorRow(MountingPanel panelMount) { Storey = panelMount.Floor.Storey; HeightMax = panelMount.Floor.PlanExtentsHeight; }
public bool IsEqualMountingStorey(Storey storey) { bool res = false; if (storey.Type == StoreyType) { if (storey.Type == EnumStorey.Number) { if (StoreyNumbers.Contains(storey.Number)) { res = true; } } else { res = true; } } return res; }
public void PostStorey(Storey storey) { db.Storeys.Add(storey); db.SaveChanges(); }
public int CompareTo(FloorMounting other) { return(Storey.CompareTo(other.Storey)); }