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

📄 frmtestreg.frm

📁 AD9954源码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   405
         Index           =   0
         Left            =   3480
         TabIndex        =   15
         Top             =   3000
         Width           =   495
      End
      Begin VB.Label lblBin 
         Caption         =   "B"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Index           =   0
         Left            =   5880
         TabIndex        =   14
         Top             =   2550
         Width           =   255
      End
      Begin VB.Label lblSigRegVal 
         Caption         =   "Signature Register Value:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   3120
         TabIndex        =   13
         Top             =   2160
         Width           =   2775
      End
      Begin VB.Label lblSigRegLoWord 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "00000000"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   405
         Index           =   0
         Left            =   4350
         TabIndex        =   12
         Top             =   2520
         Width           =   1455
      End
      Begin VB.Label lblSigRegHiWord 
         Alignment       =   1  'Right Justify
         BackColor       =   &H80000005&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "000000"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   13.5
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   405
         Index           =   0
         Left            =   3120
         TabIndex        =   11
         Top             =   2520
         Width           =   1215
      End
      Begin VB.Label lblPhaseChannelSel 
         Caption         =   "Phase Channel Select:"
         Height          =   255
         Index           =   0
         Left            =   3120
         TabIndex        =   8
         Top             =   840
         Width           =   1695
      End
   End
End
Attribute VB_Name = "frmTestReg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public IsUpdating As Boolean

Public Sub RefreshControls()
    Dim CurrentVal As String
    Dim DutCntr As Integer
    
    IsUpdating = True
        
    For DutCntr = 1 To 2
        CurrentVal = EvalBd.sGetNewRegMapVal(DutCntr, &HC)
    
        'Get the current phasechannel selection
        cmbPhaseChannelSel(DutCntr - 1).ListIndex = CInt(cbaseBinS2Dec(Right(CurrentVal, 2)))
        chkDACTest0(DutCntr - 1).value = CInt(Mid(CurrentVal, 30, 1))
        chkDACTest1(DutCntr - 1).value = CInt(Mid(CurrentVal, 29, 1))
        chkRefClkIsDDSClk(DutCntr - 1).value = CInt(Mid(CurrentVal, 28, 1))
        chkLoadSigReg(DutCntr - 1).value = CInt(Mid(CurrentVal, 27, 1))
        chkSigRegReadEnable(DutCntr - 1).value = CInt(Mid(CurrentVal, 26, 1))
        chkSigRegEnable(DutCntr - 1).value = CInt(Mid(CurrentVal, 25, 1))
        chkReadTruncPhaseWord(DutCntr - 1).value = CInt(Mid(CurrentVal, 23, 1))
        chkAutoRAMBISTActive(DutCntr - 1).value = CInt(Mid(CurrentVal, 22, 1))
        chkLoadRAMSigReg(DutCntr - 1).value = CInt(Mid(CurrentVal, 21, 1))
        chkRAMBISTActive(DutCntr - 1).value = CInt(Mid(CurrentVal, 20, 1))
        cmbRAMBistMode(DutCntr - 1).ListIndex = CInt(cbaseBinS2Dec(Mid(CurrentVal, 16, 3)))
        chkDACSWModeCtrl(DutCntr - 1).value = CInt(Mid(CurrentVal, 10, 1))
        lblSigRegHiWord(DutCntr - 1).Caption = Mid(CurrentVal, 11, 6)
        lblSigRegLoWord(DutCntr - 1).Caption = Mid(CurrentVal, 1, 8)
    Next DutCntr
    IsUpdating = False
End Sub

Private Sub chkAutoRAMBISTActive_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 10, chkAutoRAMBISTActive(Index).value
    End If
End Sub

Private Sub chkDACSWModeCtrl_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 22, chkDACSWModeCtrl(Index).value
    End If
End Sub

Private Sub chkDACTest0_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 2, chkDACTest0(Index).value
    End If
End Sub

Private Sub chkDacTest1_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 3, chkDACTest1(Index).value
    End If
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, &HC, .sGetNewRegMapVal(1, &HC)
            .sSetRegMapVal 2, &HC, .sGetRegMapVal(1, &HC)
        End With
    Else
        sstChooseDUT.TabEnabled(1) = True
        'Refresh the form
        RefreshControls
    End If
End Sub

Private Sub chkLoadRAMSigReg_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 11, chkLoadRAMSigReg(Index).value
    End If
End Sub

Private Sub chkLoadSigReg_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 5, chkLoadSigReg(Index).value
    End If
End Sub

Private Sub chkRAMBISTActive_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 12, chkRAMBISTActive(Index).value
    End If
End Sub

Private Sub chkReadTruncPhaseWord_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 9, chkReadTruncPhaseWord(Index).value
    End If
End Sub

Private Sub chkRefClkIsDDSClk_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 4, chkRefClkIsDDSClk(Index).value
    End If
End Sub

Private Sub chkSigRegEnable_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 7, chkSigRegEnable(Index).value
    End If
End Sub

Private Sub chkSigRegReadEnable_Click(Index As Integer)
    'If the form isn't being updated then set the bit in the registermap
    If Not IsUpdating Then
        'Set the bit in the Register Map Buffer
        EvalBd.sSetNewRegMapBitVal Index + 1, &HC, 6, chkSigRegReadEnable(Index).value
    End If
End Sub

Private Sub cmbPhaseChannelSel_Click(Index As Integer)
    Dim CurrentVal As String
        
    If Not IsUpdating Then
        'Get the current value from
        CurrentVal = EvalBd.sGetNewRegMapVal(Index + 1, &HC)
        
        'Set the bits in the new register map values buffer
        EvalBd.sSetNewRegMapVal Index + 1, &HC, Left(CurrentVal, 30) & cbaseDec2Bin(cmbPhaseChannelSel(Index).ListIndex, 2)
        
        'lblIntProfileCtrlInfo(Index).Caption = IntProfileCtrlInfo(lstIntProfileControl(Index).ListIndex)
    End If
End Sub

Private Sub cmbRAMBistMode_Click(Index As Integer)
    Dim CurrentVal As String
        
    If Not IsUpdating Then
        'Get the current value from
        CurrentVal = EvalBd.sGetNewRegMapVal(Index + 1, &HC)
        
        'Set the bits in the new register map values buffer
        EvalBd.sSetNewRegMapVal Index + 1, &HC, Left(CurrentVal, 16) & cbaseDec2Bin(cmbRAMBistMode(Index).ListIndex, 3) & Right(CurrentVal, 13)
        
        'lblIntProfileCtrlInfo(Index).Caption = IntProfileCtrlInfo(lstIntProfileControl(Index).ListIndex)
    End If
End Sub

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

Private Sub cmdRead_Click(Index As Integer)
    Dim ReadStr As String
    
    'Hourglass
    Screen.MousePointer = 11
    
    'Read back the test register
    ReadStr = EvalBd.SerialRead(Index + 1, &HC)
    
    With EvalBd
        'Update the registermap for the DUT to prevent the load button from flashing
        .sSetRegMapVal Index + 1, &HC, ReadStr
        .sSetNewRegMapVal Index + 1, &HC, ReadStr
    End With
         
    'Refresh the form controls
    RefreshControls
         
    'Hourglass
    Screen.MousePointer = 0
End Sub

Private Sub Form_Activate()
    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
    'Uncheck the the menu item
    mdiMain.mnuWindowTestReg.Checked = False
End Sub

Private Sub lblSigRegHiWord_Change(Index As Integer)
    lblHexValHW(Index).Caption = cbaseBinStr2Hex(lblSigRegHiWord(Index).Caption, 2)
End Sub

Private Sub lblSigRegLoWord_Change(Index As Integer)
    lblHexValLW(Index).Caption = cbaseBinStr2Hex(lblSigRegLoWord(Index).Caption, 2)
End Sub

⌨️ 快捷键说明

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