📄 frmwritedata.frm
字号:
BorderStyle = 1 'Fixed Single
Caption = "碳层"
ForeColor = &H00FF0000&
Height = 375
Index = 2
Left = 2760
TabIndex = 19
Top = 600
Width = 2655
End
Begin VB.Label Label10
Alignment = 2 'Center
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Caption = "时间"
ForeColor = &H00FF0000&
Height = 375
Index = 1
Left = 1440
TabIndex = 20
Top = 600
Width = 1335
End
Begin VB.Label Label10
Alignment = 2 'Center
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Caption = "炉号"
ForeColor = &H00FF0000&
Height = 375
Index = 0
Left = 120
TabIndex = 21
Top = 600
Width = 1335
End
Begin VB.Label Label8
Alignment = 2 'Center
BackColor = &H8000000E&
BorderStyle = 1 'Fixed Single
Caption = "加煤时间及碳层"
ForeColor = &H00FF0000&
Height = 375
Index = 0
Left = 120
TabIndex = 22
Top = 240
Width = 5295
End
End
Begin VB.Frame Frame3
Height = 1845
Left = 120
TabIndex = 0
Top = 0
Width = 5535
Begin VB.TextBox txtGas
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 4
Left = 4560
TabIndex = 2
Text = "20.5"
Top = 960
Width = 855
End
Begin VB.TextBox txtGas
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 3
Left = 3720
TabIndex = 3
Text = "40.0"
Top = 960
Width = 855
End
Begin VB.TextBox txtGas
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 2
Left = 3000
TabIndex = 4
Text = "31.0"
Top = 960
Width = 735
End
Begin VB.TextBox txtGas
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 1
Left = 2280
TabIndex = 5
Text = "0.5"
Top = 960
Width = 735
End
Begin VB.TextBox txtGas
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Index = 0
Left = 1440
TabIndex = 6
Text = "50"
Top = 960
Width = 855
End
Begin VB.TextBox txtTime
Alignment = 2 'Center
BeginProperty Font
Name = "Arial"
Size = 10.5
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
Left = 120
TabIndex = 7
Top = 960
Width = 1335
End
Begin VB.TextBox Text5
Alignment = 2 'Center
ForeColor = &H00FF0000&
Height = 360
Left = 120
Locked = -1 'True
TabIndex = 8
Text = "时 间"
Top = 600
Width = 1335
End
Begin VB.CommandButton cmdUP
Caption = "提交&U"
Enabled = 0 'False
Height = 375
Index = 0
Left = 1920
TabIndex = 1
Top = 1395
Width = 1215
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "H2"
ForeColor = &H00FF0000&
Height = 375
Index = 8
Left = 4560
TabIndex = 13
Top = 600
Width = 855
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "N2"
ForeColor = &H00FF0000&
Height = 375
Index = 9
Left = 3720
TabIndex = 12
Top = 600
Width = 855
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "CO"
ForeColor = &H00FF0000&
Height = 375
Index = 10
Left = 3000
TabIndex = 11
Top = 600
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "O2"
ForeColor = &H00FF0000&
Height = 375
Index = 11
Left = 2280
TabIndex = 10
Top = 600
Width = 735
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = "CO2"
ForeColor = &H00FF0000&
Height = 375
Index = 12
Left = 1440
TabIndex = 9
Top = 600
Width = 855
End
Begin VB.Label Label2
Alignment = 2 'Center
BackColor = &H80000009&
BorderStyle = 1 'Fixed Single
Caption = " 半 水 煤 气"
ForeColor = &H00FF0000&
Height = 375
Index = 1
Left = 120
TabIndex = 14
Top = 240
Width = 5295
End
End
End
Attribute VB_Name = "frmWriteData"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim strNumber As String
Private Sub cmdUP_Click(Index As Integer)
On Error Resume Next
' Dim Conn As New ADODB.Connection
' Dim Cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
Dim i As Long
Dim strSend As String
cmdUP(Index).Enabled = False
Select Case Index
Case 0
Cmd.CommandText = "Select*from RecGaseity"
rs.OPEN Cmd, , adOpenDynamic, adLockOptimistic
rs.AddNew
rs("WDate") = Format(Date, "yyyy-mm-dd")
rs("WTime") = Format(Time, "hh:mm:ss")
For i = 0 To 4
rs(2 + i) = Val(txtGas(i).Text)
strSend = strSend & "!" & txtGas(i).Text
Next
Case 1
Cmd.CommandText = "Select * from RecAddCoal"
rs.OPEN Cmd, , adOpenDynamic, adLockOptimistic
rs.AddNew
rs("WDate") = Format(Date, "yyyy-mm-dd")
rs("WTime") = Format(Time, "hh:mm:ss")
rs("ID") = Val(cboID.Text)
rs("CarbonHigh") = Trim(cboTc.Text)
strSend = "#" & Val(cboID.Text) & "#" & cboTc.Text
Case 2
Cmd.CommandText = "Select * from RecResidueStatus"
rs.OPEN Cmd, , adOpenDynamic, adLockOptimistic
rs.AddNew
rs("WDate") = Format(Date, "yyyy-mm-dd")
rs("WTime") = Format(Time, "hh:mm:ss")
rs("ID") = Val(cboID1.Text)
rs("ResidueStatus") = Trim(cboZk.Text)
strSend = "$" & Val(cboID1.Text) & "$" & cboZk.Text
Case 3
Cmd.CommandText = "Select * from RecStoveGaseity"
rs.OPEN Cmd, , adOpenDynamic, adLockOptimistic
rs.AddNew
rs("WDate") = Format(Date, "yyyy-mm-dd")
rs("WTime") = Format(Time, "hh:mm:ss")
rs("ID") = Val(cboID2.Text)
strSend = "-" & rs("ID")
For i = 0 To 3
rs(3 + i) = Val(txtGas1(i).Text)
strSend = strSend & "-" & txtGas1(i).Text
Next
End Select
rs.UpDate
rs.Close
Set rs = Nothing
SynchroMsg strSend
TimeDelay 100
RemoteMsg strSend
strSend = ""
End Sub
Private Sub Form_Load()
Dim i%
Dim lp_hand As Long
lp_hand = SetParent(Me.hWnd, frmMain.hWnd)
For i = 1 To StoveNumber
cboID.AddItem Format(i - 1 + StoveStart, "000")
cboID1.AddItem Format(i - 1 + StoveStart, "000")
cboID2.AddItem Format(i - 1 + StoveStart, "000")
Next
cboID.ListIndex = 0
cboID1.ListIndex = 0
cboID2.ListIndex = 0
With cboZk
.AddItem "左右灰箱红(黑)炭"
.AddItem "左右灰箱红(黑)炭夹大疤"
.AddItem "左(右)灰箱红(黑)炭 左(右)灰箱正常"
.AddItem "松散"
.AddItem "正常"
.AddItem "红疤"
.AddItem "大疤"
.AddItem "溜疤"
.ListIndex = 0
End With
cboTc.AddItem "拱圈"
cboTc.AddItem "拱下一块砖"
cboTc.AddItem "拱下二块砖"
cboTc.AddItem "拱下三块砖"
cboTc.AddItem "拱下四块砖"
cboTc.AddItem "拱下五块砖"
cboTc.AddItem "拱下六块砖"
cboTc.AddItem "夹套"
cboTc.AddItem "夹套下一块砖"
cboTc.AddItem "夹套下二块砖"
End Sub
Private Sub txtGas_Change(Index As Integer)
If IsNumeric(txtGas(Index).Text) = False Then
txtGas(Index) = 0
End If
End Sub
Private Sub txtGas_DblClick(Index As Integer)
Set ControlLink = txtGas(Index)
frmDataIn.txtNumber = txtGas(Index).Text
frmDataIn.Show
End Sub
Private Sub txtGas1_Change(Index As Integer)
If IsNumeric(txtGas1(Index).Text) = False Then
txtGas1(Index) = 0
End If
End Sub
Private Sub txtGas1_DblClick(Index As Integer)
Set ControlLink = txtGas1(Index)
frmDataIn.txtNumber = txtGas1(Index).Text
frmDataIn.Show
End Sub
Private Sub txtTime_Click()
txtTime.Text = Format(Time, "hh:mm:ss")
cmdUP(0).Enabled = True
End Sub
Private Sub txtTime1_Click()
txtTime1.Text = Format(Time, "hh:mm:ss")
cmdUP(1).Enabled = True
End Sub
Private Sub txtTime2_Click()
txtTime2.Text = Format(Time, "hh:mm:ss")
cmdUP(2).Enabled = True
End Sub
Private Sub txtTime3_Click()
txtTime3.Caption = Format(Time, "hh:mm:ss")
cmdUP(3).Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -