📄 nihongdeng.bas
字号:
If Form1.Label1(i).Visible = True Then
Form1.Data2.Recordset.AddNew
Form1.Data2.Recordset.Fields("名称") = NowFileName
Form1.Data2.Recordset.Fields("粗体") = Form1.Label1(i).FontBold
Form1.Data2.Recordset.Fields("斜体") = Form1.Label1(i).FontItalic
Form1.Data2.Recordset.Fields("下划线") = Form1.Label1(i).FontUnderline
Form1.Data2.Recordset.Fields("字号") = Form1.Label1(i).FontSize
Form1.Data2.Recordset.Fields("字体") = Form1.Label1(i).Font
Form1.Data2.Recordset.Fields("颜色") = Form1.Label1(i).ForeColor
Form1.Data2.Recordset.Fields("字符") = Form1.Label1(i).Caption
Form1.Data2.Recordset.Fields("位置left") = Form1.Label1(i).Left
Form1.Data2.Recordset.Fields("位置top") = Form1.Label1(i).Top
Form1.Data2.Recordset.Fields("编号") = i
Form1.Data2.Recordset.Update
End If
Next i
For i = 0 To MaxHuaYangNumber - 1
If NowHzHyName(i) <> HuaYangNoUseName Then
Form1.Data3.Recordset.AddNew
Form1.Data3.Recordset.Fields("名称") = NowFileName
Form1.Data3.Recordset.Fields("花样名称") = NowHzHyName(i)
Form1.Data3.Recordset.Fields("花样序号") = i
Form1.Data3.Recordset.Fields("扫描速度") = HuaYangHzCs(i, 0)
Form1.Data3.Recordset.Fields("工作次数") = HuaYangHzCs(i, 1)
Form1.Data3.Recordset.Fields("停止时间") = HuaYangHzCs(i, 2)
Form1.Data3.Recordset.Fields("对应灯管花样序号") = HuaYangHzCs(i, 3)
Form1.Data3.Recordset.Update
End If
Next i
For i = 0 To MaxHuaYangNumber - 1
If NowHyName(i) <> HuaYangNoUseName Then
Form1.Data4.Recordset.AddNew
Form1.Data4.Recordset.Fields("名称") = NowFileName
Form1.Data4.Recordset.Fields("花样名称") = NowHyName(i)
Form1.Data4.Recordset.Fields("花样序号") = i
Form1.Data4.Recordset.Fields("扫描速度") = HuaYangCs(i, 0)
Form1.Data4.Recordset.Fields("工作次数") = HuaYangCs(i, 1)
Form1.Data4.Recordset.Fields("停止时间") = HuaYangCs(i, 2)
Form1.Data4.Recordset.Fields("流水比例") = HuaYangCs(i, 3)
Form1.Data4.Recordset.Fields("压罗根数") = HuaYangCs(i, 4)
Form1.Data4.Recordset.Fields("碰碰根数") = HuaYangCs(i, 5)
Form1.Data4.Recordset.Fields("左右根数") = HuaYangCs(i, 6)
Form1.Data4.Recordset.Fields("中开位置") = HuaYangCs(i, 7)
Form1.Data4.Recordset.Fields("百叶根数") = HuaYangCs(i, 8)
Form1.Data4.Recordset.Update
End If
Next i
SaveFile = True
SaveEnd:
End Function
Public Sub WriteFile(ByVal Mode As Byte)
Dim AddressAll As String
Dim AddressH As String
Dim AddressL As String
Dim CheckSum(0 To TotalOut - 1) As String
Dim CheckMe As Long
Dim H4 As String
Dim L4 As String
If CheckPosition = False Then
For n = 0 To TotalFile - 1
If Mode = 0 Then
j = n * 8
H4 = Hex(OutputData(j) * 8 + OutputData(j + 1) * 4 + OutputData(j + 2) * 2 + OutputData(j + 3) * 1)
L4 = Hex(OutputData(j + 4) * 8 + OutputData(j + 5) * 4 + OutputData(j + 6) * 2 + OutputData(j + 7) * 1)
NowData(n) = H4 & L4
Else
NowData(n) = FileData(n, NowRec)
End If
AddressAll = Hex(AddressData)
For m = 0 To 4 - Len(AddressAll) - 1
AddressAll = "0" & AddressAll
Next m
AddressH = Mid(AddressAll, 1, 2)
AddressH = "&H" & AddressH
AddressL = Mid(AddressAll, 3, 2)
AddressL = "&H" & AddressL
j = "&H" & NowData(n)
CheckMe = Val(AddressH) + Val(AddressL) + Val(j)
j = 255 - CheckMe
a = Hex(j)
If Len(a) >= 2 Then
b = Mid(a, (Len(a) - 1), 2)
Else
b = a
End If
b = "&H" & b
c = Val(b) - (1 - 1)
a = Hex(c)
If Len(a) >= 2 Then
CheckSum(n) = Mid(a, (Len(a) - 1), 2)
Else
CheckSum(n) = "0" & a
End If
EveryData(n) = ":" & "01" & AddressAll & "00" & NowData(n) & CheckSum(n)
j = n + 1
Print #j, EveryData(n)
Next n
If Mode = 1 Then
NowRec = NowRec + 1
If NowRec >= TotalRec Then
NowRec = 0
End If
End If
End If
AddressData = AddressData + 1
If CheckPosition = True Then
Form1.Label7.Caption = Hex(AddressData)
If AddressData >= EpromSize Then
AddressData = 0
Form1.Label5.Visible = False
StopNow (1)
StopPlayFlag = True
Select Case EpromSize
Case 4096
MsgBox "这就是4K地址的花样位置!", 64, "输出"
Case 8192
MsgBox "这就是8K地址的花样位置!", 64, "输出"
Case 16384
MsgBox "这就是16K地址的花样位置!", 64, "输出"
Case 32768
MsgBox "这就是32K地址的花样位置!", 64, "输出"
Case 65536
MsgBox "这就是64K地址的花样位置!", 64, "输出"
End Select
Form1.Label6.Visible = False
Form1.Label7.Visible = False
End If
End If
End Sub
Public Sub HzHuaYangPlay(ByVal NUMBER As Integer)
If (NowHz > 0) And (TotalHzHuaYang > 0) Then
For i = 0 To TotalHz - 1
Form1.Label1(i).Visible = False
Next i
RunHzSpeed = Val(HuaYangHzCs(NUMBER, 0)) * 1000
RunHzTimes = Val(HuaYangHzCs(NUMBER, 1))
RunHzStopTime = Val(HuaYangHzCs(NUMBER, 2)) * 1000
RunHzHyName = NowHzHyName(NUMBER)
LightStyleHz = 0
NowRunHzTimes = 0
If (OutEnableFlag = True) And (OutOverFlag = False) Then
Form1.Timer3.Interval = 1
Form1.Timer4.Interval = 1
Form1.Timer5.Interval = 1
Else
Form1.Timer3.Interval = RunHzSpeed
Form1.Timer4.Interval = RunHzStopTime
Form1.Timer5.Interval = RunHzStopTime
End If
Form1.Timer4.Enabled = False
Form1.Timer5.Enabled = False
Select Case RunHzHyName
Case HuaYangShaoMiaoName1
LineCountHz = 0
Case HuaYangShaoMiaoName2
LineCountHz = NowHz - 1
Case HuaYangQuanLiangName1
End Select
Form1.Timer3.Enabled = True
End If
End Sub
Public Sub DgHuaYangPlay(ByVal NUMBER As Integer, ByVal Mode As Integer)
If (NowLs > 0) And (TotalDgHuaYang > 0) Then
RunSpeed = Val(HuaYangCs(NUMBER, 0)) * 1000
RunTimes = Val(HuaYangCs(NUMBER, 1))
RunStopTime = Val(HuaYangCs(NUMBER, 2)) * 1000
RunHyName = NowHyName(NUMBER)
DgColor(0) = DengGuanColor1
DgColor(1) = DengGuanColor2
DgColor(2) = DengGuanColor3
WriteFlag1 = False
WriteFlag2 = False
Select Case RunHyName
Case HuaYangShaoMiaoName1, HuaYangShaoMiaoName4
LineCount1 = 0
Call RGBBegin1(0, NowLs - 1, 1)
LineCount = ColorBposition1(0)
Case HuaYangShaoMiaoName2, HuaYangShaoMiaoName3
LineCount1 = 0
Call RGBEnd1(NowLs - 1, 0, -1)
LineCount = ColorEposition1(0)
Case HuaYangShaoMiaoName5
Call RGBBegin1(0, NowLs - 1, 1)
Call RGBEnd1(NowLs - 1, 0, -1)
LineCount = ColorBposition1(0)
Case HuaYangBaiYeName1, HuaYangBaiYeName4
RunBaiYe = HuaYangCs(NUMBER, 8)
LineCount1 = 0
Call RGBBegin1(0, NowLs - 1, 1)
LineCount = ColorBposition1(0)
Case HuaYangBaiYeName2, HuaYangBaiYeName3
RunBaiYe = HuaYangCs(NUMBER, 8)
LineCount1 = 0
Call RGBEnd1(NowLs - 1, 0, -1)
LineCount = ColorEposition1(0)
Case HuaYangZhongKaiName1, HuaYangZhongKaiName4
RunZhongKai = HuaYangCs(NUMBER, 7)
LineCount2 = 0
Call RGBBegin1(RunZhongKai - 1, 0, -1)
Call RGBBegin2(RunZhongKai, NowLs - 1, 1)
LineCount = ColorBposition1(0)
LineCount1 = ColorBposition2(0)
Case HuaYangZhongKaiName2, HuaYangZhongKaiName3
RunZhongKai = HuaYangCs(NUMBER, 7)
LineCount2 = 0
Call RGBBegin1(0, RunZhongKai - 1, 1)
Call RGBBegin2(NowLs - 1, RunZhongKai, -1)
LineCount = ColorBposition1(0)
LineCount1 = ColorBposition2(0)
Case HuaYangLiuShuiName1
i = InStr(HuaYangCs(NUMBER, 3), ":")
j = Val(Mid(HuaYangCs(NUMBER, 3), 1, i - 1))
m = Val(Mid(HuaYangCs(NUMBER, 3), i + 1))
If NowColor = 0 Then
RunLiuShui1 = j + m
Else
RunLiuShui1 = ((NowColor + 1) * j - 1) * (NowColor + 1)
End If
RunLiuShui2 = (NowColor + 1) * j
RunLiuShui3 = (NowColor + 1) * j - 1
BLine = 0
ELine = 0
LineCount1 = 0
Case HuaYangLiuShuiName2
i = InStr(HuaYangCs(NUMBER, 3), ":")
j = Val(Mid(HuaYangCs(NUMBER, 3), 1, i - 1))
m = Val(Mid(HuaYangCs(NUMBER, 3), i + 1))
If NowColor = 0 Then
RunLiuShui1 = j + m
Else
RunLiuShui1 = ((NowColor + 1) * j - 1) * (NowColor + 1)
End If
RunLiuShui2 = (NowColor + 1) * j
RunLiuShui3 = (NowColor + 1) * j - 1
BLine = NowLs - 1
ELine = NowLs - 1
LineCount1 = 0
Case HuaYangDuiLiuName1
RunDuiLiu = HuaYangCs(NUMBER, 7)
i = InStr(HuaYangCs(NUMBER, 3), ":")
j = Val(Mid(HuaYangCs(NUMBER, 3), 1, i - 1))
m = Val(Mid(HuaYangCs(NUMBER, 3), i + 1))
If NowColor = 0 Then
RunLiuShui1 = j + m
Else
RunLiuShui1 = ((NowColor + 1) * j - 1) * (NowColor + 1)
End If
RunLiuShui2 = (NowColor + 1) * j
RunLiuShui3 = (NowColor + 1) * j - 1
BLine = 0
ELine = 0
BLine1 = NowLs - 1
ELine1 = NowLs - 1
LineCount = 0
LineCount1 = 0
Case HuaYangDuiLiuName2
RunDuiLiu = HuaYangCs(NUMBER, 7)
i = InStr(HuaYangCs(NUMBER, 3), ":")
j = Val(Mid(HuaYangCs(NUMBER, 3), 1, i - 1))
m = Val(Mid(HuaYangCs(NUMBER, 3), i + 1))
If NowColor = 0 Then
RunLiuShui1 = j + m
Else
RunLiuShui1 = ((NowColor + 1) * j - 1) * (NowColor + 1)
End If
RunLiuShui2 = (NowColor + 1) * j
RunLiuShui3 = (NowColor + 1) * j - 1
BLine = RunDuiLiu
ELine = RunDuiLiu
BLine1 = RunDuiLiu - 1
ELine1 = RunDuiLiu - 1
LineCount = 0
LineCount1 = 0
Case HuaYangDuiLuoName1
RunDuiLuo = HuaYangCs(NUMBER, 7)
RunYaLuo = HuaYangCs(NUMBER, 4)
LineCount2 = 0
Call RGBBegin1(RunDuiLuo, NowLs - 1, 1)
Call RGBEnd1(NowLs - 1, RunDuiLuo, -1)
For i = 0 To 2
NowLine(i) = 0
TotalLine(i) = 0
For j = RunDuiLuo To NowLs - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine(i) = TotalLine(i) + 1
End If
Next j
LeftLine(i) = TotalLine(i)
Next i
Call RGBBegin2(RunDuiLuo - 1, 0, -1)
Call RGBEnd2(0, RunDuiLuo - 1, 1)
For i = 0 To 2
NowLine1(i) = 0
TotalLine1(i) = 0
For j = 0 To RunDuiLuo - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine1(i) = TotalLine1(i) + 1
End If
Next j
LeftLine1(i) = TotalLine1(i)
Next i
Case HuaYangDuiLuoName2
RunDuiLuo = HuaYangCs(NUMBER, 7)
RunYaLuo = HuaYangCs(NUMBER, 4)
LineCount2 = 0
Call RGBBegin1(0, RunDuiLuo - 1, 1)
Call RGBEnd1(RunDuiLuo - 1, 0, -1)
For i = 0 To 2
NowLine(i) = 0
TotalLine(i) = 0
For j = 0 To RunDuiLuo - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine(i) = TotalLine(i) + 1
End If
Next j
LeftLine(i) = TotalLine(i)
Next i
Call RGBBegin2(NowLs - 1, RunDuiLuo, -1)
Call RGBEnd2(RunDuiLuo, NowLs - 1, 1)
For i = 0 To 2
NowLine1(i) = 0
TotalLine1(i) = 0
For j = RunDuiLuo To NowLs - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine1(i) = TotalLine1(i) + 1
End If
Next j
LeftLine1(i) = TotalLine1(i)
Next i
Case HuaYangYaLuoName1, HuaYangYaLuoName2
RunYaLuo = HuaYangCs(NUMBER, 4)
LineCount2 = 0
Call RGBBegin1(0, NowLs - 1, 1)
Call RGBEnd1(NowLs - 1, 0, -1)
For i = 0 To 2
NowLine(i) = 0
TotalLine(i) = 0
For j = 0 To NowLs - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine(i) = TotalLine(i) + 1
End If
Next j
LeftLine(i) = TotalLine(i)
Next i
Case HuaYangYaLuoName3, HuaYangYaLuoName4
RunYaLuo = HuaYangCs(NUMBER, 4)
LineCount2 = 0
Call RGBBegin1(NowLs - 1, 0, -1)
Call RGBEnd1(0, NowLs - 1, 1)
For i = 0 To 2
NowLine(i) = 0
TotalLine(i) = 0
For j = 0 To NowLs - 1
If DgColor(i) = Form1.Shape1(j).BackColor Then
TotalLine(i) = TotalLine(i) + 1
End If
Next j
LeftLine(i) = TotalLine(i)
Next i
Case HuaYangPengPengName1
RunPengPeng = HuaYangCs(NUMBER, 5) * (NowColor + 1)
LineCount2 = 0
Pa1 = NowLs / 4
Pa2 = NowLs / 4 * 2
Pa3 = NowLs / 4 * 3
Call RGBBegin1(Pa1, 0, -1)
For i = 0 To 2
RunPengPeng1(i) = ColorBposition1(i)
Next i
Call RGBBegin1(Pa2, Pa1, -1)
For i = 0 To 2
RunPengPeng2(i) = ColorBposition1(i)
Next i
Call RGBBegin1(Pa3, Pa2, -1)
For i = 0 To 2
RunPengPeng3(i) = ColorBposition1(i)
Next i
Call RGBBegin1(0, NowLs - 1, 1)
Call RGBEnd1(NowLs - 1, 0, -1)
LineCount = ColorBposition1(0)
LineCount1 = 0
LineCount3 = 1
LineCount4 = ColorEposition1(0) + NowColor + 1
Case HuaYangPengPengName2
RunPengPeng = HuaYangCs(NUMBER, 5) * (NowColor + 1)
LineCount2 = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -