⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmconfig.frm

📁 cockpit.zip is a cockpit simulation program for various applications
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmConfig 
   Caption         =   "Sampling Configuration"
   ClientHeight    =   4815
   ClientLeft      =   60
   ClientTop       =   300
   ClientWidth     =   6615
   LinkTopic       =   "Form1"
   ScaleHeight     =   4815
   ScaleWidth      =   6615
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame fraGain 
      Caption         =   "A/D Preamp Gain"
      Height          =   1575
      Left            =   4200
      TabIndex        =   24
      Top             =   2280
      Width           =   2175
      Begin VB.OptionButton optGain 
         Caption         =   "10 (0 - 1V)"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   28
         Top             =   1080
         Width           =   1935
      End
      Begin VB.OptionButton optGain 
         Caption         =   "5 (0 - 2V)"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   27
         Top             =   840
         Width           =   1935
      End
      Begin VB.OptionButton optGain 
         Caption         =   "2 (0 - 5V)"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   26
         Top             =   600
         Value           =   -1  'True
         Width           =   1935
      End
      Begin VB.OptionButton optGain 
         Caption         =   "1 (0 - 10V)"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   25
         Top             =   360
         Width           =   1695
      End
   End
   Begin VB.CommandButton ButtonHelp 
      Caption         =   "Help"
      Height          =   375
      Left            =   5160
      TabIndex        =   23
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CommandButton ButtonOk 
      Caption         =   "Ok"
      Height          =   375
      Left            =   3120
      TabIndex        =   22
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CommandButton ButtonCancel 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   1680
      TabIndex        =   21
      Top             =   4200
      Width           =   1215
   End
   Begin VB.CommandButton ButtonDefault 
      Caption         =   "Default"
      Height          =   375
      Left            =   240
      TabIndex        =   20
      Top             =   4200
      Width           =   1215
   End
   Begin VB.Frame fraBuffer 
      Caption         =   "Onboard Buffer Size"
      Height          =   1935
      Left            =   4200
      TabIndex        =   16
      Top             =   120
      Width           =   2175
      Begin VB.OptionButton optBuffer 
         Caption         =   "16 Byte"
         Height          =   255
         Index           =   5
         Left            =   120
         TabIndex        =   31
         Top             =   1560
         Width           =   1095
      End
      Begin VB.OptionButton optBuffer 
         Caption         =   "64 Byte"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   30
         Top             =   1320
         Width           =   1095
      End
      Begin VB.OptionButton optBuffer 
         Caption         =   "256 Byte"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   29
         Top             =   1080
         Width           =   1095
      End
      Begin VB.OptionButton optBuffer 
         Caption         =   "512 Byte"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   19
         Top             =   840
         Width           =   1095
      End
      Begin VB.OptionButton optBuffer 
         Caption         =   "1 kB"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   18
         Top             =   600
         Width           =   1215
      End
      Begin VB.OptionButton optBuffer 
         Caption         =   "2 kB"
         Height          =   255
         Index           =   0
         Left            =   120
         TabIndex        =   17
         Top             =   360
         Value           =   -1  'True
         Width           =   1335
      End
   End
   Begin VB.Frame fraNrCh 
      Caption         =   "Scanned Channels"
      Height          =   2295
      Left            =   2280
      TabIndex        =   7
      Top             =   120
      Width           =   1695
      Begin VB.OptionButton optNrCh 
         Caption         =   "7 - 0"
         Height          =   255
         Index           =   7
         Left            =   120
         TabIndex        =   15
         Top             =   1920
         Width           =   975
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "6 - 0"
         Height          =   255
         Index           =   6
         Left            =   120
         TabIndex        =   14
         Top             =   1680
         Width           =   1095
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "5 - 0"
         Height          =   255
         Index           =   5
         Left            =   120
         TabIndex        =   13
         Top             =   1440
         Width           =   1095
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "4 - 0"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   12
         Top             =   1200
         Width           =   1095
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "3 - 0"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   11
         Top             =   960
         Width           =   975
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "2 - 0"
         Height          =   195
         Index           =   2
         Left            =   120
         TabIndex        =   10
         Top             =   720
         Value           =   -1  'True
         Width           =   975
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "1 - 0"
         Height          =   195
         Index           =   1
         Left            =   120
         TabIndex        =   9
         Top             =   480
         Width           =   1095
      End
      Begin VB.OptionButton optNrCh 
         Caption         =   "0"
         Height          =   195
         Index           =   0
         Left            =   120
         TabIndex        =   8
         Top             =   240
         Width           =   1095
      End
   End
   Begin VB.Frame fraSFreq 
      Caption         =   "Sampling Frequency"
      Height          =   2175
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   1815
      Begin VB.OptionButton optSFreq 
         Caption         =   "1 Hz"
         Height          =   255
         Index           =   6
         Left            =   120
         TabIndex        =   32
         Top             =   1800
         Width           =   1215
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "10 Hz"
         Height          =   255
         Index           =   5
         Left            =   120
         TabIndex        =   6
         Top             =   1560
         Width           =   1215
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "50 Hz"
         Height          =   255
         Index           =   4
         Left            =   120
         TabIndex        =   5
         Top             =   1320
         Width           =   975
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "150 Hz"
         Height          =   255
         Index           =   3
         Left            =   120
         TabIndex        =   4
         Top             =   1080
         Width           =   1095
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "300 Hz"
         Height          =   255
         Index           =   2
         Left            =   120
         TabIndex        =   3
         Top             =   840
         Width           =   1335
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "500 Hz"
         Height          =   255
         Index           =   1
         Left            =   120
         TabIndex        =   2
         Top             =   600
         Value           =   -1  'True
         Width           =   1215
      End
      Begin VB.OptionButton optSFreq 
         Caption         =   "2000 Hz"
         Height          =   195
         Index           =   0
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   1095
      End
   End
