?? frmchargetime.frm
字號:
VERSION 5.00
Begin VB.Form frmSetChargeTime
Caption = "Set Charge Time Register"
ClientHeight = 2445
ClientLeft = 60
ClientTop = 345
ClientWidth = 4035
Icon = "frmChargeTime.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2445
ScaleWidth = 4035
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdWrite
Caption = "Write Register (06h)"
Height = 375
Left = 2040
TabIndex = 10
Top = 1560
Width = 1935
End
Begin VB.CommandButton cmdRead
Caption = "Read Register (06h)"
Height = 375
Left = 0
TabIndex = 9
Top = 1560
Width = 1935
End
Begin VB.CommandButton cmdDone
Caption = "Done"
Height = 375
Left = 2040
TabIndex = 8
Top = 2040
Width = 1935
End
Begin VB.CommandButton cmdReadInit
Caption = "Read Initialization (34h)"
Height = 375
Left = 0
TabIndex = 7
Top = 1080
Width = 1935
End
Begin VB.CommandButton cmdWriteInit
Caption = "Write Initialization (34h)"
Height = 375
Left = 2040
TabIndex = 6
Top = 1080
Width = 1935
End
Begin VB.Frame Frame1
Height = 975
Left = 0
TabIndex = 0
Top = 0
Width = 3975
Begin VB.TextBox txtMinutes
Alignment = 2 'Center
Height = 285
Left = 2160
TabIndex = 2
Text = "00"
Top = 480
Width = 735
End
Begin VB.TextBox txtHours
Alignment = 2 'Center
Height = 285
Left = 1200
TabIndex = 1
Text = "00"
Top = 480
Width = 735
End
Begin VB.Label Label4
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Minutes"
Height = 255
Left = 2160
TabIndex = 5
Top = 240
Width = 735
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Hours"
Height = 255
Left = 1200
TabIndex = 4
Top = 240
Width = 735
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = ":"
Height = 255
Left = 1920
TabIndex = 3
Top = 480
Width = 255
End
End
End
Attribute VB_Name = "frmSetChargeTime"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdDone_Click()
Unload Me
End Sub
Private Sub cmdRead_Click()
Dim Register As Long
ReadBytes 6, 1
Register = DataRead(6)
ChargeTime = Register * 0.015625 'hours
'temp = gCTRLSB
'register2 = temp
'ChargeTime = ChargeTime + (temp * 0.22)
'ChargeTime = (ChargeTime) / 3600 'hours
ChargeHours = Int(ChargeTime)
ChargeMinutes = Int((ChargeTime - ChargeHours) * 60)
'ChargeSeconds = Int((ChargeTime - ChargeHours - (ChargeMinutes / 60)) * 3600)
txtHours.Text = Format(ChargeHours, "00")
txtMinutes.Text = Format(ChargeMinutes, "00")
'txtSeconds.Text = Format(ChargeSeconds, "00")
End Sub
Private Sub cmdReadInit_Click()
Dim Register As Long
RecallBytes &H30
ReadBytes &H34, 1
Register = DataRead(&H34)
ChargeTime = Register * 0.015625 'hours
'temp = gCTRLSB
'register2 = temp
'ChargeTime = ChargeTime + (temp * 0.22)
'ChargeTime = (ChargeTime) / 3600 'hours
ChargeHours = Int(ChargeTime)
ChargeMinutes = Int((ChargeTime - ChargeHours) * 60)
'ChargeSeconds = Int((ChargeTime - ChargeHours - (ChargeMinutes / 60)) * 3600)
txtHours.Text = Format(ChargeHours, "00")
txtMinutes.Text = Format(ChargeMinutes, "00")
'txtSeconds.Text = Format(ChargeSeconds, "00")
End Sub
Private Sub cmdWrite_Click()
Dim NewCTR As Double
NewCTR = (Val(txtHours.Text) / 0.015625) + _
(Val(txtMinutes.Text) / (0.015625 * 60)) '+ _
(Val(txtSeconds.Text) / (0.015625 * 3600))
If NewCTR > 255 Then NewCTR = 255
DataIn(6) = NewCTR And &HFF
WriteBytes 6, 1
cmdRead_Click
End Sub
Private Sub cmdWriteInit_Click()
Dim NewCTR As Double
NewCTR = (Val(txtHours.Text) / 0.015625) + _
(Val(txtMinutes.Text) / (0.015625 * 60)) '+ _
(Val(txtSeconds.Text) / (0.015625 * 3600))
If NewCTR > 255 Then NewCTR = 255
DataIn(&H34) = NewCTR And &HFF
WriteBytes &H34, 1
frmEvalKit.CopyCTRInittoEEPROM
cmdReadInit_Click
End Sub
Private Sub Form_Load()
cmdRead_Click
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -