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

📄 editoutf.frm

📁 AD9954源码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form frmEditOutFreq 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Edit Output Frequency"
   ClientHeight    =   2415
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   6015
   Icon            =   "EditOutF.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2415
   ScaleWidth      =   6015
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.VScrollBar vscDecTWVal 
      Height          =   435
      Left            =   260
      Max             =   -1
      Min             =   1
      TabIndex        =   15
      Top             =   360
      Width           =   200
   End
   Begin VB.TextBox txtOutputFreqVal 
      Alignment       =   1  'Right Justify
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   480
      MaxLength       =   11
      MultiLine       =   -1  'True
      TabIndex        =   0
      Text            =   "EditOutF.frx":000C
      ToolTipText     =   "Enter the desired frequency in MHz."
      Top             =   360
      Width           =   2415
   End
   Begin VB.Frame fraTunningWord 
      Caption         =   "Tuning Word Values"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1335
      Left            =   120
      TabIndex        =   9
      Top             =   960
      Width           =   4455
      Begin VB.TextBox txtTW 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   3
         Left            =   120
         MaxLength       =   8
         MultiLine       =   -1  'True
         TabIndex        =   6
         Text            =   "EditOutF.frx":001A
         ToolTipText     =   "Enter the binary value of the tuning word you want."
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox txtTW 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   2
         Left            =   1080
         MaxLength       =   8
         MultiLine       =   -1  'True
         TabIndex        =   5
         Text            =   "EditOutF.frx":0023
         ToolTipText     =   "Enter the binary value of the tuning word you want."
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox txtTW 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   1
         Left            =   2040
         MaxLength       =   8
         MultiLine       =   -1  'True
         TabIndex        =   4
         Text            =   "EditOutF.frx":002C
         ToolTipText     =   "Enter the binary value of the tuning word you want."
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox txtTW 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Index           =   0
         Left            =   3000
         MaxLength       =   8
         MultiLine       =   -1  'True
         TabIndex        =   3
         Text            =   "EditOutF.frx":0035
         ToolTipText     =   "Enter the binary value of the tuning word you want."
         Top             =   840
         Width           =   975
      End
      Begin VB.TextBox txtTWHex 
         Alignment       =   2  'Center
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2760
         MaxLength       =   8
         MultiLine       =   -1  'True
         TabIndex        =   2
         Text            =   "EditOutF.frx":003E
         ToolTipText     =   "Enter the hexidecimal value of the tuning word you want."
         Top             =   360
         Width           =   1215
      End
      Begin VB.TextBox txtTWDec 
         Alignment       =   1  'Right Justify
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   120
         MaxLength       =   11
         MultiLine       =   -1  'True
         TabIndex        =   1
         Text            =   "EditOutF.frx":0049
         ToolTipText     =   "Enter the decimal value of the tuning word you want."
         Top             =   360
         Width           =   1335
      End
      Begin VB.Label lblHex 
         BackStyle       =   0  'Transparent
         Caption         =   "Hex"
         Height          =   255
         Index           =   1
         Left            =   4080
         TabIndex        =   12
         Top             =   360
         Width           =   375
      End
      Begin VB.Label lblTWBin 
         BackStyle       =   0  'Transparent
         Caption         =   "Bin"
         Height          =   255
         Left            =   4080
         TabIndex        =   11
         Top             =   840
         Width           =   375
      End
      Begin VB.Label lblDec 
         Caption         =   "Dec"
         Height          =   255
         Left            =   1560
         TabIndex        =   10
         Top             =   360
         Width           =   375
      End
   End
   Begin VB.CommandButton CancelButton 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   4680
      TabIndex        =   8
      Top             =   600
      Width           =   1215
   End
   Begin VB.CommandButton OKButton 
      Caption         =   "OK"
      Height          =   375
      Left            =   4680
      TabIndex        =   7
      Top             =   120
      Width           =   1215
   End
   Begin VB.Shape shpOKHilight 
      BorderWidth     =   3
      Height          =   375
      Left            =   4680
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label lblMhz 
      Caption         =   "MHz"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   3000
      TabIndex        =   14
      Top             =   420
      Width           =   615
   End
   Begin VB.Label Label1 
      Caption         =   "Frequency:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   13
      Top             =   120
      Width           =   1935
   End
End
Attribute VB_Name = "frmEditOutFreq"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private CancelHit As Boolean
Private OldValue As String
Private EditTbox As TextBox
Private TWDecVal As Variant
'Private OutputFreqVal As String
Private OKHit As Boolean
Private NegValues As Boolean
Option Explicit

Private Sub CancelButton_Click()
    'Cancel was hit
    OKHit = False
    'Hide the form
    Me.Hide
End Sub

Private Sub Form_Unload(Cancel As Integer)
    OKHit = False
    'Release the pointer to the textbox being edited
    Set EditTbox = Nothing
End Sub

Private Sub OKButton_Click()
    'Ok button hit
    OKHit = True
    
    'Hide the form
    Me.Hide
End Sub

Private Sub OKButton_GotFocus()
    'Hide the hilight box
    shpOKHilight.Visible = False
End Sub

Private Sub OKButton_LostFocus()
    'Show the hilight box
    shpOKHilight.Visible = True
End Sub

Private Sub txtOutputFreqVal_GotFocus()
    SelectAllTxt txtOutputFreqVal
End Sub

Private Sub txtOutputFreqVal_KeyPress(KeyAscii As Integer)
    Dim cncl As Boolean
    Dim DecSepPos As Integer

    'Filter out all keys but the ones that are needed
    KeyAscii = NumericKeysFilter(KeyAscii)
    If NegValues = False Then
        KeyAscii = PlusMinusKeysFilter(KeyAscii)
    End If
    Select Case KeyAscii
        Case 69, 101: 'Alpha key
            KeyAscii = 0
        Case iDecSep 'Decimal Seperator
            If InStr(1, txtOutputFreqVal.Text, sDecSep) And InStr(1, txtOutputFreqVal.SelText, sDecSep) = 0 Then
                KeyAscii = 0
            End If
        Case 13: 'Enter key hit
            KeyAscii = 0
            'Validate the text box
'            txtOutpuFreqVal_Validate Cncl
            txtOutputFreqVal_Validate cncl
        Case Else 'Only a passable key was pressed
            'Get the position of the decimal seperator
            DecSepPos = InStr(1, txtOutputFreqVal.Text, sDecSep)
            
            If txtOutputFreqVal.SelStart < DecSepPos And DecSepPos < 4 Then
                If IsPrintable(KeyAscii) Then
                    'Adjust the maximum length
                    Select Case DecSepPos
                        Case 2:
                            txtOutputFreqVal.MaxLength = 12
                        Case 3:
                            txtOutputFreqVal.MaxLength = 13
                        Case Else:
                            txtOutputFreqVal.MaxLength = 14
                    End Select
                Else
                    Select Case DecSepPos
                        Case 2:
                            txtOutputFreqVal.MaxLength = 11
                        Case 3:
                            txtOutputFreqVal.MaxLength = 12
                        Case Else
                            txtOutputFreqVal.MaxLength = 13
                    End Select
                End If
            End If

    End Select

End Sub

Private Sub UpdateTW(ByVal value As Variant)
    Dim TWBin As String
    Dim OutFreqval As Variant
    Dim NegVal As Boolean
    Dim PosValue As Variant
    Dim DecSepPos As Integer
        
    If NegValues Then
        'If the value is negative then set a flag
        If value < 0 Then
            NegVal = True
            'Get absolute value
            PosValue = Abs(value)
        End If
                
        'Output frequency textbox
        If Not (ActiveControl Is txtOutputFreqVal) Then
            'Ajust the maximum length of the textbox
            AdjustOFTboxLen value
                        
            If NegVal Then
                'Update this box because it is not currently active
                OutFreqval = DecTW2CarrierFreq(PosValue) 'Calc with the Pos value
                OutFreqval = -OutFreqval 'Negatize the output frequency
                txtOutputFreqVal.Text = FormatOutFreq(OutFreqval)
            Else
                'Update this box because it is not currently active
                OutFreqval = DecTW2CarrierFreq(value)
            
                txtOutputFreqVal.Text = FormatOutFreq(OutFreqval)
            End If
            
        End If
        
        'Decimal value textbox
        If Not (ActiveControl Is txtTWDec) Then
            txtTWDec.Text = Format(value, "0000000000")
        End If
        
        'Hex textbox
        If Not (ActiveControl Is txtTWHex) Then
            'Update this box because it is not currently active
            txtTWHex.Text = cbaseSignedDec2Hex(value, 8)
            txtTWHex.Refresh
        End If
        
        'Generate a binary string representing the tunning word
        TWBin = cbaseDec2Bin(value, TWBits)
        
        'Binary TextBoxes
        If Not (ActiveControl Is txtTW(0)) Then

⌨️ 快捷键说明

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