private void RefreshBelowTerrain() { ScreensAboveTerrain.Clear(); ScreensBelowBottom.Clear(); if (wells != null) { foreach (var w in wells.Where(we => we.Terrain != -999 & we.Row >= 0 & we.Column >= 0)) { foreach (var s in w.Screens.Where(sc => sc.DepthToBottom != -999 & sc.DepthToTop != -999)) { if (s.AboveModelTerrain) { MoveToChalkViewModel mc = new MoveToChalkViewModel(w, s); mc.NewTop = mshe.GridInfo.SurfaceTopography.Data[w.Row, w.Column]; mc.NewBottom = mshe.GridInfo.LowerLevelOfComputationalLayers.Data[w.Row, w.Column, mshe.GridInfo.NumberOfLayers - 1]; mc.NewLayer = mshe.GridInfo.NumberOfLayers - 1; ScreensAboveTerrain.Add(mc); } if (s.BelowModelBottom) { MoveToChalkViewModel mc = new MoveToChalkViewModel(w, s); mc.NewBottom = mshe.GridInfo.LowerLevelOfComputationalLayers.Data[w.Row, w.Column, 0]; //Maintain filter length mc.NewTop = mc.NewBottom + (s.DepthToBottom.Value - s.DepthToTop.Value); mc.NewLayer = 0; ScreensBelowBottom.Add(mc); } } } } RaisePropertyChanged("ScreensBelowBottom"); RaisePropertyChanged("ScreensAboveTerrain"); }
public void DistributeIntakesOnLayers() { //Reset Layers foreach (Layer L in Layers) { L.Intakes.Clear(); L.OriginalIntakes.Clear(); L.IntakesMoved.Clear(); L.IntakesAllowed = true; } //Distribute the intakes foreach (IWell W in Wells) { int col; int row; if (!MShe.GridInfo.TryGetIndex(W.X, W.Y, out col, out row)) { WellsOutSideModelDomain.Add(W); } else { //Well has no terrain. Use model topography if (W.Terrain < 0) { W.Terrain = MShe.GridInfo.SurfaceTopography.Data[row, col]; } foreach (IIntake I in W.Intakes) { foreach (Screen S in I.Screens) { //Missing screen info if (S.TopAsKote < -990 || S.BottomAsKote < -990 || S.DepthToBottom < -990 || S.DepthToTop < -990) { ScreensWithMissingDepths.Add(S); } else { int TopLayer = MShe.GridInfo.GetLayer(col, row, S.TopAsKote.Value); int BottomLayer = MShe.GridInfo.GetLayer(col, row, S.BottomAsKote.Value); //Above terrain if (BottomLayer == -1) { ScreensAboveTerrain.Add(S); } //Below bottom else if (TopLayer == -2) { ScreensBelowBottom.Add(S); } else { BottomLayer = Math.Max(0, BottomLayer); if (TopLayer == -1) { TopLayer = MShe.GridInfo.NumberOfLayers - 1; } for (int i = BottomLayer; i <= TopLayer; i++) { //Prevent adding the same intake twice if has two screens in the same layer if (I.Screens.Count > 1) { if (!Layers[i].Intakes.Contains(I)) { Layers[i].Intakes.Add(I); Layers[i].OriginalIntakes.Add(I); } } else { Layers[i].Intakes.Add(I); Layers[i].OriginalIntakes.Add(I); } } } } } } } } }