Skip to content

Commit

Permalink
validate input
Browse files Browse the repository at this point in the history
  • Loading branch information
JohamSMC committed Jul 29, 2020
1 parent bc7c4c8 commit df34774
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 71 deletions.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,26 @@

'Posicionar la masa segun el dato de posicion vertical de entrada
Private Sub TextBox_y0_TextChanged(sender As Object, e As EventArgs) Handles TextBox_y0.TextChanged
If Val(TextBox_y0.Text) < 0 Then
TextBox_y0.Text = "0"
End If
masa.Top = cero - alto - Val(TextBox_y0.Text)
End Sub

'Posicionar la masa segun el dato de posicion horizontal de entrada
Private Sub TextBox_x0_TextChanged(sender As Object, e As EventArgs) Handles TextBox_x0.TextChanged
If Val(TextBox_x0.Text) < 0 Then
TextBox_x0.Text = "0"
End If
masa.Left = coorX + Val(TextBox_x0.Text)
End Sub

Private Sub TextBox_vi_TextChanged(sender As Object, e As EventArgs) Handles TextBox_vi.TextChanged
If Val(TextBox_vi.Text) < 0 Then
TextBox_vi.Text = "0"
End If
End Sub

'Resetear todos los datos de entrada y salida del sistema
Private Sub Button_restart_Click(sender As Object, e As EventArgs) Handles Button_restart.Click

Expand Down Expand Up @@ -79,6 +91,20 @@
Private Sub Button_start_Click(sender As Object, e As EventArgs) Handles Button_start.Click
Button_start.Enabled = False


' Validar valores no negativos para la velocidad, posición X y posición Y '
If Val(TextBox_y0.Text) < 0 Then
TextBox_y0.Text = "0"
End If

If Val(TextBox_x0.Text) < 0 Then
TextBox_x0.Text = "0"
End If

If Val(TextBox_vi.Text) < 0 Then
TextBox_vi.Text = "0"
End If

iniciarEntradas(Val(TextBox_x0.Text),
Val(TextBox_y0.Text),
Val(TextBox_vi.Text),
Expand Down
140 changes: 70 additions & 70 deletions Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina/Form2.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ C:\Users\Sebastian\Desktop\MovimientoParabolico-Cadena\Taller1-CaidaLibreYrebote
C:\Users\Sebastian\Desktop\MovimientoParabolico-Cadena\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.exe
C:\Users\Sebastian\Desktop\MovimientoParabolico-Cadena\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.xml
C:\Users\Sebastian\Desktop\MovimientoParabolico-Cadena\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.pdb
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\bin\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.exe.config
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\bin\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.exe
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\bin\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.pdb
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\bin\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.xml
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.vbprojAssemblyReference.cache
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1_CaidaLibreYrebote_HernanCadena_JohamMedina.Form1.resources
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1_CaidaLibreYrebote_HernanCadena_JohamMedina.Form2.resources
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1_CaidaLibreYrebote_HernanCadena_JohamMedina.Resources.resources
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.vbproj.GenerateResource.cache
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.vbproj.CoreCompileInputs.cache
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.exe
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.xml
C:\Users\Sebastian\Desktop\Taller1-CaidaLibreYrebote\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina\obj\Debug\Taller1-CaidaLibreYrebote-HernanCadena-JohamMedina.pdb
Binary file not shown.
Binary file not shown.

0 comments on commit df34774

Please sign in to comment.