예제 #1
0
 public void WriteToSettings(PiscesSettings settings)
 {
     settings.ThirtyYearAverage    = this.checkBox30Year.Checked;
     settings.SelectedAnalysisType = AnalysisType.WaterYears;
     settings.WaterYears           = this.SelectedYears;
     settings.BeginningMonth       = yearTypeSelector1.BeginningMonth;
 }
예제 #2
0
 public MovingAverageAnalysis(PiscesSettings explorer)
     : base(explorer)
 {
     m_analysisType = AnalysisType.MovingAverage;
     m_name         = "Moving Average";
     Description    = "Moving average";
 }
예제 #3
0
        public DisplayOptionsDialog(PiscesSettings explorer)
        {
            InitializeComponent();
            this.explorer1 = explorer;

            listBox1.Items.Clear();
            analysisList = explorer1.AnalysisList;

            for (int i = 0; i < analysisList.Count; i++)
            {
                listBox1.Items.Add(explorer1.AnalysisList[i].Name);
            }
            analysisList[AnalysisType.TimeSeries].UserInterface        = new TimeSeriesOptions();
            analysisList[AnalysisType.Exceedance].UserInterface        = new ExceedanceOptions();
            analysisList[AnalysisType.Probability].UserInterface       = new ProbabilityOptions();
            analysisList[AnalysisType.WaterYears].UserInterface        = new WaterYearOptions();
            analysisList[AnalysisType.SummaryHydrograph].UserInterface = new SummaryHydrographOptions();
            analysisList[AnalysisType.Correlation].UserInterface       = new CorrelationOptions();
            analysisList[AnalysisType.MonthlySummary].UserInterface    = new MonthlySummaryOptions();
            analysisList[AnalysisType.MovingAverage].UserInterface     = new MovingAverageOptions();
            analysisList[AnalysisType.TraceAnalysis].UserInterface     = new TraceOptions();


            listBox1.SelectedIndex = 0;

            ReadFromSettings(explorer);
        }
예제 #4
0
 public virtual void WriteToSettings(PiscesSettings settings)
 {
     settings.SelectedAnalysisType = analysisType;
     settings.TimeWindow           = timeWindowOptions1.TimeWindow;
     settings.MonthDayRange        = this.rangePicker1.MonthDayRange;
     settings.StatisticalMethods   = aggregateOptions1.StatisticalMethods;
     settings.BeginningMonth       = yearTypeSelector1.BeginningMonth;
 }
예제 #5
0
 public void WriteToSettings(PiscesSettings settings)
 {
     settings.SelectedAnalysisType     = AnalysisType.MovingAverage;
     settings.TimeWindow               = timeWindowOptions1.TimeWindow;
     settings.PlotMoving120HourAverage = checkBox120hr.Checked;
     settings.PlotMoving24HourAverage  = checkBox24hr.Checked;
     settings.PlotRaw = checkBoxRawData.Checked;
 }
예제 #6
0
 public override void ReadFromSettings(PiscesSettings settings)
 {
     base.ReadFromSettings(settings);
     this.radioButtonMultiYear.Checked = settings.MultiYearMonthlyAggregate;
     //this.radioButton12Values.Checked = !this.radioButtonMultiYear.Checked;
     //radioButtionMultiYear.Checked = settings.
     statisiticalMethodOptions1.StatisticalMethods = settings.StatisticalMethods;
 }
예제 #7
0
 public TimeSeriesAnalysis(PiscesSettings explorer) : base(explorer)
 {
     m_analysisType = AnalysisType.TimeSeries;
     Explorer       = explorer;
     this.view      = explorer.View;
     m_name         = "Time Series";
     Description    = "This option will graph a raw or basic summary of your data.";
 }
예제 #8
0
 public void ReadFromSettings(PiscesSettings settings)
 {
     timeWindowOptions1.TimeWindow = settings.TimeWindow;
     //this.timeWindowOptions1.AllowFullPeriodOfRecord = settings.AllowFullPeriodOfRecord;
     //this.timeWindowOptions1.Visible = !settings.HasTraces;
     this.checkBox120hr.Checked   = settings.PlotMoving120HourAverage;
     this.checkBox24hr.Checked    = settings.PlotMoving24HourAverage;
     this.checkBoxRawData.Checked = settings.PlotRaw;
 }
예제 #9
0
 /// <summary>
 /// A monthly summary of daily data
 /// displays the min,max,mean, and count for each month.
 /// </summary>
 /// <param name="explorer"></param>
 public MonthlySummaryAnalysis(PiscesSettings explorer)
     : base(explorer)
 {
     m_analysisType = AnalysisType.MonthlySummary;
     m_name         = "Monthly Summary";
     Description    =
         "A monthly summary of daily data.  Either multi years or condensed to 12 values.\n"
         + "Displays the min,max,mean, and count";
 }
예제 #10
0
 public SummaryHydrographAnalysis(PiscesSettings explorer) : base(explorer)
 {
     m_analysisType = AnalysisType.SummaryHydrograph;
     m_name         = "Summary Hydrograph";
     Description    =
         "A summary hydrograph is a statistical hydrograph.\n"
         + "Consider using a monthly summary if you don’t need a statistic for each day in the year\n"
         + "\n\nNote: February 29th is not included.";
 }
예제 #11
0
 public ExceedanceAnalysis(PiscesSettings explorer)
     : base(explorer)
 {
     m_analysisType = AnalysisType.Exceedance;
     m_name         = "Sorted Data - Exceedance";
     Description    = "Selected items are sorted, ranked "
                      + "\nand plotted using the Weibul ranking i=(1,2,3 ... n)"
                      + "\npercent = i/(n+1)";
 }
예제 #12
0
 public ProbabilityAnalysis(PiscesSettings explorer)
     : base(explorer)
 {
     m_analysisType = AnalysisType.Probability;
     m_name         = "Sorted Data - Probability";
     Description    = "Selected items are sorted, ranked "
                      + "\nand plotted using a simple ranking i=(1,2,3 ... n)"
                      + "\npercent = i/n";
 }
예제 #13
0
 public virtual void ReadFromSettings(PiscesSettings settings)
 {
     timeWindowOptions1.TimeWindow = settings.TimeWindow;
     //this.timeWindowOptions1.AllowFullPeriodOfRecord = settings.AllowFullPeriodOfRecord;
     //this.timeWindowOptions1.Visible = !settings.HasTraces;
     rangePicker1.BeginningMonth          = settings.BeginningMonth;
     rangePicker1.MonthDayRange           = settings.MonthDayRange;
     aggregateOptions1.StatisticalMethods = settings.StatisticalMethods;
     yearTypeSelector1.BeginningMonth     = settings.BeginningMonth;
     Enabling();
 }
예제 #14
0
        public PiscesForm(PiscesSettings explorer)
        {
            m_pluginManager = new PluginManager();
            m_pluginManager.LoadPlugins();// loads assemblies into memory.


            this.explorer1 = explorer;
            InitializePisces();
            m_pluginManager.RegisterPlugins(this.contextMenuStripTree.Items["AddMenu"]);
            m_pluginManager.PluginClick += m_pluginManager_PluginClick;
            Enabling();
        }
예제 #15
0
 public TraceAnalysis(PiscesSettings explorer) : base(explorer)
 {
     m_analysisType = AnalysisType.TraceAnalysis;
     m_name         = "Trace Analysis";
     Description    =
         "This analysis option allows users to comparatively and/or statistically analyze "
         + " a dataset that contains several traces/scenarios which usually result from "
         + " iterative model runs with varying model inputs, assumptions, and conditions."
         + " \n\n"
         + "Trace analysis will not run if the selected number of traces < 10."
         + " \n";
 }
예제 #16
0
        public PiscesForm(PiscesSettings explorer)
        {
            m_pluginManager = new PluginManager();
            m_pluginManager.LoadPlugins();// loads assemblies into memory.


            this.explorer1 = explorer;
            InitializePisces();
            m_pluginManager.RegisterPlugins(this.DataMenu);
            m_pluginManager.PluginClick += m_pluginManager_PluginClick;
            Enabling();
        }
