📄 formsin.frm
字号:
Index = 9
X1 = 4600
X2 = 4600
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 8
X1 = 4100
X2 = 4100
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 7
X1 = 3600
X2 = 3600
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 6
X1 = 3100
X2 = 3100
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 5
X1 = 2100
X2 = 2100
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 4
X1 = 1600
X2 = 1600
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 3
X1 = 1100
X2 = 1100
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00404040&
Index = 2
X1 = 600
X2 = 600
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line5
BorderColor = &H00000000&
BorderWidth = 3
Index = 0
X1 = 100
X2 = 100
Y1 = 120
Y2 = 3820
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 3
X1 = 100
X2 = 10100
Y1 = 1600
Y2 = 1600
End
Begin VB.Line Line1
BorderColor = &H00808080&
Index = 1
X1 = 100
X2 = 10100
Y1 = 100
Y2 = 100
End
Begin VB.Line Line1
BorderColor = &H00404040&
Index = 0
X1 = 100
X2 = 10100
Y1 = 3100
Y2 = 3100
End
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 9285
Left = 45
Top = 120
Width = 10285
End
End
End
Attribute VB_Name = "Formsin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim SinA, Sink As Integer
Dim SinAgain, SinTime As Integer
Dim Y1, Y2, Y3 As Integer
Dim A1, A2, A3 As Byte
Dim F1, F2, F3 As Single
Dim A_aud, A_aud1, A_aud2, A_aud3 As Integer
Dim F_aud, F_aud1, F_aud2, F_aud3 As Integer
Dim P_aud, P_aud2, P_aud3 As Integer
Dim Limda As Single
Dim Alim As Long
Dim i As Long
Dim j1, j2, j3 As Long
Dim TempY1 As Double
Dim TempY2 As Double
Dim TempY3 As Double
Dim TempB1 As Double
Dim TempB2 As Double
Dim TempB3 As Double
Dim TempBre1 As Double
Dim TempBre2 As Double
Dim TempBre3 As Double
Dim TempY As Single
Dim X As Single
Dim Y As Single
Dim x0 As Single
Dim y0 As Single
Dim XL0 As Single
Dim XL1 As Single
Dim Yy1 As Single
Dim Yy2 As Single
Dim Sinda1 As Single
Dim Sinda2 As Single
Dim Sinda3 As Single
Dim DemoInd As Byte
Dim DemoPh As Boolean
Dim BreX0 As Single
Dim BreX1 As Single
Dim BreY0 As Single
Dim BreY1 As Single
Dim Demo1 As Single
Dim Demo2 As Single
Dim Demox0, Demox1 As Single
Dim Demoy0, Demoy1 As Single
Dim DemoY As Single
Dim k1, k2 As Integer
Dim m, n As Long
Dim DemoMax As Single
Dim Demodowith As Boolean
Private Sub ComCarr_Click()
n = 0
If Option4(0).Value = True Then
SinTime = 1
End If
If Option4(1).Value = True Then
SinTime = 10
End If
If Option4(2).Value = True Then
SinTime = 100
End If
Picture3.Cls
Picture3.SetFocus
j1 = 0
j2 = 0
j3 = 0
Sinda1 = 0
Sinda2 = 0
Sinda3 = 0
DemoInd = 0
X = 0
A1 = Val(TextA1.Text)
F1 = Val(TextF1.Text)
A_aud1 = Val(TextAaud1.Text)
F_aud1 = Val(TextFaud1.Text)
A2 = Val(TextA2.Text)
F2 = Val(TextF2.Text)
A_aud2 = Val(TextAaud2.Text)
F_aud2 = Val(TextFaud2.Text)
P_aud2 = Val(TextPaud2.Text)
A3 = Val(TextA3.Text)
F3 = Val(TextF3.Text)
A_aud3 = Val(TextAaud3.Text)
F_aud3 = Val(TextFaud3.Text)
P_aud3 = Val(TextPaud3.Text)
A_aud = Val(TextAaud.Text)
F_aud = Val(TextFaud.Text)
Alim = Val(TextALim.Text)
For i = 528000 * (Sink - 1) * SinTime To 528000 * SinTime * Sink
If (i - (Sink - 1) * 528000 * SinTime) Mod 5280 = 0 Then '显示进程
n = (i - (Sink - 1) * 528000 * Stinime) / 5280
n = n / SinTime
Call Progress(n)
End If
Select Case True
Case Option1.Value
TempB1 = A_aud1 * Sin(2.37999443453772E-08 * F_aud1 * i)
If TempB1 > Alim Then
TempB1 = Alim
End If
If TempB1 < Alim * (-1) Then
TempB1 = Alim * (-1)
End If
TempBre1 = TempB1 + A_aud * Sin(2.37999443453772E-08 * F_aud * i)
If (i - (Sink - 1) * 528000 * SinTime) Mod 53 = 0 Then '显示波形;每53个值显1个点
If (i - (Sink - 1) * 528000 * SinTime) = 0 Then
x0 = 100
y0 = 1400 - TempBre1 / 5.8
X = x0 + (1 / SinTime)
Y = y0
Else
x0 = X
y0 = Y
X = X + (1 / SinTime)
Y = 1400 - TempBre1 / 5.8
End If
Picture3.Line (X, Y)-(x0, y0), vbBlue
End If
Case Option2.Value
TempB2 = A_aud2 * Sin(2.37999443453772E-08 * F_aud2 * (i + 0.000001 * P_aud2 * F2 * 2640))
If TempB2 > Alim Then
TempB2 = Alim
End If
If TempB2 < Alim * (-1) Then
TempB2 = Alim * (-1)
End If
TempBre2 = TempB2 + A_aud * Sin(2.37999443453772E-08 * F_aud * (i + 0.000001 * P_aud2 * F2 * 2640))
If (i - (Sink - 1) * 528000 * SinTime) Mod 53 = 0 Then
If (i - (Sink - 1) * 528000 * SinTime) = 0 Then
x0 = 100
y0 = 1400 - TempBre2 / 5.8
X = x0 + (1 / SinTime)
Y = y0
Else
x0 = X
y0 = Y
X = X + (1 / SinTime)
Y = 1400 - TempBre2 / 5.8
End If
Picture3.Line (X, Y)-(x0, y0), vbBlue
End If
Case Option3.Value
TempB3 = A_aud3 * Sin(2.37999443453772E-08 * F_aud3 * (i + 0.000001 * P_aud3 * F3 * 2640))
If TempB3 > Alim Then
TempB3 = Alim
End If
If TempB3 < Alim * (-1) Then
TempB3 = Alim * (-1)
End If
TempBre3 = TempB3 + A_aud * Sin(2.37999443453772E-08 * F_aud * (i + 0.000001 * P_aud3 * F3 * 2640))
If (i - (Sink - 1) * 528000 * SinTime) Mod 53 = 0 Then
If (i - (Sink - 1) * 528000 * SinTime) = 0 Then
x0 = 100
y0 = 1400 - TempBre3 / 5.8
X = x0 + (1 / SinTime)
Y = y0
Else
x0 = X
y0 = Y
X = X + (1 / SinTime)
Y = 1400 - TempBre3 * 3000 / 12000
End If
Picture3.Line (X, Y)-(x0, y0), vbBlue
End If
End Select
Next i
Picture3.SetFocus
End Sub
Private Sub ComCls1_Click()
Picture1.Cls
Picture2.Cls
Picture4.Cls
Picture1.SetFocus
End Sub
Private Sub ComCls3_Click()
Picture3.Cls
Picture4.Cls
Picture3.SetFocus
End Sub
Private Sub Demodulation(Stime As Integer, Sk As Integer) '调制解调函数'Sk翻页参数,Stime倍数
Picture1.SetFocus
Picture1.Cls
Picture2.Cls
Sinda1 = 0
Sinda2 = 0
Sinda3 = 0
DemoInd = 0
X = 0
Demox0 = 0
Demox1 = 0
Picture4.Cls
TempBre1 = 0
TempBre2 = 0
TempBre3 = 0
A1 = Val(TextA1.Text)
F1 = Val(TextF1.Text)
A_aud1 = Val(TextAaud1.Text)
F_aud1 = Val(TextFaud1.Text)
P_aud = Val(TextP.Text)
A2 = Val(TextA2.Text)
F2 = Val(TextF2.Text)
A_aud2 = Val(TextAaud2.Text)
F_aud2 = Val(TextFaud2.Text)
P_aud2 = Val(TextPaud2.Text)
A3 = Val(TextA3.Text)
F3 = Val(TextF3.Text)
A_aud3 = Val(TextAaud3.Text)
F_aud3 = Val(TextFaud3.Text)
P_aud3 = Val(TextPaud3.Text)
A_aud = Val(TextAaud.Text)
F_aud = Val(TextFaud.Text)
Limda = Val(TextLim.Text)
Alim = Val(TextALim.Text)
DemoMax = 0
'Open App.Path + "\num.txt" For Output As #1
TempB1 = A_aud1 * Sin(2.37999443453772E-08 * F_aud1 * i)
If TempB1 > Alim Then
TempB1 = Alim
End If
If TempB1 < Alim * (-1) Then
TempB1 = Alim * (-1)
End If
TempBre1 = TempB1 + A_aud * Sin(2.37999443453772E-08 * F_aud * i)
TempB2 = A_aud2 * Sin(2.37999443453772E-08 * F_aud2 * (i + 0.000001 * P_aud2 * F2 * 2640))
If TempB2 > Alim Then
TempB2 = Alim
End If
If TempB2 < Alim * (-1) Then
TempB2 = Alim * (-1)
End If
TempBre2 = TempB2 + A_aud * Sin(2.37999443453772E-08 * F_aud * (i + 0.000001 * P_aud2 * F2 * 2640))
TempB3 = A_aud3 * Sin(2.37999443453772E-08 * F_aud3 * (i + 0.000001 * P_aud3 * F3 * 2640))
If TempB3 > Alim Then
TempB3 = Alim
End If
If TempB3 < Alim * (-1) Then
TempB3 = Alim * (-1)
End If
TempBre3 = TempB3 + A_aud * Sin(2.37999443453772E-08 * F_aud * (i + 0.000001 * P_aud3 * F3 * 2640))
For i = 528000 * (Sk - 1) * Stime To 528000 * Stime * Sk 'Sk翻页参数,Stime倍数
If (i - (Sk - 1) * 528000 * Stime) Mod 5280 = 0 Then '显示进程
n = (i - (Sk - 1) * 528000 * Stime) / 5280
n = n / Stime
Call Progress(n)
End If
TempY1 = A1 * Sin(2.37999443453772E-08 * (F1 + TempBre1) * j1)
TempY2 = A2 * Sin(2.37999443453772E-08 * (F2 + TempBre2) * j2)
TempY3 = A3 * Sin(2.37999443453772E-08 * (F3 + TempBre3) * j3)
If TempY1 > 0 And Sinda1 < 0 Then
j1 = 1
BrePh = True
TempY1 = 0
TempB1 = A_aud1 * Sin(2.37999443453772E-08 * F_aud1 * i)
If TempB1 > Alim Then
TempB1 = Alim
End If
If TempB1 < Alim * (-1) Then
TempB1 = Alim * (-1)
End If
TempBre1 = TempB1 + A_aud * Sin(2.37999443453772E-08 * F_aud * i)
Else
BrePh = False
j1 = j1 + 1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -