From 4bc10b5f2d1e75450299a17c624af1359c8bf6b5 Mon Sep 17 00:00:00 2001 From: Arkmedess Date: Sat, 23 Aug 2025 21:13:54 -0300 Subject: [PATCH 1/4] =?UTF-8?q?Atualiza=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "TelaConfigura\303\247\303\265es.cs" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/TelaConfigura\303\247\303\265es.cs" "b/TelaConfigura\303\247\303\265es.cs" index 97f9ed1..a6b7efa 100644 --- "a/TelaConfigura\303\247\303\265es.cs" +++ "b/TelaConfigura\303\247\303\265es.cs" @@ -134,7 +134,7 @@ private async void btnTesteConexao_Click(object sender, EventArgs e) else { MessageBox.Show("Falha na conexão com a API Groq. Verifique sua conexão com a internet e a chave inserida e tente novamente.", "Erro", - MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) From a82dca99127dce7079a6f1dd915b537df550b315 Mon Sep 17 00:00:00 2001 From: Arkmedess Date: Wed, 27 Aug 2025 11:36:42 -0300 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=94=A7=20Adiciona=20CI=20para=20proje?= =?UTF-8?q?to=20C#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..408f3cd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI C# + +on: [push, pull_request] + +jobs: + build-test: + runs-on: ubuntu-latest + + steps: + - name: ?? Checkout do c�digo + uses: actions/checkout@v4 + + - name: ?? Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '8.0.x' + + - name: ?? Restaurar depend�ncias + run: dotnet restore + + - name: ??? Compilar projeto + run: dotnet build --no-restore --configuration Release + + - name: ?? Rodar testes + run: dotnet test --no-build --verbosity normal + continue-on-error: true From 5bbf3024c6aca2637bc38457836e9d31ed9763eb Mon Sep 17 00:00:00 2001 From: Arkmedess Date: Sat, 6 Sep 2025 16:25:17 -0300 Subject: [PATCH 3/4] =?UTF-8?q?-=20Implementa=20c=C3=A1lculo=20reverso=20a?= =?UTF-8?q?=20partir=20do=20Coeficiente=20de=20Varia=C3=A7=C3=A3o=20(CV)?= =?UTF-8?q?=20-=20Adiciona=20interface=20para=20entrada=20de=20CV=20+=201?= =?UTF-8?q?=20par=C3=A2metro=20(m=C3=A9dia/desvio/vari=C3=A2ncia)=20-=20Ma?= =?UTF-8?q?nt=C3=A9m=20compatibilidade=20com=20modo=20padr=C3=A3o=20de=20c?= =?UTF-8?q?=C3=A1lculo=20-=20Inclui=20valida=C3=A7=C3=B5es=20e=20tratament?= =?UTF-8?q?o=20de=20erros=20-=20Gera=20passos=20explicativos=20para=20c?= =?UTF-8?q?=C3=A1lculos=20reversos=20-=20Adiciona=20testes=20unit=C3=A1rio?= =?UTF-8?q?s=20para=20novos=20cen=C3=A1rios=20-=20Atualiza=C3=A7=C3=A3o=20?= =?UTF-8?q?na=20interface=20da=20TelaMediaPosicaoCentral=20-=20Prepara=20o?= =?UTF-8?q?=20ambiente=20para=20integra=C3=A7=C3=A3o=20com=20IA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TelaInicial.Designer.cs | 59 +- TelaInicial.cs | 5 + TelaInicial.resx | 182 ++--- TelaMediaPosicaoCentral.Designer.cs | 998 ++++++++++++++++++++---- TelaMediaPosicaoCentral.cs | 1099 ++++++++++++++++++--------- TelaMediaPosicaoCentral.resx | 41 + TelaVAC.cs | 6 +- icons/Close.png | Bin 0 -> 385 bytes icons/Plus.png | Bin 0 -> 385 bytes 9 files changed, 1734 insertions(+), 656 deletions(-) create mode 100644 icons/Close.png create mode 100644 icons/Plus.png diff --git a/TelaInicial.Designer.cs b/TelaInicial.Designer.cs index cd8e903..22f846e 100644 --- a/TelaInicial.Designer.cs +++ b/TelaInicial.Designer.cs @@ -34,6 +34,8 @@ private void InitializeComponent() pnBoasVindas = new ReaLTaiizor.Controls.Panel(); picUser = new PictureBox(); pnTelaInicial = new Panel(); + panel4 = new ReaLTaiizor.Controls.Panel(); + label3 = new Label(); panel3 = new ReaLTaiizor.Controls.Panel(); button3 = new Button(); button2 = new Button(); @@ -49,18 +51,16 @@ private void InitializeComponent() picChapeuGraduacao = new PictureBox(); picYoutube = new PictureBox(); lblLinks = new Label(); - panel4 = new ReaLTaiizor.Controls.Panel(); - label3 = new Label(); pnBoasVindas.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)picUser).BeginInit(); pnTelaInicial.SuspendLayout(); + panel4.SuspendLayout(); panel3.SuspendLayout(); pnLinks.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); ((System.ComponentModel.ISupportInitialize)picChapeuGraduacao).BeginInit(); ((System.ComponentModel.ISupportInitialize)picYoutube).BeginInit(); - panel4.SuspendLayout(); SuspendLayout(); // // lblSubTitulo @@ -122,6 +122,31 @@ private void InitializeComponent() pnTelaInicial.Size = new Size(1190, 730); pnTelaInicial.TabIndex = 10; // + // panel4 + // + panel4.BackColor = Color.WhiteSmoke; + panel4.Controls.Add(label3); + panel4.EdgeColor = Color.FromArgb(32, 41, 50); + panel4.Location = new Point(616, 488); + panel4.Name = "panel4"; + panel4.Padding = new Padding(5); + panel4.Size = new Size(525, 199); + panel4.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + panel4.TabIndex = 15; + panel4.Text = "-+"; + // + // label3 + // + label3.Font = new Font("Segoe UI", 18F, FontStyle.Bold); + label3.ForeColor = Color.FromArgb(26, 31, 52); + label3.Location = new Point(11, 8); + label3.Margin = new Padding(0); + label3.Name = "label3"; + label3.Size = new Size(179, 30); + label3.TabIndex = 12; + label3.Text = "Vazio"; + label3.TextAlign = ContentAlignment.MiddleLeft; + // // panel3 // panel3.BackColor = Color.WhiteSmoke; @@ -171,6 +196,7 @@ private void InitializeComponent() button1.Text = "\r\nEstatística Paramétrica\r\n"; button1.TextAlign = ContentAlignment.BottomCenter; button1.UseVisualStyleBackColor = true; + button1.Click += button1_Click; // // label2 // @@ -304,31 +330,6 @@ private void InitializeComponent() lblLinks.Text = "Links úteis:"; lblLinks.TextAlign = ContentAlignment.MiddleLeft; // - // panel4 - // - panel4.BackColor = Color.WhiteSmoke; - panel4.Controls.Add(label3); - panel4.EdgeColor = Color.FromArgb(32, 41, 50); - panel4.Location = new Point(616, 488); - panel4.Name = "panel4"; - panel4.Padding = new Padding(5); - panel4.Size = new Size(525, 199); - panel4.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; - panel4.TabIndex = 15; - panel4.Text = "-+"; - // - // label3 - // - label3.Font = new Font("Segoe UI", 18F, FontStyle.Bold); - label3.ForeColor = Color.FromArgb(26, 31, 52); - label3.Location = new Point(11, 8); - label3.Margin = new Padding(0); - label3.Name = "label3"; - label3.Size = new Size(179, 30); - label3.TabIndex = 12; - label3.Text = "Vazio"; - label3.TextAlign = ContentAlignment.MiddleLeft; - // // TelaInicial // AutoScaleDimensions = new SizeF(7F, 15F); @@ -340,13 +341,13 @@ private void InitializeComponent() pnBoasVindas.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)picUser).EndInit(); pnTelaInicial.ResumeLayout(false); + panel4.ResumeLayout(false); panel3.ResumeLayout(false); pnLinks.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit(); ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); ((System.ComponentModel.ISupportInitialize)picChapeuGraduacao).EndInit(); ((System.ComponentModel.ISupportInitialize)picYoutube).EndInit(); - panel4.ResumeLayout(false); ResumeLayout(false); } diff --git a/TelaInicial.cs b/TelaInicial.cs index 7c5417c..902655b 100644 --- a/TelaInicial.cs +++ b/TelaInicial.cs @@ -118,5 +118,10 @@ private void TituloBoasVindas_Click(object sender, EventArgs e) { } + + private void button1_Click(object sender, EventArgs e) + { + _gerenciadorTelas.MostrarTela("Estatística Paramétrica"); + } } } diff --git a/TelaInicial.resx b/TelaInicial.resx index 068b58b..b71376d 100644 --- a/TelaInicial.resx +++ b/TelaInicial.resx @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAAvgAAAL9CAYAAABe7xJQAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAA/7JJREFUeF7s/QeUHed1JQp3A2CSSElWIDo3wCRZtiRKDCIJNBJzJmJnZIJgzgEE + vwAADr8BOAVTJAAA/7JJREFUeF7s/QeUHed1JQp3A2CSSElWIDo3wCRZtiRKDCIJNBJzJmJnZIJgzgEE gUbqjEBStC0qWGN57DfmjNN43njssaQxJZLIsXMjkJZl+9nWjG1ZJIC+Vedfe+9z6jbx/PzG7x97bKu+ tXp19723qr4Kt2qfffbZp6QkH/nIRz7ykY985CMf+chHPvKRj3zkIx/5yEc+8pGPfOQjH/nIRz7ykY98 5CMf+chHPvKRj3zkIx/5yEc+8pGPfOQjH/nIRz7ykY985CMf+chHPvKRj3zk4x9jtLV9Z1Lxxybo5zuT @@ -12437,96 +12437,6 @@ aaWVVlpppZVWWmmllVZaad887d+WivJv+/1/Vft6Hbe00korrbTSSiuttNJKK6200korrbTSSiuttNJK K6200korrbTSSiuttNJKK6200korrbTSSiuttNJKK6200korrbTSSiuttNJKK6200kor7Wtq/y8+vVAc HpQLpgAAAABJRU5ErkJggg== - - - - - iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAALGPC/xhBQAABQBJREFUaEPt - WU1uGzcUzhFyBPYGPkBt+QYdnaC5QXwD6wb1wjPKKtEmQHcxUE2ylA4QwFp00Z18AxukgCy6cPGRfOTj -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2FtWFqJVHSCBT2gF/RkWVhkiyAIaTFz + jb+6svuANaEF+zmspdbFa+C1dBv/C1oRufxM2XiEAAAAAElFTkSuQmCC \ No newline at end of file diff --git a/TelaMediaPosicaoCentral.Designer.cs b/TelaMediaPosicaoCentral.Designer.cs index 79bd844..570aa7b 100644 --- a/TelaMediaPosicaoCentral.Designer.cs +++ b/TelaMediaPosicaoCentral.Designer.cs @@ -29,18 +29,15 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TelaMediaPosicaoCentral)); - TituloEstatPar = new Label(); - label1 = new Label(); - label2 = new Label(); - label3 = new Label(); - label4 = new Label(); - PanelFilaExpandida = new Panel(); - FilaExpandidaLabel = new Label(); - PanelListaXiFi = new Panel(); + lblTituloEstatPar = new Label(); + lblDescTela = new Label(); + lblValorXI = new Label(); + lblValorFI = new Label(); + lblFilaExpandida = new Label(); Fi1 = new TextBox(); Xi1 = new TextBox(); AdicionarFila = new Button(); - ResultadosEstatisticos = new Label(); + lblResultadosEstatisticos = new Label(); lbPassosGeral = new Label(); lbResultadoGeral = new Label(); BotaoProximoPassoVAC = new Button(); @@ -48,129 +45,148 @@ private void InitializeComponent() btnAntTxt = new Button(); btnProxTxt = new Button(); lbTituloGeral = new Label(); - btnListaOuFila = new ReaLTaiizor.Controls.HopeToggle(); - PanelFilaExpandida.SuspendLayout(); - PanelListaXiFi.SuspendLayout(); + TglBtnListaOuFila = new ReaLTaiizor.Controls.HopeToggle(); + lblModoFilaExpandida = new Label(); + flowLayoutPanelPares = new FlowLayoutPanel(); + Par0 = new Panel(); + Xi0 = new TextBox(); + Fi0 = new TextBox(); + Par1 = new Panel(); + btnRmvPar1 = new ReaLTaiizor.Controls.Button(); + Par2 = new Panel(); + btnRmvPar2 = new ReaLTaiizor.Controls.Button(); + Xi2 = new TextBox(); + Fi2 = new TextBox(); + Par3 = new Panel(); + btnRmvPar3 = new ReaLTaiizor.Controls.Button(); + Xi3 = new TextBox(); + Fi3 = new TextBox(); + Par4 = new Panel(); + btnRmvPar4 = new ReaLTaiizor.Controls.Button(); + Xi4 = new TextBox(); + Fi4 = new TextBox(); + btnAdicionarNovoPar = new Button(); + chkParesAuto = new CheckBox(); + txtboxFilaExp = new ReaLTaiizor.Controls.DungeonRichTextBox(); + btnValidarFilaExp = new Button(); + pnLinhaSeparar = new Panel(); + panel16 = new Panel(); + panel17 = new Panel(); + panel18 = new Panel(); + panel19 = new Panel(); + panel20 = new Panel(); + panel21 = new Panel(); + panel22 = new Panel(); + txtBoxCvReverso = new TextBox(); + lblChaveAPI = new Label(); + label1 = new Label(); + txtBoxMediaReverso = new TextBox(); + lblMediaReverso = new Label(); + txtBoxDesvioReverso = new TextBox(); + lblDesvioReverso = new Label(); + txtBoxVarianciaReverso = new TextBox(); + lblVarianciaReverso = new Label(); + btnCalcReverso = new ReaLTaiizor.Controls.HopeRoundButton(); + hopeBtnMetodoReverso = new ReaLTaiizor.Controls.HopeRoundButton(); + hopeBtnMetodoPadrao = new ReaLTaiizor.Controls.HopeRoundButton(); + pnModoReverso = new ReaLTaiizor.Controls.Panel(); + pnModoPadrao = new ReaLTaiizor.Controls.Panel(); pnResultadosEstatisticos.SuspendLayout(); + flowLayoutPanelPares.SuspendLayout(); + Par0.SuspendLayout(); + Par1.SuspendLayout(); + Par2.SuspendLayout(); + Par3.SuspendLayout(); + Par4.SuspendLayout(); + pnLinhaSeparar.SuspendLayout(); + panel16.SuspendLayout(); + panel17.SuspendLayout(); + panel20.SuspendLayout(); + pnModoReverso.SuspendLayout(); + pnModoPadrao.SuspendLayout(); SuspendLayout(); // - // TituloEstatPar + // lblTituloEstatPar // - TituloEstatPar.Font = new Font("Berlin Sans FB Demi", 25F, FontStyle.Bold); - TituloEstatPar.ForeColor = Color.White; - TituloEstatPar.Location = new Point(63, 53); - TituloEstatPar.Margin = new Padding(0); - TituloEstatPar.Name = "TituloEstatPar"; - TituloEstatPar.Size = new Size(608, 43); - TituloEstatPar.TabIndex = 6; - TituloEstatPar.Text = "Cálculo da Estatística Paramétrica"; - TituloEstatPar.TextAlign = ContentAlignment.MiddleLeft; + lblTituloEstatPar.Font = new Font("Berlin Sans FB Demi", 25F, FontStyle.Bold); + lblTituloEstatPar.ForeColor = Color.White; + lblTituloEstatPar.Location = new Point(63, 53); + lblTituloEstatPar.Margin = new Padding(0); + lblTituloEstatPar.Name = "lblTituloEstatPar"; + lblTituloEstatPar.Size = new Size(608, 43); + lblTituloEstatPar.TabIndex = 6; + lblTituloEstatPar.Text = "Cálculo da Estatística Paramétrica"; + lblTituloEstatPar.TextAlign = ContentAlignment.MiddleLeft; // - // label1 + // lblDescTela // - label1.Font = new Font("Berlin Sans FB", 14F); - label1.ForeColor = Color.White; - label1.Location = new Point(69, 100); - label1.Margin = new Padding(0); - label1.Name = "label1"; - label1.Size = new Size(614, 28); - label1.TabIndex = 7; - label1.Text = "Insira os valores da Frequência Acumulada (Xi) e Frequência Absoluta (Fi):"; - label1.TextAlign = ContentAlignment.MiddleLeft; + lblDescTela.Font = new Font("Berlin Sans FB", 14F); + lblDescTela.ForeColor = Color.White; + lblDescTela.Location = new Point(69, 100); + lblDescTela.Margin = new Padding(0); + lblDescTela.Name = "lblDescTela"; + lblDescTela.Size = new Size(614, 28); + lblDescTela.TabIndex = 7; + lblDescTela.Text = "Insira os valores da Frequência Acumulada (Xi) e Frequência Absoluta (Fi):"; + lblDescTela.TextAlign = ContentAlignment.MiddleLeft; // - // label2 - // - label2.Font = new Font("Berlin Sans FB", 14F); - label2.ForeColor = Color.White; - label2.Location = new Point(91, 138); - label2.Margin = new Padding(0); - label2.Name = "label2"; - label2.Size = new Size(37, 28); - label2.TabIndex = 8; - label2.Text = "Xi"; - label2.TextAlign = ContentAlignment.MiddleCenter; - // - // label3 - // - label3.Font = new Font("Berlin Sans FB", 14F); - label3.ForeColor = Color.White; - label3.Location = new Point(191, 138); - label3.Margin = new Padding(0); - label3.Name = "label3"; - label3.Size = new Size(29, 28); - label3.TabIndex = 9; - label3.Text = "Fi"; - label3.TextAlign = ContentAlignment.MiddleCenter; - // - // label4 - // - label4.Font = new Font("Berlin Sans FB", 14F); - label4.ForeColor = Color.White; - label4.Location = new Point(302, 138); - label4.Margin = new Padding(0); - label4.Name = "label4"; - label4.Size = new Size(150, 28); - label4.TabIndex = 12; - label4.Text = "Fila Expandida:"; - label4.TextAlign = ContentAlignment.MiddleCenter; - // - // PanelFilaExpandida - // - PanelFilaExpandida.BackColor = Color.FromArgb(40, 0, 0, 0); - PanelFilaExpandida.Controls.Add(FilaExpandidaLabel); - PanelFilaExpandida.Location = new Point(307, 168); - PanelFilaExpandida.Margin = new Padding(3, 2, 3, 2); - PanelFilaExpandida.Name = "PanelFilaExpandida"; - PanelFilaExpandida.Size = new Size(308, 172); - PanelFilaExpandida.TabIndex = 13; - // - // FilaExpandidaLabel - // - FilaExpandidaLabel.Anchor = AnchorStyles.Left | AnchorStyles.Right; - FilaExpandidaLabel.BackColor = Color.FromArgb(0, 0, 0, 0); - FilaExpandidaLabel.Font = new Font("Berlin Sans FB", 14F); - FilaExpandidaLabel.ForeColor = Color.White; - FilaExpandidaLabel.Location = new Point(11, 9); - FilaExpandidaLabel.Name = "FilaExpandidaLabel"; - FilaExpandidaLabel.Size = new Size(282, 21); - FilaExpandidaLabel.TabIndex = 0; - FilaExpandidaLabel.Text = "Valores aqui"; - FilaExpandidaLabel.TextAlign = ContentAlignment.MiddleLeft; - // - // PanelListaXiFi - // - PanelListaXiFi.BackColor = Color.FromArgb(40, 0, 0, 0); - PanelListaXiFi.Controls.Add(Fi1); - PanelListaXiFi.Controls.Add(Xi1); - PanelListaXiFi.Location = new Point(73, 168); - PanelListaXiFi.Margin = new Padding(3, 2, 3, 2); - PanelListaXiFi.Name = "PanelListaXiFi"; - PanelListaXiFi.Size = new Size(169, 172); - PanelListaXiFi.TabIndex = 14; + // lblValorXI + // + lblValorXI.Font = new Font("Berlin Sans FB", 14F); + lblValorXI.ForeColor = Color.White; + lblValorXI.Location = new Point(38, 5); + lblValorXI.Margin = new Padding(0); + lblValorXI.Name = "lblValorXI"; + lblValorXI.Size = new Size(35, 23); + lblValorXI.TabIndex = 8; + lblValorXI.Text = "Xi"; + lblValorXI.TextAlign = ContentAlignment.MiddleCenter; + // + // lblValorFI + // + lblValorFI.Font = new Font("Berlin Sans FB", 14F); + lblValorFI.ForeColor = Color.White; + lblValorFI.Location = new Point(133, 5); + lblValorFI.Margin = new Padding(0); + lblValorFI.Name = "lblValorFI"; + lblValorFI.Size = new Size(35, 23); + lblValorFI.TabIndex = 9; + lblValorFI.Text = "Fi"; + lblValorFI.TextAlign = ContentAlignment.MiddleCenter; + // + // lblFilaExpandida + // + lblFilaExpandida.Font = new Font("Berlin Sans FB", 14F); + lblFilaExpandida.ForeColor = Color.White; + lblFilaExpandida.Location = new Point(20, 277); + lblFilaExpandida.Margin = new Padding(0); + lblFilaExpandida.Name = "lblFilaExpandida"; + lblFilaExpandida.Size = new Size(162, 28); + lblFilaExpandida.TabIndex = 12; + lblFilaExpandida.Text = "ou Fila Expandida:"; + lblFilaExpandida.TextAlign = ContentAlignment.MiddleCenter; // // Fi1 // Fi1.Cursor = Cursors.IBeam; - Fi1.Location = new Point(108, 7); + Fi1.Location = new Point(116, 7); Fi1.Margin = new Padding(3, 2, 3, 2); Fi1.Name = "Fi1"; - Fi1.Size = new Size(49, 23); + Fi1.PlaceholderText = "Fi"; + Fi1.Size = new Size(35, 23); Fi1.TabIndex = 13; - Fi1.TextChanged += VerificacaoNovoPar; - Fi1.KeyDown += XiFi_KeyDown; - Fi1.KeyPress += XiFi_KeyPress; + Fi1.TextAlign = HorizontalAlignment.Center; // // Xi1 // Xi1.Cursor = Cursors.IBeam; - Xi1.Location = new Point(12, 7); + Xi1.Location = new Point(21, 7); Xi1.Margin = new Padding(3, 2, 3, 2); Xi1.Name = "Xi1"; - Xi1.Size = new Size(49, 23); + Xi1.PlaceholderText = "Xi"; + Xi1.Size = new Size(35, 23); Xi1.TabIndex = 12; - Xi1.TextChanged += VerificacaoNovoPar; - Xi1.KeyDown += XiFi_KeyDown; - Xi1.KeyPress += XiFi_KeyPress; + Xi1.TextAlign = HorizontalAlignment.Center; // // AdicionarFila // @@ -181,7 +197,7 @@ private void InitializeComponent() AdicionarFila.FlatStyle = FlatStyle.Flat; AdicionarFila.Font = new Font("Segoe UI", 20F, FontStyle.Bold); AdicionarFila.ForeColor = Color.White; - AdicionarFila.Location = new Point(260, 227); + AdicionarFila.Location = new Point(233, 193); AdicionarFila.Margin = new Padding(0); AdicionarFila.Name = "AdicionarFila"; AdicionarFila.Size = new Size(26, 52); @@ -190,24 +206,24 @@ private void InitializeComponent() AdicionarFila.UseVisualStyleBackColor = false; AdicionarFila.Click += AdicionarFila_Click; // - // ResultadosEstatisticos + // lblResultadosEstatisticos // - ResultadosEstatisticos.Font = new Font("Berlin Sans FB Demi", 25F, FontStyle.Bold); - ResultadosEstatisticos.ForeColor = Color.White; - ResultadosEstatisticos.Location = new Point(812, 53); - ResultadosEstatisticos.Margin = new Padding(0); - ResultadosEstatisticos.Name = "ResultadosEstatisticos"; - ResultadosEstatisticos.Size = new Size(383, 43); - ResultadosEstatisticos.TabIndex = 17; - ResultadosEstatisticos.Text = "Resultados Estatísticos"; - ResultadosEstatisticos.TextAlign = ContentAlignment.MiddleCenter; + lblResultadosEstatisticos.Font = new Font("Berlin Sans FB Demi", 25F, FontStyle.Bold); + lblResultadosEstatisticos.ForeColor = Color.White; + lblResultadosEstatisticos.Location = new Point(812, 53); + lblResultadosEstatisticos.Margin = new Padding(0); + lblResultadosEstatisticos.Name = "lblResultadosEstatisticos"; + lblResultadosEstatisticos.Size = new Size(383, 43); + lblResultadosEstatisticos.TabIndex = 17; + lblResultadosEstatisticos.Text = "Resultados Estatísticos"; + lblResultadosEstatisticos.TextAlign = ContentAlignment.MiddleCenter; // // lbPassosGeral // lbPassosGeral.BackColor = Color.FromArgb(0, 0, 0, 0); lbPassosGeral.Font = new Font("Segoe UI", 12F); lbPassosGeral.ForeColor = Color.White; - lbPassosGeral.Location = new Point(34, 24); + lbPassosGeral.Location = new Point(34, 25); lbPassosGeral.Name = "lbPassosGeral"; lbPassosGeral.Size = new Size(469, 525); lbPassosGeral.TabIndex = 1; @@ -244,7 +260,7 @@ private void InitializeComponent() // // pnResultadosEstatisticos // - pnResultadosEstatisticos.BackColor = Color.FromArgb(39, 51, 63); + pnResultadosEstatisticos.BackColor = Color.FromArgb(57, 45, 120); pnResultadosEstatisticos.Controls.Add(btnAntTxt); pnResultadosEstatisticos.Controls.Add(btnProxTxt); pnResultadosEstatisticos.Controls.Add(lbTituloGeral); @@ -257,7 +273,6 @@ private void InitializeComponent() pnResultadosEstatisticos.Size = new Size(536, 574); pnResultadosEstatisticos.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; pnResultadosEstatisticos.TabIndex = 27; - pnResultadosEstatisticos.Text = "panel1"; // // btnAntTxt // @@ -306,67 +321,669 @@ private void InitializeComponent() lbTituloGeral.TabIndex = 28; lbTituloGeral.TextAlign = ContentAlignment.MiddleLeft; // - // btnListaOuFila - // - btnListaOuFila.AutoSize = true; - btnListaOuFila.BackColor = Color.FromArgb(30, 33, 34); - btnListaOuFila.BaseColor = Color.FromArgb(30, 33, 34); - btnListaOuFila.BaseColorA = Color.FromArgb(220, 223, 230); - btnListaOuFila.BaseColorB = Color.FromArgb(100, 64, 158, 255); - btnListaOuFila.HeadColorA = Color.FromArgb(220, 223, 230); - btnListaOuFila.HeadColorB = Color.White; - btnListaOuFila.HeadColorC = Color.FromArgb(64, 158, 255); - btnListaOuFila.HeadColorD = Color.FromArgb(64, 158, 255); - btnListaOuFila.Location = new Point(253, 146); - btnListaOuFila.Name = "btnListaOuFila"; - btnListaOuFila.Size = new Size(48, 20); - btnListaOuFila.TabIndex = 28; - btnListaOuFila.Text = "hopeToggle1"; - btnListaOuFila.UseVisualStyleBackColor = false; - btnListaOuFila.CheckedChanged += btnListaOuFila_CheckedChanged; + // TglBtnListaOuFila + // + TglBtnListaOuFila.BackColor = Color.FromArgb(57, 45, 120); + TglBtnListaOuFila.BaseColor = Color.FromArgb(57, 45, 120); + TglBtnListaOuFila.BaseColorA = Color.FromArgb(220, 223, 230); + TglBtnListaOuFila.BaseColorB = Color.FromArgb(100, 64, 158, 255); + TglBtnListaOuFila.HeadColorA = Color.FromArgb(220, 223, 230); + TglBtnListaOuFila.HeadColorB = Color.White; + TglBtnListaOuFila.HeadColorC = Color.FromArgb(64, 158, 255); + TglBtnListaOuFila.HeadColorD = Color.FromArgb(64, 158, 255); + TglBtnListaOuFila.Location = new Point(195, 63); + TglBtnListaOuFila.Name = "TglBtnListaOuFila"; + TglBtnListaOuFila.Size = new Size(48, 20); + TglBtnListaOuFila.TabIndex = 28; + TglBtnListaOuFila.UseVisualStyleBackColor = false; + TglBtnListaOuFila.CheckedChanged += TglBtnListaOuFila_CheckedChanged; + // + // lblModoFilaExpandida + // + lblModoFilaExpandida.BackColor = Color.FromArgb(0, 0, 0, 0); + lblModoFilaExpandida.Font = new Font("Berlin Sans FB", 10F); + lblModoFilaExpandida.ForeColor = Color.White; + lblModoFilaExpandida.Location = new Point(240, 54); + lblModoFilaExpandida.Name = "lblModoFilaExpandida"; + lblModoFilaExpandida.Size = new Size(78, 40); + lblModoFilaExpandida.TabIndex = 1; + lblModoFilaExpandida.Text = "Modo Fila Expandida"; + lblModoFilaExpandida.TextAlign = ContentAlignment.MiddleLeft; + // + // flowLayoutPanelPares + // + flowLayoutPanelPares.Controls.Add(Par0); + flowLayoutPanelPares.Controls.Add(Par1); + flowLayoutPanelPares.Controls.Add(Par2); + flowLayoutPanelPares.Controls.Add(Par3); + flowLayoutPanelPares.Controls.Add(Par4); + flowLayoutPanelPares.Controls.Add(btnAdicionarNovoPar); + flowLayoutPanelPares.Location = new Point(14, 31); + flowLayoutPanelPares.Name = "flowLayoutPanelPares"; + flowLayoutPanelPares.Size = new Size(174, 237); + flowLayoutPanelPares.TabIndex = 29; + // + // Par0 + // + Par0.BackColor = Color.FromArgb(40, 0, 0, 0); + Par0.Controls.Add(Xi0); + Par0.Controls.Add(Fi0); + Par0.Location = new Point(3, 2); + Par0.Margin = new Padding(3, 2, 3, 2); + Par0.Name = "Par0"; + Par0.Size = new Size(169, 36); + Par0.TabIndex = 35; + // + // Xi0 + // + Xi0.Cursor = Cursors.IBeam; + Xi0.Location = new Point(21, 7); + Xi0.Margin = new Padding(3, 2, 3, 2); + Xi0.Name = "Xi0"; + Xi0.PlaceholderText = "Xi"; + Xi0.Size = new Size(35, 23); + Xi0.TabIndex = 12; + Xi0.TextAlign = HorizontalAlignment.Center; + // + // Fi0 + // + Fi0.Cursor = Cursors.IBeam; + Fi0.Location = new Point(116, 7); + Fi0.Margin = new Padding(3, 2, 3, 2); + Fi0.Name = "Fi0"; + Fi0.PlaceholderText = "Fi"; + Fi0.Size = new Size(35, 23); + Fi0.TabIndex = 13; + Fi0.TextAlign = HorizontalAlignment.Center; + // + // Par1 + // + Par1.BackColor = Color.FromArgb(40, 0, 0, 0); + Par1.Controls.Add(btnRmvPar1); + Par1.Controls.Add(Xi1); + Par1.Controls.Add(Fi1); + Par1.Enabled = false; + Par1.Location = new Point(3, 42); + Par1.Margin = new Padding(3, 2, 3, 2); + Par1.Name = "Par1"; + Par1.Size = new Size(169, 36); + Par1.TabIndex = 34; + Par1.Visible = false; + // + // btnRmvPar1 + // + btnRmvPar1.BackColor = Color.Transparent; + btnRmvPar1.BorderColor = Color.FromArgb(32, 34, 37); + btnRmvPar1.Enabled = false; + btnRmvPar1.EnteredBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar1.EnteredColor = Color.FromArgb(32, 34, 37); + btnRmvPar1.Font = new Font("Microsoft Sans Serif", 12F); + btnRmvPar1.Image = (Image)resources.GetObject("btnRmvPar1.Image"); + btnRmvPar1.ImageAlign = ContentAlignment.MiddleCenter; + btnRmvPar1.InactiveColor = Color.FromArgb(165, 37, 37); + btnRmvPar1.Location = new Point(72, 4); + btnRmvPar1.Name = "btnRmvPar1"; + btnRmvPar1.PressedBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar1.PressedColor = Color.FromArgb(165, 37, 37); + btnRmvPar1.Size = new Size(28, 28); + btnRmvPar1.TabIndex = 32; + btnRmvPar1.TextAlignment = StringAlignment.Center; + btnRmvPar1.Visible = false; + btnRmvPar1.Click += BtnRmvPar_Click; + // + // Par2 + // + Par2.BackColor = Color.FromArgb(40, 0, 0, 0); + Par2.Controls.Add(btnRmvPar2); + Par2.Controls.Add(Xi2); + Par2.Controls.Add(Fi2); + Par2.Enabled = false; + Par2.Location = new Point(3, 82); + Par2.Margin = new Padding(3, 2, 3, 2); + Par2.Name = "Par2"; + Par2.Size = new Size(169, 36); + Par2.TabIndex = 35; + Par2.Visible = false; + // + // btnRmvPar2 + // + btnRmvPar2.BackColor = Color.Transparent; + btnRmvPar2.BorderColor = Color.FromArgb(32, 34, 37); + btnRmvPar2.Enabled = false; + btnRmvPar2.EnteredBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar2.EnteredColor = Color.FromArgb(32, 34, 37); + btnRmvPar2.Font = new Font("Microsoft Sans Serif", 12F); + btnRmvPar2.Image = (Image)resources.GetObject("btnRmvPar2.Image"); + btnRmvPar2.ImageAlign = ContentAlignment.MiddleCenter; + btnRmvPar2.InactiveColor = Color.FromArgb(165, 37, 37); + btnRmvPar2.Location = new Point(72, 4); + btnRmvPar2.Name = "btnRmvPar2"; + btnRmvPar2.PressedBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar2.PressedColor = Color.FromArgb(165, 37, 37); + btnRmvPar2.Size = new Size(28, 28); + btnRmvPar2.TabIndex = 33; + btnRmvPar2.TextAlignment = StringAlignment.Center; + btnRmvPar2.Visible = false; + btnRmvPar2.Click += BtnRmvPar_Click; + // + // Xi2 + // + Xi2.Cursor = Cursors.IBeam; + Xi2.Location = new Point(21, 7); + Xi2.Margin = new Padding(3, 2, 3, 2); + Xi2.Name = "Xi2"; + Xi2.PlaceholderText = "Xi"; + Xi2.Size = new Size(35, 23); + Xi2.TabIndex = 12; + Xi2.TextAlign = HorizontalAlignment.Center; + // + // Fi2 + // + Fi2.Cursor = Cursors.IBeam; + Fi2.Location = new Point(116, 7); + Fi2.Margin = new Padding(3, 2, 3, 2); + Fi2.Name = "Fi2"; + Fi2.PlaceholderText = "Fi"; + Fi2.Size = new Size(35, 23); + Fi2.TabIndex = 13; + Fi2.TextAlign = HorizontalAlignment.Center; + // + // Par3 + // + Par3.BackColor = Color.FromArgb(40, 0, 0, 0); + Par3.Controls.Add(btnRmvPar3); + Par3.Controls.Add(Xi3); + Par3.Controls.Add(Fi3); + Par3.Enabled = false; + Par3.Location = new Point(3, 122); + Par3.Margin = new Padding(3, 2, 3, 2); + Par3.Name = "Par3"; + Par3.Size = new Size(169, 36); + Par3.TabIndex = 37; + Par3.Visible = false; + // + // btnRmvPar3 + // + btnRmvPar3.BackColor = Color.Transparent; + btnRmvPar3.BorderColor = Color.FromArgb(32, 34, 37); + btnRmvPar3.Enabled = false; + btnRmvPar3.EnteredBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar3.EnteredColor = Color.FromArgb(32, 34, 37); + btnRmvPar3.Font = new Font("Microsoft Sans Serif", 12F); + btnRmvPar3.Image = (Image)resources.GetObject("btnRmvPar3.Image"); + btnRmvPar3.ImageAlign = ContentAlignment.MiddleCenter; + btnRmvPar3.InactiveColor = Color.FromArgb(165, 37, 37); + btnRmvPar3.Location = new Point(72, 4); + btnRmvPar3.Name = "btnRmvPar3"; + btnRmvPar3.PressedBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar3.PressedColor = Color.FromArgb(165, 37, 37); + btnRmvPar3.Size = new Size(28, 28); + btnRmvPar3.TabIndex = 34; + btnRmvPar3.TextAlignment = StringAlignment.Center; + btnRmvPar3.Visible = false; + btnRmvPar3.Click += BtnRmvPar_Click; + // + // Xi3 + // + Xi3.Cursor = Cursors.IBeam; + Xi3.Location = new Point(21, 7); + Xi3.Margin = new Padding(3, 2, 3, 2); + Xi3.Name = "Xi3"; + Xi3.PlaceholderText = "Xi"; + Xi3.Size = new Size(35, 23); + Xi3.TabIndex = 12; + Xi3.TextAlign = HorizontalAlignment.Center; + // + // Fi3 + // + Fi3.Cursor = Cursors.IBeam; + Fi3.Location = new Point(116, 7); + Fi3.Margin = new Padding(3, 2, 3, 2); + Fi3.Name = "Fi3"; + Fi3.PlaceholderText = "Fi"; + Fi3.Size = new Size(35, 23); + Fi3.TabIndex = 13; + Fi3.TextAlign = HorizontalAlignment.Center; + // + // Par4 + // + Par4.BackColor = Color.FromArgb(40, 0, 0, 0); + Par4.Controls.Add(btnRmvPar4); + Par4.Controls.Add(Xi4); + Par4.Controls.Add(Fi4); + Par4.Enabled = false; + Par4.Location = new Point(3, 162); + Par4.Margin = new Padding(3, 2, 3, 2); + Par4.Name = "Par4"; + Par4.Size = new Size(169, 36); + Par4.TabIndex = 36; + Par4.Visible = false; + // + // btnRmvPar4 + // + btnRmvPar4.BackColor = Color.Transparent; + btnRmvPar4.BorderColor = Color.FromArgb(32, 34, 37); + btnRmvPar4.Enabled = false; + btnRmvPar4.EnteredBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar4.EnteredColor = Color.FromArgb(32, 34, 37); + btnRmvPar4.Font = new Font("Microsoft Sans Serif", 12F); + btnRmvPar4.Image = (Image)resources.GetObject("btnRmvPar4.Image"); + btnRmvPar4.ImageAlign = ContentAlignment.MiddleCenter; + btnRmvPar4.InactiveColor = Color.FromArgb(165, 37, 37); + btnRmvPar4.Location = new Point(72, 4); + btnRmvPar4.Name = "btnRmvPar4"; + btnRmvPar4.PressedBorderColor = Color.FromArgb(165, 37, 37); + btnRmvPar4.PressedColor = Color.FromArgb(165, 37, 37); + btnRmvPar4.Size = new Size(28, 28); + btnRmvPar4.TabIndex = 35; + btnRmvPar4.TextAlignment = StringAlignment.Center; + btnRmvPar4.Visible = false; + btnRmvPar4.Click += BtnRmvPar_Click; + // + // Xi4 + // + Xi4.Cursor = Cursors.IBeam; + Xi4.Location = new Point(21, 7); + Xi4.Margin = new Padding(3, 2, 3, 2); + Xi4.Name = "Xi4"; + Xi4.PlaceholderText = "Xi"; + Xi4.Size = new Size(35, 23); + Xi4.TabIndex = 12; + Xi4.TextAlign = HorizontalAlignment.Center; + // + // Fi4 + // + Fi4.Cursor = Cursors.IBeam; + Fi4.Location = new Point(116, 7); + Fi4.Margin = new Padding(3, 2, 3, 2); + Fi4.Name = "Fi4"; + Fi4.PlaceholderText = "Fi"; + Fi4.Size = new Size(35, 23); + Fi4.TabIndex = 13; + Fi4.TextAlign = HorizontalAlignment.Center; + // + // btnAdicionarNovoPar + // + btnAdicionarNovoPar.BackColor = Color.FromArgb(60, 190, 60); + btnAdicionarNovoPar.ForeColor = Color.White; + btnAdicionarNovoPar.Image = (Image)resources.GetObject("btnAdicionarNovoPar.Image"); + btnAdicionarNovoPar.Location = new Point(0, 200); + btnAdicionarNovoPar.Margin = new Padding(0); + btnAdicionarNovoPar.Name = "btnAdicionarNovoPar"; + btnAdicionarNovoPar.Size = new Size(172, 31); + btnAdicionarNovoPar.TabIndex = 31; + btnAdicionarNovoPar.UseVisualStyleBackColor = false; + btnAdicionarNovoPar.Click += btnAdicionarNovoPar_Click; + // + // chkParesAuto + // + chkParesAuto.Checked = true; + chkParesAuto.CheckState = CheckState.Checked; + chkParesAuto.Font = new Font("Berlin Sans FB", 10F); + chkParesAuto.ForeColor = Color.White; + chkParesAuto.Location = new Point(200, 31); + chkParesAuto.Name = "chkParesAuto"; + chkParesAuto.Size = new Size(111, 20); + chkParesAuto.TabIndex = 31; + chkParesAuto.Text = "Adicionar auto"; + chkParesAuto.UseVisualStyleBackColor = true; + // + // txtboxFilaExp + // + txtboxFilaExp.AutoWordSelection = false; + txtboxFilaExp.BackColor = Color.Transparent; + txtboxFilaExp.BorderColor = Color.FromArgb(180, 180, 180); + txtboxFilaExp.EdgeColor = Color.White; + txtboxFilaExp.Enabled = false; + txtboxFilaExp.Font = new Font("Tahoma", 10F); + txtboxFilaExp.ForeColor = Color.FromArgb(76, 76, 76); + txtboxFilaExp.Location = new Point(14, 315); + txtboxFilaExp.Name = "txtboxFilaExp"; + txtboxFilaExp.ReadOnly = false; + txtboxFilaExp.Size = new Size(172, 131); + txtboxFilaExp.TabIndex = 32; + txtboxFilaExp.TextBackColor = Color.White; + txtboxFilaExp.WordWrap = true; + // + // btnValidarFilaExp + // + btnValidarFilaExp.Location = new Point(44, 456); + btnValidarFilaExp.Name = "btnValidarFilaExp"; + btnValidarFilaExp.Size = new Size(112, 41); + btnValidarFilaExp.TabIndex = 33; + btnValidarFilaExp.Text = "Validar Lista"; + btnValidarFilaExp.UseVisualStyleBackColor = true; + btnValidarFilaExp.Click += btnValidarFilaExp_Click; + // + // pnLinhaSeparar + // + pnLinhaSeparar.BackColor = Color.White; + pnLinhaSeparar.Controls.Add(panel16); + pnLinhaSeparar.Controls.Add(panel20); + pnLinhaSeparar.Controls.Add(panel22); + pnLinhaSeparar.Location = new Point(389, 196); + pnLinhaSeparar.Margin = new Padding(3, 2, 3, 2); + pnLinhaSeparar.Name = "pnLinhaSeparar"; + pnLinhaSeparar.Size = new Size(1, 420); + pnLinhaSeparar.TabIndex = 34; + // + // panel16 + // + panel16.BackColor = Color.White; + panel16.Controls.Add(panel17); + panel16.Controls.Add(panel19); + panel16.Location = new Point(19, 2); + panel16.Margin = new Padding(3, 2, 3, 2); + panel16.Name = "panel16"; + panel16.Size = new Size(18, 2); + panel16.TabIndex = 9; + // + // panel17 + // + panel17.BackColor = Color.White; + panel17.Controls.Add(panel18); + panel17.Location = new Point(24, 0); + panel17.Margin = new Padding(3, 2, 3, 2); + panel17.Name = "panel17"; + panel17.Size = new Size(18, 2); + panel17.TabIndex = 8; + // + // panel18 + // + panel18.BackColor = Color.White; + panel18.Location = new Point(102, 0); + panel18.Margin = new Padding(3, 2, 3, 2); + panel18.Name = "panel18"; + panel18.Size = new Size(18, 2); + panel18.TabIndex = 7; + // + // panel19 + // + panel19.BackColor = Color.White; + panel19.Location = new Point(102, 0); + panel19.Margin = new Padding(3, 2, 3, 2); + panel19.Name = "panel19"; + panel19.Size = new Size(18, 2); + panel19.TabIndex = 7; + // + // panel20 + // + panel20.BackColor = Color.White; + panel20.Controls.Add(panel21); + panel20.Location = new Point(24, 0); + panel20.Margin = new Padding(3, 2, 3, 2); + panel20.Name = "panel20"; + panel20.Size = new Size(18, 2); + panel20.TabIndex = 8; + // + // panel21 + // + panel21.BackColor = Color.White; + panel21.Location = new Point(102, 0); + panel21.Margin = new Padding(3, 2, 3, 2); + panel21.Name = "panel21"; + panel21.Size = new Size(18, 2); + panel21.TabIndex = 7; + // + // panel22 + // + panel22.BackColor = Color.White; + panel22.Location = new Point(102, 0); + panel22.Margin = new Padding(3, 2, 3, 2); + panel22.Name = "panel22"; + panel22.Size = new Size(18, 2); + panel22.TabIndex = 7; + // + // txtBoxCvReverso + // + txtBoxCvReverso.Location = new Point(134, 13); + txtBoxCvReverso.Name = "txtBoxCvReverso"; + txtBoxCvReverso.Size = new Size(32, 23); + txtBoxCvReverso.TabIndex = 37; + // + // lblChaveAPI + // + lblChaveAPI.Font = new Font("Berlin Sans FB", 12F); + lblChaveAPI.ForeColor = Color.White; + lblChaveAPI.Location = new Point(9, 5); + lblChaveAPI.Margin = new Padding(0); + lblChaveAPI.Name = "lblChaveAPI"; + lblChaveAPI.Size = new Size(109, 36); + lblChaveAPI.TabIndex = 36; + lblChaveAPI.Text = "Coeficiente de Variação:"; + lblChaveAPI.TextAlign = ContentAlignment.MiddleLeft; + // + // label1 + // + label1.Font = new Font("Berlin Sans FB", 12.5F); + label1.ForeColor = Color.White; + label1.Location = new Point(9, 92); + label1.Margin = new Padding(0); + label1.Name = "label1"; + label1.Size = new Size(281, 28); + label1.TabIndex = 38; + label1.Text = "Informe ao menos um dos parâmetros:"; + label1.TextAlign = ContentAlignment.MiddleLeft; + // + // txtBoxMediaReverso + // + txtBoxMediaReverso.Location = new Point(134, 46); + txtBoxMediaReverso.Name = "txtBoxMediaReverso"; + txtBoxMediaReverso.PlaceholderText = "x̄"; + txtBoxMediaReverso.Size = new Size(32, 23); + txtBoxMediaReverso.TabIndex = 40; + txtBoxMediaReverso.TextAlign = HorizontalAlignment.Center; + // + // lblMediaReverso + // + lblMediaReverso.Font = new Font("Berlin Sans FB", 12F); + lblMediaReverso.ForeColor = Color.White; + lblMediaReverso.Location = new Point(10, 48); + lblMediaReverso.Margin = new Padding(0); + lblMediaReverso.Name = "lblMediaReverso"; + lblMediaReverso.Size = new Size(109, 18); + lblMediaReverso.TabIndex = 39; + lblMediaReverso.Text = "Média:"; + lblMediaReverso.TextAlign = ContentAlignment.MiddleLeft; + // + // txtBoxDesvioReverso + // + txtBoxDesvioReverso.Location = new Point(134, 161); + txtBoxDesvioReverso.Name = "txtBoxDesvioReverso"; + txtBoxDesvioReverso.PlaceholderText = "s"; + txtBoxDesvioReverso.Size = new Size(32, 23); + txtBoxDesvioReverso.TabIndex = 42; + txtBoxDesvioReverso.TextAlign = HorizontalAlignment.Center; + // + // lblDesvioReverso + // + lblDesvioReverso.Font = new Font("Berlin Sans FB", 12F); + lblDesvioReverso.ForeColor = Color.White; + lblDesvioReverso.Location = new Point(10, 163); + lblDesvioReverso.Margin = new Padding(0); + lblDesvioReverso.Name = "lblDesvioReverso"; + lblDesvioReverso.Size = new Size(109, 18); + lblDesvioReverso.TabIndex = 41; + lblDesvioReverso.Text = "Desvio Padrão:"; + lblDesvioReverso.TextAlign = ContentAlignment.MiddleLeft; + // + // txtBoxVarianciaReverso + // + txtBoxVarianciaReverso.Location = new Point(134, 128); + txtBoxVarianciaReverso.Name = "txtBoxVarianciaReverso"; + txtBoxVarianciaReverso.PlaceholderText = "s²"; + txtBoxVarianciaReverso.Size = new Size(32, 23); + txtBoxVarianciaReverso.TabIndex = 44; + txtBoxVarianciaReverso.TextAlign = HorizontalAlignment.Center; + // + // lblVarianciaReverso + // + lblVarianciaReverso.Font = new Font("Berlin Sans FB", 12F); + lblVarianciaReverso.ForeColor = Color.White; + lblVarianciaReverso.Location = new Point(10, 130); + lblVarianciaReverso.Margin = new Padding(0); + lblVarianciaReverso.Name = "lblVarianciaReverso"; + lblVarianciaReverso.Size = new Size(109, 18); + lblVarianciaReverso.TabIndex = 43; + lblVarianciaReverso.Text = "Variância:"; + lblVarianciaReverso.TextAlign = ContentAlignment.MiddleLeft; + // + // btnCalcReverso + // + btnCalcReverso.BorderColor = Color.FromArgb(220, 223, 230); + btnCalcReverso.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; + btnCalcReverso.DangerColor = Color.FromArgb(245, 108, 108); + btnCalcReverso.DefaultColor = Color.FromArgb(255, 255, 255); + btnCalcReverso.Font = new Font("Berlin Sans FB", 12F); + btnCalcReverso.HoverTextColor = Color.FromArgb(48, 49, 51); + btnCalcReverso.InfoColor = Color.FromArgb(144, 147, 153); + btnCalcReverso.Location = new Point(99, 209); + btnCalcReverso.Margin = new Padding(10); + btnCalcReverso.Name = "btnCalcReverso"; + btnCalcReverso.PrimaryColor = Color.FromArgb(79, 55, 139); + btnCalcReverso.Size = new Size(108, 44); + btnCalcReverso.SuccessColor = Color.FromArgb(103, 194, 58); + btnCalcReverso.TabIndex = 46; + btnCalcReverso.Text = "Realizar cálculos"; + btnCalcReverso.TextColor = Color.White; + btnCalcReverso.WarningColor = Color.FromArgb(230, 162, 60); + btnCalcReverso.Click += btnCalcReverso_Click; + // + // hopeBtnMetodoReverso + // + hopeBtnMetodoReverso.BorderColor = Color.FromArgb(220, 223, 230); + hopeBtnMetodoReverso.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; + hopeBtnMetodoReverso.DangerColor = Color.FromArgb(245, 108, 108); + hopeBtnMetodoReverso.DefaultColor = Color.FromArgb(255, 255, 255); + hopeBtnMetodoReverso.Font = new Font("Berlin Sans FB Demi", 17F, FontStyle.Bold); + hopeBtnMetodoReverso.HoverTextColor = Color.FromArgb(48, 49, 51); + hopeBtnMetodoReverso.InfoColor = Color.FromArgb(144, 147, 153); + hopeBtnMetodoReverso.Location = new Point(403, 146); + hopeBtnMetodoReverso.Margin = new Padding(10); + hopeBtnMetodoReverso.Name = "hopeBtnMetodoReverso"; + hopeBtnMetodoReverso.PrimaryColor = Color.FromArgb(79, 55, 139); + hopeBtnMetodoReverso.Size = new Size(216, 44); + hopeBtnMetodoReverso.SuccessColor = Color.FromArgb(103, 194, 58); + hopeBtnMetodoReverso.TabIndex = 47; + hopeBtnMetodoReverso.Text = "Método Reverso"; + hopeBtnMetodoReverso.TextColor = Color.White; + hopeBtnMetodoReverso.WarningColor = Color.FromArgb(230, 162, 60); + hopeBtnMetodoReverso.Click += hopeBtnMetodoReverso_Click; + // + // hopeBtnMetodoPadrao + // + hopeBtnMetodoPadrao.BorderColor = Color.FromArgb(220, 223, 230); + hopeBtnMetodoPadrao.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; + hopeBtnMetodoPadrao.DangerColor = Color.FromArgb(245, 108, 108); + hopeBtnMetodoPadrao.DefaultColor = Color.FromArgb(255, 255, 255); + hopeBtnMetodoPadrao.Font = new Font("Berlin Sans FB Demi", 17F, FontStyle.Bold); + hopeBtnMetodoPadrao.HoverTextColor = Color.FromArgb(48, 49, 51); + hopeBtnMetodoPadrao.InfoColor = Color.FromArgb(144, 147, 153); + hopeBtnMetodoPadrao.Location = new Point(51, 146); + hopeBtnMetodoPadrao.Margin = new Padding(10); + hopeBtnMetodoPadrao.Name = "hopeBtnMetodoPadrao"; + hopeBtnMetodoPadrao.PrimaryColor = Color.FromArgb(79, 55, 139); + hopeBtnMetodoPadrao.Size = new Size(216, 44); + hopeBtnMetodoPadrao.SuccessColor = Color.FromArgb(103, 194, 58); + hopeBtnMetodoPadrao.TabIndex = 48; + hopeBtnMetodoPadrao.Text = "Método Padrão"; + hopeBtnMetodoPadrao.TextColor = Color.White; + hopeBtnMetodoPadrao.WarningColor = Color.FromArgb(230, 162, 60); + hopeBtnMetodoPadrao.Click += hopeBtnMetodoPadrao_Click; + // + // pnModoReverso + // + pnModoReverso.BackColor = Color.FromArgb(57, 45, 120); + pnModoReverso.Controls.Add(lblChaveAPI); + pnModoReverso.Controls.Add(txtBoxCvReverso); + pnModoReverso.Controls.Add(label1); + pnModoReverso.Controls.Add(btnCalcReverso); + pnModoReverso.Controls.Add(lblMediaReverso); + pnModoReverso.Controls.Add(txtBoxVarianciaReverso); + pnModoReverso.Controls.Add(txtBoxMediaReverso); + pnModoReverso.Controls.Add(lblVarianciaReverso); + pnModoReverso.Controls.Add(lblDesvioReverso); + pnModoReverso.Controls.Add(txtBoxDesvioReverso); + pnModoReverso.EdgeColor = Color.FromArgb(32, 41, 50); + pnModoReverso.Location = new Point(403, 203); + pnModoReverso.Name = "pnModoReverso"; + pnModoReverso.Padding = new Padding(5); + pnModoReverso.Size = new Size(308, 410); + pnModoReverso.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + pnModoReverso.TabIndex = 30; + // + // pnModoPadrao + // + pnModoPadrao.BackColor = Color.FromArgb(57, 45, 120); + pnModoPadrao.Controls.Add(lblValorXI); + pnModoPadrao.Controls.Add(lblValorFI); + pnModoPadrao.Controls.Add(lblFilaExpandida); + pnModoPadrao.Controls.Add(AdicionarFila); + pnModoPadrao.Controls.Add(TglBtnListaOuFila); + pnModoPadrao.Controls.Add(btnValidarFilaExp); + pnModoPadrao.Controls.Add(lblModoFilaExpandida); + pnModoPadrao.Controls.Add(txtboxFilaExp); + pnModoPadrao.Controls.Add(flowLayoutPanelPares); + pnModoPadrao.Controls.Add(chkParesAuto); + pnModoPadrao.EdgeColor = Color.FromArgb(32, 41, 50); + pnModoPadrao.Location = new Point(51, 203); + pnModoPadrao.Name = "pnModoPadrao"; + pnModoPadrao.Padding = new Padding(5); + pnModoPadrao.Size = new Size(326, 521); + pnModoPadrao.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + pnModoPadrao.TabIndex = 47; // // TelaMediaPosicaoCentral // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.FromArgb(26, 31, 52); - Controls.Add(btnListaOuFila); + Controls.Add(pnModoPadrao); + Controls.Add(pnModoReverso); + Controls.Add(hopeBtnMetodoPadrao); + Controls.Add(hopeBtnMetodoReverso); + Controls.Add(pnLinhaSeparar); Controls.Add(pnResultadosEstatisticos); Controls.Add(BotaoProximoPassoVAC); - Controls.Add(ResultadosEstatisticos); - Controls.Add(AdicionarFila); - Controls.Add(PanelFilaExpandida); - Controls.Add(label4); - Controls.Add(label3); - Controls.Add(label2); - Controls.Add(label1); - Controls.Add(TituloEstatPar); - Controls.Add(PanelListaXiFi); - Margin = new Padding(3, 2, 3, 2); + Controls.Add(lblResultadosEstatisticos); + Controls.Add(lblDescTela); + Controls.Add(lblTituloEstatPar); + Margin = new Padding(0); Name = "TelaMediaPosicaoCentral"; Size = new Size(1280, 800); Load += TelaMediaPosicaoCentral_Load; - PanelFilaExpandida.ResumeLayout(false); - PanelListaXiFi.ResumeLayout(false); - PanelListaXiFi.PerformLayout(); pnResultadosEstatisticos.ResumeLayout(false); + flowLayoutPanelPares.ResumeLayout(false); + Par0.ResumeLayout(false); + Par0.PerformLayout(); + Par1.ResumeLayout(false); + Par1.PerformLayout(); + Par2.ResumeLayout(false); + Par2.PerformLayout(); + Par3.ResumeLayout(false); + Par3.PerformLayout(); + Par4.ResumeLayout(false); + Par4.PerformLayout(); + pnLinhaSeparar.ResumeLayout(false); + panel16.ResumeLayout(false); + panel17.ResumeLayout(false); + panel20.ResumeLayout(false); + pnModoReverso.ResumeLayout(false); + pnModoReverso.PerformLayout(); + pnModoPadrao.ResumeLayout(false); ResumeLayout(false); - PerformLayout(); } #endregion - private Label TituloEstatPar; - private Label label1; - private Label label2; - private Label label3; - private Label label4; - private Panel PanelFilaExpandida; - private Label FilaExpandidaLabel; - private Panel PanelListaXiFi; + private Label lblTituloEstatPar; + private Label lblDescTela; + private Label lblValorXI; + private Label lblValorFI; + private Label lblFilaExpandida; private TextBox Fi1; private TextBox Xi1; private Button AdicionarFila; - private Label ResultadosEstatisticos; + private Label lblResultadosEstatisticos; private Label lbPassosGeral; private Label lbResultadoGeral; private Button BotaoProximoPassoVAC; @@ -374,6 +991,51 @@ private void InitializeComponent() private Label lbTituloGeral; private Button btnAntTxt; private Button btnProxTxt; - private ReaLTaiizor.Controls.HopeToggle btnListaOuFila; + private ReaLTaiizor.Controls.HopeToggle TglBtnListaOuFila; + private Label lblModoFilaExpandida; + private FlowLayoutPanel flowLayoutPanelPares; + private Panel Par1; + private Panel Par0; + private TextBox Xi0; + private TextBox Fi0; + private Panel Par2; + private TextBox Xi2; + private TextBox Fi2; + private Panel Par3; + private TextBox Xi3; + private TextBox Fi3; + private Panel Par4; + private TextBox Xi4; + private TextBox Fi4; + private CheckBox chkParesAuto; + private Button btnAdicionarNovoPar; + private ReaLTaiizor.Controls.Button btnRmvPar1; + private ReaLTaiizor.Controls.Button btnRmvPar2; + private ReaLTaiizor.Controls.Button btnRmvPar3; + private ReaLTaiizor.Controls.Button btnRmvPar4; + private ReaLTaiizor.Controls.DungeonRichTextBox txtboxFilaExp; + private Button btnValidarFilaExp; + private Panel pnLinhaSeparar; + private Panel panel16; + private Panel panel17; + private Panel panel18; + private Panel panel19; + private Panel panel20; + private Panel panel21; + private Panel panel22; + private TextBox txtBoxCvReverso; + private Label lblChaveAPI; + private Label label1; + private TextBox txtBoxMediaReverso; + private Label lblMediaReverso; + private TextBox txtBoxDesvioReverso; + private Label lblDesvioReverso; + private TextBox txtBoxVarianciaReverso; + private Label lblVarianciaReverso; + private ReaLTaiizor.Controls.HopeRoundButton btnCalcReverso; + private ReaLTaiizor.Controls.HopeRoundButton hopeBtnMetodoReverso; + private ReaLTaiizor.Controls.HopeRoundButton hopeBtnMetodoPadrao; + private ReaLTaiizor.Controls.Panel pnModoReverso; + private ReaLTaiizor.Controls.Panel pnModoPadrao; } } diff --git a/TelaMediaPosicaoCentral.cs b/TelaMediaPosicaoCentral.cs index 000cfca..7f8143a 100644 --- a/TelaMediaPosicaoCentral.cs +++ b/TelaMediaPosicaoCentral.cs @@ -1,32 +1,27 @@ #region Usings - using System.Globalization; +using System.Text; +using System.Text.RegularExpressions; #endregion +#region Namespace e Declaração de Classe namespace Interface_e_sistema_em_C_ - { - public partial class TelaMediaPosicaoCentral : UserControl, ITela { - #region Campos - private int proximoXiFiY = 40; - private int XiX, FiX; - private List listaXi = new List(); - private List listaFi = new List(); - private List<(TextBox Xi, TextBox Fi, Button BotaoRemover)> listaXiFi = new List<(TextBox, TextBox, Button)>(); + #endregion + + #region Campos e Propriedades private GerenciadorTelas _gerenciadorTelas; - private bool DeveAdicionarNovoPar = false; - private bool podeAdicionar = true; private Panel _panelContainer; - private List listaPassos; + private List _painelPares; private int indiceAtualGeral = 0; private List textosSequenciais; private List resultadosSequenciais; private List titulosSequenciais; #endregion - #region Construtor + #region Inicialização e Ciclo de Vida public TelaMediaPosicaoCentral(Panel panelContainer, GerenciadorTelas gerenciadorTelas) { InitializeComponent(); @@ -34,287 +29,464 @@ public TelaMediaPosicaoCentral(Panel panelContainer, GerenciadorTelas gerenciado this.Dock = DockStyle.Fill; _gerenciadorTelas = gerenciadorTelas; _panelContainer = panelContainer; + } - XiX = Xi1.Location.X; - FiX = Fi1.Location.X; + private void TelaMediaPosicaoCentral_Load(object sender, EventArgs e) + { + InicializarPares(); + DesativarMenuContexto(this); + // Configura o botão manual + chkParesAuto.CheckedChanged += (s, e) => AtualizarBotoes(); + AtualizarBotoes(); // Primeira atualização + txtboxFilaExp.KeyPress += (s, e) => + { + char tecla = e.KeyChar; + if (char.IsControl(tecla)) + return; + if (char.IsDigit(tecla) || tecla == ',' || tecla == ';' || tecla == '-') + return; + // Bloqueia tudo que não for permitido + e.Handled = true; + }; + } - listaXi.Add(Xi1); - listaFi.Add(Fi1); + public void OnCarregar() + { + this.Visible = true; + this.BringToFront(); + } - proximoXiFiY = 40; + public void OnDescarregar() + { + this.Visible = false; + LimparRecursos(); } + + private void LimparRecursos() { } + + public UserControl GetView() => this; #endregion - #region Adição e Remoção de Pares Xi/Fi - private void AdicionarNovoPar() + #region Gerenciamento de Pares Xi/Fi (Adição e Remoção) + private void InicializarPares() { - if (listaXiFi.Count > 1) + // Inicializa a lista de painéis + _painelPares = new List { Par0, Par1, Par2, Par3, Par4 }; + // Garante que apenas o primeiro painel esteja visível inicialmente + for (int i = 0; i < _painelPares.Count; i++) { - var ultimoPar = listaXiFi.Last(); - if (ultimoPar.Xi.Text == "" || ultimoPar.Fi.Text == "") + _painelPares[i].Visible = (i == 0); + _painelPares[i].Enabled = (i == 0); + // Limpa os campos dos painéis invisíveis + if (i > 0) { - MessageBox.Show("Preencha todos os campos antes de adicionar um novo par."); - return; + var textBoxes = _painelPares[i].Controls.OfType(); + foreach (var tb in textBoxes) + { + tb.Clear(); + } } + ConfigurarEventosDoPar(_painelPares[i]); } + // Força a atualização inicial dos botões + AtualizarBotoes(); + } - TextBox novoXi = CopiarConfiguracao(Xi1); - novoXi.Location = new Point(XiX, proximoXiFiY); - novoXi.TextChanged += VerificacaoNovoPar; - novoXi.KeyPress += XiFi_KeyPress; - novoXi.KeyDown += NovoXi_KeyDown; - - TextBox novoFi = CopiarConfiguracao(Fi1); - novoFi.Location = new Point(FiX, proximoXiFiY); - novoFi.TextChanged += VerificacaoNovoPar; - novoFi.KeyPress += XiFi_KeyPress; - novoFi.KeyDown += XiFi_KeyDown; - - foreach (Control control in PanelListaXiFi.Controls) + private void ConfigurarEventosDoPar(Panel panel) + { + int indice = ObterIndice(panel.Name); + TextBox xi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Xi{indice}"); + TextBox fi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); + if (xi != null && fi != null) { - if (control is Button btn) + xi.TextChanged += Par_TextChanged; + fi.TextChanged += Par_TextChanged; + ConfigurarValidacao(xi, false); + ConfigurarValidacao(fi, true); + } + // Configura o botão de remover se existir (exceto para o primeiro painel) + if (indice > 0) + { + var btn = GetRemoveButton(panel); + if (btn != null) { - btn.Visible = false; + btn.Click -= BtnRmvPar_Click; // Evita duplicação + btn.Click += BtnRmvPar_Click; } } + } - Button botaoRemover = new Button(); - - botaoRemover.Font = new Font("Arial", 10, FontStyle.Bold); - botaoRemover.ForeColor = Color.White; - botaoRemover.Size = new Size(30, 30); - botaoRemover.Location = new Point((PanelListaXiFi.Width - botaoRemover.Width) / 2, proximoXiFiY); - botaoRemover.BackColor = Color.Red; - botaoRemover.Image = Properties.Resources.Lixeira; - - botaoRemover.Click += (sender, e) => RemoverPar(novoXi, novoFi, botaoRemover); - botaoRemover.Visible = true; - - if (listaXiFi.Count < 5) - { - - PanelListaXiFi.Controls.Add(novoXi); - PanelListaXiFi.Controls.Add(novoFi); - PanelListaXiFi.Controls.Add(botaoRemover); + private ReaLTaiizor.Controls.Button GetRemoveButton(Panel par) + { + int indice = ObterIndice(par.Name); + // Para o primeiro painel, não existe botão de remover + if (indice == 0) + return null; + // Procura o botão pelo nome + return par.Controls.OfType() + .FirstOrDefault(b => b.Name == $"btnRmvPar{indice}"); + } - listaXi.Add(novoXi); - listaFi.Add(novoFi); - listaXiFi.Add((novoXi, novoFi, botaoRemover)); + private bool ParPreenchido(Panel panel) + { + string indice = ObterIndice(panel.Name).ToString(); + TextBox xi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Xi{indice}"); + TextBox fi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); + return !string.IsNullOrWhiteSpace(xi?.Text) && + !string.IsNullOrWhiteSpace(fi?.Text); + } - proximoXiFiY += 30; - PanelListaXiFi.ScrollControlIntoView(novoXi); - } - else + private void MostrarPar(int indice) + { + if (indice < 0 || indice >= _painelPares.Count) return; + Panel panel = _painelPares[indice]; + panel.Visible = true; + panel.Enabled = true; + // Garante que o botão de remover esteja oculto inicialmente + var btn = GetRemoveButton(panel); + if (btn != null) { - MessageBox.Show("Limite de pares Xi-Fi atingido."); + btn.Visible = false; + btn.Enabled = false; } + flowLayoutPanelPares.ScrollControlIntoView(panel); + // Força a atualização dos botões após mostrar o painel + AtualizarBotoes(); } - private void RemoverPar(TextBox xi, TextBox fi, Button botao) + private void AtualizarBotoes() { - if (!PanelListaXiFi.Controls.Contains(botao)) + // Obtém todos os painéis visíveis em ordem + var paineisVisiveis = _painelPares + .Where(p => p.Visible) + .OrderBy(p => ObterIndice(p.Name)) + .ToList(); + // Se não há painéis visíveis, esconde todos os botões + if (!paineisVisiveis.Any()) { - MessageBox.Show("O botão não foi encontrado no painel."); + foreach (var panel in _painelPares) + { + var btn = GetRemoveButton(panel); + if (btn != null) + { + btn.Visible = false; + btn.Enabled = false; + } + } + btnAdicionarNovoPar.Visible = false; return; } - - PanelListaXiFi.Controls.Remove(xi); - PanelListaXiFi.Controls.Remove(fi); - PanelListaXiFi.Controls.Remove(botao); - - listaXi.Remove(xi); - listaFi.Remove(fi); - listaXiFi.RemoveAll(par => par.Xi == xi && par.Fi == fi && par.BotaoRemover == botao); - - if (listaXiFi.Count > 0) + // Obtém o último painel visível + var ultimoPar = paineisVisiveis.Last(); + int indiceUltimo = ObterIndice(ultimoPar.Name); + // Atualiza todos os botões de remover + foreach (var panel in _painelPares) { - var parAnterior = listaXiFi.Last(); - parAnterior.BotaoRemover.Visible = true; + var btn = GetRemoveButton(panel); + if (btn == null) continue; + // Só mostra o botão se: + // 1. For o último painel visível + // 2. Houver mais de um painel visível + // 3. O painel estiver visível + bool deveMostrar = (panel == ultimoPar) && + (paineisVisiveis.Count > 1) && + panel.Visible; + btn.Visible = deveMostrar; + btn.Enabled = deveMostrar; } - - proximoXiFiY -= 30; + // Atualiza botão de adição + bool podeAdicionar = !chkParesAuto.Checked && indiceUltimo < _painelPares.Count - 1; + btnAdicionarNovoPar.Visible = podeAdicionar; + btnAdicionarNovoPar.Enabled = podeAdicionar; } - private TextBox CopiarConfiguracao(TextBox modelo) + private void Par_TextChanged(object sender, EventArgs e) { - return new TextBox + if (chkParesAuto.Checked) { - Width = modelo.Width, - Height = modelo.Height, - Size = modelo.Size, - Font = modelo.Font, - TextAlign = modelo.TextAlign - }; + for (int i = 0; i < _painelPares.Count - 1; i++) + { + if (_painelPares[i].Visible && + ParPreenchido(_painelPares[i]) && + !_painelPares[i + 1].Visible) + { + MostrarPar(i + 1); + break; + } + } + } + AtualizarBotoes(); } - #endregion - #region Eventos de Tecla e Scroll - private void NovoXi_KeyDown(object? sender, KeyEventArgs e) + private void RemoverUltimoPar() { - if (e.Control && e.KeyCode == Keys.V) + Panel ultimoPar = _painelPares.LastOrDefault(p => p.Visible); + if (ultimoPar == null) return; + // Limpa os campos antes de esconder + var textBoxes = ultimoPar.Controls.OfType(); + foreach (var tb in textBoxes) { - e.SuppressKeyPress = true; + tb.Clear(); } + ultimoPar.Visible = false; + ultimoPar.Enabled = false; + // Força a atualização dos botões após remover + AtualizarBotoes(); } - private void NovoXi_KeyPress(object? sender, KeyPressEventArgs e) + private void btnAdicionarNovoPar_Click(object sender, EventArgs e) { - if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar)) + // Procuramos o primeiro par oculto que pode ser ativado + for (int i = 0; i < _painelPares.Count - 1; i++) { - e.Handled = true; + Panel parAtual = _painelPares[i]; + Panel proximoPar = _painelPares[i + 1]; + // Verifica: + // 1. O par atual está visível + // 2. Está preenchido (Xi e Fi não vazios) + // 3. O próximo par ainda está oculto + if (parAtual.Visible && + ParPreenchido(parAtual) && + !proximoPar.Visible) + { + MostrarPar(i + 1); + return; + } } + // Se chegou aqui, não há par para adicionar + MessageBox.Show( + "Todos os pares já foram adicionados ou o par anterior não está completo.", + "Aviso", + MessageBoxButtons.OK, + MessageBoxIcon.Information + ); } - private void XiFi_KeyDown(object sender, KeyEventArgs e) + private void BtnRmvPar_Click(object sender, EventArgs e) { - // Bloqueia Ctrl+V e Shift+Insert - if ((e.Control && e.KeyCode == Keys.V) || (e.Shift && e.KeyCode == Keys.Insert)) - { - e.SuppressKeyPress = true; - e.Handled = true; - } - + RemoverUltimoPar(); } + #endregion - private void XiFi_KeyPress(object sender, KeyPressEventArgs e) + #region Validação e Eventos de Entrada (Teclado, TextChanged) + private void ConfigurarValidacao(TextBox tb, bool ehFi) { - char tecla = e.KeyChar; - - if (char.IsControl(tecla)) - return; - - TextBox textBox = sender as TextBox; - if (textBox == null) return; - - bool ValidarFi = textBox.Name.StartsWith("Fi"); - - // ----------- CAMPO Fi: só números inteiros > 0 ----------- - if (ValidarFi) + tb.KeyPress += (s, e) => { - if (!char.IsDigit(tecla)) - { - e.Handled = true; - return; - } - - // Simula o texto final com a nova tecla inserida - string textofinal = textBox.Text.Insert(textBox.SelectionStart, tecla.ToString()); - - // Bloqueia '0' como primeiro caractere - if (textofinal.StartsWith("0") && textofinal.Length == 1) + char tecla = e.KeyChar; + if (char.IsControl(tecla)) return; + if (ehFi) { - e.Handled = true; - return; + if (!char.IsDigit(tecla)) + { + e.Handled = true; + return; + } + string textoFinal = tb.Text.Insert(tb.SelectionStart, tecla.ToString()); + if (textoFinal.StartsWith("0") && textoFinal.Length > 1) + e.Handled = true; } - - return; - } - - // ----------- CAMPO Xi: números com vírgula decimal ----------- - - // Permite números - if (char.IsDigit(tecla)) - { - // Bloqueia se primeiro caractere for '0' sozinho (sem vírgula) - string textofinal = textBox.Text.Insert(textBox.SelectionStart, tecla.ToString()); - if (textofinal.StartsWith("0") && !textofinal.StartsWith("0,") && textofinal.Length == 1) + else { + if (char.IsDigit(tecla)) + { + string textoFinal = tb.Text.Insert(tb.SelectionStart, tecla.ToString()); + if (textoFinal.StartsWith("0") && !textoFinal.StartsWith("0,") && textoFinal.Length == 1) + e.Handled = true; + return; + } + if (tecla == ',') + { + if (tb.Text.Contains(',') || tb.SelectionStart == 0) + e.Handled = true; + return; + } e.Handled = true; } - - return; - } - - // Permite apenas uma vírgula e não como primeiro caractere - if (tecla == ',') + }; + tb.KeyDown += (s, e) => { - if (textBox.Text.Contains(',') || textBox.SelectionStart == 0) + if ((e.Control && e.KeyCode == Keys.V) || (e.Shift && e.KeyCode == Keys.Insert)) { + e.SuppressKeyPress = true; e.Handled = true; } - - return; - } - - // Qualquer outro caractere é bloqueado - e.Handled = true; + }; } - private void BotaoProximoPassoVAC_Click(object sender, EventArgs e) + private void DesativarMenuContexto(Control controle) { - _gerenciadorTelas.MostrarTela("Variação Aleatória Contínua"); + foreach (Control c in controle.Controls) + { + if (c is TextBox) + c.ContextMenuStrip = new ContextMenuStrip(); + if (c.HasChildren) + DesativarMenuContexto(c); + } } - #endregion - #region Verificações - private void VerificacaoNovoPar(Object sender, EventArgs e) + #region Cálculos Estatísticos + public (double media, double variancia, double desvio, double cv, double somaFi, string passosMedia, string passosVariancia, string passosDesvio, string passosCv) CalcularEstatisticas() { - var ultimoXi = listaXi[listaXi.Count - 1]; - var ultimoFi = listaFi[listaFi.Count - 1]; - - bool podeAdicionar = false; - - var cultura = new CultureInfo("pt-BR"); - - if (double.TryParse(ultimoXi.Text, NumberStyles.Any, cultura, out double valorXi) && int.TryParse(ultimoFi.Text, out int valorFi)) + var dados = new List(); // Lista de valores considerando Fi ou lista em TextBox + double somaFi = 0; + if (!TglBtnListaOuFila.Checked) // Padrão: calcular pelos pares Xi/Fi { - if (valorXi > 0 && valorFi > 0) + foreach (Panel panel in _painelPares) { - podeAdicionar = true; - } - - if (podeAdicionar && !DeveAdicionarNovoPar) - { - podeAdicionar = false; - - if (listaXiFi.Count + 1 < 5) + if (!panel.Visible) continue; + string indice = ObterIndice(panel.Name).ToString(); + TextBox xiTxt = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Xi{indice}"); + TextBox fiTxt = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); + if (xiTxt == null || fiTxt == null) continue; + if (string.IsNullOrWhiteSpace(xiTxt.Text) || string.IsNullOrWhiteSpace(fiTxt.Text)) continue; + if (double.TryParse(xiTxt.Text, NumberStyles.Any, new CultureInfo("pt-BR"), out double xi) && + int.TryParse(fiTxt.Text, out int fi) && fi > 0) { - AdicionarNovoPar(); + for (int i = 0; i < fi; i++) + dados.Add(xi); // Repete Xi Fi vezes + somaFi += fi; } - - else + } + } + else // Toggle marcado: calcular baseado na TextBox com valores separados + { + string texto = txtboxFilaExp.Text.Trim(); + if (string.IsNullOrEmpty(texto)) + return (0, 0, 0, 0, 0, "Nenhum dado válido encontrado. Preencha pelo menos um par!", "", "", ""); + // Substitui tabs e espaços por ';' + texto = texto.Replace("\t", ";").Replace(" ", ";"); + // Permite tanto ';' quanto '-' como separadores + string[] tokens = texto.Split(new[] { ';', '-' }, StringSplitOptions.RemoveEmptyEntries); + foreach (string t in tokens) + { + if (double.TryParse(t.Trim(), NumberStyles.Any, new CultureInfo("pt-BR"), out double valor)) { - MessageBox.Show("Limite de inserção de pares Xi e Fi alcançados."); // Corrigir para não aparecer a cada modificação + dados.Add(valor); } } + somaFi = dados.Count; } + // Verifica se há dados + if (somaFi == 0) + { + return (0, 0, 0, 0, 0, + "Nenhum dado válido encontrado. Preencha pelo menos um valor!", + "", "", ""); + } + // Cálculos + double media = dados.Average(); + double somaQuadrados = dados.Sum(x => Math.Pow(x - media, 2)); + double variancia = somaQuadrados / somaFi; + double desvio = Math.Sqrt(variancia); + double cv = (media != 0) + ? (desvio / media) * 100 + : 0; + // Passos + string passosMedia = $@" +📌 **Passo 1: Lista de Valores** +→ {string.Join(" ; ", dados.Select(d => d.ToString("F2")))} +📌 **Passo 2: Calcular Média** +→ x̄ = ΣXi / n +→ x̄ = {string.Join(" + ", dados.Select(d => d.ToString("F2")))} / {somaFi} = {media:F2} +".Trim(); + string passosVariancia = $@" +📌 **Passo 1: Média (x̄)** +→ x̄ = {media:F2} +📌 **Passo 2: Calcular Σ(Xi - x̄)²** +→ Para cada valor: +{string.Join("\n", dados.Select(d => $"→ ({d:F2} - {media:F2})² = {Math.Pow(d - media, 2):F2}"))} +→ Soma = {somaQuadrados:F2} +📌 **Passo 3: Variância** +→ σ² = Σ(Xi - x̄)² / n +→ σ² = {somaQuadrados:F2} / {somaFi} = {variancia:F2} +".Trim(); + string passosDesvio = $@" +📌 **Passo 1: Variância (σ²)** +→ σ² = {variancia:F2} +📌 **Passo 2: Desvio Padrão** +→ σ = √σ² +→ σ = √{variancia:F2} = {desvio:F2} +".Trim(); + string passosCv = GerarPassosCV(desvio, media, cv); + return (media, variancia, desvio, cv, somaFi, passosMedia, passosVariancia, passosDesvio, passosCv); } - private void DesativarMenuContexto(Control controle) + private string GerarPassosCV(double desvio, double media, double cv) { - foreach (Control c in controle.Controls) + if (media == 0) { - if (c is TextBox) - c.ContextMenuStrip = new ContextMenuStrip(); - - if (c.HasChildren) - DesativarMenuContexto(c); + return @" +📌 **Coeficiente de Variação (CV)** +→ CV = (σ / x̄) × 100% +→ Como a média é zero, o CV não pode ser calculado. +→ O CV é indefinido quando a média é zero. +".Trim(); } + string interpretacao = cv switch + { + < 15 => "Baixa dispersão (CV < 15%): Os dados são homogêneos.", + < 30 => "Média dispersão (15% ≤ CV < 30%): Dispersão moderada.", + < 50 => "Alta dispersão (30% ≤ CV < 50%): Os dados são heterogêneos.", + _ => "Muito alta dispersão (CV ≥ 50%): Grande variabilidade nos dados." + }; + return $@" +📌 **Passo 1: Desvio Padrão (σ)** +→ σ = {desvio:F2} +📌 **Passo 2: Média (x̄)** +→ x̄ = {media:F2} +📌 **Passo 3: Coeficiente de Variação (CV)** +→ CV = (σ / x̄) × 100% +→ CV = ({desvio:F2} / {media:F2}) × 100% +→ CV = {cv:F2}% +📌 **Interpretação do CV:** +→ {interpretacao} +".Trim(); } + + + + + + #endregion - #region Backend: Estatísticas, Fila, Cálculo + #region Exibição de Resultados e Navegação private void AdicionarFila_Click(object sender, EventArgs e) { var resultados = CalcularEstatisticas(); - - - if (double.IsNaN(resultados.media) || double.IsNaN(resultados.variancia) || double.IsNaN(resultados.desvio)) + if (double.IsNaN(resultados.media) || double.IsNaN(resultados.variancia) || double.IsNaN(resultados.desvio) || double.IsNaN(resultados.cv)) { MessageBox.Show("Não é possível calcular as estatísticas sem os dados fornecidos.", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } - - InicializarSequenciaGeral(resultados.passosMedia, resultados.passosVariancia, resultados.passosDesvio, resultados.media.ToString("F2"), resultados.variancia.ToString("F2"), resultados.desvio.ToString("F2")); - + InicializarSequenciaGeral( + resultados.passosMedia, + resultados.passosVariancia, + resultados.passosDesvio, + resultados.passosCv, + resultados.media.ToString("F2"), + resultados.variancia.ToString("F2"), + resultados.desvio.ToString("F2"), + resultados.cv.ToString("F2") + ); try { - List<(double Xi, int Fi)> valores = ObterValoresXiFi(); - string fila = FilaExpandida(valores); - FilaExpandidaLabel.Text = fila; - RedimensaoFilaExpandida(); + string fila; + if (TglBtnListaOuFila.Checked) + { + // Já usa o que o usuário digitou no txtboxFilaExp + fila = txtboxFilaExp.Text; + } + else + { + // Constrói a lista expandida a partir de Xi/Fi + List<(double Xi, int Fi)> valores = ObterValoresXiFi(); + fila = FilaExpandida(valores); + txtboxFilaExp.Text = fila; // mantém sincronizado + } } catch (FormatException ex) { @@ -324,237 +496,434 @@ private void AdicionarFila_Click(object sender, EventArgs e) BotaoProximoPassoVAC.Visible = true; } - public (double media, double variancia, double desvio, double somaFi, string passosMedia, string passosVariancia, string passosDesvio) CalcularEstatisticas() + private List<(double Xi, int Fi)> ObterValoresXiFi() { - List xi = new List(); - List fi = new List(); - - double somaFi = 0; - double MultiplicacaoXiFi = 0; - - for (int i = 0; i < listaXi.Count; i++) // este if tem a função + var valores = new List<(double Xi, int Fi)>(); + foreach (Panel panel in _painelPares) { - if (double.TryParse(listaXi[i].Text, out double valorXi) && int.TryParse(listaFi[i].Text, out int valorFi)) // este if serve + if (!panel.Visible) continue; + string indice = ObterIndice(panel.Name).ToString(); + TextBox xiTxt = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Xi{indice}"); + TextBox fiTxt = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); + if (xiTxt == null || fiTxt == null) continue; + if (string.IsNullOrWhiteSpace(xiTxt.Text) || string.IsNullOrWhiteSpace(fiTxt.Text)) continue; + if (double.TryParse(xiTxt.Text, NumberStyles.Any, new CultureInfo("pt-BR"), out double xi) && + int.TryParse(fiTxt.Text, out int fi) && fi > 0) { - xi.Add(valorXi); - fi.Add(valorFi); - somaFi += valorFi; - MultiplicacaoXiFi += valorXi * valorFi; + valores.Add((xi, fi)); + } + else + { + throw new FormatException("Os valores de Xi e Fi devem ser números válidos!"); } } + return valores; + } - double media = MultiplicacaoXiFi / somaFi; - - double somaQuadrados = 0; - - for (int i = 0; i < xi.Count; i++) + private void InicializarSequenciaGeral(string passosMedia, string passosVariancia, string passosDesvio, string passosCv, string resultadoMedia, string resultadoVariancia, string resultadoDesvio, string resultadoCv) + { + textosSequenciais = new List { passosMedia, passosVariancia, passosDesvio, passosCv }; + resultadosSequenciais = new List { resultadoMedia, resultadoVariancia, resultadoDesvio, resultadoCv }; + titulosSequenciais = new List { - somaQuadrados += fi[i] * Math.Pow(xi[i] - media, 2); - } - - double variancia = somaQuadrados / somaFi; - double desvio = Math.Sqrt(variancia); - - string passosMedia = - $"📌 Passo 1: Calcular a soma de Xi · Fi\n" + - $"→ Para cada linha, multiplique o valor de Xi pela sua frequência Fi.\n" + - $"→ Depois, some esses produtos. Isso é a soma de todos os valores.\n" + - $"→ Soma (Xi · Fi) = {MultiplicacaoXiFi}\n\n" + - - $"📌 Passo 2: Calcular a soma das frequências Fi\n" + - $"→ Some todas as frequências (Fi) da sua tabela. Isso representa o número total de elementos (ou observações) no seu conjunto de dados (N).\n" + - $"→ Soma Fi = {somaFi}\n\n" + - - $"📌 Passo 3: Aplicar a fórmula da média ponderada\n" + - $"→ A média (x̄) é obtida dividindo-se a soma dos produtos (Xi · Fi) pelo número total de frequências (ΣFi).\n" + - $"→ Exemplo: x̄ = {MultiplicacaoXiFi} / {somaFi} = {media:F2}"; - - string passosVar = - $"📌 Passo 1: Calcular a média\n" + - $"→ Primeiro, você precisa da média (x̄) do seu conjunto de dados. Ela serve como o ponto de referência para medir a dispersão.\n" + - $"→ Média (x̄) = {media:F2}\n\n" + - - $"📌 Passo 2: Calcular a soma de Fi · (Xi - x̄)²\n" + - $"→ Para cada linha da sua tabela:\n" + - $" a. Subtraia a média (x̄) de cada valor (Xi): (Xi - x̄).\n" + - $" b. Eleve esse resultado ao quadrado para eliminar valores negativos e dar maior peso a desvios maiores: (Xi - x̄)².\n" + - $" c. Multiplique esse quadrado pela frequência correspondente (Fi): Fi · (Xi - x̄)².\n" + - $"→ Por fim, some todos esses resultados. Essa soma é a soma dos desvios quadrados ponderados pela frequência.\n" + - $"→ Soma = {somaQuadrados:F2}\n\n" + - - $"📌 Passo 3: Aplicar a fórmula da variância\n" + - $"→ A variância é calculada dividindo a soma obtida no Passo 2 pelo número total de frequências (N = ΣFi).\n" + - $"→ Fórmula: Variância = (ΣFi · (Xi - x̄)²) / (ΣFi)\n" + - $"→ Exemplo: Variância = {somaQuadrados:F2} / {somaFi} = {variancia:F2}"; - - string passosDesvio = - $"📌 Passo 1: Calcular a variância\n" + - $"→ O desvio padrão é diretamente derivado da variância, então você precisa ter a variância (σ²) calculada primeiro.\n" + - $"→ Variância = {variancia:F2}\n\n" + - - $"📌 Passo 2: Aplicar a fórmula do desvio padrão\n" + - $"→ Calcule a raiz quadrada da variância.\n" + - $"→ Fórmula: Desvio Padrão = √Variância\n" + - $"→ Exemplo: Desvio Padrão = √{variancia:F2} = {Math.Sqrt(variancia):F2}"; - - return (media, variancia, desvio, somaFi, passosMedia, passosVar, passosDesvio); + "Média: x̄ = (ΣXi·Fi) / ΣFi", + "Variância: s² = ΣFi·(Xi - x̄)² / ΣFi", + "Desvio Padrão: s = √s²", + "Coeficiente de Variação: CV = (σ / x̄) × 100%" + }; + indiceAtualGeral = 0; + AtualizarExibicaoResultado(); } - private void NavegarGeral(bool proximo) + private void AtualizarExibicaoResultado() { - if (textosSequenciais == null || titulosSequenciais == null) return; - - int total = Math.Min(textosSequenciais.Count, titulosSequenciais.Count); - - if (proximo) - indiceAtualGeral = (indiceAtualGeral + 1) % total; - else - indiceAtualGeral = (indiceAtualGeral - 1 + total) % total; - + if (textosSequenciais == null || titulosSequenciais == null || resultadosSequenciais == null) + return; lbPassosGeral.Text = textosSequenciais[indiceAtualGeral]; lbTituloGeral.Text = titulosSequenciais[indiceAtualGeral]; lbResultadoGeral.Text = resultadosSequenciais[indiceAtualGeral]; } - private void InicializarSequenciaGeral(string passosMedia, string passosVariancia, string passosDesvio, string resultadoMedia, string resultadoVariancia, string resultadoDesvio) + private void NavegarGeral(bool proximo) { - textosSequenciais = new List { passosMedia, passosVariancia, passosDesvio }; - - resultadosSequenciais = new List { resultadoMedia, resultadoVariancia, resultadoDesvio }; + if (textosSequenciais == null || titulosSequenciais == null) return; + int total = Math.Min(textosSequenciais.Count, titulosSequenciais.Count); + indiceAtualGeral = proximo + ? (indiceAtualGeral + 1) % total + : (indiceAtualGeral - 1 + total) % total; + AtualizarExibicaoResultado(); + } - titulosSequenciais = new List + private void LimparCamposDeTexto(Control parent) + { + foreach (Control c in parent.Controls) { - "Média: x̄ = (ΣXi·Fi) / ΣFi", - "Variância: σ² = ΣFi·(Xi - x̄)² / ΣFi", - "Desvio Padrão: σ = √σ²" - }; - - indiceAtualGeral = 0; - - lbPassosGeral.Text = textosSequenciais[indiceAtualGeral]; - lbTituloGeral.Text = titulosSequenciais[indiceAtualGeral]; - lbResultadoGeral.Text = resultadosSequenciais[indiceAtualGeral]; // Só se você quiser exibir isso + // TextBox normal ou RichTextBox + if (c is TextBox || c is RichTextBox) + { + c.Text = string.Empty; + } + else + { + // Verifica se o controle possui a propriedade "Text" (para controles customizados) + var prop = c.GetType().GetProperty("Text"); + if (prop != null && prop.CanWrite) + { + prop.SetValue(c, string.Empty); + } + } + // Se tiver controles filhos, aplica recursivamente + if (c.HasChildren) + { + LimparCamposDeTexto(c); + } + } } + private void btnProxTxt_Click(object sender, EventArgs e) => NavegarGeral(true); + private void btnAntTxt_Click(object sender, EventArgs e) => NavegarGeral(false); + #endregion + #region Manipulação de Dados (Fila Expandida) + private string FilaExpandida(List<(double Xi, int Fi)> pares) + { + var resultado = new List(); + foreach (var par in pares) + resultado.AddRange(Enumerable.Repeat(par.Xi.ToString(), par.Fi)); + return string.Join(" - ", resultado); + } + #endregion - private List<(double Xi, int Fi)> ObterValoresXiFi() + #region Navegação entre Telas + private void BotaoProximoPassoVAC_Click(object sender, EventArgs e) { - var valores = new List<(double Xi, int Fi)>(); + _gerenciadorTelas.MostrarTela("Variação Aleatória Contínua"); + } + #endregion - foreach (var (Xi, Fi, _) in listaXiFi.Prepend((Xi1, Fi1, null))) + #region Eventos de Interface (Não Funcionais / Em Teste) + private void TglBtnListaOuFila_CheckedChanged(object sender, EventArgs e) + { + // TODO: Implementar alternância entre visualização de lista e fila + // Atualmente não está funcionando corretamente + if (TglBtnListaOuFila.Checked) + { + flowLayoutPanelPares.Enabled = false; + txtboxFilaExp.Enabled = true; + btnValidarFilaExp.Enabled = TglBtnListaOuFila.Checked; + LimparCamposDeTexto(flowLayoutPanelPares); + } + else { - bool XiVazio = string.IsNullOrWhiteSpace(Xi.Text); - bool FiVazio = string.IsNullOrWhiteSpace(Fi.Text); + flowLayoutPanelPares.Enabled = true; + txtboxFilaExp.Enabled = false; + btnValidarFilaExp.Enabled = TglBtnListaOuFila.Checked; + txtboxFilaExp.Text = string.Empty; + } + } + #endregion + + #region Métodos Auxiliares + private int ObterIndice(string nome) + { + return int.Parse(new string(nome.Where(char.IsDigit).ToArray())); + } + #endregion - if (XiVazio && FiVazio) - break; + #region Validação de Dados + private string ValidarItemNumero(string item) + { + if (string.IsNullOrWhiteSpace(item)) + return "Item vazio ou com espaços."; + if (item == ",") + return "Vírgula sozinha (use um número como '0,5')."; + if (item.EndsWith(",")) + return $"Número incompleto: '{item}' (falta o decimal)."; + if (item.Count(c => c == ',') > 1) + return $"Múltiplas vírgulas: '{item}' (use apenas uma vírgula por número)."; + if (item.Contains(" ") && item.Contains(",")) + return $"Espaço dentro do número: '{item}' (não use espaço antes ou depois da vírgula)."; + if (item.Length > 1 && item.StartsWith("0") && char.IsDigit(item[1]) && !item.StartsWith("0,")) + return $"Zero à esquerda não permitido: '{item}' (use '1' em vez de '01')."; + if (!double.TryParse(item, NumberStyles.AllowDecimalPoint, new CultureInfo("pt-BR"), out _)) + return $"Não é um número válido: '{item}' (use formato brasileiro: 2,5)."; + if (double.TryParse(item, NumberStyles.Any, new CultureInfo("pt-BR"), out _)) + return null; + // Tenta converter com ponto (en-US) + if (double.TryParse(item, NumberStyles.Any, new CultureInfo("en-US"), out _)) + return null; + return $"Formato inválido: '{item}'. Use vírgula (1,5) ou ponto (1.5)."; + } - if (XiVazio || FiVazio) - continue; + private string ValidarItemNumero(string item, out string sugestao) + { + sugestao = null; + string erro = ValidarItemNumero(item); + if (erro != null) + { + // Gera sugestão baseada no erro + if (item == ",") + sugestao = "0,0"; + else if (item.EndsWith(",")) + sugestao = item + "0"; + else if (item.Count(c => c == ',') > 1) + sugestao = Regex.Replace(item, ",", (match) => match.Index == item.IndexOf(',') ? "," : ""); + else if (item.Contains(" ") && item.Contains(",")) + sugestao = item.Replace(" ", ""); + else if (item.Length > 1 && item.StartsWith("0") && char.IsDigit(item[1]) && !item.StartsWith("0,")) + sugestao = item.TrimStart('0'); + else if (item.Contains(".")) + sugestao = item.Replace(".", ","); + else + sugestao = "0"; + } + return erro; + } - if (double.TryParse(Xi.Text, out double valorXi) && int.TryParse(Fi.Text, out int valorFi)) + private bool ValidarLista(string texto, out string listaFormatada, out string erros, char separador = '-', int? minItens = null, int? maxItens = null) + { + listaFormatada = string.Empty; + erros = string.Empty; + var errosList = new List(); + if (string.IsNullOrWhiteSpace(texto)) + { + errosList.Add("O campo está vazio."); + erros = string.Join("\n→ ", errosList); + return false; + } + string[] valores = texto.Split(new[] { ';', '-' }, StringSplitOptions.RemoveEmptyEntries); + var numeros = new List(); + foreach (string v in valores) + { + string item = v.Trim(); + string erroItem = ValidarItemNumero(item, out string sugestao); + if (erroItem != null) { - valores.Add((valorXi, valorFi)); + // Adiciona a sugestão à mensagem de erro se disponível + string mensagemErro = erroItem; + if (!string.IsNullOrEmpty(sugestao)) + mensagemErro += $" Sugerido: '{sugestao}'"; + errosList.Add(mensagemErro); } else { - throw new FormatException("Os valores de Xi e Fi devem ser preenchidos com números válidos!"); + numeros.Add(item); } } - return valores; + // Se houver erros, retorna false com todos os detalhes + if (errosList.Count > 0) + { + erros = string.Join("\n→ ", errosList); + return false; + } + // Se não houver números válidos + if (numeros.Count == 0) + { + errosList.Add("Nenhum número válido foi encontrado."); + erros = string.Join("\n→ ", errosList); + return false; + } + // Validação de quantidade de itens + if (minItens.HasValue && numeros.Count < minItens) + errosList.Add($"Mínimo de {minItens} itens necessário(s). Encontrados: {numeros.Count}"); + if (maxItens.HasValue && numeros.Count > maxItens) + errosList.Add($"Máximo de {maxItens} itens permitido(s). Encontrados: {numeros.Count}"); + // Se houver erros de quantidade, retorna false + if (errosList.Count > 0) + { + erros = string.Join("\n→ ", errosList); + return false; + } + // Recria no formato padronizado: NÚMERO - NÚMERO - NÚMERO + listaFormatada = string.Join($" {separador} ", numeros); + erros = string.Empty; + return true; } - private void RedimensaoFilaExpandida() + private void AplicarCorrecoesAutomaticas(string texto) { - FilaExpandidaLabel.Width = PanelFilaExpandida.ClientSize.Width - 20; - FilaExpandidaLabel.Height = FilaExpandidaLabel.PreferredHeight + 10; - FilaExpandidaLabel.Padding = new Padding(5); - FilaExpandidaLabel.MaximumSize = new Size(PanelFilaExpandida.ClientSize.Width - 20, 0); - - if (FilaExpandidaLabel.Height > PanelFilaExpandida.ClientSize.Height) + string[] valores = texto.Split(new[] { ';', '-' }, StringSplitOptions.RemoveEmptyEntries); + var corrigidos = new List(); + foreach (string v in valores) { - PanelFilaExpandida.AutoScroll = true; + string item = v.Trim(); + ValidarItemNumero(item, out string sugestao); + if (sugestao != null) + { + corrigidos.Add(sugestao); + } + else + { + corrigidos.Add(item); + } } - - else + txtboxFilaExp.Text = string.Join(" - ", corrigidos); + // Revalida após correções + if (ValidarLista(txtboxFilaExp.Text, out string listaFormatada, out _)) { - PanelFilaExpandida.AutoScroll = false; + txtboxFilaExp.Text = listaFormatada; + MessageBox.Show("✅ Correções aplicadas com sucesso!", "Sucesso", + MessageBoxButtons.OK, MessageBoxIcon.Information); } - - FilaExpandidaLabel.TextAlign = ContentAlignment.TopLeft; } - private string FilaExpandida(List<(double Xi, int Fi)> pares) + private void btnValidarFilaExp_Click(object sender, EventArgs e) { - List Resultado = new List(); - - foreach (var par in pares) + if (ValidarLista(txtboxFilaExp.Text, out string listaFormatada, out string erros, + separador: '-', minItens: 2, maxItens: 10)) { - for (int i = 0; i < par.Fi; i++) + txtboxFilaExp.Text = listaFormatada; // força padronização + MessageBox.Show("✅ Lista válida e padronizada!", "Validação", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + else + { + // Verifica se há sugestões para oferecer correção automática + if (erros.Contains("Sugerido:")) { - Resultado.Add(par.Xi.ToString()); + var resultado = MessageBox.Show( + $"Corrija os seguintes erros:\n→ {erros}\n\nDeseja aplicar as sugestões automáticas?", + "Erros na lista", + MessageBoxButtons.YesNo, + MessageBoxIcon.Warning); + if (resultado == DialogResult.Yes) + { + AplicarCorrecoesAutomaticas(txtboxFilaExp.Text); + return; + } } + MessageBox.Show($"Corrija os seguintes erros:\n→ {erros}", + "Erro na lista", + MessageBoxButtons.OK, + MessageBoxIcon.Warning); } - return string.Join(" - ", Resultado); } #endregion - #region Ciclo de Vida da Tela - public void OnCarregar() + private void hopeBtnMetodoReverso_Click(object sender, EventArgs e) { - this.Visible = true; - this.BringToFront(); + pnModoReverso.Visible = true; + pnModoPadrao.Visible = false; } - public void OnDescarregar() + private void hopeBtnMetodoPadrao_Click(object sender, EventArgs e) { - this.Visible = false; - LimparRecursos(); + pnModoReverso.Visible = false; + pnModoPadrao.Visible = true; } - private void LimparRecursos() { } + private void btnCalcReverso_Click(object sender, EventArgs e) + { + if (string.IsNullOrWhiteSpace(txtBoxCvReverso.Text) || string.IsNullOrWhiteSpace(txtBoxMediaReverso.Text)) + { + MessageBox.Show("É necessário inserir valores para o Coeficiente de Variação e a Média!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } - public UserControl GetView() { return this; } + try + { + double cvReverso = double.Parse(txtBoxCvReverso.Text.Replace(",",".")); - private void TelaMediaPosicaoCentral_Load(object sender, EventArgs e) - { - RedimensaoFilaExpandida(); - DesativarMenuContexto(this); - } + double? mediaReversa = string.IsNullOrEmpty(txtBoxMediaReverso.Text) + ? null + : double.Parse(txtBoxMediaReverso.Text.Replace(",", ".")); - #endregion + double? varianciaReversa = string.IsNullOrEmpty(txtBoxDesvioReverso.Text) + ? null + : double.Parse(txtBoxDesvioReverso.Text.Replace(",", ".")); - private void btnProxTxt_Click(object sender, EventArgs e) - { - NavegarGeral(true); - } + double? desvioReverso = string.IsNullOrEmpty(txtBoxDesvioReverso.Text) + ? null + : double.Parse(txtBoxDesvioReverso.Text.Replace(",", ".")); - private void btnAntTxt_Click(object sender, EventArgs e) - { - NavegarGeral(false); + if (cvReverso <= 0 || (mediaReversa.HasValue && mediaReversa.Value <= 0)) + { + MessageBox.Show("O valor do Coeficiente de Variação e Média devem ser maior que zero!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + double mediaCalculadaReversa, desvioCalculadoReverso, varianciaCalculadaReversa; + + if (mediaReversa.HasValue) + { + mediaCalculadaReversa = mediaReversa.Value; + desvioCalculadoReverso = (cvReverso * mediaCalculadaReversa) / 100; + varianciaCalculadaReversa = Math.Pow(desvioCalculadoReverso, 2); + } + else if (varianciaReversa.HasValue) + { + varianciaCalculadaReversa = varianciaReversa.Value; + desvioCalculadoReverso = Math.Sqrt(varianciaCalculadaReversa); + mediaCalculadaReversa = (desvioCalculadoReverso * 100) / cvReverso; + } + else if (desvioReverso.HasValue) + { + desvioCalculadoReverso = desvioReverso.Value; + mediaCalculadaReversa = (desvioCalculadoReverso * 100) / cvReverso; + varianciaCalculadaReversa = Math.Pow(desvioCalculadoReverso, 2); + } + else + { + MessageBox.Show("Você deve fornecer pelo menos mais um parâmetro além do CV e Média", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + string passosReverso = GerarPassosReverso(cvReverso, mediaReversa, desvioReverso, varianciaReversa, mediaCalculadaReversa, desvioCalculadoReverso, varianciaCalculadaReversa); + + // Exibir resultados + lbPassosGeral.Text = $@" +Média: {mediaCalculadaReversa:F2} +Desvio Padrão: {desvioCalculadoReverso:F2} +Variância: {varianciaCalculadaReversa:F2} +CV: {cvReverso:F2}% + +{passosReverso} +"; + } + catch (Exception ex) + { + MessageBox.Show($"Erro: {ex.Message}", "Erro de Cálculo", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } - private void btnListaOuFila_CheckedChanged(object sender, EventArgs e) // não funciona, veriricar o por que isso ocore + private string GerarPassosReverso(double cvReverso, double? mediaReversa, double? desvioReverso, double? varianciaReversa, + double mediaCalculadaReversa, double desvioCalculadoReverso, double varianciaCalculadaReversa) { - if (btnListaOuFila.Checked) - { - Panel pnlBlock = new Panel(); - pnlBlock.Location = new Point(73, 168); - pnlBlock.Size = new Size(169, 172); - pnlBlock.BackColor = Color.FromArgb(60, 128, 128, 128); + StringBuilder sb = new StringBuilder(); + sb.AppendLine("\n📌 **Passos do Cálculo Reverso:**"); - this.Controls.Add(pnlBlock); + if (mediaReversa.HasValue) + { + sb.AppendLine($"1. Dados conhecidos: CV = {cvReverso:F2}%, Média = {mediaReversa:F2}"); + sb.AppendLine($"2. Cálculo do Desvio Padrão:"); + sb.AppendLine($" σ = (CV × x̄) / 100"); + sb.AppendLine($" σ = ({cvReverso:F2} × {mediaReversa:F2}) / 100 = {desvioCalculadoReverso:F2}"); + sb.AppendLine($"3. Cálculo da Variância:"); + sb.AppendLine($" σ² = σ² = {desvioCalculadoReverso:F2}² = {varianciaCalculadaReversa:F2}"); } - else + else if (desvioReverso.HasValue) { - RichTextBox txtFilaExpandida = new RichTextBox(); - txtFilaExpandida.Location = new Point(307, 168); - txtFilaExpandida.Size = new Size(300, 160); - - this.Controls.Add(txtFilaExpandida); + sb.AppendLine($"1. Dados conhecidos: CV = {cvReverso:F2}%, Desvio = {desvioReverso:F2}"); + sb.AppendLine($"2. Cálculo da Média:"); + sb.AppendLine($" x̄ = (σ × 100) / CV"); + sb.AppendLine($" x̄ = ({desvioReverso:F2} × 100) / {cvReverso:F2} = {mediaCalculadaReversa:F2}"); + sb.AppendLine($"3. Cálculo da Variância:"); + sb.AppendLine($" σ² = σ² = {desvioReverso:F2}² = {varianciaCalculadaReversa:F2}"); } + else if (varianciaReversa.HasValue) + { + sb.AppendLine($"1. Dados conhecidos: CV = {cvReverso:F2}%, Variância = {varianciaReversa:F2}"); + sb.AppendLine($"2. Cálculo do Desvio Padrão:"); + sb.AppendLine($" σ = √σ² = √{varianciaReversa:F2} = {desvioCalculadoReverso:F2}"); + sb.AppendLine($"3. Cálculo da Média:"); + sb.AppendLine($" x̄ = (σ × 100) / CV"); + sb.AppendLine($" x̄ = ({desvioCalculadoReverso:F2} × 100) / {cvReverso:F2} = {mediaCalculadaReversa:F2}"); + } + + sb.AppendLine("\n📌 **Fórmulas Utilizadas:**"); + sb.AppendLine("CV = (σ / x̄) × 100%"); + sb.AppendLine("σ = √σ²"); + sb.AppendLine("x̄ = (σ × 100) / CV"); + + return sb.ToString(); } } -} - +} \ No newline at end of file diff --git a/TelaMediaPosicaoCentral.resx b/TelaMediaPosicaoCentral.resx index 45739ae..6bf1b31 100644 --- a/TelaMediaPosicaoCentral.resx +++ b/TelaMediaPosicaoCentral.resx @@ -146,6 +146,47 @@ k+ruvLp2BF2xD+U9Eyma+/7hCsQU8UaFg1OLoK9DiielCBuT0bbAgZxiipAX+icVoHvslwt8GJFk7gpw ERE4MMWchL4DMY9pyJw80HdAiql/0YLmvnh6pE/FcXEZtaGMsmv0Y5Gi8soXDYe0E07RK0fcmfh2o2wb zDwW93fTtnD6lulP8AR0vfPhhzlYNgAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAAFlJREFUOE9jYEAC399/V/jy7vv9z2+//0fGIDGQHLJaBnRFxGLyNVIE0E0jhEc1 + 4sGjGvFgamj89h5dEhf+9Pb7fbjGT2++J4AE0BWh409vv73/8uZXPEgPADAoCyUr16wGAAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAAFlJREFUOE9jYEAC399/V/jy7vv9z2+//0fGIDGQHLJaBnRFxGLyNVIE0E0jhEc1 + 4sGjGvFgamj89h5dEhf+9Pb7fbjGT2++J4AE0BWh409vv73/8uZXPEgPADAoCyUr16wGAAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAAFlJREFUOE9jYEAC399/V/jy7vv9z2+//0fGIDGQHLJaBnRFxGLyNVIE0E0jhEc1 + 4sGjGvFgamj89h5dEhf+9Pb7fbjGT2++J4AE0BWh409vv73/8uZXPEgPADAoCyUr16wGAAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAAA4AAAASCAYAAABrXO8xAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAAFlJREFUOE9jYEAC399/V/jy7vv9z2+//0fGIDGQHLJaBnRFxGLyNVIE0E0jhEc1 + 4sGjGvFgamj89h5dEhf+9Pb7fbjGT2++J4AE0BWh409vv73/8uZXPEgPADAoCyUr16wGAAAAAElFTkSu + QmCC + + + + + iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAALGPC/xhBQAAAKxJREFUSEvt + lFkKg0AQRD2KR80N9GZ6owoFip2yN5OP+OEDYRiqt+rBYXi4PQBGABOABQc8825U/SUAzCZpxKRxLQCs + milh0fiUZufKrHlcNs8jXkXxeidZAqOJqKfIvDeaiHoXGkFbVLPjTauaExqQPcNvC/xi0fqZzcHrasdo + IlpLzp4pfw/8IupnSrIpEuruLdkuHGrvPZqTXOtc2XbCQnYinnnX8/zhr7wB2iz5UWChVYoAAAAASUVO + RK5CYII= \ No newline at end of file diff --git a/TelaVAC.cs b/TelaVAC.cs index 05567b6..b8d0e11 100644 --- a/TelaVAC.cs +++ b/TelaVAC.cs @@ -103,7 +103,7 @@ private void IconeImportarMedia_Click(object sender, EventArgs e) if (TelaMedia != null) { - var (media, _, _, _, _, _, _) = TelaMedia.CalcularEstatisticas(); + var (media, _, _, _, _, _, _, _, _) = TelaMedia.CalcularEstatisticas(); if (media == 0 || double.IsNaN(media)) { @@ -122,7 +122,7 @@ private void IconeImportarDesvio_Click(object sender, EventArgs e) if (TelaMedia != null) { - var (_, desvio, _, _, _, _, _) = TelaMedia.CalcularEstatisticas(); + var (_, desvio, _, _, _, _, _, _, _) = TelaMedia.CalcularEstatisticas(); if (desvio == 0 || double.IsNaN(desvio)) { @@ -140,7 +140,7 @@ private void IconeImportarAmostra_Click(object sender, EventArgs e) if (TelaMedia != null) { - var (_, _, _, somaFi, _, _, _) = TelaMedia.CalcularEstatisticas(); + var (_, _, _, _, somaFi, _, _, _, _) = TelaMedia.CalcularEstatisticas(); if (somaFi == 0 || double.IsNaN(somaFi)) { diff --git a/icons/Close.png b/icons/Close.png new file mode 100644 index 0000000000000000000000000000000000000000..ecac6f2b85cf030e717ddea7b434a6a46a21be3d GIT binary patch literal 385 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#VfT_7KQ`*nt&xgho-Z>KjJ~V%wa6dK=~f z`L`C_&lOBNd`vI#fgb0t<9@NOj!yPvSLV&O-a6sMLf^8odoc#B=R~!0pGN^5 z$KdJe=d#Wzp@~IMxc|nZ16!JJBpnD448OL(R6sUbU8CCXjdJYl?ne$=niUlu8M?U0 zEECx1uqX4HQ;vS`+XS7CH+L#}*e~+5HF6v`5KNR{U1Y_!p1eq&x)b8N^CG_eqkMFB_ UAh5%Rap}RtCVnni5oBiq06Ex~?*IS* literal 0 HcmV?d00001 diff --git a/icons/Plus.png b/icons/Plus.png new file mode 100644 index 0000000000000000000000000000000000000000..9f39d049728014407dd031db2204f895a6e1bbc5 GIT binary patch literal 385 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vfb1(OfL%E9^#n`W{ z_gww6$>`atoyupvyZNj1M@AH%oN=c0;iV~d7cS^lr5-VfboN|>r0#@x``j55*|Y@Km4*r4WM!1qq!Gd!2 Date: Sat, 6 Sep 2025 23:14:34 -0300 Subject: [PATCH 4/4] =?UTF-8?q?Corre=C3=A7=C3=B5es=20na=20interface=20e=20?= =?UTF-8?q?melhoria=20/=20limpeza=20no=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TelaInicial.cs | 2 +- TelaMediaPosicaoCentral.Designer.cs | 380 ++++++++++++-------------- TelaMediaPosicaoCentral.cs | 404 +++++++++++++++++++--------- TelaMediaPosicaoCentral.resx | 26 ++ eStats.csproj | 1 + 5 files changed, 473 insertions(+), 340 deletions(-) diff --git a/TelaInicial.cs b/TelaInicial.cs index 902655b..44477c6 100644 --- a/TelaInicial.cs +++ b/TelaInicial.cs @@ -121,7 +121,7 @@ private void TituloBoasVindas_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) { - _gerenciadorTelas.MostrarTela("Estatística Paramétrica"); + _gerenciadorTelas.MostrarTela("Média de Posição Central"); } } } diff --git a/TelaMediaPosicaoCentral.Designer.cs b/TelaMediaPosicaoCentral.Designer.cs index 570aa7b..9439340 100644 --- a/TelaMediaPosicaoCentral.Designer.cs +++ b/TelaMediaPosicaoCentral.Designer.cs @@ -31,8 +31,6 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TelaMediaPosicaoCentral)); lblTituloEstatPar = new Label(); lblDescTela = new Label(); - lblValorXI = new Label(); - lblValorFI = new Label(); lblFilaExpandida = new Label(); Fi1 = new TextBox(); Xi1 = new TextBox(); @@ -69,14 +67,6 @@ private void InitializeComponent() chkParesAuto = new CheckBox(); txtboxFilaExp = new ReaLTaiizor.Controls.DungeonRichTextBox(); btnValidarFilaExp = new Button(); - pnLinhaSeparar = new Panel(); - panel16 = new Panel(); - panel17 = new Panel(); - panel18 = new Panel(); - panel19 = new Panel(); - panel20 = new Panel(); - panel21 = new Panel(); - panel22 = new Panel(); txtBoxCvReverso = new TextBox(); lblChaveAPI = new Label(); label1 = new Label(); @@ -90,7 +80,13 @@ private void InitializeComponent() hopeBtnMetodoReverso = new ReaLTaiizor.Controls.HopeRoundButton(); hopeBtnMetodoPadrao = new ReaLTaiizor.Controls.HopeRoundButton(); pnModoReverso = new ReaLTaiizor.Controls.Panel(); + pnSubModoReverso = new ReaLTaiizor.Controls.Panel(); + lblCampoObrigatorio = new Label(); + label4 = new Label(); pnModoPadrao = new ReaLTaiizor.Controls.Panel(); + pnSubModoPadrao = new ReaLTaiizor.Controls.Panel(); + label2 = new Label(); + label3 = new Label(); pnResultadosEstatisticos.SuspendLayout(); flowLayoutPanelPares.SuspendLayout(); Par0.SuspendLayout(); @@ -98,12 +94,10 @@ private void InitializeComponent() Par2.SuspendLayout(); Par3.SuspendLayout(); Par4.SuspendLayout(); - pnLinhaSeparar.SuspendLayout(); - panel16.SuspendLayout(); - panel17.SuspendLayout(); - panel20.SuspendLayout(); pnModoReverso.SuspendLayout(); + pnSubModoReverso.SuspendLayout(); pnModoPadrao.SuspendLayout(); + pnSubModoPadrao.SuspendLayout(); SuspendLayout(); // // lblTituloEstatPar @@ -130,40 +124,16 @@ private void InitializeComponent() lblDescTela.Text = "Insira os valores da Frequência Acumulada (Xi) e Frequência Absoluta (Fi):"; lblDescTela.TextAlign = ContentAlignment.MiddleLeft; // - // lblValorXI - // - lblValorXI.Font = new Font("Berlin Sans FB", 14F); - lblValorXI.ForeColor = Color.White; - lblValorXI.Location = new Point(38, 5); - lblValorXI.Margin = new Padding(0); - lblValorXI.Name = "lblValorXI"; - lblValorXI.Size = new Size(35, 23); - lblValorXI.TabIndex = 8; - lblValorXI.Text = "Xi"; - lblValorXI.TextAlign = ContentAlignment.MiddleCenter; - // - // lblValorFI - // - lblValorFI.Font = new Font("Berlin Sans FB", 14F); - lblValorFI.ForeColor = Color.White; - lblValorFI.Location = new Point(133, 5); - lblValorFI.Margin = new Padding(0); - lblValorFI.Name = "lblValorFI"; - lblValorFI.Size = new Size(35, 23); - lblValorFI.TabIndex = 9; - lblValorFI.Text = "Fi"; - lblValorFI.TextAlign = ContentAlignment.MiddleCenter; - // // lblFilaExpandida // lblFilaExpandida.Font = new Font("Berlin Sans FB", 14F); lblFilaExpandida.ForeColor = Color.White; - lblFilaExpandida.Location = new Point(20, 277); + lblFilaExpandida.Location = new Point(192, 91); lblFilaExpandida.Margin = new Padding(0); lblFilaExpandida.Name = "lblFilaExpandida"; - lblFilaExpandida.Size = new Size(162, 28); + lblFilaExpandida.Size = new Size(33, 28); lblFilaExpandida.TabIndex = 12; - lblFilaExpandida.Text = "ou Fila Expandida:"; + lblFilaExpandida.Text = "ou"; lblFilaExpandida.TextAlign = ContentAlignment.MiddleCenter; // // Fi1 @@ -195,14 +165,14 @@ private void InitializeComponent() AdicionarFila.FlatAppearance.BorderColor = Color.FromArgb(79, 55, 139); AdicionarFila.FlatAppearance.BorderSize = 0; AdicionarFila.FlatStyle = FlatStyle.Flat; - AdicionarFila.Font = new Font("Segoe UI", 20F, FontStyle.Bold); + AdicionarFila.Font = new Font("Berlin Sans FB", 12F); AdicionarFila.ForeColor = Color.White; - AdicionarFila.Location = new Point(233, 193); + AdicionarFila.Location = new Point(231, 224); AdicionarFila.Margin = new Padding(0); AdicionarFila.Name = "AdicionarFila"; - AdicionarFila.Size = new Size(26, 52); + AdicionarFila.Size = new Size(156, 37); AdicionarFila.TabIndex = 15; - AdicionarFila.Text = ">"; + AdicionarFila.Text = "Realizar Cálculos"; AdicionarFila.UseVisualStyleBackColor = false; AdicionarFila.Click += AdicionarFila_Click; // @@ -221,12 +191,14 @@ private void InitializeComponent() // lbPassosGeral // lbPassosGeral.BackColor = Color.FromArgb(0, 0, 0, 0); - lbPassosGeral.Font = new Font("Segoe UI", 12F); + lbPassosGeral.Font = new Font("Berlin Sans FB", 10F); lbPassosGeral.ForeColor = Color.White; - lbPassosGeral.Location = new Point(34, 25); + lbPassosGeral.ImageAlign = ContentAlignment.MiddleLeft; + lbPassosGeral.Location = new Point(46, 48); lbPassosGeral.Name = "lbPassosGeral"; - lbPassosGeral.Size = new Size(469, 525); + lbPassosGeral.Size = new Size(443, 491); lbPassosGeral.TabIndex = 1; + lbPassosGeral.TextAlign = ContentAlignment.TopCenter; // // lbResultadoGeral // @@ -267,10 +239,10 @@ private void InitializeComponent() pnResultadosEstatisticos.Controls.Add(lbResultadoGeral); pnResultadosEstatisticos.Controls.Add(lbPassosGeral); pnResultadosEstatisticos.EdgeColor = Color.FromArgb(32, 41, 50); - pnResultadosEstatisticos.Location = new Point(724, 112); + pnResultadosEstatisticos.Location = new Point(739, 112); pnResultadosEstatisticos.Name = "pnResultadosEstatisticos"; pnResultadosEstatisticos.Padding = new Padding(5); - pnResultadosEstatisticos.Size = new Size(536, 574); + pnResultadosEstatisticos.Size = new Size(521, 574); pnResultadosEstatisticos.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; pnResultadosEstatisticos.TabIndex = 27; // @@ -302,7 +274,7 @@ private void InitializeComponent() btnProxTxt.Font = new Font("Segoe UI", 20F, FontStyle.Bold); btnProxTxt.ForeColor = Color.White; btnProxTxt.Image = (Image)resources.GetObject("btnProxTxt.Image"); - btnProxTxt.Location = new Point(505, 259); + btnProxTxt.Location = new Point(492, 259); btnProxTxt.Margin = new Padding(0); btnProxTxt.Name = "btnProxTxt"; btnProxTxt.Size = new Size(25, 24); @@ -312,26 +284,26 @@ private void InitializeComponent() // // lbTituloGeral // - lbTituloGeral.Font = new Font("Segoe UI", 15F, FontStyle.Bold); + lbTituloGeral.Font = new Font("Segoe UI", 14F, FontStyle.Bold); lbTituloGeral.ForeColor = Color.White; - lbTituloGeral.Location = new Point(111, 5); + lbTituloGeral.Location = new Point(34, 5); lbTituloGeral.Margin = new Padding(0); lbTituloGeral.Name = "lbTituloGeral"; - lbTituloGeral.Size = new Size(268, 30); + lbTituloGeral.Size = new Size(345, 30); lbTituloGeral.TabIndex = 28; lbTituloGeral.TextAlign = ContentAlignment.MiddleLeft; // // TglBtnListaOuFila // - TglBtnListaOuFila.BackColor = Color.FromArgb(57, 45, 120); - TglBtnListaOuFila.BaseColor = Color.FromArgb(57, 45, 120); + TglBtnListaOuFila.BackColor = Color.FromArgb(26, 31, 52); + TglBtnListaOuFila.BaseColor = Color.FromArgb(26, 31, 52); TglBtnListaOuFila.BaseColorA = Color.FromArgb(220, 223, 230); TglBtnListaOuFila.BaseColorB = Color.FromArgb(100, 64, 158, 255); TglBtnListaOuFila.HeadColorA = Color.FromArgb(220, 223, 230); TglBtnListaOuFila.HeadColorB = Color.White; TglBtnListaOuFila.HeadColorC = Color.FromArgb(64, 158, 255); TglBtnListaOuFila.HeadColorD = Color.FromArgb(64, 158, 255); - TglBtnListaOuFila.Location = new Point(195, 63); + TglBtnListaOuFila.Location = new Point(216, 185); TglBtnListaOuFila.Name = "TglBtnListaOuFila"; TglBtnListaOuFila.Size = new Size(48, 20); TglBtnListaOuFila.TabIndex = 28; @@ -343,9 +315,9 @@ private void InitializeComponent() lblModoFilaExpandida.BackColor = Color.FromArgb(0, 0, 0, 0); lblModoFilaExpandida.Font = new Font("Berlin Sans FB", 10F); lblModoFilaExpandida.ForeColor = Color.White; - lblModoFilaExpandida.Location = new Point(240, 54); + lblModoFilaExpandida.Location = new Point(261, 186); lblModoFilaExpandida.Name = "lblModoFilaExpandida"; - lblModoFilaExpandida.Size = new Size(78, 40); + lblModoFilaExpandida.Size = new Size(130, 18); lblModoFilaExpandida.TabIndex = 1; lblModoFilaExpandida.Text = "Modo Fila Expandida"; lblModoFilaExpandida.TextAlign = ContentAlignment.MiddleLeft; @@ -358,7 +330,7 @@ private void InitializeComponent() flowLayoutPanelPares.Controls.Add(Par3); flowLayoutPanelPares.Controls.Add(Par4); flowLayoutPanelPares.Controls.Add(btnAdicionarNovoPar); - flowLayoutPanelPares.Location = new Point(14, 31); + flowLayoutPanelPares.Location = new Point(10, 9); flowLayoutPanelPares.Name = "flowLayoutPanelPares"; flowLayoutPanelPares.Size = new Size(174, 237); flowLayoutPanelPares.TabIndex = 29; @@ -382,7 +354,7 @@ private void InitializeComponent() Xi0.Name = "Xi0"; Xi0.PlaceholderText = "Xi"; Xi0.Size = new Size(35, 23); - Xi0.TabIndex = 12; + Xi0.TabIndex = 10; Xi0.TextAlign = HorizontalAlignment.Center; // // Fi0 @@ -393,7 +365,7 @@ private void InitializeComponent() Fi0.Name = "Fi0"; Fi0.PlaceholderText = "Fi"; Fi0.Size = new Size(35, 23); - Fi0.TabIndex = 13; + Fi0.TabIndex = 11; Fi0.TextAlign = HorizontalAlignment.Center; // // Par1 @@ -474,7 +446,7 @@ private void InitializeComponent() Xi2.Name = "Xi2"; Xi2.PlaceholderText = "Xi"; Xi2.Size = new Size(35, 23); - Xi2.TabIndex = 12; + Xi2.TabIndex = 14; Xi2.TextAlign = HorizontalAlignment.Center; // // Fi2 @@ -485,7 +457,7 @@ private void InitializeComponent() Fi2.Name = "Fi2"; Fi2.PlaceholderText = "Fi"; Fi2.Size = new Size(35, 23); - Fi2.TabIndex = 13; + Fi2.TabIndex = 15; Fi2.TextAlign = HorizontalAlignment.Center; // // Par3 @@ -531,7 +503,7 @@ private void InitializeComponent() Xi3.Name = "Xi3"; Xi3.PlaceholderText = "Xi"; Xi3.Size = new Size(35, 23); - Xi3.TabIndex = 12; + Xi3.TabIndex = 16; Xi3.TextAlign = HorizontalAlignment.Center; // // Fi3 @@ -542,7 +514,7 @@ private void InitializeComponent() Fi3.Name = "Fi3"; Fi3.PlaceholderText = "Fi"; Fi3.Size = new Size(35, 23); - Fi3.TabIndex = 13; + Fi3.TabIndex = 17; Fi3.TextAlign = HorizontalAlignment.Center; // // Par4 @@ -588,7 +560,7 @@ private void InitializeComponent() Xi4.Name = "Xi4"; Xi4.PlaceholderText = "Xi"; Xi4.Size = new Size(35, 23); - Xi4.TabIndex = 12; + Xi4.TabIndex = 18; Xi4.TextAlign = HorizontalAlignment.Center; // // Fi4 @@ -599,7 +571,7 @@ private void InitializeComponent() Fi4.Name = "Fi4"; Fi4.PlaceholderText = "Fi"; Fi4.Size = new Size(35, 23); - Fi4.TabIndex = 13; + Fi4.TabIndex = 19; Fi4.TextAlign = HorizontalAlignment.Center; // // btnAdicionarNovoPar @@ -621,7 +593,7 @@ private void InitializeComponent() chkParesAuto.CheckState = CheckState.Checked; chkParesAuto.Font = new Font("Berlin Sans FB", 10F); chkParesAuto.ForeColor = Color.White; - chkParesAuto.Location = new Point(200, 31); + chkParesAuto.Location = new Point(15, 251); chkParesAuto.Name = "chkParesAuto"; chkParesAuto.Size = new Size(111, 20); chkParesAuto.TabIndex = 31; @@ -637,106 +609,27 @@ private void InitializeComponent() txtboxFilaExp.Enabled = false; txtboxFilaExp.Font = new Font("Tahoma", 10F); txtboxFilaExp.ForeColor = Color.FromArgb(76, 76, 76); - txtboxFilaExp.Location = new Point(14, 315); + txtboxFilaExp.Location = new Point(231, 11); txtboxFilaExp.Name = "txtboxFilaExp"; txtboxFilaExp.ReadOnly = false; - txtboxFilaExp.Size = new Size(172, 131); + txtboxFilaExp.Size = new Size(155, 131); txtboxFilaExp.TabIndex = 32; txtboxFilaExp.TextBackColor = Color.White; txtboxFilaExp.WordWrap = true; // // btnValidarFilaExp // - btnValidarFilaExp.Location = new Point(44, 456); + btnValidarFilaExp.Location = new Point(231, 149); btnValidarFilaExp.Name = "btnValidarFilaExp"; - btnValidarFilaExp.Size = new Size(112, 41); + btnValidarFilaExp.Size = new Size(155, 27); btnValidarFilaExp.TabIndex = 33; btnValidarFilaExp.Text = "Validar Lista"; btnValidarFilaExp.UseVisualStyleBackColor = true; btnValidarFilaExp.Click += btnValidarFilaExp_Click; // - // pnLinhaSeparar - // - pnLinhaSeparar.BackColor = Color.White; - pnLinhaSeparar.Controls.Add(panel16); - pnLinhaSeparar.Controls.Add(panel20); - pnLinhaSeparar.Controls.Add(panel22); - pnLinhaSeparar.Location = new Point(389, 196); - pnLinhaSeparar.Margin = new Padding(3, 2, 3, 2); - pnLinhaSeparar.Name = "pnLinhaSeparar"; - pnLinhaSeparar.Size = new Size(1, 420); - pnLinhaSeparar.TabIndex = 34; - // - // panel16 - // - panel16.BackColor = Color.White; - panel16.Controls.Add(panel17); - panel16.Controls.Add(panel19); - panel16.Location = new Point(19, 2); - panel16.Margin = new Padding(3, 2, 3, 2); - panel16.Name = "panel16"; - panel16.Size = new Size(18, 2); - panel16.TabIndex = 9; - // - // panel17 - // - panel17.BackColor = Color.White; - panel17.Controls.Add(panel18); - panel17.Location = new Point(24, 0); - panel17.Margin = new Padding(3, 2, 3, 2); - panel17.Name = "panel17"; - panel17.Size = new Size(18, 2); - panel17.TabIndex = 8; - // - // panel18 - // - panel18.BackColor = Color.White; - panel18.Location = new Point(102, 0); - panel18.Margin = new Padding(3, 2, 3, 2); - panel18.Name = "panel18"; - panel18.Size = new Size(18, 2); - panel18.TabIndex = 7; - // - // panel19 - // - panel19.BackColor = Color.White; - panel19.Location = new Point(102, 0); - panel19.Margin = new Padding(3, 2, 3, 2); - panel19.Name = "panel19"; - panel19.Size = new Size(18, 2); - panel19.TabIndex = 7; - // - // panel20 - // - panel20.BackColor = Color.White; - panel20.Controls.Add(panel21); - panel20.Location = new Point(24, 0); - panel20.Margin = new Padding(3, 2, 3, 2); - panel20.Name = "panel20"; - panel20.Size = new Size(18, 2); - panel20.TabIndex = 8; - // - // panel21 - // - panel21.BackColor = Color.White; - panel21.Location = new Point(102, 0); - panel21.Margin = new Padding(3, 2, 3, 2); - panel21.Name = "panel21"; - panel21.Size = new Size(18, 2); - panel21.TabIndex = 7; - // - // panel22 - // - panel22.BackColor = Color.White; - panel22.Location = new Point(102, 0); - panel22.Margin = new Padding(3, 2, 3, 2); - panel22.Name = "panel22"; - panel22.Size = new Size(18, 2); - panel22.TabIndex = 7; - // // txtBoxCvReverso // - txtBoxCvReverso.Location = new Point(134, 13); + txtBoxCvReverso.Location = new Point(150, 38); txtBoxCvReverso.Name = "txtBoxCvReverso"; txtBoxCvReverso.Size = new Size(32, 23); txtBoxCvReverso.TabIndex = 37; @@ -745,7 +638,7 @@ private void InitializeComponent() // lblChaveAPI.Font = new Font("Berlin Sans FB", 12F); lblChaveAPI.ForeColor = Color.White; - lblChaveAPI.Location = new Point(9, 5); + lblChaveAPI.Location = new Point(26, 29); lblChaveAPI.Margin = new Padding(0); lblChaveAPI.Name = "lblChaveAPI"; lblChaveAPI.Size = new Size(109, 36); @@ -757,17 +650,17 @@ private void InitializeComponent() // label1.Font = new Font("Berlin Sans FB", 12.5F); label1.ForeColor = Color.White; - label1.Location = new Point(9, 92); + label1.Location = new Point(11, 84); label1.Margin = new Padding(0); label1.Name = "label1"; - label1.Size = new Size(281, 28); + label1.Size = new Size(150, 21); label1.TabIndex = 38; - label1.Text = "Informe ao menos um dos parâmetros:"; + label1.Text = "Campos Opcionais:"; label1.TextAlign = ContentAlignment.MiddleLeft; // // txtBoxMediaReverso // - txtBoxMediaReverso.Location = new Point(134, 46); + txtBoxMediaReverso.Location = new Point(150, 138); txtBoxMediaReverso.Name = "txtBoxMediaReverso"; txtBoxMediaReverso.PlaceholderText = "x̄"; txtBoxMediaReverso.Size = new Size(32, 23); @@ -778,7 +671,7 @@ private void InitializeComponent() // lblMediaReverso.Font = new Font("Berlin Sans FB", 12F); lblMediaReverso.ForeColor = Color.White; - lblMediaReverso.Location = new Point(10, 48); + lblMediaReverso.Location = new Point(26, 140); lblMediaReverso.Margin = new Padding(0); lblMediaReverso.Name = "lblMediaReverso"; lblMediaReverso.Size = new Size(109, 18); @@ -788,7 +681,7 @@ private void InitializeComponent() // // txtBoxDesvioReverso // - txtBoxDesvioReverso.Location = new Point(134, 161); + txtBoxDesvioReverso.Location = new Point(150, 204); txtBoxDesvioReverso.Name = "txtBoxDesvioReverso"; txtBoxDesvioReverso.PlaceholderText = "s"; txtBoxDesvioReverso.Size = new Size(32, 23); @@ -799,7 +692,7 @@ private void InitializeComponent() // lblDesvioReverso.Font = new Font("Berlin Sans FB", 12F); lblDesvioReverso.ForeColor = Color.White; - lblDesvioReverso.Location = new Point(10, 163); + lblDesvioReverso.Location = new Point(26, 206); lblDesvioReverso.Margin = new Padding(0); lblDesvioReverso.Name = "lblDesvioReverso"; lblDesvioReverso.Size = new Size(109, 18); @@ -809,7 +702,7 @@ private void InitializeComponent() // // txtBoxVarianciaReverso // - txtBoxVarianciaReverso.Location = new Point(134, 128); + txtBoxVarianciaReverso.Location = new Point(150, 171); txtBoxVarianciaReverso.Name = "txtBoxVarianciaReverso"; txtBoxVarianciaReverso.PlaceholderText = "s²"; txtBoxVarianciaReverso.Size = new Size(32, 23); @@ -820,7 +713,7 @@ private void InitializeComponent() // lblVarianciaReverso.Font = new Font("Berlin Sans FB", 12F); lblVarianciaReverso.ForeColor = Color.White; - lblVarianciaReverso.Location = new Point(10, 130); + lblVarianciaReverso.Location = new Point(26, 173); lblVarianciaReverso.Margin = new Padding(0); lblVarianciaReverso.Name = "lblVarianciaReverso"; lblVarianciaReverso.Size = new Size(109, 18); @@ -837,11 +730,11 @@ private void InitializeComponent() btnCalcReverso.Font = new Font("Berlin Sans FB", 12F); btnCalcReverso.HoverTextColor = Color.FromArgb(48, 49, 51); btnCalcReverso.InfoColor = Color.FromArgb(144, 147, 153); - btnCalcReverso.Location = new Point(99, 209); + btnCalcReverso.Location = new Point(98, 243); btnCalcReverso.Margin = new Padding(10); btnCalcReverso.Name = "btnCalcReverso"; btnCalcReverso.PrimaryColor = Color.FromArgb(79, 55, 139); - btnCalcReverso.Size = new Size(108, 44); + btnCalcReverso.Size = new Size(108, 34); btnCalcReverso.SuccessColor = Color.FromArgb(103, 194, 58); btnCalcReverso.TabIndex = 46; btnCalcReverso.Text = "Realizar cálculos"; @@ -855,14 +748,14 @@ private void InitializeComponent() hopeBtnMetodoReverso.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; hopeBtnMetodoReverso.DangerColor = Color.FromArgb(245, 108, 108); hopeBtnMetodoReverso.DefaultColor = Color.FromArgb(255, 255, 255); - hopeBtnMetodoReverso.Font = new Font("Berlin Sans FB Demi", 17F, FontStyle.Bold); + hopeBtnMetodoReverso.Font = new Font("Berlin Sans FB Demi", 16F, FontStyle.Bold); hopeBtnMetodoReverso.HoverTextColor = Color.FromArgb(48, 49, 51); hopeBtnMetodoReverso.InfoColor = Color.FromArgb(144, 147, 153); - hopeBtnMetodoReverso.Location = new Point(403, 146); + hopeBtnMetodoReverso.Location = new Point(72, 473); hopeBtnMetodoReverso.Margin = new Padding(10); hopeBtnMetodoReverso.Name = "hopeBtnMetodoReverso"; hopeBtnMetodoReverso.PrimaryColor = Color.FromArgb(79, 55, 139); - hopeBtnMetodoReverso.Size = new Size(216, 44); + hopeBtnMetodoReverso.Size = new Size(207, 44); hopeBtnMetodoReverso.SuccessColor = Color.FromArgb(103, 194, 58); hopeBtnMetodoReverso.TabIndex = 47; hopeBtnMetodoReverso.Text = "Método Reverso"; @@ -876,14 +769,14 @@ private void InitializeComponent() hopeBtnMetodoPadrao.ButtonType = ReaLTaiizor.Util.HopeButtonType.Primary; hopeBtnMetodoPadrao.DangerColor = Color.FromArgb(245, 108, 108); hopeBtnMetodoPadrao.DefaultColor = Color.FromArgb(255, 255, 255); - hopeBtnMetodoPadrao.Font = new Font("Berlin Sans FB Demi", 17F, FontStyle.Bold); + hopeBtnMetodoPadrao.Font = new Font("Berlin Sans FB Demi", 16F, FontStyle.Bold); hopeBtnMetodoPadrao.HoverTextColor = Color.FromArgb(48, 49, 51); hopeBtnMetodoPadrao.InfoColor = Color.FromArgb(144, 147, 153); - hopeBtnMetodoPadrao.Location = new Point(51, 146); + hopeBtnMetodoPadrao.Location = new Point(72, 146); hopeBtnMetodoPadrao.Margin = new Padding(10); hopeBtnMetodoPadrao.Name = "hopeBtnMetodoPadrao"; hopeBtnMetodoPadrao.PrimaryColor = Color.FromArgb(79, 55, 139); - hopeBtnMetodoPadrao.Size = new Size(216, 44); + hopeBtnMetodoPadrao.Size = new Size(207, 44); hopeBtnMetodoPadrao.SuccessColor = Color.FromArgb(103, 194, 58); hopeBtnMetodoPadrao.TabIndex = 48; hopeBtnMetodoPadrao.Text = "Método Padrão"; @@ -894,55 +787,126 @@ private void InitializeComponent() // pnModoReverso // pnModoReverso.BackColor = Color.FromArgb(57, 45, 120); - pnModoReverso.Controls.Add(lblChaveAPI); - pnModoReverso.Controls.Add(txtBoxCvReverso); - pnModoReverso.Controls.Add(label1); - pnModoReverso.Controls.Add(btnCalcReverso); - pnModoReverso.Controls.Add(lblMediaReverso); - pnModoReverso.Controls.Add(txtBoxVarianciaReverso); - pnModoReverso.Controls.Add(txtBoxMediaReverso); - pnModoReverso.Controls.Add(lblVarianciaReverso); - pnModoReverso.Controls.Add(lblDesvioReverso); - pnModoReverso.Controls.Add(txtBoxDesvioReverso); + pnModoReverso.Controls.Add(pnSubModoReverso); pnModoReverso.EdgeColor = Color.FromArgb(32, 41, 50); - pnModoReverso.Location = new Point(403, 203); + pnModoReverso.Location = new Point(295, 473); pnModoReverso.Name = "pnModoReverso"; pnModoReverso.Padding = new Padding(5); - pnModoReverso.Size = new Size(308, 410); + pnModoReverso.Size = new Size(308, 288); pnModoReverso.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; pnModoReverso.TabIndex = 30; // + // pnSubModoReverso + // + pnSubModoReverso.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + pnSubModoReverso.BackColor = Color.FromArgb(26, 31, 52); + pnSubModoReverso.Controls.Add(lblCampoObrigatorio); + pnSubModoReverso.Controls.Add(label4); + pnSubModoReverso.Controls.Add(lblChaveAPI); + pnSubModoReverso.Controls.Add(txtBoxDesvioReverso); + pnSubModoReverso.Controls.Add(txtBoxCvReverso); + pnSubModoReverso.Controls.Add(lblDesvioReverso); + pnSubModoReverso.Controls.Add(label1); + pnSubModoReverso.Controls.Add(lblVarianciaReverso); + pnSubModoReverso.Controls.Add(btnCalcReverso); + pnSubModoReverso.Controls.Add(txtBoxMediaReverso); + pnSubModoReverso.Controls.Add(lblMediaReverso); + pnSubModoReverso.Controls.Add(txtBoxVarianciaReverso); + pnSubModoReverso.EdgeColor = Color.FromArgb(32, 41, 50); + pnSubModoReverso.Location = new Point(3, 3); + pnSubModoReverso.Name = "pnSubModoReverso"; + pnSubModoReverso.Padding = new Padding(5); + pnSubModoReverso.Size = new Size(302, 282); + pnSubModoReverso.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + pnSubModoReverso.TabIndex = 47; + // + // lblCampoObrigatorio + // + lblCampoObrigatorio.Font = new Font("Berlin Sans FB", 12.5F); + lblCampoObrigatorio.ForeColor = Color.White; + lblCampoObrigatorio.Location = new Point(12, 5); + lblCampoObrigatorio.Margin = new Padding(0); + lblCampoObrigatorio.Name = "lblCampoObrigatorio"; + lblCampoObrigatorio.Size = new Size(159, 21); + lblCampoObrigatorio.TabIndex = 48; + lblCampoObrigatorio.Text = "Campo Obrigatório:"; + lblCampoObrigatorio.TextAlign = ContentAlignment.MiddleLeft; + // + // label4 + // + label4.Font = new Font("Berlin Sans FB", 9F); + label4.ForeColor = Color.White; + label4.Location = new Point(13, 105); + label4.Margin = new Padding(0); + label4.Name = "label4"; + label4.Size = new Size(123, 30); + label4.TabIndex = 47; + label4.Text = "Informe ao menos um dos parâmetros:"; + label4.TextAlign = ContentAlignment.MiddleLeft; + // // pnModoPadrao // pnModoPadrao.BackColor = Color.FromArgb(57, 45, 120); - pnModoPadrao.Controls.Add(lblValorXI); - pnModoPadrao.Controls.Add(lblValorFI); - pnModoPadrao.Controls.Add(lblFilaExpandida); - pnModoPadrao.Controls.Add(AdicionarFila); - pnModoPadrao.Controls.Add(TglBtnListaOuFila); - pnModoPadrao.Controls.Add(btnValidarFilaExp); - pnModoPadrao.Controls.Add(lblModoFilaExpandida); - pnModoPadrao.Controls.Add(txtboxFilaExp); - pnModoPadrao.Controls.Add(flowLayoutPanelPares); - pnModoPadrao.Controls.Add(chkParesAuto); + pnModoPadrao.Controls.Add(pnSubModoPadrao); pnModoPadrao.EdgeColor = Color.FromArgb(32, 41, 50); - pnModoPadrao.Location = new Point(51, 203); + pnModoPadrao.Location = new Point(292, 146); pnModoPadrao.Name = "pnModoPadrao"; pnModoPadrao.Padding = new Padding(5); - pnModoPadrao.Size = new Size(326, 521); + pnModoPadrao.Size = new Size(414, 282); pnModoPadrao.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; pnModoPadrao.TabIndex = 47; // + // pnSubModoPadrao + // + pnSubModoPadrao.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; + pnSubModoPadrao.BackColor = Color.FromArgb(26, 31, 52); + pnSubModoPadrao.Controls.Add(chkParesAuto); + pnSubModoPadrao.Controls.Add(lblFilaExpandida); + pnSubModoPadrao.Controls.Add(flowLayoutPanelPares); + pnSubModoPadrao.Controls.Add(AdicionarFila); + pnSubModoPadrao.Controls.Add(txtboxFilaExp); + pnSubModoPadrao.Controls.Add(TglBtnListaOuFila); + pnSubModoPadrao.Controls.Add(lblModoFilaExpandida); + pnSubModoPadrao.Controls.Add(btnValidarFilaExp); + pnSubModoPadrao.EdgeColor = Color.FromArgb(32, 41, 50); + pnSubModoPadrao.Location = new Point(3, 3); + pnSubModoPadrao.Name = "pnSubModoPadrao"; + pnSubModoPadrao.Padding = new Padding(5); + pnSubModoPadrao.Size = new Size(408, 276); + pnSubModoPadrao.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + pnSubModoPadrao.TabIndex = 48; + // + // label2 + // + label2.Font = new Font("Berlin Sans FB", 9.5F); + label2.ForeColor = Color.White; + label2.Location = new Point(74, 200); + label2.Name = "label2"; + label2.Size = new Size(205, 228); + label2.TabIndex = 49; + label2.Text = resources.GetString("label2.Text"); + // + // label3 + // + label3.Font = new Font("Berlin Sans FB", 9.5F); + label3.ForeColor = Color.White; + label3.Location = new Point(74, 527); + label3.Name = "label3"; + label3.Size = new Size(205, 184); + label3.TabIndex = 50; + label3.Text = resources.GetString("label3.Text"); + // // TelaMediaPosicaoCentral // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.FromArgb(26, 31, 52); + Controls.Add(label3); + Controls.Add(label2); Controls.Add(pnModoPadrao); Controls.Add(pnModoReverso); Controls.Add(hopeBtnMetodoPadrao); Controls.Add(hopeBtnMetodoReverso); - Controls.Add(pnLinhaSeparar); Controls.Add(pnResultadosEstatisticos); Controls.Add(BotaoProximoPassoVAC); Controls.Add(lblResultadosEstatisticos); @@ -964,21 +928,17 @@ private void InitializeComponent() Par3.PerformLayout(); Par4.ResumeLayout(false); Par4.PerformLayout(); - pnLinhaSeparar.ResumeLayout(false); - panel16.ResumeLayout(false); - panel17.ResumeLayout(false); - panel20.ResumeLayout(false); pnModoReverso.ResumeLayout(false); - pnModoReverso.PerformLayout(); + pnSubModoReverso.ResumeLayout(false); + pnSubModoReverso.PerformLayout(); pnModoPadrao.ResumeLayout(false); + pnSubModoPadrao.ResumeLayout(false); ResumeLayout(false); } #endregion private Label lblTituloEstatPar; private Label lblDescTela; - private Label lblValorXI; - private Label lblValorFI; private Label lblFilaExpandida; private TextBox Fi1; private TextBox Xi1; @@ -1015,14 +975,6 @@ private void InitializeComponent() private ReaLTaiizor.Controls.Button btnRmvPar4; private ReaLTaiizor.Controls.DungeonRichTextBox txtboxFilaExp; private Button btnValidarFilaExp; - private Panel pnLinhaSeparar; - private Panel panel16; - private Panel panel17; - private Panel panel18; - private Panel panel19; - private Panel panel20; - private Panel panel21; - private Panel panel22; private TextBox txtBoxCvReverso; private Label lblChaveAPI; private Label label1; @@ -1037,5 +989,11 @@ private void InitializeComponent() private ReaLTaiizor.Controls.HopeRoundButton hopeBtnMetodoPadrao; private ReaLTaiizor.Controls.Panel pnModoReverso; private ReaLTaiizor.Controls.Panel pnModoPadrao; + private ReaLTaiizor.Controls.Panel pnSubModoReverso; + private ReaLTaiizor.Controls.Panel pnSubModoPadrao; + private Label label2; + private Label label3; + private Label label4; + private Label lblCampoObrigatorio; } } diff --git a/TelaMediaPosicaoCentral.cs b/TelaMediaPosicaoCentral.cs index 7f8143a..e9bdd9e 100644 --- a/TelaMediaPosicaoCentral.cs +++ b/TelaMediaPosicaoCentral.cs @@ -70,14 +70,15 @@ private void LimparRecursos() { } #region Gerenciamento de Pares Xi/Fi (Adição e Remoção) private void InicializarPares() { - // Inicializa a lista de painéis + _painelPares = new List { Par0, Par1, Par2, Par3, Par4 }; - // Garante que apenas o primeiro painel esteja visível inicialmente + + // Garante que apenas o primeiro painel esteja visível já no início. for (int i = 0; i < _painelPares.Count; i++) { _painelPares[i].Visible = (i == 0); _painelPares[i].Enabled = (i == 0); - // Limpa os campos dos painéis invisíveis + if (i > 0) { var textBoxes = _painelPares[i].Controls.OfType(); @@ -88,7 +89,6 @@ private void InicializarPares() } ConfigurarEventosDoPar(_painelPares[i]); } - // Força a atualização inicial dos botões AtualizarBotoes(); } @@ -97,20 +97,30 @@ private void ConfigurarEventosDoPar(Panel panel) int indice = ObterIndice(panel.Name); TextBox xi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Xi{indice}"); TextBox fi = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); - if (xi != null && fi != null) + + if (xi != null) { + xi.TextChanged += Xi_TextChanged; + xi.KeyPress += ValidarEntradaXi_KeyPress; + xi.TextChanged += Par_TextChanged; + } + + if (fi != null) + { + fi.TextChanged += Fi_TextChanged; + fi.KeyPress += ValidarEntradaFi_KeyPress; + fi.TextChanged += Par_TextChanged; - ConfigurarValidacao(xi, false); - ConfigurarValidacao(fi, true); } - // Configura o botão de remover se existir (exceto para o primeiro painel) + + // Configura o botão de remover (exceto para o primeiro painel) if (indice > 0) { var btn = GetRemoveButton(panel); if (btn != null) { - btn.Click -= BtnRmvPar_Click; // Evita duplicação + btn.Click -= BtnRmvPar_Click; btn.Click += BtnRmvPar_Click; } } @@ -119,10 +129,10 @@ private void ConfigurarEventosDoPar(Panel panel) private ReaLTaiizor.Controls.Button GetRemoveButton(Panel par) { int indice = ObterIndice(par.Name); - // Para o primeiro painel, não existe botão de remover + if (indice == 0) return null; - // Procura o botão pelo nome + return par.Controls.OfType() .FirstOrDefault(b => b.Name == $"btnRmvPar{indice}"); } @@ -142,7 +152,7 @@ private void MostrarPar(int indice) Panel panel = _painelPares[indice]; panel.Visible = true; panel.Enabled = true; - // Garante que o botão de remover esteja oculto inicialmente + var btn = GetRemoveButton(panel); if (btn != null) { @@ -150,7 +160,7 @@ private void MostrarPar(int indice) btn.Enabled = false; } flowLayoutPanelPares.ScrollControlIntoView(panel); - // Força a atualização dos botões após mostrar o painel + AtualizarBotoes(); } @@ -161,7 +171,7 @@ private void AtualizarBotoes() .Where(p => p.Visible) .OrderBy(p => ObterIndice(p.Name)) .ToList(); - // Se não há painéis visíveis, esconde todos os botões + if (!paineisVisiveis.Any()) { foreach (var panel in _painelPares) @@ -176,14 +186,16 @@ private void AtualizarBotoes() btnAdicionarNovoPar.Visible = false; return; } - // Obtém o último painel visível + var ultimoPar = paineisVisiveis.Last(); int indiceUltimo = ObterIndice(ultimoPar.Name); + // Atualiza todos os botões de remover foreach (var panel in _painelPares) { var btn = GetRemoveButton(panel); if (btn == null) continue; + // Só mostra o botão se: // 1. For o último painel visível // 2. Houver mais de um painel visível @@ -194,7 +206,6 @@ private void AtualizarBotoes() btn.Visible = deveMostrar; btn.Enabled = deveMostrar; } - // Atualiza botão de adição bool podeAdicionar = !chkParesAuto.Checked && indiceUltimo < _painelPares.Count - 1; btnAdicionarNovoPar.Visible = podeAdicionar; btnAdicionarNovoPar.Enabled = podeAdicionar; @@ -222,6 +233,7 @@ private void RemoverUltimoPar() { Panel ultimoPar = _painelPares.LastOrDefault(p => p.Visible); if (ultimoPar == null) return; + // Limpa os campos antes de esconder var textBoxes = ultimoPar.Controls.OfType(); foreach (var tb in textBoxes) @@ -230,17 +242,18 @@ private void RemoverUltimoPar() } ultimoPar.Visible = false; ultimoPar.Enabled = false; - // Força a atualização dos botões após remover + AtualizarBotoes(); } private void btnAdicionarNovoPar_Click(object sender, EventArgs e) { - // Procuramos o primeiro par oculto que pode ser ativado + // Procura-se o primeiro par oculto que pode ser ativado for (int i = 0; i < _painelPares.Count - 1; i++) { Panel parAtual = _painelPares[i]; Panel proximoPar = _painelPares[i + 1]; + // Verifica: // 1. O par atual está visível // 2. Está preenchido (Xi e Fi não vazios) @@ -253,7 +266,7 @@ private void btnAdicionarNovoPar_Click(object sender, EventArgs e) return; } } - // Se chegou aqui, não há par para adicionar + MessageBox.Show( "Todos os pares já foram adicionados ou o par anterior não está completo.", "Aviso", @@ -269,51 +282,122 @@ private void BtnRmvPar_Click(object sender, EventArgs e) #endregion #region Validação e Eventos de Entrada (Teclado, TextChanged) - private void ConfigurarValidacao(TextBox tb, bool ehFi) + + private void ValidarEntradaXi_KeyPress(object sender, KeyPressEventArgs e) { - tb.KeyPress += (s, e) => + char tecla = e.KeyChar; + if (char.IsControl(tecla)) + return; + + TextBox textBox = sender as TextBox; + if (textBox == null) return; + + // Permite dígitos e vírgula + if (char.IsDigit(tecla) || tecla == ',') { - char tecla = e.KeyChar; - if (char.IsControl(tecla)) return; - if (ehFi) + if (tecla == ',') { - if (!char.IsDigit(tecla)) + if (textBox.Text.Contains(',') || textBox.SelectionStart == 0) { e.Handled = true; - return; } - string textoFinal = tb.Text.Insert(tb.SelectionStart, tecla.ToString()); - if (textoFinal.StartsWith("0") && textoFinal.Length > 1) - e.Handled = true; } - else + return; + } + + e.Handled = true; + } + + + private void ValidarEntradaFi_KeyPress(object sender, KeyPressEventArgs e) + { + char tecla = e.KeyChar; + if (char.IsControl(tecla)) + return; + + TextBox textBox = sender as TextBox; + if (textBox == null) return; + + // Permite apenas dígitos + if (!char.IsDigit(tecla)) + { + e.Handled = true; + return; + } + + // Bloqueia '0' como primeiro caractere + string textoFinal = textBox.Text.Insert(textBox.SelectionStart, tecla.ToString()); + if (textoFinal.StartsWith("0") && textoFinal.Length == 1) + { + e.Handled = true; + return; + } + } + + + private void Xi_TextChanged(object sender, EventArgs e) + { + TextBox textBox = sender as TextBox; + if (textBox == null) return; + + string texto = textBox.Text; + + // Remove caracteres inválidos + string textoLimpo = ""; + bool virgulaEncontrada = false; + + foreach (char c in texto) + { + if (char.IsDigit(c)) { - if (char.IsDigit(tecla)) - { - string textoFinal = tb.Text.Insert(tb.SelectionStart, tecla.ToString()); - if (textoFinal.StartsWith("0") && !textoFinal.StartsWith("0,") && textoFinal.Length == 1) - e.Handled = true; - return; - } - if (tecla == ',') - { - if (tb.Text.Contains(',') || tb.SelectionStart == 0) - e.Handled = true; - return; - } - e.Handled = true; + textoLimpo += c; } - }; - tb.KeyDown += (s, e) => - { - if ((e.Control && e.KeyCode == Keys.V) || (e.Shift && e.KeyCode == Keys.Insert)) + else if (c == ',' && !virgulaEncontrada) { - e.SuppressKeyPress = true; - e.Handled = true; + textoLimpo += c; + virgulaEncontrada = true; } - }; + } + + // Valida formato "0," vs "0X" + if (textoLimpo.StartsWith("0") && textoLimpo.Length > 1 && textoLimpo[1] != ',') + { + textoLimpo = "0," + textoLimpo.Substring(1); + } + + // Atualiza o texto se necessário + if (texto != textoLimpo) + { + int posicao = textBox.SelectionStart; + textBox.Text = textoLimpo; + textBox.SelectionStart = Math.Min(posicao, textoLimpo.Length); + } + } + + + private void Fi_TextChanged(object sender, EventArgs e) + { + TextBox textBox = sender as TextBox; + if (textBox == null) return; + + // Remove não dígitos + string textoLimpo = new string(textBox.Text.Where(char.IsDigit).ToArray()); + + // Bloqueia "0" sozinho + if (textoLimpo == "0") + { + textoLimpo = ""; + } + + if (textBox.Text != textoLimpo) + { + int posicao = textBox.SelectionStart; + textBox.Text = textoLimpo; + textBox.SelectionStart = Math.Min(posicao, textoLimpo.Length); + } } + private void DesativarMenuContexto(Control controle) { foreach (Control c in controle.Controls) @@ -330,8 +414,9 @@ private void DesativarMenuContexto(Control controle) public (double media, double variancia, double desvio, double cv, double somaFi, string passosMedia, string passosVariancia, string passosDesvio, string passosCv) CalcularEstatisticas() { var dados = new List(); // Lista de valores considerando Fi ou lista em TextBox + var listaFi = new List(); double somaFi = 0; - if (!TglBtnListaOuFila.Checked) // Padrão: calcular pelos pares Xi/Fi + if (!TglBtnListaOuFila.Checked) { foreach (Panel panel in _painelPares) { @@ -341,16 +426,16 @@ private void DesativarMenuContexto(Control controle) TextBox fiTxt = panel.Controls.OfType().FirstOrDefault(tb => tb.Name == $"Fi{indice}"); if (xiTxt == null || fiTxt == null) continue; if (string.IsNullOrWhiteSpace(xiTxt.Text) || string.IsNullOrWhiteSpace(fiTxt.Text)) continue; - if (double.TryParse(xiTxt.Text, NumberStyles.Any, new CultureInfo("pt-BR"), out double xi) && - int.TryParse(fiTxt.Text, out int fi) && fi > 0) + if (double.TryParse(xiTxt.Text, NumberStyles.Any, new CultureInfo("pt-BR"), out double xi) && int.TryParse(fiTxt.Text, out int fi) && fi > 0) { for (int i = 0; i < fi; i++) dados.Add(xi); // Repete Xi Fi vezes + listaFi.Add(fi); somaFi += fi; } } } - else // Toggle marcado: calcular baseado na TextBox com valores separados + else // Toggle marcado (Fila Expandida) { string texto = txtboxFilaExp.Text.Trim(); if (string.IsNullOrEmpty(texto)) @@ -368,49 +453,106 @@ private void DesativarMenuContexto(Control controle) } somaFi = dados.Count; } - // Verifica se há dados + if (somaFi == 0) { return (0, 0, 0, 0, 0, "Nenhum dado válido encontrado. Preencha pelo menos um valor!", "", "", ""); } - // Cálculos + double media = dados.Average(); double somaQuadrados = dados.Sum(x => Math.Pow(x - media, 2)); - double variancia = somaQuadrados / somaFi; + double variancia = somaQuadrados / (somaFi - 1); double desvio = Math.Sqrt(variancia); double cv = (media != 0) ? (desvio / media) * 100 : 0; - // Passos - string passosMedia = $@" -📌 **Passo 1: Lista de Valores** -→ {string.Join(" ; ", dados.Select(d => d.ToString("F2")))} -📌 **Passo 2: Calcular Média** -→ x̄ = ΣXi / n -→ x̄ = {string.Join(" + ", dados.Select(d => d.ToString("F2")))} / {somaFi} = {media:F2} + + string passosMedia = GerarPassosMedia(dados, listaFi, media, somaFi); + string passosVariancia = GerarPassosVariancia(dados, media, somaQuadrados, somaFi, variancia); + string passosDesvio = GerarPassosDesvio(variancia, desvio); + string passosCv = GerarPassosCV(desvio, media, cv); + return (media, variancia, desvio, cv, somaFi, passosMedia, passosVariancia, passosDesvio, passosCv); + } + + private string GerarPassosMedia(List dados, List listaFi, double media, double somaFi) + { + var valoresComFrequencia = dados.GroupBy(d => d) + .Select(g => new + { + Valor = g.Key, + Frequencia = g.Count(), + Produto = g.Key * g.Count() + }) + .ToList(); + + var passosMultiplicacao = valoresComFrequencia.Select(v => $"{v.Valor:F2} × {v.Frequencia} = {(v.Valor * v.Frequencia):F2}"); + + double somaProdutos = valoresComFrequencia.Sum(v => v.Valor * v.Frequencia); + + var somaProdutosStr = string.Join(" + ", valoresComFrequencia.Select(v => v.Produto.ToString("F2"))); + + string somaFiStr = string.Join(" + ", listaFi.Select(f => f.ToString())); + + return $@" +→ Passo 1: Realizar a multiplicação Xi × Fi +{string.Join("\n", passosMultiplicacao)} + + +→ Passo 2: Somar o produto dos cálculos para obter o resultado de ΣXiFi +{somaProdutosStr} = {somaProdutos:F2} + + +→ Passo 3: Realizar a soma dos valores de Fi para obter o resultado de ΣFi (ou N) +{somaFiStr} = {somaFi:F0} + + +→ Passo 4: Substituir os valores na fórmula e calcular a Média: x̄ = Σ(XiFi) / ΣFi +x̄ = {somaProdutos:F2} / {somaFi:F0} = {media:F2} ".Trim(); - string passosVariancia = $@" -📌 **Passo 1: Média (x̄)** -→ x̄ = {media:F2} -📌 **Passo 2: Calcular Σ(Xi - x̄)²** -→ Para cada valor: -{string.Join("\n", dados.Select(d => $"→ ({d:F2} - {media:F2})² = {Math.Pow(d - media, 2):F2}"))} -→ Soma = {somaQuadrados:F2} -📌 **Passo 3: Variância** -→ σ² = Σ(Xi - x̄)² / n -→ σ² = {somaQuadrados:F2} / {somaFi} = {variancia:F2} + } + + private string GerarPassosVariancia(List dados, double media, double somaQuadrados, double somaFi, double variancia) + { + var grupos = dados.GroupBy(d => d) + .Select(g => new + { + Valor = g.Key, + Frequencia = g.Count(), + DesvioQuadrado = Math.Pow(g.Key - media, 2) + }) + .OrderBy(g => g.Valor); + + var desviosFormatados = new StringBuilder(); + foreach (var grupo in grupos) + { + desviosFormatados.AppendLine($"({grupo.Valor:F2} - {media:F2})² = {grupo.DesvioQuadrado:F2} ({grupo.Frequencia}x) = {(grupo.DesvioQuadrado * grupo.Frequencia):F4}"); + } + + return $@" +→ Passo 1: Tenha em mãos o valor da Média (x̄) e do Tamanho da Amostra (N) +Média dos valores: x̄ = {media:F2} +N = {somaFi} + +→ Passo 2: Calcular (Xi - x̄)² × Fi para cada valor (desvio quadrático multiplicado pela frequência) +{desviosFormatados.ToString().Trim()} +Soma dos quadrados: Σ(Xi - x̄)² = {somaQuadrados:F2} + +→ Passo 3: Substituir os valores da fórmula e calcular a Variância: s² = Σ(Xi - x̄)² / N - 1 +s² = {somaQuadrados:F2} / {somaFi} - 1 = {variancia:F2} ".Trim(); - string passosDesvio = $@" -📌 **Passo 1: Variância (σ²)** -→ σ² = {variancia:F2} -📌 **Passo 2: Desvio Padrão** -→ σ = √σ² -→ σ = √{variancia:F2} = {desvio:F2} + } + + private string GerarPassosDesvio(double variancia, double desvio) + { + return $@" +→ Passo 1: Tenha em mãos o valor da Variância (s²) +s² = {variancia:F2} + +→ Passo 2: Substituir os valores da fórmula e calcular o Desvio Padrão: s = √s² +s = √{variancia:F2} = {desvio:F2} ".Trim(); - string passosCv = GerarPassosCV(desvio, media, cv); - return (media, variancia, desvio, cv, somaFi, passosMedia, passosVariancia, passosDesvio, passosCv); } private string GerarPassosCV(double desvio, double media, double cv) @@ -419,11 +561,12 @@ private string GerarPassosCV(double desvio, double media, double cv) { return @" 📌 **Coeficiente de Variação (CV)** -→ CV = (σ / x̄) × 100% +→ CV = (s / x̄) × 100% → Como a média é zero, o CV não pode ser calculado. → O CV é indefinido quando a média é zero. ".Trim(); } + string interpretacao = cv switch { < 15 => "Baixa dispersão (CV < 15%): Os dados são homogêneos.", @@ -431,28 +574,26 @@ private string GerarPassosCV(double desvio, double media, double cv) < 50 => "Alta dispersão (30% ≤ CV < 50%): Os dados são heterogêneos.", _ => "Muito alta dispersão (CV ≥ 50%): Grande variabilidade nos dados." }; - return $@" -📌 **Passo 1: Desvio Padrão (σ)** -→ σ = {desvio:F2} -📌 **Passo 2: Média (x̄)** -→ x̄ = {media:F2} -📌 **Passo 3: Coeficiente de Variação (CV)** -→ CV = (σ / x̄) × 100% -→ CV = ({desvio:F2} / {media:F2}) × 100% -→ CV = {cv:F2}% -📌 **Interpretação do CV:** -→ {interpretacao} -".Trim(); - } - - - + return $@" +→ Passo 1: Desvio Padrão (s) +s = {desvio:F2} +→ Passo 2: Média (x̄) +x̄ = {media:F2} +→ Passo 3: Coeficiente de Variação (CV) +CV = (s / x̄) × 100% +CV = ({desvio:F2} / {media:F2}) × 100% +CV = {cv:F2}% +📌 Interpretação do CV: +→ {interpretacao} +".Trim(); + } #endregion + #region Exibição de Resultados e Navegação private void AdicionarFila_Click(object sender, EventArgs e) { @@ -527,9 +668,9 @@ private void InicializarSequenciaGeral(string passosMedia, string passosVarianci titulosSequenciais = new List { "Média: x̄ = (ΣXi·Fi) / ΣFi", - "Variância: s² = ΣFi·(Xi - x̄)² / ΣFi", + "Variância: s² = (Xi - x̄)² / ΣFi", "Desvio Padrão: s = √s²", - "Coeficiente de Variação: CV = (σ / x̄) × 100%" + "Coeficiente de Variação: CV = (s / x̄) × 100%" }; indiceAtualGeral = 0; AtualizarExibicaoResultado(); @@ -594,6 +735,7 @@ private string FilaExpandida(List<(double Xi, int Fi)> pares) } #endregion + #region Navegação entre Telas private void BotaoProximoPassoVAC_Click(object sender, EventArgs e) { @@ -604,8 +746,6 @@ private void BotaoProximoPassoVAC_Click(object sender, EventArgs e) #region Eventos de Interface (Não Funcionais / Em Teste) private void TglBtnListaOuFila_CheckedChanged(object sender, EventArgs e) { - // TODO: Implementar alternância entre visualização de lista e fila - // Atualmente não está funcionando corretamente if (TglBtnListaOuFila.Checked) { flowLayoutPanelPares.Enabled = false; @@ -631,27 +771,33 @@ private int ObterIndice(string nome) #endregion #region Validação de Dados + private string ValidarItemNumero(string item) { if (string.IsNullOrWhiteSpace(item)) return "Item vazio ou com espaços."; + if (item == ",") return "Vírgula sozinha (use um número como '0,5')."; + if (item.EndsWith(",")) return $"Número incompleto: '{item}' (falta o decimal)."; + if (item.Count(c => c == ',') > 1) return $"Múltiplas vírgulas: '{item}' (use apenas uma vírgula por número)."; + if (item.Contains(" ") && item.Contains(",")) return $"Espaço dentro do número: '{item}' (não use espaço antes ou depois da vírgula)."; + if (item.Length > 1 && item.StartsWith("0") && char.IsDigit(item[1]) && !item.StartsWith("0,")) return $"Zero à esquerda não permitido: '{item}' (use '1' em vez de '01')."; - if (!double.TryParse(item, NumberStyles.AllowDecimalPoint, new CultureInfo("pt-BR"), out _)) - return $"Não é um número válido: '{item}' (use formato brasileiro: 2,5)."; + if (double.TryParse(item, NumberStyles.Any, new CultureInfo("pt-BR"), out _)) return null; - // Tenta converter com ponto (en-US) + if (double.TryParse(item, NumberStyles.Any, new CultureInfo("en-US"), out _)) return null; + return $"Formato inválido: '{item}'. Use vírgula (1,5) ou ponto (1.5)."; } @@ -659,9 +805,9 @@ private string ValidarItemNumero(string item, out string sugestao) { sugestao = null; string erro = ValidarItemNumero(item); + if (erro != null) { - // Gera sugestão baseada no erro if (item == ",") sugestao = "0,0"; else if (item.EndsWith(",")) @@ -674,11 +820,15 @@ private string ValidarItemNumero(string item, out string sugestao) sugestao = item.TrimStart('0'); else if (item.Contains(".")) sugestao = item.Replace(".", ","); + else if (double.TryParse(item, NumberStyles.Any, CultureInfo.InvariantCulture, out _)) + sugestao = item.Replace(".", ","); else - sugestao = "0"; + sugestao = "0"; // Sugestão genérica como último recurso } + return erro; } + #endregion private bool ValidarLista(string texto, out string listaFormatada, out string erros, char separador = '-', int? minItens = null, int? maxItens = null) { @@ -728,7 +878,7 @@ private bool ValidarLista(string texto, out string listaFormatada, out string er errosList.Add($"Mínimo de {minItens} itens necessário(s). Encontrados: {numeros.Count}"); if (maxItens.HasValue && numeros.Count > maxItens) errosList.Add($"Máximo de {maxItens} itens permitido(s). Encontrados: {numeros.Count}"); - // Se houver erros de quantidade, retorna false + if (errosList.Count > 0) { erros = string.Join("\n→ ", errosList); @@ -758,7 +908,7 @@ private void AplicarCorrecoesAutomaticas(string texto) } } txtboxFilaExp.Text = string.Join(" - ", corrigidos); - // Revalida após correções + if (ValidarLista(txtboxFilaExp.Text, out string listaFormatada, out _)) { txtboxFilaExp.Text = listaFormatada; @@ -772,8 +922,8 @@ private void btnValidarFilaExp_Click(object sender, EventArgs e) if (ValidarLista(txtboxFilaExp.Text, out string listaFormatada, out string erros, separador: '-', minItens: 2, maxItens: 10)) { - txtboxFilaExp.Text = listaFormatada; // força padronização - MessageBox.Show("✅ Lista válida e padronizada!", "Validação", MessageBoxButtons.OK, MessageBoxIcon.Information); + txtboxFilaExp.Text = listaFormatada; + MessageBox.Show("Lista válida e padronizada!", "Validação", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { @@ -797,7 +947,6 @@ private void btnValidarFilaExp_Click(object sender, EventArgs e) MessageBoxIcon.Warning); } } - #endregion private void hopeBtnMetodoReverso_Click(object sender, EventArgs e) { @@ -821,13 +970,13 @@ private void btnCalcReverso_Click(object sender, EventArgs e) try { - double cvReverso = double.Parse(txtBoxCvReverso.Text.Replace(",",".")); + double cvReverso = double.Parse(txtBoxCvReverso.Text.Replace(",", ".")); double? mediaReversa = string.IsNullOrEmpty(txtBoxMediaReverso.Text) ? null : double.Parse(txtBoxMediaReverso.Text.Replace(",", ".")); - double? varianciaReversa = string.IsNullOrEmpty(txtBoxDesvioReverso.Text) + double? varianciaReversa = string.IsNullOrEmpty(txtBoxVarianciaReverso.Text) ? null : double.Parse(txtBoxDesvioReverso.Text.Replace(",", ".")); @@ -835,9 +984,10 @@ private void btnCalcReverso_Click(object sender, EventArgs e) ? null : double.Parse(txtBoxDesvioReverso.Text.Replace(",", ".")); - if (cvReverso <= 0 || (mediaReversa.HasValue && mediaReversa.Value <= 0)) + if (cvReverso <= 0) { - MessageBox.Show("O valor do Coeficiente de Variação e Média devem ser maior que zero!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("O valor do Coeficiente de Variação deve ser maior que zero!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; } double mediaCalculadaReversa, desvioCalculadoReverso, varianciaCalculadaReversa; @@ -848,27 +998,26 @@ private void btnCalcReverso_Click(object sender, EventArgs e) desvioCalculadoReverso = (cvReverso * mediaCalculadaReversa) / 100; varianciaCalculadaReversa = Math.Pow(desvioCalculadoReverso, 2); } - else if (varianciaReversa.HasValue) - { - varianciaCalculadaReversa = varianciaReversa.Value; - desvioCalculadoReverso = Math.Sqrt(varianciaCalculadaReversa); - mediaCalculadaReversa = (desvioCalculadoReverso * 100) / cvReverso; - } else if (desvioReverso.HasValue) { desvioCalculadoReverso = desvioReverso.Value; mediaCalculadaReversa = (desvioCalculadoReverso * 100) / cvReverso; varianciaCalculadaReversa = Math.Pow(desvioCalculadoReverso, 2); } + else if (varianciaReversa.HasValue) + { + varianciaCalculadaReversa = varianciaReversa.Value; + desvioCalculadoReverso = Math.Sqrt(varianciaCalculadaReversa); + mediaCalculadaReversa = (desvioCalculadoReverso * 100) / cvReverso; + } else { - MessageBox.Show("Você deve fornecer pelo menos mais um parâmetro além do CV e Média", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Você deve fornecer pelo menos mais um parâmetro além do CV (Média, Desvio ou Variância)!", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string passosReverso = GerarPassosReverso(cvReverso, mediaReversa, desvioReverso, varianciaReversa, mediaCalculadaReversa, desvioCalculadoReverso, varianciaCalculadaReversa); - // Exibir resultados lbPassosGeral.Text = $@" Média: {mediaCalculadaReversa:F2} Desvio Padrão: {desvioCalculadoReverso:F2} @@ -884,8 +1033,7 @@ private void btnCalcReverso_Click(object sender, EventArgs e) } } - private string GerarPassosReverso(double cvReverso, double? mediaReversa, double? desvioReverso, double? varianciaReversa, - double mediaCalculadaReversa, double desvioCalculadoReverso, double varianciaCalculadaReversa) + private string GerarPassosReverso(double cvReverso, double? mediaReversa, double? desvioReverso, double? varianciaReversa, double mediaCalculadaReversa, double desvioCalculadoReverso, double varianciaCalculadaReversa) { StringBuilder sb = new StringBuilder(); sb.AppendLine("\n📌 **Passos do Cálculo Reverso:**"); diff --git a/TelaMediaPosicaoCentral.resx b/TelaMediaPosicaoCentral.resx index 6bf1b31..43a47d1 100644 --- a/TelaMediaPosicaoCentral.resx +++ b/TelaMediaPosicaoCentral.resx @@ -189,4 +189,30 @@ RK5CYII= + + 1. MODO DE ENTRADA: + • Botão de alternar entre: + [ ] Pares Xi/Fi & [ ] Fila Expandida + +2. MODO PARES (Xi/Fi): + • Adicione valores: + - Automático: ao preencher, novo par aparece + - Manual: clique em "+" + +3. MODO FILA EXPANDIDA: + • Digite valores separados por ; ou - + • Ex: 5;10;15 ou 5-10-15 + • Validação: clique em "Validar Fila" + + + 1. ATIVE O MODO REVERSO: + • Clique em "Modo Reverso" (ao lado de "Modo Padrão") + +2. INSIRA OS DADOS: + • Campo OBRIGATÓRIO: CV (%) + • Campo OPCIONAL (escolha PELO MENOS UM): + - Média (x̄) ou + - Desvio Padrão (s) ou + - Variância (s²) + \ No newline at end of file diff --git a/eStats.csproj b/eStats.csproj index 830cef2..33e6885 100644 --- a/eStats.csproj +++ b/eStats.csproj @@ -7,6 +7,7 @@ enable true enable + true