VERSION 5.00 Begin VB.Form FormCampo Caption = "Datos Campo" ClientHeight = 3585 ClientLeft = 60 ClientTop = 450 ClientWidth = 8055 LinkTopic = "Form1" LockControls = -1 'True ScaleHeight = 3585 ScaleWidth = 8055 StartUpPosition = 2 'CenterScreen Begin VB.Frame Frame3 Caption = "Lazo a considerar :" Height = 3375 Left = 2760 TabIndex = 12 Top = 120 Width = 5175 Begin VB.OptionButton Option2 Caption = "Activos" Height = 255 Left = 120 TabIndex = 16 Top = 1920 Width = 1095 End Begin VB.OptionButton Option1 Caption = "Pasivos" Height = 375 Left = 120 TabIndex = 15 Top = 300 Value = -1 'True Width = 1095 End Begin VB.ListBox List2 Height = 1230 Left = 1320 TabIndex = 14 Top = 1920 Width = 3615 End Begin VB.ListBox List1 Height = 1230 Left = 1320 TabIndex = 13 Top = 360 Width = 3615 End End Begin VB.CommandButton Command2 Cancel = -1 'True Caption = "Cancelar" Height = 375 Left = 1560 TabIndex = 9 Top = 3120 Width = 1095 End Begin VB.Frame Frame2 Caption = "Rango Coordenada X" Height = 1695 Left = 120 TabIndex = 4 Top = 1320 Width = 2535 Begin VB.TextBox Text4 Height = 285 Left = 1440 TabIndex = 11 Top = 1260 Width = 735 End Begin VB.TextBox Text3 Height = 285 Left = 1440 TabIndex = 8 Top = 780 Width = 735 End Begin VB.TextBox Text2 Height = 285 Left = 1440 TabIndex = 7 Top = 300 Width = 735 End Begin VB.Label Label4 Caption = "Incremento :" Height = 255 Left = 240 TabIndex = 10 Top = 1320 Width = 1095 End Begin VB.Label Label3 Caption = "Xmax (m) :" Height = 255 Left = 240 TabIndex = 6 Top = 840 Width = 855 End Begin VB.Label Label2 Caption = "Xmin (m) :" Height = 255 Left = 240 TabIndex = 5 Top = 360 Width = 855 End End Begin VB.CommandButton Command1 Caption = "Aceptar" Height = 375 Left = 120 TabIndex = 3 Top = 3120 Width = 1095 End Begin VB.Frame Frame1 Caption = "Opciones" Height = 1215 Left = 120 TabIndex = 0 Top = 120 Width = 2535 Begin VB.TextBox Text5 Height = 285 Left = 1320 TabIndex = 19 Top = 780 Width = 495 End Begin VB.TextBox Text1 Height = 285 Left = 1320 TabIndex = 1 Top = 315 Width = 495 End Begin VB.Label Label7 Caption = "m" Height = 255 Left = 1920 TabIndex = 20 Top = 840 Width = 495 End Begin VB.Label Label6 Caption = "d postes" Height = 255 Left = 120 TabIndex = 18 Top = 840 Width = 975 End Begin VB.Label Label5 Caption = "Altura:" Height = 255 Left = 120 TabIndex = 17 Top = 360 Width = 1095 End Begin VB.Label Label1 Caption = "m" Height = 255 Left = 1920 TabIndex = 2 Top = 360 Width = 495 End End End Attribute VB_Name = "FormCampo" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Public noLlamesGraficas As Boolean Private Sub Command1_Click() ' Primero se comprueba que no haya casillas vacías If (Len(Text1.Text) = 0 Or Len(Text2.Text) = 0 Or Len(Text3.Text) = 0 Or _ Len(Text4.Text) = 0 Or Len(Text5.Text) = 0) Then If Principal.idioma = "Español" Then MsgBox "Atención. No puede dejar en blanco ninguna casilla", vbExclamation, "MitLoop" Else MsgBox "Please fill in all required fields", vbExclamation, "MitLoop" End If ElseIf (Not (IsNumeric(Text1.Text) And IsNumeric(Text2.Text) And IsNumeric(Text3.Text) And _ IsNumeric(Text4.Text) And IsNumeric(Text5.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay números con formato incorrecto", vbExclamation, "MitLoop" Else MsgBox "There are invalid numbers", vbExclamation, "MitLoop" End If ElseIf (InStr(1, Text1.Text, ".") <> 0 Or InStr(1, Text2.Text, ".") <> 0 Or _ InStr(1, Text4.Text, ".") <> 0 Or InStr(1, Text5.Text, ".") <> 0) Then If Principal.idioma = "Español" Then MsgBox "Utilice ',' como separador decimal.", vbExclamation, "MitLoop" Else MsgBox "Use ',' as decimal separator", vbExclamation, "MitLoop" End If ElseIf (CSng(Text2.Text) >= CSng(Text3.Text) Or CSng(Text4.Text) < 0 Or CSng(Text5.Text) < 0) Then If Principal.idioma = "Español" Then MsgBox "Introduzca valores lógicos. ", vbExclamation, "MitLoop" Else MsgBox "Please use logical values. ", vbExclamation, "MitLoop" End If Else ' Ponemos todas las variables 'calcular' de los lazos a false If (Module1.totalLazos > 0) Then Dim yy As Integer yy = 1 While (yy <= UBound(Module1.Lazos)) Lazos(yy).Calcular = False yy = yy + 1 Wend End If ' Ponemos su valor a esa variable. CrearInforme.distanciaPostes = CSng(Text5.Text) ' Para el lazo seleccionado, se pone su variable calcular a true Dim u As Integer Dim numero As String Dim posicion As Integer Dim posicion2 As Integer ' Lazos pasivos u = 0 While (u < List1.ListCount) If List1.Selected(u) Then numero = List1.List(u) posicion = InStr(1, Trim(numero), " ") posicion2 = InStr(1, Trim(numero), "(") numero = CInt(Mid(numero, posicion + 1, posicion2 - posicion - 1)) Lazos(numero).Calcular = True End If u = u + 1 Wend ' Lazos activos u = 0 While (u < List2.ListCount) If List2.Selected(u) Then numero = List2.List(u) posicion = InStr(1, Trim(numero), " ") posicion2 = InStr(1, Trim(numero), "(") numero = CInt(Mid(numero, posicion + 1, posicion2 - posicion - 1)) Lazos(numero).Calcular = True End If u = u + 1 Wend ' Ponemos resuelto a True Principal.resuelto = True ' Llamamos a la funcion que nos dibuja las graficas Campo.ficherosm Unload Me End If End Sub Private Sub Command2_Click() Principal.hasCancelado = True Unload Me End Sub Private Sub Form_Load() Dim aux As String Dim pos As Integer If Principal.idioma = "Español" Then Me.Caption = "Datos para cálculos" Frame1.Caption = "Altura de Cálculo" Frame2.Caption = "Rango Coordenada" Frame3.Caption = "Lazos a considerar" Option1.Caption = "Pasivos" Option2.Caption = "Activos" Label4.Caption = "Incremento (m) :" Else Me.Caption = "Field Data" Frame1.Caption = "Height value for analysis" Frame2.Caption = "X Range" Frame3.Caption = "Loop to use" Option1.Caption = "Passive :" Option2.Caption = "Active :" Label4.Caption = "Step (m) :" End If Text1.Text = "1" aux = CStr(Principal.xminima) pos = InStr(1, aux, ",") If pos <> 0 Then aux = Mid(aux, 1, pos - 1) & "," & Mid(aux, pos + 1, 2) End If Text2.Text = aux aux = CStr(Principal.xmaxima) pos = InStr(1, aux, ",") If pos <> 0 Then aux = Mid(aux, 1, pos - 1) & "," & Mid(aux, pos + 1, 2) End If Text3.Text = aux Text4.Text = "0,25" ' Rellenamos las casillas de lazos If Module1.totalLazos > 0 Then Dim n As Integer Dim miString As String Dim LazoOLoop As String If Principal.idioma = "Español" Then LazoOLoop = "Lazo " Else LazoOLoop = "Loop " End If n = 1 While (n <= UBound(Module1.Lazos)) If Lazos(n).pasivo = True Then Select Case Lazos(n).tipo Case Is = 2 List1.AddItem (LazoOLoop & Lazos(n).numero & " (" & _ Lazos(n).x1 & ", " & Lazos(n).y1 & ", " & Lazos(n).x2 & _ ", " & Lazos(n).y2 & ")") Case Is = 3 List1.AddItem (LazoOLoop & Lazos(n).numero & " (" & _ Lazos(n).x1 & ", " & Lazos(n).y1 & ", " & Lazos(n).x2 & ", " & _ Lazos(n).y2 & ", " & Lazos(n).x3 & ", " & Lazos(n).y3 & ")") Case Is = 4 List1.AddItem (LazoOLoop & Lazos(n).numero & " (" & _ Lazos(n).x1 & ", " & Lazos(n).y1 & ", " & Lazos(n).x2 & ", " & _ Lazos(n).y2 & ", " & Lazos(n).x3 & ", " & Lazos(n).y3 & ", " & _ Lazos(n).x4 & ", " & Lazos(n).y4 & ")") End Select Else Select Case Lazos(n).tipo Case Is = 2 List2.AddItem (LazoOLoop & CStr(Lazos(n).numero) & " (" & _ CStr(Lazos(n).x1) & ", " & CStr(Lazos(n).y1) & ", " & _ CStr(Lazos(n).x2) & ", " & Lazos(n).y2 & ")") Case Is = 3 List2.AddItem (LazoOLoop & Lazos(n).numero & " (" & _ Lazos(n).x1 & ", " & Lazos(n).y1 & ", " & Lazos(n).x2 & ", " & _ Lazos(n).y2 & ", " & Lazos(n).x3 & ", " & Lazos(n).y3 & ")") Case Is = 4 List2.AddItem (LazoOLoop & Lazos(n).numero & " (" & _ Lazos(n).x1 & ", " & Lazos(n).y1 & ", " & Lazos(n).x2 & ", " & _ Lazos(n).y2 & ", " & Lazos(n).x3 & ", " & Lazos(n).y3 & ", " & _ Lazos(n).x4 & ", " & Lazos(n).y4 & ")") End Select End If n = n + 1 Wend End If End Sub Private Sub List1_Click() Option1.Value = True Option1_Click End Sub Private Sub List2_Click() Option2.Value = True Option2_Click End Sub Private Sub Option1_Click() List2.Enabled = False List1.Enabled = True End Sub Private Sub Option2_Click() List1.Enabled = False List2.Enabled = True End Sub e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


PROGRAMA DE DISEÑO DE LAZOS ACTIVOS/PASIVOS PARA AMORTIGUAMIENTO DEL CAMPO MAGNÉTICO EN LÃNEAS ELÉCTRICAS AÉREAS DE ALTA TENSIÓN

: Casas Pérez, José Eduardo De Las
: Ingeniería Industrial
Contenido del proyecto: