VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmMain 
   BackColor       =   &H8000000A&
   BorderStyle     =   1  'Fest Einfach
   Caption         =   "Filterschaltungen"
   ClientHeight    =   5490
   ClientLeft      =   150
   ClientTop       =   435
   ClientWidth     =   8730
   Icon            =   "frmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5490
   ScaleWidth      =   8730
   StartUpPosition =   1  'Fenstermitte
   Begin MSComctlLib.StatusBar stbStatus 
      Align           =   2  'Unten ausrichten
      Height          =   255
      Left            =   0
      TabIndex        =   31
      Top             =   5235
      Width           =   8730
      _ExtentX        =   15399
      _ExtentY        =   450
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   1
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   2646
            MinWidth        =   2646
         EndProperty
      EndProperty
   End
   Begin VB.Frame fraLegende 
      Caption         =   "Legende"
      Height          =   1695
      Left            =   120
      TabIndex        =   25
      Top             =   3480
      Width           =   2295
      Begin VB.Label Label5 
         Caption         =   "Grenzfrequenz"
         Height          =   255
         Left            =   960
         TabIndex        =   32
         Top             =   1200
         Width           =   1095
      End
      Begin VB.Line Line10 
         BorderColor     =   &H000000FF&
         BorderWidth     =   3
         X1              =   660
         X2              =   730
         Y1              =   1280
         Y2              =   1280
      End
      Begin VB.Line Line9 
         BorderColor     =   &H000000FF&
         BorderWidth     =   3
         X1              =   520
         X2              =   590
         Y1              =   1280
         Y2              =   1280
      End
      Begin VB.Line Line8 
         BorderColor     =   &H000000FF&
         BorderWidth     =   3
         X1              =   380
         X2              =   450
         Y1              =   1280
         Y2              =   1280
      End
      Begin VB.Line Line7 
         BorderColor     =   &H000000FF&
         BorderWidth     =   3
         Index           =   0
         X1              =   240
         X2              =   310
         Y1              =   1280
         Y2              =   1280
      End
      Begin VB.Line Line3 
         BorderColor     =   &H000000FF&
         BorderWidth     =   3
         X1              =   255
         X2              =   715
         Y1              =   315
         Y2              =   315
      End
      Begin VB.Line Line4 
         BorderColor     =   &H0000C000&
         BorderWidth     =   3
         X1              =   255
         X2              =   715
         Y1              =   540
         Y2              =   540
      End
      Begin VB.Line Line5 
         BorderColor     =   &H00FF8080&
         BorderWidth     =   3
         X1              =   255
         X2              =   715
         Y1              =   795
         Y2              =   795
      End
      Begin VB.Line Line6 
         BorderColor     =   &H00FF00FF&
         BorderWidth     =   3
         X1              =   255
         X2              =   715
         Y1              =   1050
         Y2              =   1050
      End
      Begin VB.Label Label1 
         Caption         =   "RL - Tiefpass"
         Height          =   255
         Left            =   960
         TabIndex        =   29
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "RL - Hochpass"
         Height          =   255
         Left            =   960
         TabIndex        =   28
         Top             =   480
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "RC - Tiefpass"
         Height          =   255
         Left            =   960
         TabIndex        =   27
         Top             =   720
         Width           =   975
      End
      Begin VB.Label Label4 
         Caption         =   "RC - Hochpass"
         Height          =   255
         Left            =   960
         TabIndex        =   26
         Top             =   960
         Width           =   1215
      End
   End
   Begin VB.Frame fraGFX 
      Caption         =   "Grafik"
      Height          =   3855
      Left            =   2520
      TabIndex        =   9
      Top             =   1320
      Width           =   6135
      Begin VB.PictureBox picGFX 
         Appearance      =   0  '2D
         AutoRedraw      =   -1  'True
         BackColor       =   &H00FFFFFF&
         ForeColor       =   &H80000008&
         Height          =   3495
         Left            =   120
         ScaleHeight     =   231
         ScaleMode       =   3  'Pixel
         ScaleWidth      =   393
         TabIndex        =   16
         Top             =   240
         Width           =   5925
      End
   End
   Begin VB.Frame fraInput 
      Caption         =   "Eingaben"
      Height          =   2055
      Left            =   120
      TabIndex        =   8
      Top             =   1320
      Width           =   2295
      Begin VB.CommandButton btnDia 
         Caption         =   "X"
         Height          =   255
         Left            =   1920
         TabIndex        =   30
         Top             =   1680
         Visible         =   0   'False
         Width           =   255
      End
      Begin VB.CommandButton btnCalc 
         Caption         =   "Berechnen"
         Height          =   255
         Left            =   360
         TabIndex        =   17
         Top             =   1680
         Width           =   1455
      End
      Begin VB.TextBox edtC 
         Appearance      =   0  '2D
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   360
         TabIndex        =   12
         Text            =   "1000"
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox edtL 
         Appearance      =   0  '2D
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   360
         TabIndex        =   11
         Text            =   "1"
         Top             =   1320
         Width           =   1335
      End
      Begin VB.TextBox edtR 
         Appearance      =   0  '2D
         BackColor       =   &H80000004&
         Height          =   285
         Left            =   360
         TabIndex        =   10
         Text            =   "100"
         Top             =   600
         Width           =   1335
      End
      Begin VB.Label lblC 
         Caption         =   "Kapazität (nF)"
         Height          =   255
         Left            =   360
         TabIndex        =   15
         Top             =   1080
         Width           =   1455
      End
      Begin VB.Label lblL 
         Caption         =   "Induktivität (mH)"
         Height          =   255
         Left            =   360
         TabIndex        =   14
         Top             =   1080
         Width           =   1695
      End
      Begin VB.Label lblR 
         Caption         =   "Wiederstand (Ohm)"
         Height          =   255
         Left            =   360
         TabIndex        =   13
         Top             =   360
         Width           =   1575
      End
   End
   Begin VB.Frame fraResult 
      Caption         =   "Spannungsverhältnisse"
      Height          =   1095
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   8535
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   6
         Left            =   7320
         Locked          =   -1  'True
         TabIndex        =   24
         Tag             =   "100000"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   5
         Left            =   6120
         Locked          =   -1  'True
         TabIndex        =   23
         Tag             =   "50000"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   4
         Left            =   4920
         Locked          =   -1  'True
         TabIndex        =   22
         Tag             =   "10000"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   3
         Left            =   3720
         Locked          =   -1  'True
         TabIndex        =   21
         Tag             =   "5000"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   2
         Left            =   2520
         Locked          =   -1  'True
         TabIndex        =   20
         Tag             =   "1000"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   1
         Left            =   1320
         Locked          =   -1  'True
         TabIndex        =   19
         Tag             =   "500"
         Top             =   600
         Width           =   1095
      End
      Begin VB.TextBox edtFreq 
         Appearance      =   0  '2D
         BackColor       =   &H8000000B&
         Enabled         =   0   'False
         Height          =   285
         Index           =   0
         Left            =   120
         Locked          =   -1  'True
         TabIndex        =   18
         Tag             =   "100"
         Top             =   600
         Width           =   1095
      End
      Begin VB.Label lbl100k 
         Caption         =   "100kHz"
         Height          =   255
         Left            =   7560
         TabIndex        =   7
         Top             =   360
         Width           =   735
      End
      Begin VB.Label lbl50k 
         Caption         =   "50kHz"
         Height          =   255
         Left            =   6360
         TabIndex        =   6
         Top             =   360
         Width           =   615
      End
      Begin VB.Label lbl10k 
         Caption         =   "10kHz"
         Height          =   255
         Left            =   5160
         TabIndex        =   5
         Top             =   360
         Width           =   615
      End
      Begin VB.Label lbl5k 
         Caption         =   "5kHz"
         Height          =   255
         Left            =   3960
         TabIndex        =   4
         Top             =   360
         Width           =   615
      End
      Begin VB.Label lbl1k 
         Caption         =   "1kHz"
         Height          =   255
         Left            =   2880
         TabIndex        =   3
         Top             =   360
         Width           =   615
      End
      Begin VB.Label lbl500 
         Caption         =   "500Hz"
         Height          =   255
         Left            =   1680
         TabIndex        =   2
         Top             =   360
         Width           =   615
      End
      Begin VB.Label lbl100 
         Caption         =   "100Hz"
         Height          =   255
         Left            =   360
         TabIndex        =   1
         Top             =   360
         Width           =   615
      End
   End
   Begin VB.Line Line2 
      BorderColor     =   &H80000005&
      X1              =   75
      X2              =   8640
      Y1              =   45
      Y2              =   45
   End
   Begin VB.Line Line1 
      BorderColor     =   &H80000010&
      BorderWidth     =   2
      X1              =   75
      X2              =   8640
      Y1              =   45
      Y2              =   45
   End
   Begin VB.Menu mnuDatei 
      Caption         =   "Datei"
      Begin VB.Menu mnuClearGraph 
         Caption         =   "Grafik löschen"
      End
      Begin VB.Menu mnuFree 
         Caption         =   "-"
      End
      Begin VB.Menu mnuDatei_Exit 
         Caption         =   "Exit"
      End
   End
   Begin VB.Menu mnuFilter 
      Caption         =   "Filter"
      Begin VB.Menu mnuFilter_Pass 
         Caption         =   "RL-Tiefpass"
         Index           =   1
      End
      Begin VB.Menu mnuFilter_Pass 
         Caption         =   "RL-Hochpass"
         Index           =   2
      End
      Begin VB.Menu mnuFilter_Pass 
         Caption         =   "RC-Tiefpass"
         Index           =   3
      End
      Begin VB.Menu mnuFilter_Pass 
         Caption         =   "RC-Hochpass"
         Index           =   4
      End
   End
   Begin VB.Menu mnuSkalierung 
      Caption         =   "Skalierung"
      Begin VB.Menu mnuSkalierungX 
         Caption         =   "X-Achse"
         Begin VB.Menu mnuSkalierung_X 
            Caption         =   "sehr klein"
            Index           =   1
         End
         Begin VB.Menu mnuSkalierung_X 
            Caption         =   "klein"
            Index           =   2
         End
         Begin VB.Menu mnuSkalierung_X 
            Caption         =   "groß"
            Index           =   3
         End
      End
      Begin VB.Menu mnu_SkalierungY 
         Caption         =   "Y-Achse"
         Begin VB.Menu mnuSkalierung_Y 
            Caption         =   "groß"
            Index           =   1
         End
         Begin VB.Menu mnuSkalierung_Y 
            Caption         =   "klein"
            Index           =   2
         End
         Begin VB.Menu mnuSkalierung_Y 
            Caption         =   "sehr klein"
            Index           =   4
         End
      End
   End
   Begin VB.Menu mnuHilfe 
      Caption         =   "Hilfe"
      Begin VB.Menu mnuAbout 
         Caption         =   "About"
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Pass As Byte                            ' Welche Filterschaltung ist aktive
Private Const PI As Double = 3.14159265358979   ' PI :p
Private Const XOffset As Byte = 25              ' Verschiebung der X-Achse
Private Const YOffset As Byte = 10              ' Verschiebung der Y-Achse
Private bolDia As Boolean                       ' Diagramm gezeichnet ?
Private bySkalX As Byte                         ' Skalierung der X-Achse
Private bySkalY As Byte                         ' Skalierung der Y-Achse


