예제 #1
0
        private void SWATSQLiteFrm_Load(object sender, EventArgs e)
        {
            this.FormClosing += (s, ee) =>
            {
                if (_prj != null)
                {
                    _prj.close();
                }
            };

            projectTree1.onResultLevelChanged += (scenario, modelType, type) =>
            {
                switchView(scenario.Scenario, modelType, scenario.Interval, type);
            };
            projectTree1.onScenarioSelectionChanged += (scenario) => { updateScenarioView(scenario); };
            projectTree1.onProjectNodeSelected      += (ss, ee) => { updateProjectView(); };
            projectTree1.onDifferenceNodeSelected   += (ss, ee) =>
            {
                ScenarioComparasionReportView compareView = new ScenarioComparasionReportView();
                compareView.Result = projectTree1.ScenarioResult;
                compareView.Dock   = DockStyle.Fill;

                splitContainer1.Panel2.Controls.Clear();
                splitContainer1.Panel2.Controls.Add(compareView);
                updateStatus(compareView);
                Map = null;
            };
            projectTree1.onPerformanceNodeSelected += (ss, ee) =>
            {
                PerformanceView performanceView = getPerformanceView(projectTree1.ScenarioResult.Scenario, projectTree1.ScenarioResult.ModelType, projectTree1.ScenarioResult.Interval);

                splitContainer1.Panel2.Controls.Clear();
                splitContainer1.Panel2.Controls.Add(performanceView);
                updateStatus(performanceView);
                Map = null;
            };


            if (Properties.Settings.Default.Projects == null)
            {
                Properties.Settings.Default.Projects = new System.Collections.Specialized.StringCollection();
            }

            foreach (string p in Properties.Settings.Default.Projects)
            {
                cmbProjects.Items.Add(p);
            }

            cmbProjects.SelectedIndexChanged += (ss, ee) => { openProject(cmbProjects.SelectedItem.ToString()); };

            Map = null;
        }
예제 #2
0
        private PerformanceView getPerformanceView(ArcSWAT.Scenario scenario, ArcSWAT.SWATModelType modelType, ArcSWAT.SWATResultIntervalType interval)
        {
            string key = string.Format("{0}_{1}_{2}", scenario.Name, modelType, interval);

            if (!_performanceViews.ContainsKey(key))
            {
                PerformanceView performanceView = new PerformanceView();
                performanceView.Result = scenario.getModelResult(modelType, interval);
                performanceView.Dock   = DockStyle.Fill;
                _performanceViews.Add(key, performanceView);
            }
            return(_performanceViews[key]);
        }