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

📄 frmeditram.frm

📁 AD9954源码
💻 FRM
📖 第 1 页 / 共 5 页
字号:
End Sub

Private Sub chkShowGenRamp_Click()
    'Uncheck the other so that we can se the one we want
    If fraGenRandom.Visible Then
        chkGenRand.value = 0
    End If
    
    'Check to see what format the displays are in
    If chkPhaseOffsetWords.value Then
        txtRampGenInstruc.Text = "This will generate a linear phase ramp that will start at the Start Phase and increment by the Delta Phase." & vbNewLine & vbNewLine & "It will start at the begining address and fill the entire RAM segment."
        txtDeltaFrequency.Text = Format(CalcPO(cbaseBinS2Dec(Left(cbaseDec2Bin(txtDeltaFrequency.Tag, 32), 14))), "0.000")
        lblStartRampFreq.Caption = "Start Phase:"
        lblDeltaRampFreq.Caption = "Delta Phase:"
        chkRampDown.Caption = "Ramp Down (Subract Delta Phase)"
    Else
        txtDeltaFrequency.Text = FormatOutFreq(DecTW2CarrierFreq(txtDeltaFrequency.Tag, txtSystemClock.Text))
        txtRampGenInstruc.Text = "This will generate a linear frequency ramp that will start at the Start Frequency and increment by the Delta Frequency." & vbNewLine & vbNewLine & "It will start at the begining address and fill the entire RAM segment."
        lblStartRampFreq.Caption = "Start Freq:"
        lblDeltaRampFreq.Caption = "Delta Freq:"
        chkRampDown.Caption = "Ramp Down (Subract Delta Frequency)"
    End If
    
    fraGenerateRamp.Visible = chkShowGenRamp.value
    'If showing the Ramp Gen then get the start freq from the RAM
    If chkShowGenRamp.value Then
        If chkPhaseOffsetWords.value = 0 Then
            txtStartFreq.Tag = cbaseBinS2Dec(RAMData(CInt(txtBeginAddr.Text)))
            txtStartFreq.Text = FormatOutFreq(DecTW2CarrierFreq(txtStartFreq.Tag, txtSystemClock.Text))
            'disable the RSCW frame until finished with ramp generation
            fraRSCW.Enabled = False
        Else
            txtStartFreq.Tag = cbaseBinS2Dec(RAMData(CInt(txtBeginAddr.Text)))
            txtStartFreq.Text = Format(CalcPO(cbaseBinS2Dec(Left(cbaseDec2Bin(txtStartFreq.Tag, 32), 14))), "0.000")
            'disable the RSCW frame until finished with ramp generation
            fraRSCW.Enabled = False
        End If
    Else
        'Enable the RSCW frame
        fraRSCW.Enabled = True
    End If
    
    'Disable the ok button until ramp generation is finished
    cmdOK.Enabled = Not (CBool(chkShowGenRamp.value))
End Sub

Private Sub cmbModeCtrl_Click()
    
    If Not IsUpdating Then
        'Store the info, just incase the form is in FileEditMode
        RamSegCW(RAMSegSel).ModeControl = cmbModeCtrl.ListIndex
    End If

End Sub

Private Sub cmdCancel_Click()
    '
    Me.Hide
    
    'Unload the form
'    Unload Me

End Sub

Private Sub cmdEditAddressRampRate_Click()
    'Show the edit dialog
    frmEditRAMAddrRR.ShowEditDialog txtAddrRampRate, "Edit the address ramp rate.", txtSystemClock.Text

    'Store the info, just incase the form is in FileEditMode
    RamSegCW(RAMSegSel).AddressRampRate = CLng(txtAddrRampRate.Tag)

End Sub

Private Sub cmdEditBegAddr_Click()
    
    'Edit the number
    frmEditNumber.ShowEditDialog txtBeginAddr, 10, "Edit Beginning Address Value"
    'Update the scroll bar
'    vscScroller.Min = CInt(txtBeginAddr.Text)
    
    'Setup the scroll area again
    SetupScrollArea
    'Helps udate the scroll area
    vscScroller.value = txtBeginAddr.Text
    
    'Store the info, just incase the form is in FileEditMode
    RamSegCW(RAMSegSel).BeginAddr = CInt(txtBeginAddr.Text)
    
    CheckForRSCWErrors
    'RefreshDisplay
    'Enabled the scroll bar if the
'    If vscScroller.Max >= vscScroller.Min Then
'        cmdOK.Enabled = True
'        cmdSaveFile.Enabled = True
'    Else
'        cmdOK.Enabled = False
'        cmdSaveFile.Enabled = False
'        chkShowGenRamp.Enabled = False
'    End If
'
'    If CInt(txtBeginAddr.Text) < CInt(txtFinalAddr.Text) Then
'        chkShowGenRamp.Enabled = True
'    Else
'        chkShowGenRamp.Enabled = False
'    End If

