350 lines
9.3 KiB
Plaintext
350 lines
9.3 KiB
Plaintext
VERSION 5.00
|
|
Begin VB.Form frmPruefgangUmgebung
|
|
Caption = "Zulassungsprüfung PTB / DKD"
|
|
ClientHeight = 3765
|
|
ClientLeft = 60
|
|
ClientTop = 345
|
|
ClientWidth = 3075
|
|
LinkTopic = "Form2"
|
|
ScaleHeight = 3765
|
|
ScaleWidth = 3075
|
|
StartUpPosition = 3 'Windows-Standard
|
|
Begin VB.Frame Frame2
|
|
Height = 3045
|
|
Left = 30
|
|
TabIndex = 4
|
|
Top = 0
|
|
Width = 3015
|
|
Begin VB.TextBox txtLuftdruck
|
|
Alignment = 1 'Rechts
|
|
Height = 345
|
|
Left = 1500
|
|
TabIndex = 2
|
|
Top = 1380
|
|
Width = 975
|
|
End
|
|
Begin VB.TextBox txtLufttemperatur
|
|
Alignment = 1 'Rechts
|
|
Height = 345
|
|
Left = 1500
|
|
TabIndex = 0
|
|
Top = 210
|
|
Width = 975
|
|
End
|
|
Begin VB.TextBox txtLuftfeuchte
|
|
Alignment = 1 'Rechts
|
|
Height = 345
|
|
Left = 1500
|
|
TabIndex = 1
|
|
Top = 780
|
|
Width = 975
|
|
End
|
|
Begin VB.Label Label7
|
|
BackColor = &H008080FF&
|
|
Caption = "Bitte ebenfalls die Einbaulagen der einzelnen Zähler wählen! (Klick auf Zählersymbol)"
|
|
Height = 705
|
|
Left = 240
|
|
TabIndex = 11
|
|
Top = 2130
|
|
Width = 2655
|
|
End
|
|
Begin VB.Label Label1
|
|
Caption = "Lufttemperatur"
|
|
Height = 375
|
|
Left = 330
|
|
TabIndex = 10
|
|
Top = 270
|
|
Width = 1095
|
|
End
|
|
Begin VB.Label Label2
|
|
Caption = "Luftfeuchte"
|
|
Height = 405
|
|
Left = 480
|
|
TabIndex = 9
|
|
Top = 840
|
|
Width = 855
|
|
End
|
|
Begin VB.Label Label3
|
|
Caption = "°C"
|
|
Height = 255
|
|
Left = 2520
|
|
TabIndex = 8
|
|
Top = 300
|
|
Width = 375
|
|
End
|
|
Begin VB.Label Label4
|
|
Caption = "%"
|
|
Height = 255
|
|
Left = 2610
|
|
TabIndex = 7
|
|
Top = 870
|
|
Width = 315
|
|
End
|
|
Begin VB.Label Label5
|
|
Caption = "Luftdruck"
|
|
Height = 405
|
|
Index = 0
|
|
Left = 630
|
|
TabIndex = 6
|
|
Top = 1440
|
|
Width = 735
|
|
End
|
|
Begin VB.Label Label6
|
|
Caption = "hPa"
|
|
Height = 255
|
|
Left = 2550
|
|
TabIndex = 5
|
|
Top = 1440
|
|
Width = 345
|
|
End
|
|
End
|
|
Begin VB.CommandButton cmdOk
|
|
Caption = "OK"
|
|
Enabled = 0 'False
|
|
Height = 465
|
|
Left = 810
|
|
TabIndex = 3
|
|
Top = 3150
|
|
Width = 1425
|
|
End
|
|
End
|
|
Attribute VB_Name = "frmPruefgangUmgebung"
|
|
Attribute VB_GlobalNameSpace = False
|
|
Attribute VB_Creatable = False
|
|
Attribute VB_PredeclaredId = True
|
|
Attribute VB_Exposed = False
|
|
Option Explicit
|
|
|
|
Private mblnAutoUnload As Boolean
|
|
|
|
Private Sub cmdOk_Click()
|
|
If CDbl("12,4") = 12.4 Then
|
|
txtLufttemperatur.text = Replace(txtLufttemperatur.text, ".", ",")
|
|
txtLuftfeuchte.text = Replace(txtLuftfeuchte.text, ".", ",")
|
|
txtLuftdruck.text = Replace(txtLuftdruck.text, ".", ",")
|
|
End If
|
|
|
|
If CDbl("12.4") = 12.4 Then
|
|
txtLufttemperatur.text = Replace(txtLufttemperatur.text, ",", ".")
|
|
txtLuftfeuchte.text = Replace(txtLuftfeuchte.text, ",", ".")
|
|
txtLuftdruck.text = Replace(txtLuftdruck.text, ",", ".")
|
|
End If
|
|
|
|
|
|
If txtLufttemperatur.text <> "" Then
|
|
g_dblLuftTemperatur = CDbl(txtLufttemperatur.text)
|
|
Else
|
|
g_dblLuftTemperatur = 0
|
|
End If
|
|
|
|
If txtLuftfeuchte.text <> "" Then
|
|
g_dblLuftFeuchte = CDbl(txtLuftfeuchte.text)
|
|
Else
|
|
g_dblLuftFeuchte = 0
|
|
End If
|
|
|
|
If txtLuftdruck.text <> "" Then
|
|
g_dblLuftDruck = CDbl(txtLuftdruck.text)
|
|
Else
|
|
g_dblLuftDruck = 0
|
|
End If
|
|
|
|
'DebugMsg "***************************************************"
|
|
'DebugMsg "Zulassungsprüfung PTB / DKD"
|
|
DebugMsg "Lufttemperatur: " & g_dblLuftTemperatur & " °C"
|
|
DebugMsg "Luftfeuchte: " & g_dblLuftFeuchte & " %"
|
|
DebugMsg "Luftdruck: " & g_dblLuftDruck & " mbar"
|
|
'DebugMsg "***************************************************"
|
|
|
|
Unload Me
|
|
End Sub
|
|
|
|
|
|
Private Function CheckIfEingabeOK() As Boolean
|
|
cmdOK.Enabled = False
|
|
|
|
|
|
If IsNumeric(txtLufttemperatur.text) Then
|
|
If IsNumeric(txtLuftfeuchte.text) Then
|
|
If IsNumeric(txtLuftdruck.text) Then
|
|
cmdOK.Enabled = True
|
|
CheckIfEingabeOK = True
|
|
End If
|
|
End If
|
|
End If
|
|
End Function
|
|
|
|
Private Sub Form_Activate()
|
|
If txtLufttemperatur.Enabled = True Then
|
|
txtLufttemperatur.SetFocus
|
|
ElseIf txtLuftdruck.Enabled = True Then
|
|
txtLuftdruck.SetFocus
|
|
End If
|
|
|
|
If mblnAutoUnload = True Then
|
|
Unload Me
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Form_Load()
|
|
Dim objSPS As CSPS
|
|
Dim strTemp As String
|
|
|
|
If g_App.Settings.getTempFeuchteMessen() = 1 Then
|
|
Set objSPS = g_App.getSPS
|
|
txtLufttemperatur.text = objSPS.GetLuftTemperatur
|
|
txtLufttemperatur.Enabled = False
|
|
|
|
txtLuftfeuchte.text = objSPS.GetRelativeFeuchte
|
|
txtLuftfeuchte.Enabled = False
|
|
End If
|
|
|
|
If g_dblLuftDruck <> 0 Then
|
|
txtLuftdruck.text = g_dblLuftDruck
|
|
End If
|
|
txtLuftdruck.Enabled = True
|
|
|
|
If g_dblLuftTemperatur <> 0 Then
|
|
txtLufttemperatur.text = g_dblLuftTemperatur
|
|
End If
|
|
txtLuftfeuchte.Enabled = True
|
|
|
|
If g_dblLuftFeuchte <> 0 Then
|
|
txtLuftfeuchte.text = g_dblLuftFeuchte
|
|
End If
|
|
txtLuftfeuchte.Enabled = True
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub txtLuftdruck_Change()
|
|
If CheckIfEingabeOK() Then
|
|
cmdOK.Default = True
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Private Sub txtLuftdruck_GotFocus()
|
|
txtLuftdruck.SelStart = 0
|
|
txtLuftdruck.SelLength = Len(txtLuftdruck.text)
|
|
End Sub
|
|
|
|
Private Sub txtLuftfeuchte_Change()
|
|
If CheckIfEingabeOK() Then
|
|
cmdOK.Default = True
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub txtLuftfeuchte_GotFocus()
|
|
txtLuftfeuchte.SelStart = 0
|
|
txtLuftfeuchte.SelLength = Len(txtLuftfeuchte.text)
|
|
End Sub
|
|
|
|
|
|
Private Sub txtLufttemperatur_Change()
|
|
If CheckIfEingabeOK() Then
|
|
cmdOK.Default = True
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub txtLufttemperatur_GotFocus()
|
|
txtLufttemperatur.SelStart = 0
|
|
txtLufttemperatur.SelLength = Len(txtLufttemperatur.text)
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub txtLufttemperatur_KeyPress(KeyAscii As Integer)
|
|
Select Case KeyAscii
|
|
Case 3 ' ctrl C
|
|
Case 8 ' backspace
|
|
Case 9 ' tab
|
|
Case 13 'return
|
|
If txtLuftfeuchte.Enabled = True Then
|
|
txtLuftfeuchte.SetFocus
|
|
Exit Sub
|
|
End If
|
|
Case 22 ' ctrl V
|
|
Case 24 ' ctrl X
|
|
Case 44 ' ,
|
|
If CDbl("1.2") = 1.2 Then
|
|
' . ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case 46 '.
|
|
If CDbl("1,2") = 1.2 Then
|
|
' , ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case Else
|
|
If Not IsNumeric(Chr(KeyAscii)) Then
|
|
KeyAscii = 0
|
|
End If
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub txtLuftfeuchte_KeyPress(KeyAscii As Integer)
|
|
Select Case KeyAscii
|
|
Case 3 ' ctrl C
|
|
Case 8 ' backspace
|
|
Case 9 ' tab
|
|
Case 13 'return
|
|
If txtLuftdruck.Enabled = True Then
|
|
txtLuftdruck.SetFocus
|
|
Exit Sub
|
|
End If
|
|
Case 22 ' ctrl V
|
|
Case 24 ' ctrl X
|
|
Case 44 ' ,
|
|
If CDbl("1.2") = 1.2 Then
|
|
' . ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case 46 '.
|
|
If CDbl("1,2") = 1.2 Then
|
|
' , ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case Else
|
|
If Not IsNumeric(Chr(KeyAscii)) Then
|
|
KeyAscii = 0
|
|
End If
|
|
End Select
|
|
End Sub
|
|
|
|
Private Sub txtLuftdruck_KeyPress(KeyAscii As Integer)
|
|
Debug.Print KeyAscii
|
|
|
|
Select Case KeyAscii
|
|
Case 3 ' ctrl C
|
|
Case 8 ' backspace
|
|
Case 9 ' tab
|
|
Case 13 'return
|
|
Exit Sub
|
|
Case 22 ' ctrl V
|
|
Case 24 ' ctrl X
|
|
Case 44 ' ,
|
|
If CDbl("1.2") = 1.2 Then
|
|
' . ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case 46 '.
|
|
If CDbl("1,2") = 1.2 Then
|
|
' , ist Dezimaltrenner
|
|
KeyAscii = 0
|
|
Exit Sub
|
|
End If
|
|
Case Else
|
|
If Not IsNumeric(Chr(KeyAscii)) Then
|
|
KeyAscii = 0
|
|
End If
|
|
End Select
|
|
End Sub
|
|
|