End
Attribute VB_Name = "frmConfig"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim dummy As Integer

Private Sub ButtonCancel_Click()
    ' Originalsettings in OptionButtonArray wiederherstellen
    Restore_OptionButton
    frmConfig.Hide
End Sub

Private Sub ButtonDefault_Click()
    ' DefaultWerte einstellen:
    optSFreq.Item(2).Value = True
    optNrCh.Item(7).Value = True
    optBuffer.Item(0).Value = True
    optGain.Item(1).Value = True
End Sub

Private Sub ButtonHelp_Click()
    dummy = MsgBox("Not yet implemented", vbInformation, "Help")
End Sub

Private Sub ButtonOk_Click()
    ' Settings in globalern Variablen abspeichern
    ' Zuerst die Samplingfrequenz:
    If optSFreq.Item(0).Value = True Then
        S_Freq = 2000
        ElseIf optSFreq.Item(1).Value = True Then S_Freq = 500
        ElseIf optSFreq.Item(2).Value = True Then S_Freq = 300
        ElseIf optSFreq.Item(3).Value = True Then S_Freq = 150
        ElseIf optSFreq.Item(4).Value = True Then S_Freq = 50
        ElseIf optSFreq.Item(5).Value = True Then S_Freq = 10
        ElseIf optSFreq.Item(6).Value = True Then S_Freq = 1
    End If
    ' Jetzt die Anzahl Channels:
    If optNrCh.Item(0).Value = True Then
        S_NrCh = 1
        ElseIf optNrCh.Item(1).Value = True Then S_NrCh = 2
        ElseIf optNrCh.Item(2).Value = True Then S_NrCh = 3
        ElseIf optNrCh.Item(3).Value = True Then S_NrCh = 4
        ElseIf optNrCh.Item(4).Value = True Then S_NrCh = 5
        ElseIf optNrCh.Item(5).Value = True Then S_NrCh = 6
        ElseIf optNrCh.Item(6).Value = True Then S_NrCh = 7
        ElseIf optNrCh.Item(7).Value = True Then S_NrCh = 8
    End If
    ' Nun die Buffergroesse:
    If optBuffer.Item(0).Value = True Then
        S_bufferSize = 2048
        ElseIf optBuffer.Item(1).Value = True Then S_bufferSize = 1024
        ElseIf optBuffer.Item(2).Value = True Then S_bufferSize = 512
        ElseIf optBuffer.Item(3).Value = True Then S_bufferSize = 256
        ElseIf optBuffer.Item(4).Value = True Then S_bufferSize = 64
        ElseIf optBuffer.Item(5).Value = True Then S_bufferSize = 16
    End If
    ' Zuletzt noch das Gain:
    If optGain.Item(0).Value = True Then
        S_gain = 1
        ElseIf optGain.Item(1).Value = True Then S_gain = 2
        ElseIf optGain.Item(2).Value = True Then S_gain = 5
        ElseIf optGain.Item(3).Value = True Then S_gain = 10
    End If
    frmConfig.Hide
End Sub

Private Sub Form_Load()
    Restore_OptionButton
End Sub

Private Sub Restore_OptionButton()
    Select Case S_Freq
        Case 2000
            optSFreq.Item(0).Value = True
        Case 500
            optSFreq.Item(1).Value = True
        Case 300
            optSFreq.Item(2).Value = True
        Case 150
            optSFreq.Item(3).Value = True
        Case 50
            optSFreq.Item(4).Value = True
        Case 10
            optSFreq.Item(5).Value = True
        Case 1
            optSFreq.Item(6).Value = True
    End Select
    Select Case S_NrCh
        Case 1
            optNrCh.Item(0).Value = True
        Case 2
            optNrCh.Item(1).Value = True
        Case 3
            optNrCh.Item(2).Value = True
        Case 4
            optNrCh.Item(3).Value = True
        Case 5
            optNrCh.Item(4).Value = True
        Case 6
            optNrCh.Item(5).Value = True
        Case 7
            optNrCh.Item(6).Value = True
        Case 8
            optNrCh.Item(7).Value = True
    End Select
    Select Case S_bufferSize
        Case 2048
            optBuffer.Item(0).Value = True
        Case 1024
            optBuffer.Item(1).Value = True
        Case 512
            optBuffer.Item(2).Value = True
    End Select
    Select Case S_gain
        Case 1
            optGain.Item(0).Value = True
        Case 2
            optGain.Item(1).Value = True
        Case 5
            optGain.Item(2).Value = True
        Case 10
            optGain.Item(3).Value = True
    End Select
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -