public bool LoadResultSet(string dirPath, out Core.Result.IResultSet set)
        {
            TecplotReader reader = new TecplotReader(Path.GetFileNameWithoutExtension(dirPath), Path.Combine(dirPath, "TecPlot1D.DAT"));

            set = reader;
            return(reader.LoadFile());
        }
Exemple #2
0
        private void SetupResultsMapGroup(Core.Result.IResultSet set)
        {
            if (this.resultsGroup == null)
            {
                this.resultsGroup                  = new DotSpatial.Controls.MapGroup();
                this.resultsGroup.LegendText       = "Results";
                this.resultsGroup.SelectionEnabled = true;
                this.resultsGroup.IsVisible        = false;
                this.map.Layers.Add(this.resultsGroup);
            }

            if (set == null)
            {
                if (this.resultsLayer != null)
                {
                    this.resultsGroup.Layers.Remove(this.resultsLayer);
                    this.resultsLayer = null;
                }
                this.curResultsSet          = null;
                this.resultsGroup.IsVisible = false;
                return;
            }

            this.resultsGroup.IsVisible = true;
            if (this.resultsGroup.Layers.Count > 0)
            {
                this.resultsGroup.Layers.Clear();
            }

            this.curResultsSet = set;

            FeatureSet featureSet = new FeatureSet(FeatureType.Line);

            featureSet.Projection = this.map.Projection;
            featureSet.DataTable.Columns.Add(new DataColumn("LayerName", typeof(string)));

            foreach (var layer in this.curResultsSet.LayerNames)
            {
                var points = this.curResultsSet.GetDataset(layer);
                List <Coordinate> coords = new List <Coordinate>();
                for (int i = 0; i <= points.GetUpperBound(0); i++)
                {
                    coords.Add(new Coordinate(points[i, 0], points[i, 1]));
                }
                var feature = featureSet.AddFeature(new LineString(coords));
                feature.DataRow["LayerName"] = layer;
            }

            this.resultsLayer = new MapLineLayer(featureSet);
            this.resultsLayer.Symbology.EditorSettings.ExcludeExpression = "[LayerName] <> ''";

            this.resultsGroup.Layers.Add(this.resultsLayer);
        }
Exemple #3
0
        public MapWindow([Import] Core.Events.IEventManager eventMgr, [Import] IProjectManager projectMgr)
        {
            InitializeComponent();

            this.eventMgr   = eventMgr;
            this.projectMgr = projectMgr;

            this.curResultsSet     = null;
            this.resultsGroup      = null;
            this.map.Legend        = this.legend;
            this.map.GeoMouseMove += map_GeoMouseMove;

            this.toolItems = new List <Core.Window.IToolbarItem>();
            SetupToolItems();

            SetupColors();

            this.eventMgr.AddListener(this);
        }