End Sub

Private Sub cmdEditDeltaFreq_Click()
    'Show the edit dialog
    If chkPhaseOffsetWords.value = 0 Then
        frmEditOutFreq.ShowEditDialog txtDeltaFrequency, "Edit Delta Frequency", txtSystemClock.Text
    Else
        frmEditRAMPhaseOffset.ShowEditDialog txtDeltaFrequency, txtSystemClock.Text
    End If
End Sub

Private Sub cmdEditFinalAddr_Click()
    'Edit the number
    frmEditNumber.ShowEditDialog txtFinalAddr, 10, "Edit Final Address Value"
    'Update the scroll bar
'    If txtFinalAddr.Text > 1023 Then
'        vscScroller.Max = 1008
'    Else
'        vscScroller.Max = CInt(txtFinalAddr.Text)
'    End If
    
    'Setup the scroll area again
    SetupScrollArea
    
    'Helps udate the scroll area
    vscScroller.value = txtBeginAddr.Text
    
    'Store the info, just incase the form is in FileEditMode
    RamSegCW(RAMSegSel).FinalAddr = CInt(txtFinalAddr.Text)
    
    CheckForRSCWErrors
    'Enabled the scroll bar if the
'    If vscScroller.Max >= vscScroller.Min Then
'        cmdOK.Enabled = True
'        cmdSaveFile.Enabled = True
'    Else
'        cmdOK.Enabled = False
'        cmdSaveFile.Enabled = False
'    End If
End Sub

Private Sub cmdEditRndLowerLimit_Click()
    'Show the proper edit dialog
    If chkPhaseOffsetWords.value = 0 Then
        frmEditOutFreq.ShowEditDialog txtRndLowerLimit, "Edit Lower Frequency Limit", txtSystemClock.Text
    Else
        frmEditRAMPhaseOffset.ShowEditDialog txtRndLowerLimit, txtSystemClock.Text
    End If
End Sub

Private Sub cmdEditRndUpperLimit_Click()
    'Show the proper edit dialog
    If chkPhaseOffsetWords.value = 0 Then
        frmEditOutFreq.ShowEditDialog txtRndUpperLimit, "Edit Upper Frequency Limit", txtSystemClock.Text
    Else
        frmEditRAMPhaseOffset.ShowEditDialog txtRndUpperLimit, txtSystemClock.Text
    End If

End Sub

Private Sub cmdEditStartFreq_Click()
    'Show the proper edit dialog
    If chkPhaseOffsetWords.value = 0 Then
        frmEditOutFreq.ShowEditDialog txtStartFreq, "Edit Start Frequency", txtSystemClock.Text
    Else
        frmEditRAMPhaseOffset.ShowEditDialog txtStartFreq, txtSystemClock.Text
    End If
    
End Sub

Private Sub cmdEditVal_Click(Index As Integer)
    'Show the edit dialog
    If chkPhaseOffsetWords.value = 0 Then
        frmEditOutFreq.ShowEditDialog txtValue(Index), "Edit Output Frequency", txtSystemClock.Text
    Else
        frmEditRAMPhaseOffset.ShowEditDialog txtValue(Index), txtSystemClock.Text
    End If
    
    'Replace the new value
    RAMData(lblAddress(Index).Caption) = cbaseDec2Bin(txtValue(Index).Tag, 32)
End Sub

Private Sub cmdGenRandData_Click()
    Dim cntr As Integer
    
    'Change the caption of the button
    cmdGenRandData.Caption = "Generating Ramp Data"
    cmdGenRandData.Enabled = False
    
    'Setup and show the progress bar
    prgProgBar.Min = CInt(txtBeginAddr.Text)
    prgProgBar.Max = CInt(txtFinalAddr.Text)
    fraProgress.Visible = True
    fraProgress.Refresh
    fraProgress.ZOrder (0)
        
    For cntr = CInt(txtBeginAddr.Text) To CInt(txtFinalAddr.Text)
        'Store the current value in the ramdata buffer
        RAMData(cntr) = cbaseDec2Bin(DecFix((CDec(txtRndUpperLimit.Tag) * Rnd) + CDec(txtRndLowerLimit.Tag)), 32)
        'Update the progress bar
        prgProgBar.value = cntr
    Next cntr
        
    'Hide the progress bar
    fraProgress.Visible = False
    
    'Change the caption of the button
    cmdGenRandData.Caption = "Generate Random Data"
    cmdGenRandData.Enabled = True
    
    'Hide the frame
    chkGenRand.value = 0
    
    'Refresh the display
'    RefreshDisplay
    vscScroller_Change
