VERSION 5.00 Begin VB.Form FormLazoActivo BorderStyle = 1 'Fixed Single Caption = "Crear nuevo Lazo Activo" ClientHeight = 8385 ClientLeft = 45 ClientTop = 435 ClientWidth = 6960 LinkTopic = "Form1" LockControls = -1 'True MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 8385 ScaleWidth = 6960 StartUpPosition = 2 'CenterScreen Begin VB.Frame Frame4 Caption = "Poste" Height = 1215 Left = 120 TabIndex = 53 Top = 4440 Width = 6735 Begin VB.CommandButton Command6 Caption = "Cambiar" Height = 375 Left = 4200 TabIndex = 60 Top = 720 Width = 1455 End Begin VB.TextBox Text24 Height = 285 Left = 4320 TabIndex = 59 Top = 300 Width = 1095 End Begin VB.TextBox Text23 Height = 285 Left = 1080 TabIndex = 57 Top = 740 Width = 1215 End Begin VB.TextBox Text22 Height = 285 Left = 1080 TabIndex = 55 Top = 300 Width = 1215 End Begin VB.Label Label24 Caption = "Precio (€/ud) :" Height = 255 Left = 2880 TabIndex = 58 Top = 360 Width = 1215 End Begin VB.Label Label23 Caption = "Altura (m) :" Height = 255 Left = 120 TabIndex = 56 Top = 800 Width = 1095 End Begin VB.Label Label22 Caption = "Tipo : " Height = 255 Left = 120 TabIndex = 54 Top = 360 Width = 855 End End Begin VB.Frame Frame3 Caption = "Conductor" Height = 1935 Left = 120 TabIndex = 38 Top = 2520 Width = 6735 Begin VB.TextBox Text21 Height = 285 Left = 1920 TabIndex = 52 Top = 1380 Width = 1095 End Begin VB.TextBox Text20 Height = 285 Left = 5040 TabIndex = 50 Top = 900 Width = 1095 End Begin VB.CommandButton Command4 Caption = "Cambiar" Height = 375 Left = 4200 TabIndex = 45 Top = 1380 Width = 1455 End Begin VB.TextBox Text18 Height = 285 Left = 1440 TabIndex = 44 Top = 900 Width = 1575 End Begin VB.TextBox Text17 Height = 285 Left = 5040 TabIndex = 42 Top = 420 Width = 1095 End Begin VB.TextBox Text16 Height = 285 Left = 1440 TabIndex = 40 Top = 420 Width = 1575 End Begin VB.Label Label21 Caption = "Coste (€/km) :" Height = 255 Left = 240 TabIndex = 51 Top = 1440 Width = 1215 End Begin VB.Label Label20 Caption = "Longitud (m) :" Height = 255 Left = 3360 TabIndex = 49 Top = 960 Width = 975 End Begin VB.Label Label18 Caption = "rgm (m) :" Height = 255 Left = 240 TabIndex = 43 Top = 960 Width = 975 End Begin VB.Label Label17 Caption = "R' (ohm/m) :" Height = 255 Left = 3360 TabIndex = 41 Top = 480 Width = 1215 End Begin VB.Label Label16 Caption = "Nombre :" Height = 255 Left = 240 TabIndex = 39 Top = 480 Width = 975 End End Begin VB.Frame Frame2 Caption = "Localizacion" Height = 2415 Left = 3360 TabIndex = 25 Top = 120 Width = 3495 Begin VB.TextBox Text12 Height = 285 Left = 2640 TabIndex = 8 Top = 1860 Width = 615 End Begin VB.TextBox Text11 Height = 285 Left = 960 TabIndex = 7 Top = 1860 Width = 615 End Begin VB.TextBox Text10 Height = 285 Left = 2640 TabIndex = 6 Top = 1380 Width = 615 End Begin VB.TextBox Text9 Height = 285 Left = 960 TabIndex = 5 Top = 1380 Width = 615 End Begin VB.TextBox Text8 Height = 285 Left = 2640 TabIndex = 4 Top = 885 Width = 615 End Begin VB.TextBox Text7 Height = 285 Left = 960 TabIndex = 3 Top = 885 Width = 615 End Begin VB.TextBox Text6 Height = 285 Left = 2640 TabIndex = 2 Top = 420 Width = 615 End Begin VB.TextBox Text5 Height = 285 Left = 960 TabIndex = 1 Top = 420 Width = 615 End Begin VB.Label Label12 Caption = "Y4 (m) :" Height = 255 Left = 1800 TabIndex = 33 Top = 1920 Width = 735 End Begin VB.Label Label11 Caption = "X4 (m) :" Height = 255 Left = 120 TabIndex = 32 Top = 1920 Width = 735 End Begin VB.Label Label10 Caption = "Y3 (m) :" Height = 255 Left = 1800 TabIndex = 31 Top = 1440 Width = 735 End Begin VB.Label Label9 Caption = "X3 (m) :" Height = 255 Left = 120 TabIndex = 30 Top = 1440 Width = 735 End Begin VB.Label Label8 Caption = "Y2 (m) :" Height = 255 Left = 1800 TabIndex = 29 Top = 960 Width = 735 End Begin VB.Label Label7 Caption = "X2 (m) :" Height = 255 Left = 120 TabIndex = 28 Top = 960 Width = 735 End Begin VB.Label Label6 Caption = "Y1 (m) :" Height = 255 Left = 1800 TabIndex = 27 Top = 480 Width = 735 End Begin VB.Label Label5 Caption = "X1 (m) :" Height = 255 Left = 120 TabIndex = 26 Top = 480 Width = 735 End End Begin VB.CommandButton Command3 Caption = "Cancelar" Height = 375 Left = 3960 TabIndex = 18 Top = 7920 Width = 1215 End Begin VB.CommandButton Command2 Caption = "Aceptar" Height = 375 Left = 1920 TabIndex = 17 Top = 7920 Width = 1215 End Begin VB.Frame Frame1 Caption = "Imagen" Height = 2415 Left = 120 TabIndex = 23 Top = 120 Width = 3135 Begin VB.PictureBox Picture1 Height = 2055 Left = 120 Picture = "FormLazoActivo.frx":0000 ScaleHeight = 1995 ScaleWidth = 2835 TabIndex = 24 Top = 240 Width = 2895 End End Begin VB.Frame Frame5 Caption = "Intensidad" Height = 2175 Left = 120 TabIndex = 0 Top = 5640 Width = 6735 Begin VB.CommandButton Command5 Caption = "Usar I sug." Height = 375 Left = 360 TabIndex = 48 Top = 1560 Width = 1815 End Begin VB.TextBox Text19 Enabled = 0 'False Height = 285 Left = 4440 TabIndex = 47 Top = 660 Width = 2055 End Begin VB.TextBox Text15 Height = 285 Left = 5760 TabIndex = 16 Top = 1500 Width = 735 End Begin VB.TextBox Text14 Height = 285 Left = 3600 TabIndex = 15 Top = 1500 Width = 855 End Begin VB.TextBox Text13 Height = 285 Left = 5760 TabIndex = 14 Top = 1140 Width = 735 End Begin VB.TextBox Text4 Height = 285 Left = 1200 TabIndex = 10 Top = 660 Width = 615 End Begin VB.TextBox Text1 Height = 285 Left = 1200 TabIndex = 9 Top = 300 Width = 615 End Begin VB.CommandButton Command1 Caption = "I sugerida" Height = 375 Left = 360 TabIndex = 11 Top = 1080 Width = 1815 End Begin VB.TextBox Text2 Enabled = 0 'False Height = 285 Left = 4440 TabIndex = 12 Top = 300 Width = 2055 End Begin VB.TextBox Text3 Height = 285 Left = 3600 TabIndex = 13 Top = 1140 Width = 855 End Begin VB.Label Label19 Caption = "I2 sug. (A, rms) :" Height = 255 Left = 2400 TabIndex = 46 Top = 720 Width = 1935 End Begin VB.Label Label15 Caption = "Fase 2 (º) :" Height = 255 Left = 4560 TabIndex = 36 Top = 1560 Width = 1335 End Begin VB.Label Label14 Caption = "Fase 1 (º) :" Height = 255 Left = 4560 TabIndex = 35 Top = 1200 Width = 1095 End Begin VB.Label Label13 Caption = "I2 (A, rms) :" Height = 255 Left = 2400 TabIndex = 34 Top = 1560 Width = 1695 End Begin VB.Label Label4 Caption = "Y (m) :" Height = 255 Left = 360 TabIndex = 22 Top = 720 Width = 615 End Begin VB.Label Label1 Caption = "X (m) :" Height = 255 Left = 360 TabIndex = 21 Top = 360 Width = 735 End Begin VB.Label Label2 Caption = "I1 sug. (A, rms) :" Height = 255 Left = 2400 TabIndex = 20 Top = 360 Width = 1935 End Begin VB.Label Label3 Caption = "I1 (A, rms) :" Height = 255 Left = 2400 TabIndex = 19 Top = 1200 Width = 1335 End End Begin VB.Label Editando Caption = "NO" Height = 375 Left = 600 TabIndex = 37 Top = 7920 Visible = 0 'False Width = 495 End End Attribute VB_Name = "FormLazoActivo" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim ok As Boolean Dim mensaje As String Public conductor As String Public poste As String Dim coma As Integer Dim comaanterior As Integer Public tipo As Integer Const pi As Single = 3.1416 Dim parte11 As String Dim parte12 As String Dim parte21 As String Dim parte22 As String Private Sub Command1_Click() ' Ponemos tipo a su valor If (Text11.Text = "N/A" And Text9.Text = "N/A") Then tipo = 2 ElseIf Text11.Text = "N/A" Then tipo = 3 Else tipo = 4 End If ' Comprobamos que todo está correcto para llamar al ejecutable auxiliar. ' No hay casillas vacías. If (Len(Text1.Text) = 0 Or Len(Text4.Text) = 0 Or Len(Text5.Text) = 0 Or Len(Text6.Text) = 0 Or _ Len(Text7.Text) = 0 Or Len(Text8.Text) = 0 Or Len(Text9.Text) = 0 Or Len(Text10.Text) = 0 Or _ Len(Text11.Text) = 0 Or Len(Text12.Text) = 0) Then If Principal.idioma = "Español" Then MsgBox "Rellene todas las casillas necesarias.", vbExclamation, "MitLoop" Else MsgBox "Please fill in all required fields.", vbExclamation, "MitLoop" End If ' Las casillas necesarias y comunes a todo tipo de lazo son números ElseIf Not (IsNumeric(Text1.Text) And IsNumeric(Text4.Text) And IsNumeric(Text5.Text) And _ IsNumeric(Text6.Text) And IsNumeric(Text7.Text) And IsNumeric(Text8.Text)) Then If Principal.idioma = "Español" Then MsgBox "Los valores de coordenadas deben ser numéricos.", vbExclamation, "MitLoop" Else MsgBox "Coordinates values must be valid numbers", vbExclamation, "MitLoop" End If ElseIf (tipo = 3 And Not (IsNumeric(Text9.Text) And IsNumeric(Text10.Text))) Then If Principal.idioma = "Español" Then MsgBox "Las coordenadas del lazo deben ser valores numéricos.", vbExclamation, "MitLoop" Else MsgBox "Loop coordinates must be valid numbers", vbExclamation, "MitLoop" End If ElseIf (tipo = 4 And Not (IsNumeric(Text9.Text) And IsNumeric(Text10.Text) And _ IsNumeric(Text11.Text) And IsNumeric(Text12.Text))) Then If Principal.idioma = "Español" Then MsgBox "Las coordenadas del lazo deben ser valores numéricos.", vbExclamation, "MitLoop" Else MsgBox "Loop coordinates must be valid numbers", vbExclamation, "MitLoop" End If Else ' Creamos los ficheros necesarios ' Fichero de lazos Campo.conductoresEquivalentes ' Ahora grabamos datos Dim ficherom As Integer Dim cadena As String Dim contador As Integer ficherom = FreeFile ' Borramos fichero previo si es que existía If Len(Dir$(App.Path & "\calculos\fases.txt")) > 0 Then Kill (App.Path & "\calculos\fases.txt") ' Creamos el nuevo Open (App.Path & "\calculos\fases.txt") For Output As ficherom ' Grabamos todas las fases equivalentes, por filas contador = 1 While (contador <= conductores) cadena = Campo.conductoresActivos(contador).Xi & ";" cadena = cadena & Campo.conductoresActivos(contador).Yi & ";" cadena = cadena & Campo.conductoresActivos(contador).intensidad & ";" cadena = cadena & Campo.conductoresActivos(contador).desfase & ";" cadena = Replace(cadena, ",", ".") Print #ficherom, cadena contador = contador + 1 Wend Close ficherom ' Ahora el fichero punto, que contiene las coordenadas del punto a optimizar. ficherom = FreeFile ' Borramos fichero previo si es que existía If Len(Dir$(App.Path & "\calculos\punto.txt")) > 0 Then Kill (App.Path & "\calculos\punto.txt") ' Creamos el nuevo Open (App.Path & "\calculos\punto.txt") For Output As ficherom ' Grabamos todas las fases equivalentes, por filas contador = 1 cadena = Text1.Text & ";" & Text4.Text Print #ficherom, cadena Close ficherom ' Finalmente las coordenadas del lazo ficherom = FreeFile ' Borramos fichero previo si es que existía If Len(Dir$(App.Path & "\calculos\lazoAct.txt")) > 0 Then Kill (App.Path & "\calculos\lazoAct.txt") ' Creamos el nuevo Open (App.Path & "\calculos\lazoAct.txt") For Output As ficherom If tipo = 2 Then Print #ficherom, "2;" & Text5.Text & ";" & Text6.Text & ";" & _ Text7.Text & ";" & Text8.Text & ";" ElseIf tipo = 3 Then Print #ficherom, "3;" & Text5.Text & ";" & Text6.Text & ";" & _ Text7.Text & ";" & Text8.Text & ";" & Text9.Text & ";" & _ Text10.Text & ";" Else Print #ficherom, "4;" & Text5.Text & ";" & Text6.Text & ";" & _ Text7.Text & ";" & Text8.Text & ";" & Text9.Text & ";" & _ Text10.Text & ";" & Text11.Text & ";" & Text12.Text & ";" End If Close ficherom ' Grabamos el path donde debe ir el fichero de salida ficherom = FreeFile If Len(Dir$(App.Path & "\calculos\path.txt")) > 0 Then Kill (App.Path & "\calculos\path.txt") Open (App.Path & "\calculos\path.txt") For Output As ficherom Print #ficherom, App.Path & "\calculos\" Close ficherom ' Nos cargamos los fichero de salida para evitar interferencias ' de alguna ejecucion anterior. If Len(Dir$(App.Path & "\calculos\Ioptima1.txt")) > 0 Then Kill (App.Path & "\calculos\Ioptima1.txt") End If If Len(Dir$(App.Path & "\calculos\Ioptima2.txt")) > 0 Then Kill (App.Path & "\calculos\Ioptima2.txt") End If ' Llamamos a la funcion Shell (App.Path & "\calculos\Iactiva.exe") ' Nos quedamos esperando a que termine el calculo If tipo <> 2 Then While (Len(Dir$(App.Path & "\calculos\Ioptima1.txt")) = 0 And _ Len(Dir$(App.Path & "\calculos\Ioptima2.txt")) = 0) Wend Else While (Len(Dir$(App.Path & "\calculos\Ioptima1.txt")) = 0) Wend End If ' Ahora metemos el(los) valor(es) en la casilla Dim fidd As Integer Dim ff As String Dim auxi As Integer Dim auxi2 As Single fidd = FreeFile Open (App.Path & "\calculos\Ioptima1.txt") For Input As fidd Line Input #fidd, ff auxi = InStr(1, ff, ";") If auxi <> 0 Then parte11 = Mid(ff, 1, auxi - 1) parte12 = Mid(ff, auxi + 1, Len(ff) - auxi) End If ' Si parte11 tiene '.' se le cambia por ',' auxi = InStr(1, parte11, ".") If auxi > 0 Then parte11 = Mid(parte11, 1, auxi - 1) & "," & _ Mid(parte11, auxi + 1, Len(parte11) - auxi) Else parte11 = Mid(parte11, 1, Len(parte11) - 1) End If auxi = InStr(1, parte12, ".") If auxi > 0 Then parte12 = Mid(parte12, 1, auxi - 1) & "," & _ Mid(parte12, auxi + 1, Len(parte12) - auxi) Else parte12 = Mid(parte12, 1, Len(parte12) - 1) End If parte12 = CStr(CSng(parte12) * 180 / pi) Text2.Text = parte11 & " |_" & parte12 Close fidd If (tipo <> 2) Then fidd = FreeFile Open (App.Path & "\calculos\Ioptima2.txt") For Input As fidd Line Input #fidd, ff auxi = InStr(1, ff, ";") parte21 = Mid(ff, 1, auxi - 1) parte22 = Mid(ff, auxi + 1, Len(ff) - auxi) ' Si parte11 tiene '.' se le cambia por ',' auxi = InStr(1, parte21, ".") If auxi > 0 Then parte21 = Mid(parte21, 1, auxi - 1) & "," & _ Mid(parte21, auxi + 1, Len(parte21) - auxi) Else parte21 = Mid(parte21, 1, Len(parte21) - 1) End If auxi = InStr(1, parte22, ".") If auxi > 0 Then parte22 = Mid(parte22, 1, auxi - 1) & "," & _ Mid(parte22, auxi + 1, Len(parte22) - auxi) Else parte22 = Mid(parte22, 1, Len(parte22) - 1) End If parte22 = CStr(CSng(parte22) * 180 / pi) Text19.Text = parte21 & " |_" & parte22 Close fidd End If End If End Sub Private Sub Command2_Click() ok = True ' No puede haber casillas vacias. If (Len(Text1.Text) = 0 Or Len(Text3.Text) = 0 Or Len(Text4.Text) = 0 Or Len(Text5.Text) = 0 Or _ Len(Text6.Text) = 0 Or Len(Text7.Text) = 0 Or Len(Text8.Text) = 0 Or Len(Text9.Text) = 0 Or _ Len(Text10.Text) = 0 Or Len(Text11.Text) = 0 Or Len(Text12.Text) = 0 Or _ Len(Text13.Text) = 0 Or Len(Text14.Text) = 0 Or Len(Text15.Text) = 0 Or _ Len(Text20.Text) = 0) Then If Principal.idioma = "Español" Then MsgBox "Rellene todas las casillas necesarias.", vbExclamation, "MitLoop" Else MsgBox "Please fill in all required fields.", vbExclamation, "MitLoop" End If ' El separador decimal debe ser ',' ElseIf (InStr(1, Text1.Text, ".") <> 0 Or InStr(1, Text3.Text, ".") <> 0 Or _ InStr(1, Text4.Text, ".") <> 0 Or InStr(1, Text5.Text, ".") <> 0 Or _ InStr(1, Text6.Text, ".") <> 0 Or InStr(1, Text7.Text, ".") <> 0 Or _ InStr(1, Text8.Text, ".") <> 0 Or InStr(1, Text9.Text, ".") <> 0 Or _ InStr(1, Text10.Text, ".") <> 0 Or InStr(1, Text11.Text, ".") <> 0 Or _ InStr(1, Text13.Text, ".") <> 0 Or InStr(1, Text14.Text, ".") <> 0 Or _ InStr(1, Text15.Text, ".") <> 0 Or InStr(1, Text20.Text, ".") <> 0) Then If Principal.idioma = "Español" Then MsgBox "Utilize ',' como separador decimal", vbInformation, "MitLoop" Else MsgBox "Please use ',' as decimal separador", vbInformation, "MitLoop" End If ' Vemos si las casillas necesarias para lazo simple estan correctas. ElseIf (Text9.Text = "N/A" And Text11.Text = "N/A" And Not (IsNumeric(Text5.Text) And _ IsNumeric(Text6.Text) And IsNumeric(Text7.Text) And IsNumeric(Text8.Text) And _ IsNumeric(Text3.Text) And IsNumeric(Text13.Text) And IsNumeric(Text20.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay valores no válidos.", vbExclamation, "MitLoop" Else MsgBox "There are invalid values.", vbExclamation, "MitLoop" End If ' idem lazo doble conductor comun ElseIf (Text11.Text = "N/A" And Text9.Text <> "N/A" And Not (IsNumeric(Text5.Text) And _ IsNumeric(Text6.Text) And IsNumeric(Text7.Text) And IsNumeric(Text8.Text) And _ IsNumeric(Text9.Text) And IsNumeric(Text10.Text) And IsNumeric(Text1.Text) And _ IsNumeric(Text4.Text) And IsNumeric(Text3.Text) And IsNumeric(Text13.Text) And _ IsNumeric(Text20.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay valores no válidos.", vbExclamation, "MitLoop" Else MsgBox "There are invalid values.", vbExclamation, "MitLoop" End If ' idem lazo doble ElseIf (Text11.Text <> "N/A" And Text9.Text <> "N/A" And Not (IsNumeric(Text5.Text) And _ IsNumeric(Text6.Text) And IsNumeric(Text7.Text) And IsNumeric(Text8.Text) And _ IsNumeric(Text9.Text) And IsNumeric(Text10.Text) And IsNumeric(Text11.Text) And _ IsNumeric(Text12.Text) And IsNumeric(Text3.Text) And IsNumeric(Text13.Text) And _ IsNumeric(Text14.Text) And IsNumeric(Text15.Text) And IsNumeric(Text20.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay valores no válidos.", vbExclamation, "MitLoop" Else MsgBox "There are invalid values.", vbExclamation, "MitLoop" End If ElseIf CSng(Text20.Text) < 0 Then If Principal.idioma = "Español" Then MsgBox "El valor de la loingitud no puede ser " & _ "negativo o cero", vbExclamation, "MitLoop" Else MsgBox "Loop length value must be positive", vbExclamation, "MitLoop" End If ' Comprobamos que no haya un conductor encima de otro del mismo lazo ' Lazo 2 conductores ElseIf (Text9.Text = "N/A" And Text11.Text = "N/A" And (Text5.Text = Text7.Text And _ Text6.Text = Text8.Text)) Then If Principal.idioma = "Español" Then MsgBox "Hay conductores superpuestos.", vbExclamation, "MitLoop" Else MsgBox "There are conductors at the same coordinates.", vbExclamation, "MitLoop" End If ElseIf (Text11.Text = "N/A" And ((Text5.Text = Text7.Text And _ Text6.Text = Text8.Text) Or (Text5.Text = Text9.Text And _ Text8.Text = Text10.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay conductores superpuestos.", vbExclamation, "MitLoop" Else MsgBox "There are conductors at the same coordinates.", vbExclamation, "MitLoop" End If ElseIf (Text11.Text <> "N/A" And Text9 <> "N/A" And ((Text5.Text = Text7.Text And _ Text6.Text = Text8.Text) Or (Text5.Text = Text9.Text And _ Text6.Text = Text10.Text) Or (Text5.Text = Text11.Text And _ Text6.Text = Text12.Text) Or (Text7.Text = Text9.Text And _ Text8.Text = Text10.Text) Or (Text7.Text = Text11.Text And _ Text8.Text = Text12.Text) Or (Text9.Text = Text11.Text And _ Text10.Text = Text12.Text))) Then If Principal.idioma = "Español" Then MsgBox "Hay conductores superpuestos.", vbExclamation, "MitLoop" Else MsgBox "There are conductors at the same coordinates.", vbExclamation, "MitLoop" End If Else If Editando = "NO" Then Module1.añadeLazoActivo Else Me.Hide End If End If End Sub Private Sub Command3_Click() Module1.RedibujaImagen Module1.HaCancelado = True Unload Me End Sub Private Sub Command4_Click() ' Cambiamos de conductor de lazo Load SelConductor SelConductor.soloDimeConductor = True SelConductor.quienLlamo = "Activo" SelConductor.Show vbModal SelConductor.soloDimeConductor = False SelConductor.quienLlamo = "" Unload SelConductor ' Ahora tendremos en conductor los datos del nuevo conductor If Len(conductor) > 0 Then ponDatosConductor (conductor) End If End Sub Private Sub Command5_Click() Dim cadenita As String If (Text2.Text = "N/A" And Text19.Text = "N/A") Then If Principal.idioma = "Español" Then MsgBox "Obtenga primero la(s) intendidad(es) sugeridas", vbExclamation, "MitLoop" Else MsgBox "First you need to get suggested current(s)", vbExclamation, "MitLoop" End If Else Text3.Text = parte11 Text13 = parte12 If tipo <> 2 Then Text14.Text = parte21 Text15.Text = parte22 End If End If End Sub Private Sub Command6_Click() ' Cambiamos de poste de lazo Load SelPoste SelPoste.soloDimeConductor = True SelPoste.quienLlamo = "Activo" SelPoste.Show vbModal SelPoste.soloDimeConductor = False SelPoste.quienLlamo = "" Unload SelPoste ' Ahora tendremos en conductor los datos del nuevo conductor If Len(poste) > 0 Then ponDatosPoste (poste) End If End Sub Private Sub Form_Load() ' Según el idioma, cambiamos el texto de lo que hay que cambiar If Principal.idioma = "Español" Then FormLazoActivo.Caption = "Crear nuevo lazo activo" Frame1.Caption = "Imagen" Frame2.Caption = "Localización" Frame3.Caption = "Conductor" Frame4.Caption = "Poste" Frame5.Caption = "Intensidad" Label14.Caption = "Fase 1 (º):" Label15.Caption = "Fase 2 (º):" Label16.Caption = "Nombre :" Label20.Caption = "Longitud (m) :" Label21.Caption = "Coste (€/km) :" Label22.Caption = "Tipo :" Label23.Caption = "Altura (m) :" Label24.Caption = "Precio (€/ud) :" Command1.Caption = "I sugerida" Command2.Caption = "Aceptar" Command3.Caption = "Cancelar" Command4.Caption = "Cambiar" Command5.Caption = "Usar I sug." Command6.Caption = "Cambiar" Else FormLazoActivo.Caption = "New Active Loop" Frame1.Caption = "Image" Frame2.Caption = "Localization" Frame3.Caption = "Conductor" Frame4.Caption = "Tower" Frame5.Caption = "Current" Label14.Caption = "Phase 1 (º):" Label15.Caption = "Phase 2 (º):" Label16.Caption = "Name :" Label20.Caption = "Length (m) :" Label21.Caption = "Cost (€/km) :" Label22.Caption = "Type :" Label23.Caption = "Height (m) :" Label24.Caption = "Cost (€/ud) :" Command1.Caption = "Suggested I" Command2.Caption = "OK" Command3.Caption = "Cancel" Command4.Caption = "Change" Command5.Caption = "Use sug. I" Command6.Caption = "Change" End If Principal.manual = True Text2.Text = "N/A" Text19.Text = "N/A" Text1.Text = "0" Text4.Text = "1" If SelLazo.Option1.Value = True Then Text5.Text = "-12" Text6.Text = "25" Text7.Text = "12" Text8.Text = "25" Text9.Enabled = False Text9.Text = "N/A" Text10.Enabled = False Text10.Text = "N/A" Text11.Enabled = False Text11.Text = "N/A" Text12.Enabled = False Text12.Text = "N/A" Text3.Text = "100" Text13.Text = "-45" Text14.Enabled = False Text14.Text = "N/A" Text15.Enabled = False Text15.Text = "N/A" ElseIf SelLazo.Option2.Value = True Then Text5.Text = "-12" Text6.Text = "25" Text7.Text = "0" Text8.Text = "25" Text9.Enabled = True Text9.Text = "12" Text10.Enabled = True Text10.Text = "25" Text11.Enabled = False Text11.Text = "N/A" Text12.Enabled = False Text12.Text = "N/A" Text3.Enabled = True Text3.Text = "100" Text13.Enabled = True Text13.Text = "-40" Text14.Enabled = True Text14.Text = "105" Text15.Enabled = True Text15.Text = "-45" Else Text5.Text = "-12" Text6.Text = "25" Text7.Text = "-4" Text8.Text = "25" Text9.Enabled = True Text9.Text = "4" Text10.Enabled = True Text10.Text = "25" Text11.Enabled = True Text11.Text = "12" Text12.Enabled = True Text12.Text = "25" Text3.Enabled = True Text3.Text = "75" Text13.Enabled = True Text13.Text = "-40" Text14.Enabled = True Text14.Text = "85" Text15.Enabled = True Text15.Text = "-45" End If ' Ahora leemos nombre, R' y rgm del conductor, si existen. If Len(conductor) > 0 Then ponDatosConductor (conductor) If Len(poste) > 0 Then ponDatosPoste (poste) End Sub Sub ponDatosPoste(ByVal cadena As String) ' Tipo comaanterior = 1 coma = InStr(1, cadena, ";") Text22.Text = Trim(Mid(cadena, 1, coma - 1)) ' Altura comaanterior = coma + 1 coma = InStr(comaanterior, cadena, ";") Text23.Text = Trim(Mid(cadena, comaanterior, coma - comaanterior)) ' Precio comaanterior = coma + 1 coma = InStr(comaanterior, cadena, ":") If coma = 0 Then coma = Len(cadena) Text24.Text = Trim(Mid(cadena, comaanterior, coma - comaanterior)) End Sub Sub ponDatosConductor(ByVal cadena As String) comaanterior = 1 coma = InStr(1, conductor, ";") Text16.Text = Trim(Mid(conductor, 1, coma - 1)) comaanterior = coma + 1 coma = InStr(comaanterior, conductor, ";") Text17.Text = Trim(Mid(conductor, comaanterior, coma - comaanterior)) comaanterior = coma + 1 coma = InStr(comaanterior, conductor, ";") If coma = 0 Then coma = Len(conductor) Text18.Text = Trim(Mid(conductor, comaanterior, coma - comaanterior)) comaanterior = coma + 1 coma = InStr(comaanterior, conductor, ":") If coma = 0 Then coma = Len(conductor) Text21.Text = Trim(Mid(conductor, comaanterior, coma - comaanterior)) 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: