Esempio n. 1
0
        private void InitializeComponent(BivariateDataset ds, int width, int height)
        {
            this.Dataset = ds;

            this.Width = width;
            int            sidebarWidth = (int)(this.Width * 0.3);
            MyPlotDataView view         = new MyPlotDataView();

            this.DisplayAbsoluteButton = new System.Windows.Forms.Button();

            this.ControlGroupBox       = new System.Windows.Forms.GroupBox();
            this.DisplayAbsoluteButton = new System.Windows.Forms.Button();
            this.DisplayRelativeButton = new System.Windows.Forms.Button();

            this.DisplayAbsoluteButton.Click += new System.EventHandler(this.onDisplayAbsoluteButtonClick);
            this.DisplayRelativeButton.Click += new System.EventHandler(this.onDisplayRelativeButtonClick);



            this.DisplayDataSettings = new System.Windows.Forms.GroupBox();
            this.DataTable           = new System.Windows.Forms.ListView();

            this.DataTable.View = View.Details;

            MyImportCSV ctr  = new MyImportCSV();
            var         temp = ctr.DisplayData(0, 0, 600, 200, this.DisplayDataSettings, this.DataTable);

            // this.DisplayDataSettings.Anchor = (
            //     (System.Windows.Forms.AnchorStyles)(
            //         (System.Windows.Forms.AnchorStyles.Top) | (System.Windows.Forms.AnchorStyles.Left)
            //     ));

            MyButton b = new MyButton();

            b.Init(DisplayDataSettings.Right, temp, 200, ControlGroupBox, DisplayRelativeButton, "Display Options", "Relative Values");
            b.Add(ControlGroupBox, DisplayAbsoluteButton, "Absolute Values");
            this.ControlGroupBox.Anchor = (
                (System.Windows.Forms.AnchorStyles)(
                    (System.Windows.Forms.AnchorStyles.Right) | (System.Windows.Forms.AnchorStyles.Bottom)
                    ));



            this.ChartGroupBox1 = new System.Windows.Forms.GroupBox();
            this.Chart1         = new System.Windows.Forms.PictureBox();

            view.ChartView(DisplayDataSettings.Right, 0, 200, 200, this.ChartGroupBox1, this.Chart1);

            this.ChartGroupBox1.Anchor = (
                (System.Windows.Forms.AnchorStyles)(
                    (System.Windows.Forms.AnchorStyles.Right) | (System.Windows.Forms.AnchorStyles.Top) |
                    (System.Windows.Forms.AnchorStyles.Bottom)
                    ));

            this.ChartGroupBox2 = new System.Windows.Forms.GroupBox();
            this.Chart2         = new System.Windows.Forms.PictureBox();

            view.ChartView(15, DisplayDataSettings.Bottom, 600, 200, this.ChartGroupBox2, this.Chart2);

            this.ChartGroupBox2.Anchor = (
                (System.Windows.Forms.AnchorStyles)(
                    (System.Windows.Forms.AnchorStyles.Left) | (System.Windows.Forms.AnchorStyles.Bottom) |
                    (System.Windows.Forms.AnchorStyles.Right)
                    ));

            this.Height = height;
            DisplayDataSettings.Text = "Calculated Statistics";

            this.Controls.Add(this.DisplayDataSettings);
            this.Controls.Add(this.ControlGroupBox);
            this.Controls.Add(this.ChartGroupBox1);
            this.Controls.Add(this.ChartGroupBox2);

            this.ClientSize = new System.Drawing.Size(this.Width, this.Height);

            this.Text = "Contigency Table";

            InitializeListView();
        }
Esempio n. 2
0
        private void InitializeComponent(int width, int height)
        {
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize    = new System.Drawing.Size(this.Width, this.Height);

            this.Text = "StatApp";

            this.Width = width;
            int sidebarWidth = (int)(this.Width * 0.3);

            this.ImportDataSettings = new System.Windows.Forms.GroupBox();
            this.BrowseButton       = new System.Windows.Forms.Button();
            this.Path        = new System.Windows.Forms.RichTextBox();
            this.ClearButton = new System.Windows.Forms.Button();
            this.LoadButton  = new System.Windows.Forms.Button();

            this.BrowseButton.Click += new System.EventHandler(this.onBrowseButtonClick);
            this.ClearButton.Click  += new System.EventHandler(this.onClearButtonClick);
            this.LoadButton.Click   += new System.EventHandler(this.onLoadButtonClick);
            this.Path.AllowDrop      = true;
            this.Path.DragDrop      += new System.Windows.Forms.DragEventHandler(this.onPathDragDrop);

            MyImportCSV ctr = new MyImportCSV();

            this.Height = ctr.ImportCSV(0, 0, sidebarWidth, this.ImportDataSettings, this.BrowseButton, this.ClearButton, this.Path, this.LoadButton);

            this.ImportSettingsSettings = new System.Windows.Forms.GroupBox();
            this.ImportLabels           = new System.Windows.Forms.CheckBox();
            this.DelimiterLabel         = new System.Windows.Forms.Label();
            this.Delimiter            = new System.Windows.Forms.TextBox();
            this.DeleteSelectedButton = new System.Windows.Forms.Button();

            this.DeleteSelectedButton.Click  += new System.EventHandler(this.onDeleteSelectedButtonClick);
            this.ImportLabels.CheckedChanged += new System.EventHandler(this.LabelsChecked);

            this.Height += ctr.ImportSettings(0, this.Height, sidebarWidth, this.ImportSettingsSettings, this.DeleteSelectedButton, this.ImportLabels, this.DelimiterLabel, this.Delimiter);

            this.ChartSettings    = new System.Windows.Forms.GroupBox();
            this.UnivariateButton = new System.Windows.Forms.Button();
            this.BivariateButton  = new System.Windows.Forms.Button();

            this.UnivariateButton.Click += new System.EventHandler(this.onUnivariateAnalysisButtonClick);
            this.BivariateButton.Click  += new System.EventHandler(this.onBivariateAnalysisButtonClick);

            MyButton btn = new MyButton();

            this.Height += btn.Init(0, this.Height, sidebarWidth, this.ChartSettings, this.BivariateButton, "Chart Options", "Bivariate Analysis");
            btn.Add(this.ChartSettings, this.UnivariateButton, "Riemann/Lebesgue Integration");


            this.DisplayTypesSettings = new System.Windows.Forms.GroupBox();

            this.TypesTreeView = new System.Windows.Forms.TreeView();

            this.TypesTreeView.CheckBoxes  = true;
            this.TypesTreeView.AfterCheck += new System.Windows.Forms.TreeViewEventHandler(this.AfterCheck);

            this.Height += ctr.DisplayVariableTypes(0, this.Height, sidebarWidth, this.DisplayTypesSettings, this.TypesTreeView);

            this.DisplayDataSettings = new System.Windows.Forms.GroupBox();
            this.DataTable           = new System.Windows.Forms.ListView();

            this.DataTable.View                  = System.Windows.Forms.View.Details;
            this.DataTable.FullRowSelect         = true;
            this.DataTable.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.onChangeSelect);
            int temp = ctr.DisplayData(sidebarWidth, 0, width - sidebarWidth, 0, this.DisplayDataSettings, this.DataTable);

            this.Controls.Add(this.ImportDataSettings);
            this.Controls.Add(this.ImportSettingsSettings);
            this.Controls.Add(this.ChartSettings);
            this.Controls.Add(this.DisplayTypesSettings);
            if (temp > this.Height)
            {
                this.Height = temp;
            }
            else
            {
                this.DisplayDataSettings.Height = this.Height - 30;
            }
            this.Controls.Add(this.DisplayDataSettings);

            this.ClientSize = new System.Drawing.Size(this.Width, this.Height);
        }
