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

📄 form2.frm

📁 该程序基于RS232串口通讯的激光检测钻头钻孔内径及外径等相关参数从而判断该产品是否为OK/NG
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         Width           =   5775
         _ExtentX        =   10186
         _ExtentY        =   2990
         _Version        =   393216
         AllowUpdate     =   -1  'True
         DefColWidth     =   54
         HeadLines       =   1
         RowHeight       =   13
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "@宋体"
            Size            =   9.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "@宋体"
            Size            =   8.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
      Begin VB.Label Label12 
         Caption         =   "产品型号:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Index           =   0
         Left            =   1080
         TabIndex        =   68
         Top             =   480
         Width           =   975
      End
      Begin VB.Label Label25 
         AutoSize        =   -1  'True
         Caption         =   "请输入数据的起始点与结束点:"
         Height          =   195
         Left            =   -74640
         TabIndex        =   59
         Top             =   600
         Width           =   2520
      End
      Begin VB.Label Label24 
         AutoSize        =   -1  'True
         Caption         =   "起始点:"
         Height          =   195
         Left            =   -74640
         TabIndex        =   58
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label23 
         AutoSize        =   -1  'True
         Caption         =   "结束点:"
         Height          =   195
         Left            =   -72840
         TabIndex        =   57
         Top             =   960
         Width           =   720
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "最大值:"
         Height          =   195
         Index           =   4
         Left            =   -74700
         TabIndex        =   56
         Top             =   1560
         Width           =   720
      End
      Begin VB.Line Line4 
         BorderColor     =   &H80000005&
         BorderWidth     =   2
         X1              =   -74880
         X2              =   -70770
         Y1              =   1380
         Y2              =   1380
      End
      Begin VB.Line Line3 
         BorderColor     =   &H80000006&
         X1              =   -74880
         X2              =   -70770
         Y1              =   1380
         Y2              =   1380
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "最小值:"
         Height          =   195
         Index           =   1
         Left            =   -72840
         TabIndex        =   55
         Top             =   1560
         Width           =   720
      End
      Begin VB.Label CurMAX 
         AutoSize        =   -1  'True
         Height          =   195
         Left            =   -73800
         TabIndex        =   54
         Top             =   1560
         Width           =   45
      End
      Begin VB.Label CurMIN 
         AutoSize        =   -1  'True
         Height          =   195
         Left            =   -71880
         TabIndex        =   53
         Top             =   1560
         Width           =   45
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "差值:"
         Height          =   195
         Index           =   2
         Left            =   -74520
         TabIndex        =   52
         Top             =   2040
         Width           =   540
      End
      Begin VB.Label CurDIFF 
         AutoSize        =   -1  'True
         Height          =   195
         Left            =   -73800
         TabIndex        =   51
         Top             =   2040
         Width           =   45
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         Caption         =   "平均值:"
         Height          =   195
         Index           =   3
         Left            =   -72840
         TabIndex        =   50
         Top             =   2040
         Width           =   720
      End
      Begin VB.Label CurAVG 
         AutoSize        =   -1  'True
         Height          =   195
         Left            =   -71880
         TabIndex        =   49
         Top             =   2040
         Width           =   45
      End
   End
End
Attribute VB_Name = "fcontrol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If MsgBox("你确认删除这个产品吗?", vbOKCancel + vbInformation, "提示----") = vbCancel Then
                        Exit Sub
End If
On Error Resume Next
Adodc2.Recordset.Delete
Adodc2.Recordset.Update
adoname.Recordset.Update
adoname.Refresh
End Sub

Private Sub Command6_Click()

End Sub

Private Sub Command2_Click()
If Adodc2.Recordset.Fields("hh") < Adodc2.Recordset.Fields("hl") Or Adodc2.Recordset.Fields("hl") < Adodc2.Recordset.Fields("lo") Or Adodc2.Recordset.Fields("lo") < Adodc2.Recordset.Fields("ll") Then
               MsgBox "你输入的数据不正确!请重新检查!(必须满足:Hh>Hl>Lo>Ll)", vbCritical + vbInformation, "提示"
      Exit Sub
End If
Adodc2.Recordset.Update
adoname.Recordset.Update
adoname.Refresh
End Sub

Private Sub Command3_Click()
On Error Resume Next
If DataCombo2.Text = "" Or IsNumeric(tpyramidal.Text) = False Or IsNumeric(tpyramidal1.Text) = False Or IsNumeric(tpyu.Text) = False Or IsNumeric(tpyu.Text) = False Or Val(tpyu.Text) < Val(tpyd.Text) Then
      MsgBox "你输入的锥度数据不完全!请重新检查!", vbCritical + vbInformation, "提示"
      Exit Sub
