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

📄 frmset.frm

📁 用VB实现正弦波的采集和傅里叶变换。将时域信号变化为频域信号
💻 FRM
📖 第 1 页 / 共 2 页
字号:
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   8
         Top             =   600
         Width           =   1575
      End
      Begin VB.Label Label2 
         Caption         =   "采样点数:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   7
         Top             =   1200
         Width           =   1575
      End
      Begin VB.Label Label5 
         Caption         =   "增    益:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   6
         Top             =   2400
         Width           =   1695
      End
      Begin VB.Label Label6 
         Caption         =   "采样块数:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   480
         TabIndex        =   5
         Top             =   1800
         Width           =   1695
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "保存"
      BeginProperty Font 
         Name            =   "华文彩云"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1575
      Left            =   240
      TabIndex        =   0
      Top             =   240
      Width           =   7575
      Begin VB.CommandButton CmdSave 
         Caption         =   "..."
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   6840
         TabIndex        =   1
         Top             =   600
         Width           =   495
      End
      Begin VB.Label Label7 
         Caption         =   "文件名:"
         BeginProperty Font 
            Name            =   "楷体_GB2312"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   360
         TabIndex        =   3
         Top             =   600
         Width           =   1335
      End
      Begin VB.Label LblFile 
         BackColor       =   &H80000009&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "e:\yjt\abc"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   1680
         TabIndex        =   2
         Top             =   600
         Width           =   4935
      End
   End
   Begin MSComDlg.CommonDialog CmDialog1 
      Left            =   8280
      Top             =   1920
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   327680
      CancelError     =   -1  'True
      Filter          =   "数据文件|*.dat"
   End
End
Attribute VB_Name = "FrmSet"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub CmdEnd_Click()
   Unload FrmSet
End Sub

Private Sub CmdOK_Click()
Dim k As Integer, FileName As String

  k = Len(FilePath) - 3: FileName = Left$(FilePath, k) + "sts"
  Open FileName For Output As #1
     Write #1, "采样频率:" + CombFreq.Text
     Write #1, "采样点数:" + Combnsamp.Text
     Write #1, "采样块数:" + CombBlock.Text
     Write #1, "增    益:" + Combgain.Text
     Write #1, "触发电平:" + CombLevel.Text
     Write #1, "滞后点数:" + CombSg.Text
  Close #1
  Unload FrmSet
  
End Sub

Private Sub CmdSave_Click()
  
  On Error GoTo Errhandler
  CmDialog1.Action = 2
  
Errhandler:

  If Err = 32755 Then
     Exit Sub
  Else
     FilePath = CmDialog1.FileName
  End If
  
  LblFile.Caption = FilePath
 
End Sub

Private Sub CombBlock_Click()

   If CombBlock.ListIndex = 0 Then block = 1
   If CombBlock.ListIndex = 1 Then block = 5
   If CombBlock.ListIndex = 2 Then block = 10
   If CombBlock.ListIndex = 3 Then block = 20
  
End Sub

Private Sub CombFreq_Click()

  kf = CombFreq.ListIndex     '选择50k,  kf=0 , 总采样频率100k
 
End Sub

Private Sub Combgain_Click()

  gain = Combgain.ListIndex

End Sub

Private Sub CombLevel_Click()

   If CombLevel.ListIndex = 0 Then level = 0.1
   If CombLevel.ListIndex = 1 Then level = 0.2
   If CombLevel.ListIndex = 2 Then level = 0.5
   If CombLevel.ListIndex = 3 Then level = 1#

End Sub

Private Sub Combnsamp_Click()
 
   If Combnsamp.ListIndex = 0 Then ndraw = 256
   If Combnsamp.ListIndex = 1 Then ndraw = 512
   If Combnsamp.ListIndex = 2 Then ndraw = 1024
   If Combnsamp.ListIndex = 3 Then ndraw = 2048
   If Combnsamp.ListIndex = 4 Then ndraw = 4096

End Sub

Private Sub CombSg_Click()
   
    If CombSg.ListIndex = 0 Then nsg = 16
    If CombSg.ListIndex = 1 Then nsg = 32
    If CombSg.ListIndex = 2 Then nsg = 64
    If CombSg.ListIndex = 3 Then nsg = 128
    If CombSg.ListIndex = 4 Then nsg = 256
      
End Sub

Private Sub Form_Load()
  
   LblFile.Caption = FilePath

End Sub


⌨️ 快捷键说明

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