Esempio n. 3
0
        private void InitializeComponent(int width, int h)
        {
            this.Width = width;
            int            sidebarWidth = (int)(this.Width * 0.3);
            MyPlotDataView view         = new MyPlotDataView();

            this.ClearChartButton = new System.Windows.Forms.Button();

            this.StatisticsGroupBox = new System.Windows.Forms.GroupBox();
            this.SelectSimulation   = new System.Windows.Forms.ComboBox();
            this.ClearChartButton   = new System.Windows.Forms.Button();
            this.PlotDataButton     = new System.Windows.Forms.Button();

            this.SelectSimulation.SelectedIndexChanged += new System.EventHandler(this.onSelectSimulationChange);
            this.ClearChartButton.Click += new System.EventHandler(this.onClearClick);
            this.PlotDataButton.Click   += new System.EventHandler(this.onPlotClick);
            this.PlotDataButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.onPlotClicked);

            MyButton b = new MyButton();

            this.Height += b.Init(0, 0, sidebarWidth, StatisticsGroupBox, SelectSimulation, "Chart Controls", "-- Simulation Output --");
            this.Height  = b.Add(StatisticsGroupBox, PlotDataButton, "Begin Simulation");
            this.Height  = b.Add(StatisticsGroupBox, ClearChartButton, "Clear Chart");

            this.DisplayDataSettings = new System.Windows.Forms.GroupBox();
            this.DataTable           = new System.Windows.Forms.ListView();

            this.DataTable.View = View.Details;


            UserSelectableSettings     = new System.Windows.Forms.GroupBox();
            NumericStart               = new System.Windows.Forms.NumericUpDown();
            NumericStart.ValueChanged += new System.EventHandler(this.numericValueChanged);
            NumericN     = new System.Windows.Forms.NumericUpDown();
            NumericM     = new System.Windows.Forms.NumericUpDown();
            NumericCheck = new System.Windows.Forms.NumericUpDown();
            NumericDistN = new System.Windows.Forms.NumericUpDown();


            // bernoulli
            NumericP = new System.Windows.Forms.NumericUpDown();

            // law of large numbers
            NumericLambda = new System.Windows.Forms.NumericUpDown();

            // law of large numbers
            // NumericEpsilon = new System.Windows.Forms.NumericUpDown();

            // brown
            NumericSigma = new System.Windows.Forms.NumericUpDown();

            // vasiceck
            NumericA = new System.Windows.Forms.NumericUpDown();
            NumericB = new System.Windows.Forms.NumericUpDown();

            // Jump Diffusion
            NumericL = new System.Windows.Forms.NumericUpDown();

            NumericStart.Value   = 0;
            NumericStart.Maximum = decimal.MaxValue;

            NumericN.Maximum = decimal.MaxValue;
            NumericN.Value   = 800;

            NumericM.Maximum = decimal.MaxValue;
            NumericM.Value   = 1600;

            NumericCheck.Maximum = decimal.MaxValue;
            NumericCheck.Value   = NumericN.Value / 2;

            NumericDistN.Value = 42;

            NumericP.Value = 50;

            // NumericEpsilon.Value = 10;

            NumericLambda.Minimum = 0;
            NumericLambda.Maximum = decimal.MaxValue;
            NumericLambda.Value   = 30;

            NumericSigma.Minimum = 1;
            NumericSigma.Maximum = decimal.MaxValue;
            NumericSigma.Value   = 30;

            NumericA.Maximum = decimal.MaxValue;
            NumericA.Value   = 100;

            NumericB.Maximum = decimal.MaxValue;
            NumericB.Value   = 250;

            NumericL.Minimum = 0;
            NumericL.Maximum = decimal.MaxValue;
            NumericL.Value   = 50;

            disableAllControls();

            MyNumeric num = new MyNumeric();

            num.Init(0, this.Height, sidebarWidth, UserSelectableSettings, NumericStart, "Start Position (X_0 = 0.01 * SP)");
            num.Add(UserSelectableSettings, NumericN, "N: samples per path");
            num.Add(UserSelectableSettings, NumericM, "M: paths");
            num.Add(UserSelectableSettings, NumericCheck, "Control Distribution");
            num.Add(UserSelectableSettings, NumericDistN, "Max Number of Intervals");
            num.Add(UserSelectableSettings, NumericP, "P: Probability of Bernoulli");
            // num.Add(UserSelectableSettings, NumericEpsilon, "Epsilon");
            num.Add(UserSelectableSettings, NumericLambda, "Lambda");
            num.Add(UserSelectableSettings, NumericSigma, "Sigma (sigma = 0.01 * Sigma)");
            num.Add(UserSelectableSettings, NumericA, "A (a = 0.01 * A)");
            num.Add(UserSelectableSettings, NumericB, "B (b = 0.01 * B)");
            this.Height += num.Add(UserSelectableSettings, NumericL, "L (l = 0.01 * L)");

            MyImportCSV ctr = new MyImportCSV();

            this.Height += ctr.DisplayData(0, this.Height, sidebarWidth, 0, this.DisplayDataSettings, this.DataTable);

            DisplayDataSettings.Text = "Calculated Statistics";

            this.DisplayDataSettings.Anchor = (
                (System.Windows.Forms.AnchorStyles)(
                    (System.Windows.Forms.AnchorStyles.Top) | (System.Windows.Forms.AnchorStyles.Bottom) |
                    (System.Windows.Forms.AnchorStyles.Left)
                    ));
            this.DataTable.Anchor = (
                (System.Windows.Forms.AnchorStyles)(
                    (System.Windows.Forms.AnchorStyles.Top) | (System.Windows.Forms.AnchorStyles.Bottom) |
                    (System.Windows.Forms.AnchorStyles.Left)
                    ));

            this.ChartGroupBox = new System.Windows.Forms.GroupBox();
            this.Chart         = new System.Windows.Forms.PictureBox();

            int temp = view.ChartView(sidebarWidth, 0, this.Width - sidebarWidth, 0, this.ChartGroupBox, this.Chart);


            if (temp > this.Height)
            {
                this.Height = temp;
            }
            else
            {
                this.ChartGroupBox.Height = this.Height - 50;
                this.Chart.Height        -= 10;
            }

            // this.ChartGroupBox2 = new System.Windows.Forms.GroupBox();
            // this.Chart2 = new System.Windows.Forms.PictureBox();

            // view.ChartView(ChartGroupBox.Right, 0, (this.Width - sidebarWidth)/2, 0, this.ChartGroupBox2, this.Chart2);

            // ChartGroupBox2.Anchor = (
            //     (System.Windows.Forms.AnchorStyles)(
            //         (System.Windows.Forms.AnchorStyles.Top) | (System.Windows.Forms.AnchorStyles.Bottom) |
            //         (System.Windows.Forms.AnchorStyles.Right)
            //     ));
            // this.Controls.Add(this.ChartGroupBox2);

            this.Controls.Add(this.UserSelectableSettings);
            this.Controls.Add(this.ChartGroupBox);
            this.Controls.Add(this.DisplayDataSettings);

            this.Controls.Add(this.StatisticsGroupBox);

            this.ClientSize = new System.Drawing.Size(this.Width, this.Height);

            this.Text = "Stochastic Differential Equation Simulator";
        }