Alejandro Acuña
2024-08-12 831c7bd85763b5eb5ef46664c65f0181824f9e13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
Friend Class frmMain_OLD
    Inherits System.Windows.Forms.Form
 
#Region "Controles"
    Friend WithEvents BtnSalir As System.Windows.Forms.Button
    Friend WithEvents BtnLog As System.Windows.Forms.Button
#End Region
 
#Region "Declaraciones"
    Dim Postes As New Collection
    Friend WithEvents Logo As System.Windows.Forms.PictureBox
    Friend WithEvents ImageListLeds As System.Windows.Forms.ImageList
    Friend WithEvents ListaPostes As New E301ControlDemo.ClassSosPhoneList
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents ImageListLogo As System.Windows.Forms.ImageList
    Friend WithEvents LBMasterSlave As System.Windows.Forms.ListBox
#End Region
 
#Region "Código generado por el Diseñador de Windows Forms "
    Public Sub New()
        MyBase.New()
        If m_vb6FormDefInstance Is Nothing Then
            If m_InitializingDefInstance Then
                m_vb6FormDefInstance = Me
            Else
                Try
                    'Para el formulario de inicio, la primera instancia creada es la instancia predeterminada.
                    If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
                        m_vb6FormDefInstance = Me
                    End If
                Catch
                End Try
            End If
        End If
        'El Diseñador de Windows Forms requiere esta llamada.
        InitializeComponent()
    End Sub
    'Form reemplaza a Dispose para limpiar la lista de componentes.
    Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
        If Disposing Then
            If Not components Is Nothing Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(Disposing)
    End Sub
    'Requerido por el Diseñador de Windows Forms
    Private components As System.ComponentModel.IContainer
    Public ToolTip1 As System.Windows.Forms.ToolTip
    'Public WithEvents TcpClient As AxMSWinsockLib.AxWinsock
    'NOTA: el siguiente procedimiento es necesario para el Diseñador de Windows Forms
    'Se puede modificar mediante el Diseñador de Windows Forms.
    'No lo modifique con el editor de código.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMain_OLD))
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.BtnSalir = New System.Windows.Forms.Button
        Me.BtnLog = New System.Windows.Forms.Button
        Me.ImageListLeds = New System.Windows.Forms.ImageList(Me.components)
        Me.ImageListLogo = New System.Windows.Forms.ImageList(Me.components)
        Me.Logo = New System.Windows.Forms.PictureBox
        Me.ListaPostes = New E301ControlDemo.ClassSosPhoneList
        Me.Label2 = New System.Windows.Forms.Label
        Me.LBMasterSlave = New System.Windows.Forms.ListBox
        CType(Me.Logo, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'BtnSalir
        '
        Me.BtnSalir.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.BtnSalir.Location = New System.Drawing.Point(511, 288)
        Me.BtnSalir.Name = "BtnSalir"
        Me.BtnSalir.Size = New System.Drawing.Size(75, 23)
        Me.BtnSalir.TabIndex = 27
        Me.BtnSalir.Text = "SALIR"
        Me.BtnSalir.UseVisualStyleBackColor = True
        '
        'BtnLog
        '
        Me.BtnLog.Location = New System.Drawing.Point(430, 288)
        Me.BtnLog.Name = "BtnLog"
        Me.BtnLog.Size = New System.Drawing.Size(75, 23)
        Me.BtnLog.TabIndex = 1
        Me.BtnLog.Text = "Ver Log..."
        Me.BtnLog.UseVisualStyleBackColor = True
        '
        'ImageListLeds
        '
        Me.ImageListLeds.ImageStream = CType(resources.GetObject("ImageListLeds.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageListLeds.TransparentColor = System.Drawing.Color.White
        Me.ImageListLeds.Images.SetKeyName(0, "Verde")
        Me.ImageListLeds.Images.SetKeyName(1, "Rojo")
        Me.ImageListLeds.Images.SetKeyName(2, "Off")
        '
        'ImageListLogo
        '
        Me.ImageListLogo.ImageStream = CType(resources.GetObject("ImageListLogo.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.ImageListLogo.TransparentColor = System.Drawing.Color.White
        Me.ImageListLogo.Images.SetKeyName(0, "logo")
        '
        'Logo
        '
        Me.Logo.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
        Me.Logo.Location = New System.Drawing.Point(12, 257)
        Me.Logo.Margin = New System.Windows.Forms.Padding(0)
        Me.Logo.Name = "Logo"
        Me.Logo.Size = New System.Drawing.Size(238, 54)
        Me.Logo.TabIndex = 32
        Me.Logo.TabStop = False
        '
        'ListaPostes
        '
        Me.ListaPostes.BackColor = System.Drawing.Color.White
        Me.ListaPostes.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable
        Me.ListaPostes.FormattingEnabled = True
        Me.ListaPostes.Location = New System.Drawing.Point(12, 52)
        Me.ListaPostes.Name = "ListaPostes"
        Me.ListaPostes.Size = New System.Drawing.Size(200, 196)
        Me.ListaPostes.TabIndex = 33
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.Location = New System.Drawing.Point(12, 36)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(71, 13)
        Me.Label2.TabIndex = 34
        Me.Label2.Text = "SOS Phones:"
        '
        'LBMasterSlave
        '
        Me.LBMasterSlave.FormattingEnabled = True
        Me.LBMasterSlave.Items.AddRange(New Object() {"Master", "Slave"})
        Me.LBMasterSlave.Location = New System.Drawing.Point(218, 52)
        Me.LBMasterSlave.Name = "LBMasterSlave"
        Me.LBMasterSlave.Size = New System.Drawing.Size(92, 30)
        Me.LBMasterSlave.TabIndex = 29
        '
        'frmMain
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.SystemColors.Control
        Me.ClientSize = New System.Drawing.Size(709, 317)
        Me.Controls.Add(Me.LBMasterSlave)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.ListaPostes)
        Me.Controls.Add(Me.Logo)
        Me.Controls.Add(Me.BtnLog)
        Me.Controls.Add(Me.BtnSalir)
        Me.Cursor = System.Windows.Forms.Cursors.Default
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.HelpButton = True
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Location = New System.Drawing.Point(4, 23)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmMain"
        Me.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me.Text = "EQUITEL E301 Control Demo"
        CType(Me.Logo, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()
 
    End Sub
#End Region
 
#Region "Soporte para la actualización "
    Private Shared m_vb6FormDefInstance As frmMain_OLD
    Private Shared m_InitializingDefInstance As Boolean
    Public Shared Property DefInstance() As frmMain_OLD
        Get
            If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
                m_InitializingDefInstance = True
                m_vb6FormDefInstance = New frmMain_OLD()
                m_InitializingDefInstance = False
            End If
            DefInstance = m_vb6FormDefInstance
        End Get
        Set(ByVal value As frmMain_OLD)
            m_vb6FormDefInstance = value
        End Set
    End Property
#End Region
 
 
    Private Sub frmPrincipal_HelpButtonClicked(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles Me.HelpButtonClicked
        Dim F As New Form
        F = AboutBox2
        F.ShowDialog()
        e.Cancel = True
    End Sub
 
    Private Sub Form_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
        Dim Linea(255) As String
        Const ConfigurationFile As String = "E301_Control_Demo.ini"
 
        Control.CheckForIllegalCrossThreadCalls = False
        VentanaLog.Show()
        'VentanaLog.Hide()
        ListaPostes.DisplayMember = "Nombre"
        TestMode = True
 
        Try
            Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(ConfigurationFile)
                MyReader.TextFieldType = FileIO.FieldType.Delimited
                MyReader.HasFieldsEnclosedInQuotes = True
                MyReader.SetDelimiters(" ")
                While Not MyReader.EndOfData
                    Try
                        Linea = MyReader.ReadFields()
                        If UCase(Linea(0)) = "POSTE" Then
                            If UBound(Linea) <> 4 Then
                                MsgBox("Numero erroneo de campos en definición poste en fichero .ini")
                            Else
                                CreaPoste(Linea(1), Linea(2), CInt(Linea(3)), CInt(Linea(4)))
                            End If
                        End If
                        If UCase(Linea(0)) = "MODOPRUEBAS" Then
                            TestMode = (UCase(Linea(1)) = "SI")
                        End If
                    Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
                        If Mid(Linea(0), 1, 1) <> "#" Then
                            MsgBox("Fichero .ini: Error de sintaxis: " & ex.Message)
                        End If
                    End Try
                End While
            End Using
        Catch
            MsgBox("ERROR: Configuration file '" + ConfigurationFile + "' not found", MsgBoxStyle.Critical)
            End
        End Try
 
        If ListaPostes.Items.Count > 0 Then ListaPostes.SelectedIndex = 0
 
        Logo.Image = ImageListLogo.Images.Item("Logo")
        LedTestFon.Image = ImageListLeds.Images.Item("Off")
        lblVol.Text = "(D)"
        'lblVolMic.Text = "(D)"
        LBMasterSlave.SelectedIndex = 0
    End Sub
 
    Private Sub CreaPoste(ByVal Ip As String, ByVal Comentario As String, ByVal PuertoCTRL As Integer, ByVal PuertoRTP As Integer)
        Dim Poste As ClasePoste
        Static N As Integer = 1
        Poste = New ClasePoste(Ip, N, Comentario)
        Poste.PuertoCTRL = PuertoCTRL
        Poste.PuertoRTP = PuertoRTP
        AddHandler Poste.Log, AddressOf OnLog
        AddHandler Poste.OnExitoConexion, AddressOf OnExitoConexion
        AddHandler Poste.OnFalloConexion, AddressOf OnFalloConexion
        AddHandler Poste.OnRespuestaTestFonia, AddressOf OnResultadoTestFonia
        AddHandler Poste.OnEnvioAlarmas, AddressOf OnEnvioAlarmas
        AddHandler Poste.OnRespuestaTestMantenimiento, AddressOf OnRespuestaTestMantenimiento
        AddHandler Poste.OnLecturaIO, AddressOf OnLecturaIO
        Postes.Add(Poste, N)
        ListaPostes.Items.Add(Poste)
        N = N + 1
    End Sub
 
 
    Private Sub OnFalloConexion(ByVal NumeroPoste As Integer)
        ListaPostes.MyRefresh()
    End Sub
 
    Private Sub OnExitoConexion(ByVal NumeroPoste As Integer)
        ListaPostes.MyRefresh()
    End Sub
 
    Private Sub OnLog(ByVal S As String, ByVal NumeroPoste As Integer)
        VentanaLog.NuevaLinea = "P_" + Str(NumeroPoste) + "->" + S + vbCrLf
    End Sub
 
 
    Private Function MasterOrSlave() As Byte
        If LBMasterSlave.SelectedIndex = 1 Then
            Return P_ESC
        Else
            Return P_MAS
        End If
    End Function
 
 
 
    Private Sub Btn_VOZ_ON_LL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.ActivarSintetizador(ClasePoste.TiposMensaje.LlamadaRecibida, MasterOrSlave())
    End Sub
 
    Private Sub Btn_VOZ_ON_F_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.ActivarSintetizador(ClasePoste.TiposMensaje.FueraDeServicio, MasterOrSlave())
    End Sub
 
    Private Sub Btn_VOZ_OFF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.DesactivarSintetizador(MasterOrSlave())
    End Sub
 
    Private Sub BtnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSalir.Click
        End
    End Sub
 
    Private Sub BtnLog_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLog.Click
        frmLog.Show()
    End Sub
 
    Private Sub BtnTonoLlamadaON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.ActivarTono(MasterOrSlave(), ClasePoste.TiposTono.Llamada)
    End Sub
 
    Private Sub BtnTonoComON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.ActivarTono(MasterOrSlave(), ClasePoste.TiposTono.Comunicando)
    End Sub
 
    Private Sub BtnTonoOFF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.DesactivarTono(MasterOrSlave())
    End Sub
 
    Private Sub BtnFoniaOn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.ActivarFoníaDesdeCentral(MasterOrSlave())
    End Sub
 
    Private Sub BtnFoniaOff_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.DesactivarFoníaDesdeCentral(MasterOrSlave())
    End Sub
 
    Private Sub BtnTestMantenimiento_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.TestMantenimiento()
    End Sub
 
    Private Sub BtnTestFonia_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        LedTestFon.Image = ImageListLeds.Images.Item("Off")
        P.TestFonia(MasterOrSlave())
    End Sub
 
    Private Sub BtnLeerIO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.LecturaPuerto()
    End Sub
 
    Private Sub BtnEscribirIO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        Dim Valor As Byte = 0
        If Bt_Salida_0.Text = "1" Then Valor = Valor Or &H1
        If Bt_Salida_1.Text = "1" Then Valor = Valor Or &H2
        If Bt_Salida_2.Text = "1" Then Valor = Valor Or &H4
        If Bt_Salida_3.Text = "1" Then Valor = Valor Or &H8
        If Bt_Salida_4.Text = "1" Then Valor = Valor Or &H10
        If Bt_Salida_5.Text = "1" Then Valor = Valor Or &H20
        If Bt_Salida_6.Text = "1" Then Valor = Valor Or &H40
        If Bt_Salida_7.Text = "1" Then Valor = Valor Or &H80
        P = ListaPostes.SelectedItem
        P.EscrituraPuerto(Valor)
    End Sub
 
    Private Sub OnResultadoTestFonia(ByVal Resultado As Byte)
        If Resultado = TST_OK Then
            LedTestFon.Image = ImageListLeds.Images.Item("Verde")
        Else
            LedTestFon.Image = ImageListLeds.Images.Item("Rojo")
        End If
    End Sub
 
    Private Sub OnEnvioAlarmas(ByVal EstadoMaestro As Byte, ByVal EstadoEsclavo As Byte, ByVal NumeroPoste As Byte)
        If ListaPostes.SelectedIndex = (NumeroPoste - 1) Then
            RefrescaEstadoAlarmas()
        End If
    End Sub
 
    Private Sub OnLecturaIO(ByVal Valor As Byte)
        RB_Entrada_0.Checked = ((Valor And &H1) <> 0)
        RB_Entrada_1.Checked = ((Valor And &H2) <> 0)
        RB_Entrada_2.Checked = ((Valor And &H4) <> 0)
        RB_Entrada_3.Checked = ((Valor And &H8) <> 0)
        RB_Entrada_4.Checked = ((Valor And &H10) <> 0)
        RB_Entrada_5.Checked = ((Valor And &H20) <> 0)
        RB_Entrada_6.Checked = ((Valor And &H40) <> 0)
        RB_Entrada_7.Checked = ((Valor And &H80) <> 0)
    End Sub
 
    Private Sub RefrescaEstadoAlarmas()
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        If P.AlarmasActualizadas Then
            ChkBx_PAM.Checked = P.PuertaAbiertaMaestro
            ChkBx_PAE.Checked = P.PuertaAbiertaEsclavo
            ChkBx_FM.Checked = P.FoniaOnMaestro
            ChkBx_FE.Checked = P.FoniaOnEsclavo
            ChkBx_TM.Checked = P.TonoOnMaestro
            ChkBx_TE.Checked = P.TonoOnEsclavo
            ChkBx_BB.Checked = P.BateriaBaja
            ChkBx_AL.Checked = P.FalloAlimentacion
        Else
            ChkBx_PAM.Checked = False
            ChkBx_PAE.Checked = False
            ChkBx_FM.Checked = False
            ChkBx_FE.Checked = False
            ChkBx_TM.Checked = False
            ChkBx_TE.Checked = False
            ChkBx_BB.Checked = False
            ChkBx_AL.Checked = False
            ChkBx_PAM.CheckState = CheckState.Indeterminate
            ChkBx_PAE.CheckState = CheckState.Indeterminate
            ChkBx_FM.CheckState = CheckState.Indeterminate
            ChkBx_FE.CheckState = CheckState.Indeterminate
            ChkBx_TM.CheckState = CheckState.Indeterminate
            ChkBx_TE.CheckState = CheckState.Indeterminate
            ChkBx_BB.CheckState = CheckState.Indeterminate
            ChkBx_AL.CheckState = CheckState.Indeterminate
        End If
    End Sub
 
    Private Sub ListaPostes_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
 
        RefrescaHabilitacionBotones()
        'Hacemos un test de mantenimiento para que se refresque el valor
        'de volumen y las alarmas
        If P.Conectado Then P.TestMantenimiento()
    End Sub
 
 
    Private Sub RefrescaHabilitacionBotones()
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
 
        Me.GB_CanEco.Enabled = P.Conectado
        Me.Btn_ECO_OFF.Enabled = P.Conectado
        Me.Btn_ECO_ON.Enabled = P.Conectado
        Me.AjusteVolumen.Enabled = P.Conectado
        Me.BtnFoniaOff.Enabled = P.Conectado
        Me.BotFoniaOn.Enabled = P.Conectado
        Me.BtnTonoComON.Enabled = P.Conectado
        Me.BtnTonoOFF.Enabled = P.Conectado
        Me.BtnTonoLamadaON.Enabled = P.Conectado
        Me.Btn_VOZ_OFF.Enabled = P.Conectado
        Me.Btn_VOZ_ON_F.Enabled = P.Conectado
        Me.Btn_VOZ_ON_LL.Enabled = P.Conectado
        Me.BtnTestFonia.Enabled = P.Conectado
        Me.BtnTestMantenimiento.Enabled = P.Conectado
        Me.GB_Salidas.Enabled = P.Conectado
        Me.GB_Entradas.Enabled = P.Conectado
        Me.BtnEscribirIO.Enabled = P.Conectado
        Me.BtnLeerIO.Enabled = P.Conectado
        Me.Label4.Enabled = P.Conectado
        Me.lblVol.Enabled = P.Conectado
    End Sub
 
 
    Private Sub OnRespuestaTestMantenimiento(ByVal NumeroPoste As Byte)
        If ListaPostes.SelectedIndex = (NumeroPoste - 1) Then
            RefrescaEstadoAlarmas()
            RefrescaEstadoVolumen()
        End If
    End Sub
 
    Private Sub RefrescaEstadoVolumen()
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        If P.VolumenMaestro > 1 And P.VolumenMaestro < 7 Then
            AjusteVolumen.Value = P.VolumenMaestro
            lblVol.Text = P.VolumenMaestro.ToString
        Else
            AjusteVolumen.Value = 1
            lblVol.Text = "¿" + P.VolumenMaestro.ToString + "?"
        End If
    End Sub
 
    Private Sub AjusteVolumen_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        Dim P As ClasePoste
        If e.Button = Windows.Forms.MouseButtons.Left Then
            P = ListaPostes.SelectedItem
            P.AjusteVolumenSalida(MasterOrSlave(), AjusteVolumen.Value)
        End If
    End Sub
 
    Private Sub Btn_ECO_ON_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.CanceladorEcoON()
    End Sub
 
    Private Sub Btn_ECO_OFF_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim P As ClasePoste
        P = ListaPostes.SelectedItem
        P.CanceladorEcoOFF()
    End Sub
 
    Private Sub SlideVolMic_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        Dim P As ClasePoste
        If e.Button = Windows.Forms.MouseButtons.Left Then
            P = ListaPostes.SelectedItem
            P.AjusteVolumenMicrofono(MasterOrSlave(), SlideVolMic.Value)
        End If
    End Sub
 
    Private Sub SlideVolMic_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs)
        lblVolMic.Text = Format(SlideVolMic.Value, "0")
    End Sub
 
    Private Sub AjusteVolumen_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs)
        lblVol.Text = AjusteVolumen.Value.ToString
    End Sub
 
    Private Sub Bt_Salida_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
 
 
        If sender.text = "0" Then sender.text = "1" Else sender.text = "0"
    End Sub
 
End Class