End Sub

Private Sub cmdLoadRAM_Click()

End Sub

Private Sub cmdOK_Click()
    Dim AddrCntr As Integer
    Dim cntr As Integer
    Dim RSCWAddr As Integer
    Dim RSCW As String
    
    'Flag that OK was hit
    OKHit = True
    
    'Just load the changed RAM Segment value
    'Get the RAM Segment Control Word Address
    RSCWAddr = RAMSegSel + 7
    
    'Build the RSCW
    RSCW = EncodeRSCW(txtBeginAddr.Text, txtFinalAddr.Text, txtAddrRampRate.Tag, cmbModeCtrl.ListIndex, chkNoDwell.value)
    
    
    If txtBeginAddr.Text <= txtFinalAddr.Text Then
        'If the user hit the OK button then apply the changes
        Screen.MousePointer = 11
        'frmRAMLoadStatus.Show 1
        cmdOK.Caption = "LOADING"
        Me.Caption = "Loading RAM Segment " & RAMSegSel
        
        'Load the changes into the RAM
        LoadEditedRAMSeg
        'Copy the changes to the RAM buffer
        For AddrCntr = CInt(txtBeginAddr.Text) To CInt(txtFinalAddr.Text)
            If DUTSel = 2 Then
                DUT2_RAM(AddrCntr) = RAMData(AddrCntr)
            Else
                DUT1_RAM(AddrCntr) = RAMData(AddrCntr)
            End If
        Next AddrCntr
    
        EvalBd.sSetNewRegMapVal DUTSel, RAMSegSel + 7, RSCW
     
    '    Unload frmRAMLoadStatus
        Screen.MousePointer = 0
    Else
        'Load the RAM Segment Control Word
        EvalBd.SerialLoad DUTSel, RSCWAddr, RSCW
    End If
    
    Me.Hide
    
    'Unload the form
'    Unload Me
    
End Sub

Private Sub cmdOKGenRamp_Click()
    Dim cntr As Integer
    Dim TempTW As Variant
    
    TempTW = CDec(txtStartFreq.Tag)
    
    'Change the caption of the button
    cmdOKGenRamp.Caption = "Generating Ramp Data"
    cmdOKGenRamp.Enabled = False
    
    'Setup and show the progress bar
    prgProgBar.Max = CInt(txtFinalAddr.Text)
    prgProgBar.Min = CInt(txtBeginAddr.Text)
    fraProgress.Visible = True
    fraProgress.Refresh
    fraProgress.ZOrder (0)
        
    For cntr = CInt(txtBeginAddr.Text) To CInt(txtFinalAddr.Text)
        'Store the current value in the ramdata buffer
        RAMData(cntr) = cbaseDec2Bin(TempTW, 32)
        'Update the progress bar
        prgProgBar.value = cntr
        If chkRampDown.value = 0 Then
            'Increment to the next value in the sweep
            TempTW = TempTW + CDec(txtDeltaFrequency.Tag)
        Else
            'Increment to the next value in the sweep
            TempTW = TempTW - CDec(txtDeltaFrequency.Tag)
        End If
    Next cntr
        
    'Hide the progress bar
    fraProgress.Visible = False
    
    'Change the caption of the button
    cmdOKGenRamp.Caption = "Generate Ramp Data"
    cmdOKGenRamp.Enabled = True
    
    'Hide the fram
    chkShowGenRamp.value = 0
    
    'Refresh the display
'    RefreshDisplay
    vscScroller_Change
End Sub

Private Sub cmdOpenFile_Click()
    Dim RamFile As String
    Dim cntr As Integer
    
    RamFile = frmFileBrowse.ShowDialog("Select the RAM file to open.", "Open", 0, App.path, True)
    
    'frmEditRam.Refresh

     If RamFile <> "" Then
        EditFileName = GetFileName(RamFile)
        Me.Caption = sCaption & " - Loading " & EditFileName
        
        'Open the choosen ram file
        OpenRAMFile RamFile
        
        Me.Caption = sCaption & " - (" & EditFileName & ")"
    End If
    
    'Find the currently selected ram segment
    For cntr = 0 To 3
        If optRS(cntr).value Then
            'Retrieve the ram segment control word info from the RamSegCW array
            txtBeginAddr.Text = Format(RamSegCW(cntr).BeginAddr, "0000")
            txtFinalAddr.Text = Format(RamSegCW(cntr).FinalAddr, "0000")
            chkNoDwell.value = RamSegCW(cntr).NoDwell
            txtAddrRampRate.Tag = RamSegCW(cntr).AddressRampRate
            cmbModeCtrl.ListIndex = RamSegCW(cntr).ModeControl
        End If
    Next

⌨️ 快捷键说明

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