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

📄 frmaplitude.frm

📁 AD9954源码
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Height          =   375
            Index           =   1
            Left            =   4590
            TabIndex        =   13
            Top             =   360
            Width           =   255
         End
         Begin VB.Label lblAutoARRSC 
            Caption         =   "Auto Ramp Rate Speed Control:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   0
            Left            =   120
            TabIndex        =   12
            Top             =   900
            Width           =   3495
         End
         Begin VB.Label lblARR 
            Caption         =   "Amplitude Ramp Rate:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   12
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   375
            Index           =   0
            Left            =   120
            TabIndex        =   11
            Top             =   420
            Width           =   2415
         End
      End
      Begin VB.TextBox txtASF_DSP 
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   480
         Index           =   0
         Left            =   3510
                =   4
       
           g             =   "0"
         Text            =   "0.00000"
         Top             =   450
         Width           =   1245
      End
      Begin VB.CommandButton cmdEditASFR 
         Caption         =   "EDIT"
         Height          =   480
         Index           =   0
         Left            =   2880
         TabIndex        =   1
         Top             =   450
         Width           =   615
      End
      Begin VB.Label lblASF 
         Alignment       =   2  'Center
         Caption         =   "Amplitude Scale Factor:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   1
         Left            =   -74760
         TabIndex        =   17
         Top             =   540
         Width           =   2535
      End
      Begin VB.Label lblASF 
         Alignment       =   2  'Center
         Caption         =   "Amplitude Scale Factor:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   240
         TabIndex        =   6
         Top             =   540
         Width           =   2535
      End
   End
End
Attribute VB_Name = "frmAmplitude"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public IsUpdating As Boolean
Private Sub chkARRSC_Click(Index As Integer)
    
End Sub

Private Sub chkLoadBothDUTs_Click()
    If chkLoadBothDUTs.value = 1 Then
        'Make sure that you select the dut1 tab before disabling the dut2 tab
        If sstChooseDUT.Tab = 1 Then
            sstChooseDUT.Tab = 0
        End If
        
        sstChooseDUT.TabEnabled(1) = False
        With EvalBd
            'Set DUT2's Regmap = DUT1's Regmap
            .sSetNewRegMapVal 2, 2, .sGetNewRegMapVal(1, 2)
            .sSetNewRegMapVal 2, 3, .sGetNewRegMapVal(1, 3)
        End With
    Else
        sstChooseDUT.TabEnabled(1) = True
        'Refresh the form
        RefreshControls
    End If
End Sub

Private Sub chkOSKPin_Click(Index As Integer)
    If Index = 0 And chkLoadBothDUTs.value = 0 Then
        'Take the pin high or low
        EvalBd.OSK_DUT1 = chkOSKPin(Index).value
    Else
        'Take the pin high or low
        EvalBd.OSK_DUT2 = chkOSKPin(Index).value
    End If
    
    If chkLoadBothDUTs.value = 1 Then
        EvalBd.OSK_DUT1 = chkOSKPin(Index).value
        EvalBd.OSK_DUT2 = chkOSKPin(Index).value
    End If
    
    'Set the caption to show the pin value
    If chkOSKPin(Index).value = 0 Then
        chkOSKPin(Index).Caption = "OSK (Low)"
    Else
        chkOSKPin(Index).Caption = "OSK (High)"
    End If
    
    'Set the value on the eval board
    EvalBd.WriteEvbBuffVal evb59Buff1
End Sub

Private Sub cmbAutoARRSC_Click(Index As Integer)
    Dim ASFRegVal As String
    Dim ASFVal As String
    
    If Not IsUpdating Then
        'Get the current RegMapVal
        ASFRegVal = EvalBd.sGetNewRegMapVal(Index + 1, ASF)
        
        'Get the Amplitude Scale Factor
        ASFVal = Right(ASFRegVal, 14)
        
        'Build the new value
        ASFRegVal = cbaseDec2Bin(cmbAutoARRSC(Index).ListIndex, 2) & ASFVal
        
        'Update the new vals regmap value
        EvalBd.sSetNewRegMapVal Index + 1, ASF, ASFRegVal

    End If
End Sub

Private Sub cmdEditARRR_Click(Index As Integer)
    'Show the edit dialog
    frmEditFreqRampRate.ShowEditDialog txtARRR(Index), "Edit Amplitude Ramp Rate", frmControl.txtSysClkTxt(Index).Text
    
    'Update the new vals regmap value
    EvalBd.sSetNewRegMapVal Index + 1, ARR, cbaseDec2Bin(txtARRR(Index).Tag, 8)

    'Set the focus to the load button
    cmdLoad.SetFocus
End Sub

Private Sub cmdEditASFR_Click(Index As Integer)
    Dim ASFRegVal As String
    Dim ARRSCVal As String
    
    'Show the edit dialog
    'frmEditNumber.ShowEditDialog txtASF_DSP(Index), 14, "Edit the Amplitude Scale Factor"
    frmEditOSF.ShowEditDialog txtASF_DSP(Index)
    
    'Get the current RegMapVal
    ASFRegVal = EvalBd.sGetNewRegMapVal(Index + 1, ASF)
    
    'Get the Amplitude Ramp Rate Speed Control
    ARRSCVal = Left(ASFRegVal, 2)
    
    'Build the new value
    ASFRegVal = ARRSCVal & cbaseDec2Bin(txtASF_DSP(Index).Tag, 14)
    
    'Update the new vals regmap value
    EvalBd.sSetNewRegMapVal Index + 1, ASF, ASFRegVal

    'Set the focus to the load button
    cmdLoad.SetFocus
End Sub

Private Sub cmdLoad_Click()
    'Hourglass
    Screen.MousePointer = 11
    If chkLoadBothDUTs.value = 1 Then
        With EvalBd
            'Load Register 4 - FTW0
            .SerialLoad 0, &H2, .sGetNewRegMapVal(1, &H2)
            'Load Register 5 - POW0
            .SerialLoad 0, &H3, .sGetNewRegMapVal(1, &H3)
            
            'Update the registermap for DUT2 to prevent the load button from flashing
            .sSetNewRegMapVal 2, &H2, .sGetNewRegMapVal(1, &H2)
            .sSetNewRegMapVal 2, &H3, .sGetNewRegMapVal(1, &H3)

        End With
    Else
        With EvalBd
            'Load Register 4 - FTW0
            .SerialLoad 1, &H2, .sGetNewRegMapVal(1, &H2)
            'Load Register 5 - POW0
            .SerialLoad 1, &H3, .sGetNewRegMapVal(1, &H3)
        
            'Load Register 4 - FTW0
            .SerialLoad 2, &H2, .sGetNewRegMapVal(2, &H2)
            'Load Register 5 - POW0
            .SerialLoad 2, &H3, .sGetNewRegMapVal(2, &H3)
        End With
    End If
    'Hourglass
    Screen.MousePointer = 0
End Sub

Private Sub Form_Activate()
    'Disable DUT Tabs that aren't usable
'    Select Case EvalBd.DutsInstalled
'        Case 0:
'            sstChooseDUT.TabEnabled(0) = False
'            sstChooseDUT.TabEnabled(1) = False
'        Case 1:
'            sstChooseDUT.TabEnabled(0) = True
'            sstChooseDUT.TabEnabled(1) = False
'        Case 2:
'            sstChooseDUT.TabEnabled(0) = False
'            sstChooseDUT.TabEnabled(1) = True
'        Case 3:
'            sstChooseDUT.TabEnabled(0) = True
'            sstChooseDUT.TabEnabled(1) = True
'            chkLoadBothDUTs.Enabled = True
'    End Select
End Sub

Private Sub Form_Load()
    Dim cntr As Integer
    
    Dim StrArray(0 To 3) As String
    
    StrArray(0) = "1 * System Clock"
    StrArray(1) = "1/2 * System Clock"
    StrArray(2) = "1/4 * System Clock"
    StrArray(3) = "1/8 * System Clock"
    
    'Populate the AARRSC listbox
    For cntr = 0 To 3
        cmbAutoARRSC(0).AddItem StrArray(cntr)
        cmbAutoARRSC(1).AddItem StrArray(cntr)
    Next cntr
    
    'Refresh the controls on the form
    RefreshControls
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    'Do not allow the user to close the window instead
    'just hide it.
    If UnloadMode = vbFormControlMenu Then
        Cancel = 1
    End If
    Me.Hide
End Sub

'Refreshes the controls with the current values
Public Sub RefreshControls()
    Dim AutoARRSCVal As String
    Dim ASFVal As String
    Dim ARRVal As String
    Dim ASFRegVal As String
    Dim ASRRRegVal As String
    Dim iDut As Integer
    
    For iDut = 1 To  
    
        'Get the current regmap values
        ASFRegVal = EvalBd.sGetNewRegMapVal(iDut, ASF)
        ARRRegVal = EvalBd.sGetNewRegMapVal(iDut, ARR)
    
        'Extract out the indiviual values
        AutoARRSCVal = Left(ASFRegVal, 2)
        ASFVal = Right(ASFRegVal, 14)
        
        'Update the controls
        IsUpdating = True
        
        cmbAutoARRSC(iDut - 1).ListIndex = cbaseBinS2Dec(ASRRRegVal)
        txtARRR(iDut - 1).  g = cbaseBinS2Dec(ARRRegVal)
        txtASF_DSP(iDut - 1).  g = cbaseBinS2Dec(ASFVal)
        txtASF_DSP(iDut - 1). ext = Format(CalculateOSF(txtASF_DSP(iDut - 1).  g), "0.00000")
        
        IsUpdating = False
    
    Next iDut
            
    'Update the display values
    UpdateFormVals
End Sub

Public Sub UpdateFormVals()
    Dim iDut As Integer
    
    For iDut = 1 To  
        'Update the ramprate displays
        txtARRR(iDut - 1). ext = FormatRRT(CalculateRRTime(txtARRR(iDut - 1).  g, frmControl.txtSysClkTxt(iDut - 1). ext))
    Next iDut
End Sub

Public Sub PowerDownForm(ByVal DUTNum As Integer, ByVal bPowDwn As Boolean)
    Dim cntr As Integer
    Dim Cntrl As Control
    
    'Make sure that dutnum is either 1 or  
    If DUTNum <> 1 Then
        DUTNum =  
    End If
    
    'Loop through all of the controls and disable the ones
    For Each Cntrl In Me.Controls
        If TypeOf Cntrl.Container Is Frame Then
            If Cntrl.Container.Name <> "fraLoad" Then
                'if the frame isnt the load frame and is the proper index
                If Cntrl.Container.Index = DUTNum - 1 Then
                    If Cntrl.Name <> "chkOSKPin" Then
                        Cntrl.Enabled = Not bPowDwn
                    End If
                End If
                'Disable the frame
                If Cntrl.Container.Enabled = bPowDwn Then
                    Cntrl.Container.Enabled = Not bPowDwn
                End If
            End If
        End If
        If TypeOf Cntrl.Container Is SSTab Then
            If Cntrl.Index = DUTNum - 1 Then
                Cntrl.Enabled = Not bPowDwn
            End If
        End If
    Next
    
End Sub

⌨️ 快捷键说明

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