End If
  Adodc1.RecordSource = "select * from putout where name='" & Trim(DataCombo2.Text) & "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
                 Adodc1.Recordset.Fields("name") = DataCombo2.Text
                 Adodc1.Recordset.Fields("pyramidal") = tpyramidal.Text
                 Adodc1.Recordset.Fields("pyramidal1") = tpyramidal1.Text
                 Adodc1.Recordset.Fields("pyu") = tpyu.Text
                 Adodc1.Recordset.Fields("pyd") = tpyd.Text
              Adodc1.Recordset.Update
              Adodc1.Refresh
  Else
                 Adodc1.Recordset.AddNew
                 Adodc1.Recordset.Fields("name") = DataCombo2.Text
                 Adodc1.Recordset.Fields("pyramidal") = tpyramidal.Text
                 Adodc1.Recordset.Fields("pyramidal1") = tpyramidal1.Text
                 Adodc1.Recordset.Fields("pyu") = tpyu.Text
                 Adodc1.Recordset.Fields("pyd") = tpyd.Text
                 Adodc1.Recordset.Update
                 Adodc1.Refresh
   MsgBox "---增加测量点成功!", vbInformation + vbInformation, "提示"
  End If
adoname.Recordset.Update
adoname.Refresh
End Sub

Private Sub Command4_Click()
If MsgBox("你确认删除这个产品吗?", vbOKCancel + vbInformation, "提示----") = vbCancel Then
                        Exit Sub
End If
  Adodc1.RecordSource = "select * from measure where name='" & Trim(DataCombo2.Text) & "'"
  Adodc1.Refresh
  If Adodc1.Recordset.RecordCount > 0 Then
        MsgBox "请先删除产品的测量点数据!", vbOKOnly + vbInformation, "提示---"
  Else
    Adodc1.RecordSource = "select * from putout where name='" & Trim(DataCombo2.Text) & "'"
    Adodc1.Refresh
    Adodc1.Recordset.Delete
    Adodc1.Recordset.Update
    Adodc1.Refresh
    adoname.Refresh
    DataCombo2.Text = ""
 End If
End Sub

Private Sub Command5_Click()
Adodc2.Recordset.AddNew
Adodc2.Recordset.Fields("name") = DataCombo2.Text
End Sub

Private Sub Command7_Click()
Dim combotext As String
'On Error Resume Next                 '在control中增加一项如果有则修改,
If IsNumeric(tout1.Text) = False Or IsNumeric(tout2.Text) = False Or IsNumeric(tout3.Text) = False Or IsNumeric(tout4.Text) = False Or IsNumeric(tout5.Text) = False Or IsNumeric(rout1.Text) = False Or IsNumeric(tfat.Text) = False Or IsNumeric(trade.Text) = False Or IsNumeric(tbat.Text) = False Then
      MsgBox "你输入的参数数据不完全!请重新检查!", vbCritical + vbInformation, "提示"
      Exit Sub
End If
  adosyscontrol.Recordset.Update
End Sub



Private Sub Command9_Click()
'写入数据个数DM-------0_4+50+200-202
        frmmain.com1.Output = "WRS" & Space(1) & "DM" & 0 & Space(1) & 5 & Space(1) & Val(adosyscontrol.Recordset.Fields("out1")) & Space(1) & Val(adosyscontrol.Recordset.Fields("out2")) & Space(1) & Val(adosyscontrol.Recordset.Fields("out3")) & Space(1) & Val(adosyscontrol.Recordset.Fields("out4")) & Space(1) & Val(adosyscontrol.Recordset.Fields("out5")) & vbCr
        frmmain.com1.Output = "WRS" & Space(1) & "DM" & 200 & Space(1) & 3 & Space(1) & Val(adosyscontrol.Recordset.Fields("brade")) & Space(1) & Val(adosyscontrol.Recordset.Fields("bat")) & Space(1) & Val(adosyscontrol.Recordset.Fields("fat")) & vbCr
        frmmain.com1.Output = "WR" & Space(1) & "DM" & 50 & Space(1) & Val(adosyscontrol.Recordset.Fields("rade")) & vbCr
End Sub
Private Sub DataCombo2_Change()
On Error Resume Next
Adodc1.RecordSource = "select * from putout where name='" & Trim(DataCombo2.Text) & "'"
Adodc1.Refresh
tpyramidal.Text = ""
tpyramidal1.Text = ""
tpyu.Text = ""
tpyd.Text = ""
tpyramidal.Text = Adodc1.Recordset.Fields("pyramidal")
tpyramidal1.Text = Adodc1.Recordset.Fields("pyramidal1")
tpyu.Text = Adodc1.Recordset.Fields("pyu")
tpyd.Text = Adodc1.Recordset.Fields("pyd")

Adodc2.RecordSource = "select * from measure where name='" & Trim(DataCombo2.Text) & "'"
Adodc2.Refresh
DataCombo1.Text = "请选择测量点-" & "SUM(" & Adodc2.Recordset.RecordCount & ")"
Combo2.Text = ""
fcontrol.Caption = DataCombo2.Text & "-参数设置--"
End Sub

Private Sub Form_Unload(Cancel As Integer)
frmmain.Adodc1.RecordSource = "select * from putout"
frmmain.Adodc1.Refresh
frmmain.DataCombo1.Refresh
End Sub

Private Sub Timer1_Timer()
 'frmmain.com1.Output = "RD" & Space(1) & "CM2050" & vbCr
'DigitalY.Digital = WaitRS(frmmain.com1, vbCrLf, 50)

 frmmain.com1.Output = "RD" & Space(1) & "CM2020" & vbCr
TXX.Caption = WaitRS(frmmain.com1, vbCrLf, 50)
End Sub

Private Sub tp1_Change()

End Sub

⌨️ 快捷键说明

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