2.2 METHODS FOR DETERMINING THE STIFFNESS OF ASPHALT
2.2.4 Comparison of methods
Esta formulario tiene la misma funcionabilidad que la ventana “ConexionForm” pero aquí no se interactua con el hardware si no que se consulta la base de datos de trabajo de la aplicación, de manera que sea posible la simulación del experimento.
Figura Nº 1-40 El código asociado es:
Dim arranque As Boolean Dim ConexionTipo As String
Private Sub Tabla_Mono() ' Carga los valores desde la tabla de datos (tabla.sfk) If Dtabla.Recordset.EOF = False Then
Dtabla.Recordset.MoveFirst End If VoltajePrim = Dtabla.Recordset.Fields("Vnp") Sn = Dtabla.Recordset.Fields("Sn") + 0 Rp = Dtabla.Recordset.Fields("Rp") + 0 Rs = Dtabla.Recordset.Fields("Rs") + 0
P0 = Dtabla.Recordset.Fields("Po") + 0 Vpcc = Dtabla.Recordset.Fields("Vpcc") + 0 Ppcc = Dtabla.Recordset.Fields("Ppcc") + 0 Ipcc = Dtabla.Recordset.Fields("Ipcc") + 0 Iexc = Dtabla.Recordset.Fields("Iexec") + 0 VPrim = Dtabla.Recordset.Fields("Vnp") + 0 'Tabla Desfase
DDesfase.Recordset.FindFirst "Conexion = 'Y y'" Desfase = DDesfase.Recordset.Fields("Ang") VoltajeSec = DDesfase.Recordset.Fields("Vns") CorrienteSec = Sn / VoltajeSec
End Sub
Private Sub Tabla_TF() ' Carga los valores desde la tabla de datos (tabla.sfk) If Dtabla.Recordset.BOF = False Then
Dtabla.Recordset.MoveLast End If VoltajePrim = Dtabla.Recordset.Fields("Vnp") Sn = Dtabla.Recordset.Fields("Sn") + 0 Rp = Dtabla.Recordset.Fields("Rp") + 0 Rs = Dtabla.Recordset.Fields("Rs") + 0 P0 = Dtabla.Recordset.Fields("Po") + 0 Vpcc = Dtabla.Recordset.Fields("Vpcc") + 0 Ppcc = Dtabla.Recordset.Fields("Ppcc") + 0 Ipcc = Dtabla.Recordset.Fields("Ipcc") + 0 Iexc = Dtabla.Recordset.Fields("Iexec") VPrim = Dtabla.Recordset.Fields("Vnp")
DDesfase.Recordset.FindFirst "Conexion = '" & ConexionTipo & "'" Desfase = DDesfase.Recordset.Fields("Ang")
VoltajeSec = DDesfase.Recordset.Fields("Vns") CorrienteSec = Sn / VoltajeSec
End Sub
Private Sub Form_Activate()
Dtabla.DatabaseName = App.Path & "\tabla.skf" DDesfase.DatabaseName = App.Path & "\tabla.skf" Dtabla.RecordSource = "Tabla"
DDesfase.RecordSource = "Desfase" Dtabla.Refresh
DDesfase.Refresh Select Case Var_Paso Case 1 To 4
ConexiónTipo = "Monofásico" Tabla_Mono
If Var_Paso_1 = 1 Then
ConexiónTipo = "Y d" ElseIf Var_Paso_1 = 2 Then ConexiónTipo = "D y" ElseIf Var_Paso_1 = 3 Then ConexiónTipo = "Y y" ElseIf Var_Paso_1 = 4 Then ConexiónTipo = "D d" End If Tabla_TF Case 6 ConexiónTipo = "Y z5" Tabla_TF Case 7 If Var_Paso_1 = 5 Then ConexiónTipo = "D yy" ElseIf Var_Paso_1 = 6 Then
ConexiónTipo = "Y yy" End If
Tabla_TF Case 8
ConexiónTipo = "Monofásicos en paralelo" Tabla_Mono
End Select
ConexionFTeo.Caption = " Conexión Tipo: " & ConexionTipo ' Lectura delos valores nominales desde la tabla.
Mostrar_Control AsigDataTabla End Sub
Private Sub Mostrar_Control() Shape1.Visible = True 'Etiquetas Label1.Visible = True Label6.Visible = True Label7.Visible = True CargaTxt.Visible = True RpTxt.Visible = True RsTxt.Visible = True P0Txt.Visible = True VpccTxt.Visible = True PpccTxt.Visible = True IpccTxt.Visible = True
' Cuadros de texto (Salidas) V_Entrada.Visible = True
V_Entrada3.Visible = True V_Entrada4.Visible = True CargaTx.Visible = True RpTx.Visible = True RsTx.Visible = True P0Tx.Visible = True VpccTx.Visible = True PpccTx.Visible = True IpccTx.Visible = True End Sub
Private Sub AsigDataTabla() 'Muestra en los cuadros de texto los parametros leidos de las tablas
V_Entrada.Text = VoltajePrim & " V" V_Entrada3.Text = VoltajeSec & " V" V_Entrada4.Text = CorrienteSec & " A" CargaTx.Text = Carga & " Ohms" RpTx.Text = Rp & " Ohms"
RsTx.Text = Rs & " Ohms" P0Tx.Text = P0 & " W" VpccTx.Text = Vpcc & " V" PpccTx.Text = Ppcc & " W" IpccTx.Text = Ipcc & " A" End Sub
Private Sub Form_Load() SelecCarga
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image2.Picture = ImageList1.ListImages(1).Picture Image3.Picture = ImageList1.ListImages(3).Picture Image4.Picture = ImageList1.ListImages(5).Picture Image5.Picture = ImageList1.ListImages(7).Picture Image1.Picture = ImageList1.ListImages(9).Picture End Sub
Private Sub Form_Unload(Cancel As Integer) If Qsalir = 0 Then
principal.Toolbar1.Buttons.Item(4).Enabled = True End If
Private Sub Image1_Click() If Var_Paso = 0 Then
MsgBox "Debe escoger una práctica", vbOKOnly, "Atención" Exit Sub
End If
'Si no hay archivo de ayuda para este proyecto, mostrar un mensaje al usuario 'puede establecer el archivo de Ayuda para la aplicación en el cuadro
'de diálogo Propiedades del proyecto If Len(App.HelpFile) = 0 Then
MsgBox "No se puede mostrar el contenido de la Guía. No se puede encontrar el archivo de ayuda asociado.", vbInformation, Me.Caption Else
On Error Resume Next Select Case Var_Paso Case 1
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía1.chm", HH_DISPLAY_TOPIC, 0&)
Case 2
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía2.chm", HH_DISPLAY_TOPIC, 0&)
Case 3
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía3.chm", HH_DISPLAY_TOPIC, 0&)
Case 4
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía4.chm", HH_DISPLAY_TOPIC, 0&)
Case 5
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía5.chm", HH_DISPLAY_TOPIC, 0&)
Case 6
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía6.chm", HH_DISPLAY_TOPIC, 0&)
Case 7
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía7.chm", HH_DISPLAY_TOPIC, 0&)
Case 8
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía8.chm", HH_DISPLAY_TOPIC, 0&)
Case 9
h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía9.chm", HH_DISPLAY_TOPIC, 0&)
End Select If Err Then
MsgBox Err.Description End If
End If End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = ImageList1.ListImages(10).Picture Label4.Caption = "Guía de la Práctica"
End Sub
Private Sub Image2_Click()
'si no hay archivo de ayuda para este proyecto, mostrar un mensaje al usuario 'puede establecer el archivo de Ayuda para la aplicación en el cuadro 'de diálogo Propiedades del proyecto
If Len(App.HelpFile) = 0 Then
MsgBox "No se puede mostrar el contenido de la Ayuda. No se puede encontrar el archivo de ayuda asociado.", vbInformation, Me.Caption
Else
On Error Resume Next
h = HtmlHelp(Me.hWnd, App.Path & "\Ayuda\Ayuda3.chm", HH_DISPLAY_TOPIC, 0&) If Err Then MsgBox Err.Description End If End If End Sub
Private Sub Image3_Click() Buscar_Temas.Show Buscar_Temas.SetFocus Unload Me
End Sub
Private Sub Image4_Click() 'Permite escoger otra práctica Entrada = "" Cargas_Paso = 0 Var_Paso = 0 Var_Paso_1 = 0 Experimento.Show Unload Me End Sub
Private Sub Image5_Click() 'Activa la formulario de evaluación Qsalir = 1
VoltajePrim = Val(V_Entrada.Text) VoltajeSec = Val(V_Entrada3.Text) CorrienteSec = Val(V_Entrada4.Text)
Cálculo.Show 'Carga la formulario de los cálculos Unload Me 'Descarga la presente ventana End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image2.Picture = ImageList1.ListImages(2).Picture Label4.Caption = "Ayuda"
Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub
Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image3.Picture = ImageList1.ListImages(4).Picture Label4.Caption = "Teoría"
Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub
Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image4.Picture = ImageList1.ListImages(6).Picture Label4.Caption = "Atrás"
Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub
Private Sub Image5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image5.Picture = ImageList1.ListImages(8).Picture Label4.Caption = "Test Evaluativo"
Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub