public TSIWindow() { InitializeComponent(); _selectedSLsDict = new Dictionary<string, IEnumerable<DGObject>>(); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _slsGrade = new Dictionary<int, int>(); _slsGraphics = new Dictionary<int, IGraphicCollection>(); _mainFrame = Globals.mainframe; _prj = Globals.project; _structureDomain = _prj.getDomain(DomainType.Structure); _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new List<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); Loaded += TSIWindow_Loaded; Unloaded += TSIWindow_Unloaded; }
void getresult() { MPLB.ItemsSource = null; //clear the ItemsSource _mpsResult.Clear(); //clear the previous results of analysis //Get result _prj = Globals.project; _monitoringDomain = _prj.getDomain(DomainType.Monitoring); _allMPs = _monitoringDomain.getObjects("MonPoint"); _mps = _allMPs.merge(); int count = 0; string _message = ""; foreach (DGObject mp in _mps) { MonPoint _mp = mp as MonPoint; foreach (string key in _mp.readingsDict.Keys) { List <MonReading> a = _mp.readingsDict[key]; foreach (MonReading b in a) { if (System.Math.Abs(b.value) > mptb) { count++; } } _message = string.Format("{0} of the {1} value exceed the limit value {2}", count, _mp.Name, mptb); } _mpsResult.Add(_message); } MPLB.ItemsSource = _mpsResult; }
/// <summary> /// acquire data from iS3 /// </summary> public void inputProData() { IMainFrame _mainFrame = Globals.mainframe; Project _project = Globals.project; Domain _monitorDom = _project.getDomain(DomainType.Monitoring); _monitorGroup=_monitorDom.getObjects("MonitorGroup"); }
public override List <FrameworkElement> chartViews( IEnumerable <DGObject> objs, double width, double height) { List <FrameworkElement> charts = new List <FrameworkElement>(); List <Borehole> bhs = new List <Borehole>(); foreach (Borehole bh in objs) { if (bh != null && bh.Geologies.Count > 0) { bhs.Add(bh); } } Domain geologyDomain = Globals.project.getDomain(DomainType.Geology); DGObjectsCollection strata = geologyDomain.getObjects("Stratum"); BoreholeCollectionView bhsView = new BoreholeCollectionView(); bhsView.Name = "Geology"; bhsView.Boreholes = bhs; bhsView.Strata = strata; bhsView.ViewerHeight = height; bhsView.RefreshView(); bhsView.UpdateLayout(); charts.Add(bhsView); return(charts); }
private void DemoWindow_Loaded(object sender, RoutedEventArgs e) { objSelectionChangedTrigger += Globals.mainframe.objSelectionChangedListener; Globals.mainframe.objSelectionChangedTrigger += objSelectionChangedListener; Project prj = Globals.project; Domain monDomain = prj["Monitoring"]; DGObjectsCollection dc = monDomain.getObjects("MonPoint"); listLB.ItemsSource = dc.FirstOrDefault().values; }
public static DGObjects GetDGObjsByName(DGObjectsCollection dgObjsColl, string name) { DGObjects dgObjs = null; foreach (DGObjects objs in dgObjsColl) { if (objs.definition.Name == name) { dgObjs = objs; break; } } return dgObjs; }
public DemoWindow() { InitializeComponent(); //Initialize global variables _prj = Globals.project; _monitoringDomain = _prj.getDomain(DomainType.Monitoring); _allMPs = _monitoringDomain.getObjects("MonPoint"); _mps = _allMPs.merge(); _mainFrame = Globals.mainframe; _monpoints = new Dictionary <string, IEnumerable <DGObject> >(); mptb = 0.002; Loaded += DemoWindow_Loaded1; getresult(); }
Dictionary <int, IGraphicCollection> _MonGraphics; //分析结果存储 public void initial() { //初始化全局变量 _selectedMonsDict = new Dictionary <string, IEnumerable <DGObject> >(); _MonGrade = new Dictionary <int, int>(); _MonGraphics = new Dictionary <int, IGraphicCollection>(); _mainFrame = Globals.mainframe; _prj = Globals.project; _MonitorDomain = _prj.getDomain(DomainType.Monitoring); _allMons = _MonitorDomain.getObjects("MonPoint"); _monLayerIDs = new List <string>(); foreach (DGObjects objs in _allMons) { _monLayerIDs.Add(objs.definition.GISLayerName); } Loaded += MonitorDemoTool_Loaded; Unloaded += MonitorDemoTool_Unloaded; }
Dictionary <int, IGraphicCollection> _slsGraphics; //图形结果存储 public DemoWindow() { InitializeComponent(); //初始化全局变量 _selectedSLsDict = new Dictionary <string, IEnumerable <DGObject> >(); _slsGrade = new Dictionary <int, int>(); _slsGraphics = new Dictionary <int, IGraphicCollection>(); _mainFrame = Globals.mainframe; _prj = Globals.project; _structureDomain = _prj.getDomain(DomainType.Structure); _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List <string>(); foreach (DGObjects objs in _allSLs) { _slLayerIDs.Add(objs.definition.GISLayerName); } //窗口加载、关闭事件 Loaded += DemoWindow_Loaded; Unloaded += DemoWindow_Unloaded; }
// Summary: // Get objects according to the specified object type // Remarks: // If there is only a DGObjects with the specified object type, // it will be returned directly. // // If there are multiple DGObjects with the specified object type, // then a new DGObjects is returned which will merged all the objects. // In this situation, the index of the DGObjects are lost. public DGObjectsCollection getObjects(string objType) { IEnumerable<DGObjectsDefinition> defs = objsDefinitions.Values.Where(x => x.Type == objType); if (defs == null || defs.Count() == 0) return null; DGObjectsCollection result = new DGObjectsCollection(); foreach (DGObjectsDefinition def in defs) { if (objsContainer.ContainsKey(def.Name)) { DGObjects objs = objsContainer[def.Name]; result.Add(objs); } } return result; }
public DrawTunnelsWindow() { InitializeComponent(); //Initialize ISimpleLineSymbol linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Red, Core.Graphics.SimpleLineStyle.Solid, 1.0); _symbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, linesymbol); _tunnelsGraphics = new Dictionary<int, IGraphicCollection>(); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _lpResults = new List<DGObject>(); _settings = new DrawTunnelsSettings(); SettingsHolder.DataContext = _settings; Loaded += DrawTunnelsWindow_Loaded; Unloaded += DrawTunnelsWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new HashSet<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); _allAxes = _structureDomain.getObjects("TunnelAxis"); if (_allAxes == null) { _initFailed = true; return; } }
HashSet<string> _tunnelLayerIDs; // tunnel layer IDs #endregion Fields #region Constructors public TunnelDepthAnalysisWindow() { InitializeComponent(); //Initialize _linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Blue, Core.Graphics.SimpleLineStyle.Solid, 1.0); _selectedTunnelsDict = new Dictionary<string, IEnumerable<DGObject>>(); _depthGraphics = new Dictionary<int, IGraphicCollection>(); Loaded += TunnelDepthAnalysisWindow_Loaded; Unloaded += TunnelDepthAnalysisWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new HashSet<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); }
List<string> _tunnelLayerIDs; // tunnel layer IDs #endregion Fields #region Constructors public SimpleProfileAnalysisWindow() { InitializeComponent(); _settings = new GeoProjSettings(); SettingsHolder.DataContext = _settings; Loaded += SimpleProfileAnalysisWindow_Loaded; Unloaded += SimpleProfileAnalysisWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); _structureDomain = _prj.getDomain(DomainType.Structure); if (_geologyDomain == null || _structureDomain == null) { _initFailed = true; return; } // set the input view _inputView = _mainFrame.activeView; if (_inputView == null || _inputView.eMap.MapType != EngineeringMapType.FootPrintMap) _inputView = _mainFrame.views.FirstOrDefault( x => x.eMap.MapType == EngineeringMapType.FootPrintMap); if (_inputView == null) { _initFailed = true; return; } InputViewTB.DataContext = _inputView; _allBhs = _geologyDomain.getObjects("Borehole"); _allSts = _geologyDomain.getObjects("Stratum"); _bhLayerIDs = new List<string>(); foreach (DGObjects objs in _allBhs) _bhLayerIDs.Add(objs.definition.GISLayerName); _allTunnels = _structureDomain.getObjects("Tunnel"); _tunnelLayerIDs = new List<string>(); foreach (DGObjects objs in _allTunnels) _tunnelLayerIDs.Add(objs.definition.GISLayerName); // add borehole layer as selectable layer _inputView.removeSelectableLayer("_ALL"); _inputView.addSeletableLayer("0"); // "0" is the drawing layer ID foreach (string layerID in _bhLayerIDs) _inputView.addSeletableLayer(layerID); foreach (string layerID in _tunnelLayerIDs) _inputView.addSeletableLayer(layerID); // add a listener to object selection changed event _inputView.objSelectionChangedTrigger += _inputView_objSelectionChangedListener; // add a listener to drawing graphics changed event _inputView.drawingGraphicsChangedTrigger += _inputView_drawingGraphicsChangedListener; }
public DrawSLWindow() { InitializeComponent(); //Initialize ISimpleLineSymbol linesymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _fillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Color.FromArgb(150, 0, 0, 255), SimpleFillStyle.Solid, linesymbol); _whiteFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Color.FromArgb(150, 255, 255, 255), SimpleFillStyle.Solid, linesymbol); _selectedSLsDict = new Dictionary<string, IEnumerable<DGObject>>(); _slsGraphics = new Dictionary<int, IGraphicCollection>(); _lsGraphics = new Dictionary<string, LSGraphics>(); _csGraphics = new Dictionary<string, CSGraphics>(); Loaded += DrawSLWindow_Loaded; Unloaded += DrawSLWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); }
public LoadStructureModelWindow() { InitializeComponent(); ISimpleLineSymbol outline = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _whitefillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.White, SimpleFillStyle.Solid, outline); _lineSymbol = Runtime.graphicEngine.newSimpleLineSymbol( Color.FromArgb(255, 0, 0, 0), Core.Graphics.SimpleLineStyle.Solid, 1.0); _arrowFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, outline); SLMomentGraphics = new Dictionary<int, IGraphicCollection>(); SLAxialGraphics = new Dictionary<int, IGraphicCollection>(); SLShearGraphics = new Dictionary<int, IGraphicCollection>(); SLDisplacementGraphics = new Dictionary<int, IGraphicCollection>(); _loadStructure = new LoadStructure(); Loaded += LoadStructureModelWindow_Loaded; Unloaded += LoadStructureModelWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); if (_geologyDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); _ansysPath = Runtime.rootPath + "//Conf//ansysPath.xml"; }
Domain _structureDomain; // the structure domain of the project #endregion Fields #region Constructors public TunnelCSLoadWindow() { InitializeComponent(); ISimpleLineSymbol outline = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Black, Core.Graphics.SimpleLineStyle.Solid, 1.0); _fillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Cyan, SimpleFillStyle.Solid, outline); _lineSymbol = Runtime.graphicEngine.newSimpleLineSymbol( Colors.Blue, Core.Graphics.SimpleLineStyle.Solid, 1.0); _arrowFillSymbol = Runtime.graphicEngine.newSimpleFillSymbol( Colors.Blue, SimpleFillStyle.Solid, outline); _IniStress = new SoilInitalStress(); _slsGraphics = new Dictionary<string, IGraphicCollection>(); Loaded += TunnelCSLoadWindow_Loaded; Unloaded += TunnelCSLoadWindow_Unloaded; _mainFrame = Globals.mainframe; _prj = Globals.project; if (_mainFrame == null || _prj == null) { _initFailed = true; return; } _structureDomain = _prj.getDomain(DomainType.Structure); if (_structureDomain == null) { _initFailed = true; return; } _geologyDomain = _prj.getDomain(DomainType.Geology); if (_geologyDomain == null) { _initFailed = true; return; } _allSLs = _structureDomain.getObjects("SegmentLining"); _slLayerIDs = new List<string>(); foreach (DGObjects objs in _allSLs) _slLayerIDs.Add(objs.definition.GISLayerName); }
void StartAnalysis() { string mapID = _inputView.eMap.MapID; _settings.mapID = mapID; _spatialRef = _inputView.spatialReference; // check all needed data is set up correctly if (_selectedTunnelsDict == null || _selectedTunnelsDict.Count() == 0) return; foreach (string tunnelLayerID in _selectedTunnelsDict.Keys) { IGraphicsLayer gLayer = _inputView.getLayer("DES_AXL"); if (gLayer == null) continue; IEnumerable<DGObject> tunnels = _selectedTunnelsDict[tunnelLayerID]; foreach (var obj in tunnels) { Tunnel tunnel = obj as Tunnel; if (tunnel.StartMileage == null || tunnel.EndMileage == null || tunnel.LineNo == null) continue; _allAxes = _structureDomain.getObjects("TunnelAxis"); TunnelAxis ta = _allAxes[tunnel.id] as TunnelAxis; if (ta == null) continue; //analysis the axis, change the engineering coordinate to map coordinate TunnelAxis engineeringAxis = ta; int count = engineeringAxis.AxisPoints.Count; IGraphicCollection gc = gLayer.getGraphics(ta); if (gc.Count == 0) continue; IGraphic g = gc[0]; IPolyline pline = g.Geometry as IPolyline; if (pline == null) continue; IPointCollection pc = pline.GetPoints(); if (pc.Count != count) { return; } TunnelAxis mapAxis = new TunnelAxis(); mapAxis.AxisPoints = new System.Collections.Generic.List<TunnelAxisPoint>(); for (int i = 0; i < count; i++) { TunnelAxisPoint p1 = engineeringAxis.AxisPoints[i]; TunnelAxisPoint p2 = new TunnelAxisPoint(); p2.Mileage = p1.Mileage; p2.X = pc[i].X; p2.Y = pc[i].Y; p2.Z = p1.Z; mapAxis.AxisPoints.Add(p2); } mapAxis = TunnelMappingUtility.ClipAxis(mapAxis, (double)tunnel.StartMileage, (double)tunnel.EndMileage); if (mapAxis.AxisPoints[0].Mileage != tunnel.StartMileage) { TunnelAxisPoint pt = TunnelMappingUtility.MileageToAxisPoint((double)tunnel.StartMileage, mapAxis); mapAxis.AxisPoints.Insert(0, pt); } count = mapAxis.AxisPoints.Count; if (mapAxis.AxisPoints[count - 1].Mileage != tunnel.EndMileage) { TunnelAxisPoint pt = TunnelMappingUtility.MileageToAxisPoint((double)tunnel.EndMileage, mapAxis); mapAxis.AxisPoints.Add(pt); } mapAxis.LineNo = ta.LineNo; mapAxis.id = ta.id; mapAxis.name = ta.name; _results.Add(mapAxis); } } }