'
' Prüft die Eingabefelder auf korrekte Eingaben
'
Public Function chkInput(C As Boolean, L As Boolean)
    On Error GoTo Error
    If C Then
        If CDbl(edtC.Text) <> edtC.Text Then
            chkInput = False
            Exit Function
        End If
    End If
    
    If L Then
        If CDbl(edtL.Text) <> edtL.Text Then
            chkInput = False
            Exit Function
        End If
    End If
    
    chkInput = True
    Exit Function
    
Error:
    chkInput = False
    
End Function

'
' Der "Berechnen" Button
'
Private Sub btnCalc_Click()
    Dim objEdt As Object
    Dim R, L, C, i, Y, X, F, Hoehe As Double
        
    btnCalc.Enabled = False
    
    If Not bolDia Then
        doMakeDiagramm
    End If
        
    '
    ' Berechnung
    '
    If chkInput(False, True) Then
        R = edtR.Text
        L = edtL.Text
        C = edtC.Text
        For Each objEdt In frmMain
            If objEdt.Name = "edtFreq" Then
                Select Case Pass
                    Case 1      ' RL-Tiefpass
                        objEdt.Text = Round(RL_Tiefpass(R, L, objEdt.Tag), 9)
                    Case 2      ' RL-Hochpass
                        objEdt.Text = Round(RL_Hochpass(R, L, objEdt.Tag), 9)
                    Case 3      ' RC-Tiefpass
                        objEdt.Text = Round(RC_Tiefpass(R, C, objEdt.Tag), 9)
                    Case 4      ' RC-Hochpass
                        objEdt.Text = Round(RC_Hochpass(R, C, objEdt.Tag), 9)
                End Select
             End If
        Next
        '
        ' Graphen ausgeben
        '
        picGFX.ScaleMode = 3
        
        '
        ' Grenzfrequenz zeichnen
        paintGrenzFrequenz
        
        '
        ' Kurfe zeichnen
        Hoehe = picGFX.ScaleHeight - YOffset - (picGFX.ScaleHeight - (10 * 20) - YOffset)
        For i = 0 To picGFX.ScaleWidth - 35 Step 1
            F = 10 ^ (i / 40)
            Select Case Pass
                    Case 1      ' **** RL-Tiefpass ****
                        Y = (1 - RL_Tiefpass(R, L, F)) * Hoehe + YOffset
                        If i = 0 Then
                            picGFX.CurrentY = Y
                            picGFX.CurrentX = 1 + XOffset
                        End If
                        picGFX.Line -(i + XOffset, Y), &HFF&
                        
                    Case 2      ' **** RL-Hochpass ****
                        Y = (1 - RL_Hochpass(R, L, F)) * Hoehe + YOffset
                        If i = 0 Then
                            picGFX.CurrentY = Y
                            picGFX.CurrentX = 1 + XOffset
                        End If
                        picGFX.Line -(i + XOffset, Y), &HC000&
                       
                    Case 3      ' **** RC-Tiefpass ****
                        Y = (1 - RC_Tiefpass(R, C, F)) * Hoehe + YOffset
                        If i = 0 Then
                            picGFX.CurrentY = Y
                            picGFX.CurrentX = 1 + XOffset
                        End If
                        picGFX.Line -(i + XOffset, Y), &HFF8080

                    Case 4      ' **** RC-Hochpass ****
                        Y = (1 - RC_Hochpass(R, C, F)) * Hoehe + YOffset
                        If i = 0 Then
                            picGFX.CurrentY = Y
                            picGFX.CurrentX = 1 + XOffset
                        End If
                        picGFX.Line -(i + XOffset, Y), &HFF00FF
                       
            End Select
        Next i
    Else
    '
    ' Fehlerbehandlung
    '
        If Pass = 0 Then
            MsgBox "Bitte eine Filterart aus dem Menue wählen" _
                    , vbOKOnly + vbInformation, "Hinweis"
        Else
            MsgBox "Es müßen alle Felder mit Zahlen ausgefüllt werden"
        End If
    End If
    
    btnCalc.Enabled = True
End Sub


'
' Löscht das Diagramm und zeichnet es neu
'
Private Sub btnClearGraph_Click()
    picGFX.Cls
    doMakeDiagramm
End Sub


'
' Zeichnet das Diagramm
'
Private Sub btnDia_Click()
    doMakeDiagramm
End Sub

Private Sub Form_Load()
    frmSplash.Show 1
    doDisableAll ("mnuFilter_Pass")
    doDisableEdt
    mnuFilter_Pass_Click (3)
    bolDia = False
    bySkalX = 3
    bySkalY = 2
    mnuSkalierung_X_Click (3)
    mnuSkalierung_Y_Click (2)
    doMakeDiagramm
    frmMain.Caption = "..:: " & frmMain.Caption & " " & App.Major & "." & App.Minor & "." & App.Revision & " ::.."
End Sub


'
' Aboutformular
'
Private Sub mnuAbout_Click()
    frmAbout.Show 1, frmMain
End Sub


'
' Löscht das Bild und Zeichnet das Diagramm neu
'
Private Sub mnuClearGraph_Click()
    picGFX.Cls
    doMakeDiagramm
End Sub


'
' Schließen
'
Private Sub mnuDatei_Exit_Click()
    Unload frmMain
End Sub


'
' Auswahl des Filters
'
Private Sub mnuFilter_Pass_Click(Index As Integer)
    Select Case Index
        Case 1      ' RL-Tiefpass
            doDisableAll ("mnuFilter_Pass")
            doDisableEdt
            mnuFilter_Pass(1).Checked = True
            edtL.Visible = True
            lblL.Visible = True
            Pass = 1
            stbStatus.Panels(1).Text = "Filter: RL-Tiefpass"
            
            
        Case 2      ' RL-Hochpass
            doDisableAll ("mnuFilter_Pass")
            doDisableEdt
            mnuFilter_Pass(2).Checked = True
            edtL.Visible = True
            lblL.Visible = True
            Pass = 2
            stbStatus.Panels(1).Text = "Filter: RL-Hochpass"
            
        Case 3      ' RC-Tiefpass
            doDisableAll ("mnuFilter_Pass")
            doDisableEdt
            mnuFilter_Pass(3).Checked = True
            edtC.Visible = True
            lblC.Visible = True
            Pass = 3
            stbStatus.Panels(1).Text = "Filter: RC-Tiefpass"
            
        Case 4      ' RC-Hochpass
            doDisableAll ("mnuFilter_Pass")
            doDisableEdt
            mnuFilter_Pass(4).Checked = True
            edtC.Visible = True
            lblC.Visible = True
            Pass = 4
            stbStatus.Panels(1).Text = "Filter: RC-Hochpass"
            
    End Select
End Sub


'
' Deaktieviert alle MenuePunkte des angegebenen Namen
'
Private Sub doDisableAll(Name As String)
    Dim obj As Object
    
    For Each obj In frmMain
        If obj.Name = Name Then
            obj.Checked = False
            'MsgBox obj.Name
        End If
    Next
End Sub


'
' Deaktiviert die Eingabefelder
'
Private Sub doDisableEdt()
    edtC.Visible = False
    lblC.Visible = False
    edtL.Visible = False
    lblL.Visible = False
End Sub


'
' Berechnung der Kreisfrequenz
'
Private Function KreisFreq(Frequenz As Double)
    KreisFreq = CDbl(2 * PI * Frequenz)
    'MsgBox KreisFreq
End Function


'
' Brechnung RL-Tiefpass
'
Private Function RL_Tiefpass(ByVal Wiederstand As Double, _
                            ByVal Induktivitaet As Double, _
                            ByVal Frequenz As Double)
    
    Induktivitaet = Induktivitaet / 1000  ' Umrechnung milliHenry => Henry
    'RL_Tiefpass = 1 / (Sqr((KreisFreq(Frequenz) * Induktivitaet / Wiederstand) ^ 2) + 1)
    RL_Tiefpass = 1 / Sqr((KreisFreq(Frequenz) * Induktivitaet / Wiederstand) ^ 2 + 1)
End Function


'
' Berechnung RL-Hochpass
'
Private Function RL_Hochpass(ByVal Wiederstand As Double, _
                            ByVal Induktivitaet As Double, _
                            ByVal Frequenz As Double)
    
    Induktivitaet = Induktivitaet / 1000   ' Umrechnung milliHenry => Henry
    RL_Hochpass = 1 / Sqr(((Wiederstand / (KreisFreq(Frequenz) * Induktivitaet)) ^ 2 + 1))
End Function


'
' Berechnung RC-Tiefpass
'
Private Function RC_Tiefpass(ByVal Wiederstand As Double, _
                            ByVal Kapazitaet As Double, _
                            ByVal Frequenz As Double)
    
    Kapazitaet = Kapazitaet / (10000000000#)
    'RC_Tiefpass = 1 / (Sqr((Wiederstand ^ 2) * (KreisFreq(Frequenz) ^ 2) * (Kapazitaet ^ 2) + (1)))
    RC_Tiefpass = 1 / Sqr((Wiederstand ^ 2 * KreisFreq(Frequenz) ^ 2 * Kapazitaet ^ 2) + 1)
End Function


'
' Berechnung RC-Hochpass
'
Private Function RC_Hochpass(ByVal Wiederstand As Double, _
                            ByVal Kapazitaet As Double, _
                            ByVal Frequenz As Double)

    Kapazitaet = Kapazitaet / (10000000000#)
    RC_Hochpass = 1 / Sqr(1 / (Wiederstand ^ 2 * KreisFreq(Frequenz) ^ 2 * Kapazitaet ^ 2) + 1)
End Function
    
    
'
' 10'er Logaritmus
'
Static Function Log10(X)
   Log10 = Log(X) / Log(10#)
End Function

'
' Zeichnet das Diagramm
'
Private Sub doMakeDiagramm()
    Dim msg As String
    Dim i, j, tmpY, tmpX, Y, F, tmp, gfY As Double
    Dim Step As Byte
    
    picGFX.FontName = "Times New Roman"
    picGFX.FontSize = 10
    
    
    ' Y-Achse
    picGFX.Line (XOffset, YOffset - 5)-(XOffset, picGFX.ScaleHeight - YOffset)
    picGFX.CurrentY = YOffset - 20
    For i = 10 To 0 Step -1
        msg = i / 10
        picGFX.CurrentY = picGFX.CurrentY + 20
        If i = 7 Then gfY = picGFX.CurrentY
        picGFX.Line (XOffset - 5, picGFX.CurrentY)-(XOffset, picGFX.CurrentY)
        picGFX.Line (XOffset, picGFX.CurrentY)-(picGFX.ScaleWidth - 7, picGFX.CurrentY), &HE0E0E0
        tmpX = picGFX.CurrentX
        tmpY = picGFX.CurrentY
        For j = 1 To bySkalY
            If Not i = 0 Then
                tmp = picGFX.CurrentY + (20 / bySkalY)
                picGFX.Line (XOffset - 3, tmp)-(XOffset, tmp)
                picGFX.Line (XOffset, tmp)-(picGFX.ScaleWidth - 7, tmp), &HE0E0E0
            End If
        Next j
        picGFX.CurrentX = tmpX
        picGFX.CurrentY = tmpY
        tmpY = picGFX.CurrentY
        picGFX.CurrentX = XOffset - 23
        picGFX.CurrentY = picGFX.CurrentY - 5
        picGFX.Print (msg)
        picGFX.CurrentY = tmpY
    Next i
    
    '
    ' X-Achse
    picGFX.Line (XOffset - 10, tmpY)-(picGFX.ScaleWidth - 7, tmpY)
    Y = picGFX.CurrentY
    
    
    
    For i = 0 To 10 Step 1
        For j = 1 To 10 Step bySkalX
            tmp = (Log10(j) * 40) + i * 40
            picGFX.Line (tmp + XOffset, YOffset)-(tmp + XOffset, picGFX.ScaleHeight - (YOffset * 2)), &HE0E0E0
            picGFX.Line (tmp + XOffset, picGFX.ScaleHeight - (YOffset * 2))-(tmp + XOffset, picGFX.ScaleHeight - (YOffset * 2) + 4)
        Next j
        picGFX.CurrentX = picGFX.CurrentX - 11
        picGFX.FontName = "Times New Roman"
        picGFX.FontSize = 10
        picGFX.Print ("10");
        picGFX.FontName = "Times New Roman"
        picGFX.FontSize = 7
        picGFX.Print (i + 1)
        picGFX.FontName = "Times New Roman"
        picGFX.FontSize = 10
    Next i
    
    picGFX.Line (XOffset - 10, tmpY)-(picGFX.ScaleWidth - 7, tmpY)
    picGFX.Line (XOffset, YOffset - 5)-(XOffset, picGFX.ScaleHeight - YOffset)
    bolDia = True
End Sub


'
' Berechnet die Grenzfrequenz für RL-Filter
'
Private Function RL_Grenzfrequenz(ByVal Widerstand As Double, ByVal Induktivitaet As Double)
    RL_Grenzfrequenz = Widerstand / (2 * PI * Induktivitaet)
End Function


'
' Berechnet die Grenzfrequenz für RC-Filter
'
Private Function RC_Grenzfrequenz(ByVal Widerstand As Double, ByVal Kapazitaet As Double)
    RC_Grenzfrequenz = 1 / (2 * PI * Widerstand * Kapazitaet)
End Function


'
' Zeichnet die Grenzfrequenz ein [1/sqr(2)]
'
Private Sub paintGrenzFrequenz()
    Dim Y, i As Double
    
    Y = (picGFX.ScaleHeight - (YOffset * 2) - 1) - ((1 / Sqr(2)) * 10 * 20)
   
    For i = XOffset To picGFX.ScaleWidth - 7 - 10 Step 10
        picGFX.Line (i, Y)-(i + 5, Y), &HFF&
    Next i
End Sub


'
' Skalierung für X-Achse festlegen
'
Private Sub mnuSkalierung_X_Click(Index As Integer)
    doDisableAll ("mnuSkalierung_X")
    mnuSkalierung_X(Index).Checked = True
    bySkalX = Index
    doClearPic
    doMakeDiagramm
End Sub


'
' Skalierung für Y-Achse festlegen
'
Private Sub mnuSkalierung_Y_Click(Index As Integer)
    doDisableAll ("mnuSkalierung_Y")
    mnuSkalierung_Y(Index).Checked = True
    bySkalY = Index
    doClearPic
    doMakeDiagramm
End Sub


'
' Löscht das Bild
'
Private Sub doClearPic()
    picGFX.Cls
    bolDia = False
End Sub