예제 #17
0
        public void WriteToSettings(PiscesSettings settings)
        {
            settings.SelectedAnalysisType = AnalysisType.SummaryHydrograph;
            settings.TimeWindow           = timeWindowOptions1.TimeWindow;

            settings.ExceedanceLevels = exceedanceLevelPicker1.ExceedanceLevels;
            settings.AlsoPlotYear     = this.checkBoxPlotYear.Checked;
            settings.PlotYear         = this.YearToPlot;

            settings.PlotMax        = this.checkBoxMaximum.Checked;
            settings.PlotMin        = this.checkBoxMinimum.Checked;
            settings.PlotAvg        = this.checkBoxAverage.Checked;
            settings.BeginningMonth = this.yearTypeSelector1.BeginningMonth;
        }
예제 #18
0
        public void ReadFromSettings(PiscesSettings settings)
        {
            this.checkBoxAverage.Checked    = settings.PlotAvg;
            this.checkBoxMaximum.Checked    = settings.PlotMax;
            this.checkBoxMinimum.Checked    = settings.PlotMin;
            this.checkBoxPlotYear.Checked   = settings.AlsoPlotYear;
            this.maskedTextBoxPlotYear.Text = settings.PlotYear.ToString();

            timeWindowOptions1.TimeWindow = settings.TimeWindow;
            //this.timeWindowOptions1.AllowFullPeriodOfRecord = settings.AllowFullPeriodOfRecord;

            //this.exceedanceLevelPicker1.ExceedanceLevels = settings.ExceedanceLevels;
            this.yearTypeSelector1.BeginningMonth = settings.BeginningMonth;
        }
예제 #19
0
 public void ReadFromSettings(PiscesSettings settings)
 {
     this.checkBoxPlotTrace.Checked        = settings.AlsoPlotTrace;
     this.comboBoxSelectedTrace.Text       = settings.PlotTrace.ToString();
     this.traceExceedanceCheckBox.Checked  = settings.traceExceedanceAnalysis;
     this.traceAggregationCheckBox.Checked = settings.traceAggregationAnalysis;
     this.sumCYRadio.Checked            = settings.sumCYRadio;
     this.sumWYRadio.Checked            = settings.sumWYRadio;
     this.sumRangeRadio.Checked         = settings.sumCustomRangeRadio;
     this.checkBoxPlotMin.Checked       = settings.PlotMinTrace;
     this.checkBoxPlotAvg.Checked       = settings.PlotAvgTrace;
     this.checkBoxPlotMax.Checked       = settings.PlotMaxTrace;
     this.timeWindowOptions1.TimeWindow = settings.TimeWindow;
     this.rangePicker1.BeginningMonth   = settings.BeginningMonth;
     this.rangePicker1.MonthDayRange    = settings.MonthDayRange;
     this.scenarioTable = settings.Database.GetSelectedScenarios();
 }
예제 #20
0
 public void WriteToSettings(PiscesSettings settings)
 {
     settings.SelectedAnalysisType = AnalysisType.TraceAnalysis;
     settings.ExceedanceLevels     = exceedanceLevelPicker1.ExceedanceLevels;
     settings.AlsoPlotTrace        = this.checkBoxPlotTrace.Checked;
     try // stupid hack... needs some better logic here. problem is that Pisces crashes when the combobox is left blank
     { settings.PlotTrace = this.comboBoxSelectedTrace.SelectedItem.ToString(); }
     catch
     { settings.PlotTrace = "Run0"; }
     settings.traceExceedanceAnalysis  = this.traceExceedanceCheckBox.Checked;
     settings.traceAggregationAnalysis = this.traceAggregationCheckBox.Checked;
     settings.sumCYRadio          = this.sumCYRadio.Checked;
     settings.sumWYRadio          = this.sumWYRadio.Checked;
     settings.sumCustomRangeRadio = this.sumRangeRadio.Checked;
     settings.PlotMinTrace        = this.checkBoxPlotMin.Checked;
     settings.PlotAvgTrace        = this.checkBoxPlotAvg.Checked;
     settings.PlotMaxTrace        = this.checkBoxPlotMax.Checked;
     settings.TimeWindow          = timeWindowOptions1.TimeWindow;
     settings.MonthDayRange       = this.rangePicker1.MonthDayRange;
 }
예제 #21
0
 public override void WriteToSettings(PiscesSettings settings)
 {
     base.WriteToSettings(settings);
     settings.StatisticalMethods        = statisiticalMethodOptions1.StatisticalMethods;
     settings.MultiYearMonthlyAggregate = radioButtonMultiYear.Checked;
 }
예제 #22
0
 public void ReadFromSettings(PiscesSettings settings)
 {
     yearTypeSelector1.BeginningMonth = settings.BeginningMonth;
     checkBox30Year.Checked           = settings.ThirtyYearAverage;
 }
예제 #23
0
        static void Main(string[] args)
        {
            Logger.EnableLogger(true);
            var x = HdbPoet.Hdb.Instance; // force this assembly to load.

            try
            {
                string fileName = "";
                if (args.Length == 1)
                {
                    fileName = args[0];
                    if (!File.Exists(fileName))
                    {
                        MessageBox.Show("Could not open file '" + fileName + "'");
                        return;
                    }
                }

                else if (UserPreference.Lookup("fileName") != "" &&
                         File.Exists(UserPreference.Lookup("fileName")) &&
                         Path.GetExtension(UserPreference.Lookup("fileName")) != ".sdf")
                {
                    fileName = UserPreference.Lookup("fileName");
                }
                else
                {// open default database
                    fileName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\tsdatabase.pdb";
                }

                if (!File.Exists(fileName))
                {
                    SQLiteServer.CreateNewDatabase(fileName);
                }

                HydrometInfoUtility.SetDefaultHydrometServer();


                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadExit      += new EventHandler(Application_ThreadExit);
                Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
                //Application.Idle += new EventHandler(Application_Idle);
                //Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);


                explorer = new PiscesSettings(new ExplorerView());
                // explorer.Database

                explorer.Open(fileName);
                db = explorer.Database;

                piscesForm1 = new PiscesForm(explorer);



                piscesForm1.FormClosed += new FormClosedEventHandler(explorerForm1_FormClosed);
                //Pisces2 p2 = new Pisces2(explorer);
                //p2.FormClosed += new FormClosedEventHandler(explorerForm1_FormClosed);

                Application.Run(piscesForm1);
                explorer.Database.SaveSettingsToDatabase(explorer.TimeWindow);
                //db.SaveSettingsToDatabase(explorer.TimeWindow);

                PostgreSQL.ClearAllPools();

                FileUtility.CleanTempPath();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
        }
예제 #24
0
 public void ReadFromSettings(PiscesSettings settings)
 {
     analysisList[this.listBox1.SelectedIndex].ExplorerSettings.ReadFromSettings(settings);
     //explorer1.SaveSettings();
 }
예제 #25
0
 public void WriteToSettings(PiscesSettings settings)
 {
     analysisList[this.listBox1.SelectedIndex].ExplorerSettings.WriteToSettings(settings);
 }
예제 #26
0
 private void InitSettings()
 {
     m_settings = new PiscesSettings(m_server);
 }
예제 #27
0
 public AnalysisCollection(PiscesSettings explorer)
 {
     m_list   = new List <BaseAnalysis>();
     Explorer = explorer;
 }
예제 #28
0
 protected BaseAnalysis(PiscesSettings explorer)
 {
     m_explorer = explorer;
     view       = explorer.View;
 }
예제 #29
0
 public CorrelationAnalysis(PiscesSettings explorer) : base(explorer)
 {
     m_analysisType = AnalysisType.Correlation;
     m_name         = "Correlation";
     Description    = "Correlation between two items. You must selected exactly two items";
 }
예제 #30
0
 public WaterYearsAnalysis(PiscesSettings explorer) : base(explorer)
 {
     m_analysisType = AnalysisType.WaterYears;
     m_name         = "Water Years";
     Description    = "This option allows comparing different water or calendar years";
 }