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

📄 drawform.frm

📁 某机械工程学院的毕业设计以及毕业论文 非常参考价值
💻 FRM
📖 第 1 页 / 共 4 页
字号:
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   555
         Left            =   300
         TabIndex        =   2
         Top             =   750
         Width           =   1545
      End
      Begin VB.CommandButton Cmdquit 
         Caption         =   "退  出"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   555
         Left            =   300
         TabIndex        =   1
         Top             =   9315
         Width           =   1545
      End
   End
   Begin VB.Label Label14 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   11430
      TabIndex        =   11
      Top             =   360
      Width           =   1845
   End
   Begin VB.Label Label16 
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   405
      Left            =   13320
      TabIndex        =   10
      Top             =   360
      Width           =   2025
   End
   Begin VB.Label Label17 
      BackStyle       =   0  'Transparent
      Caption         =   "节水灌溉智能监控系统"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   26.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000080FF&
      Height          =   540
      Left            =   4320
      TabIndex        =   9
      Top             =   210
      Width           =   7545
   End
End
Attribute VB_Name = "drawForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Dim tabgrid As Integer
Public minlx, maxlx, maxly As Integer
Dim bx As Integer
Dim bx2 As Integer
Dim getbz As Integer
Dim delaytime As Integer
Dim kk As Integer

Private Sub Form_Load()
  tabgrid = 1
  Grid.Visible = False
  HS1.Min = 0: HS1.Max = 100
  HS1.value = 0
  minlx = 0: maxlx = 100: maxly = 60
  Call tabinit1
  Call xxd_Lx1
  Call cal1
End Sub

Private Sub Cqx1_Click()
  Pl2.Visible = False
  HS2.Visible = False
  Pdata2.Visible = False
  pl.Visible = True
  HS1.Visible = True
  Pdata1.Visible = True
  tabgrid = 1
  Grid.Visible = False
  distable.Caption = "显示数据表"
End Sub

Public Sub xxd_Lx1()
On Error GoTo hh
  If dustnum = 0 Then Exit Sub
  If dustnum > 100 Then
    HS1.Max = dustnum
    minlx = minlx + 1: maxlx = maxlx + 1
  End If
  kk = 5
  pl.Cls
  pl.DrawWidth = 1
  'pl.BackColor = QBColor(2)
  pl.Scale (minlx, maxly)-(maxlx, 0)
  For i = 1 To 12
    X1 = 0: Y1 = kk
    X2 = maxlx: Y2 = kk
    pl.Line (X1, Y1)-(X2, Y2), QBColor(6)
    kk = kk + 5
  Next i
  pl.DrawWidth = 2
  For i = 1 To dustnum - 1
    X1 = (i - 1): Y1 = Val(dusttemp(i - 1, 1))
    X2 = i: Y2 = Val(dusttemp(i, 1))
    pl.Line (X1, Y1)-(X2, Y2), QBColor(14)
  Next i
hh:  Exit Sub
End Sub

Sub cal1()
  On Error GoTo hh
  If dustnum = 0 Then Exit Sub
  Sum = 0
  Max = Val(dusttemp(0, 1)): Min = Max
  For i = 0 To dustnum - 1
    If Val(dusttemp(i, 1)) >= Max Then Max = Val(dusttemp(i, 1))
    If Val(dusttemp(i, 1)) <= Min Then Min = Val(dusttemp(i, 1))
    Sum = Sum + Val(dusttemp(i, 1))
  Next i
  aver = Sum / dustnum
  Temp.Text = xxForm.Label14.Caption
  maxTemp.Text = Format$(Max, "0.0")
  minTemp.Text = Format$(Min, "0.0")
  averTemp.Text = Format$(aver, "0.0")
hh:  Exit Sub
End Sub

Sub tabinit1()
  On Error GoTo hh
  Grid.Cols = 3
  Grid.Rows = 6000 + 1
  Grid.ColWidth(0) = 800
  Grid.ColWidth(1) = 2800
  Grid.ColWidth(2) = 1000
  Grid.Col = 0
  For i = 1 To 6000
    Grid.Row = i
    Grid.Text = " " + Str$(i)
  Next i
  Grid.Row = 0
  Grid.Col = 0: Grid.Text = " 序号"
  Grid.Col = 1: Grid.Text = "         记录时间"
  Grid.Col = 2: Grid.Text = "  温度"
  Grid.TopRow = 1
  Grid.LeftCol = 1
hh:  Exit Sub
End Sub

Private Sub HS1_Change()
On Error GoTo hh
  pl.DrawWidth = 1
  pl.Line (bx, Val(dusttemp(bx, 1)))-(bx, 0), QBColor(3)
  kk = 5
  pl.DrawWidth = 1
  For i = 1 To 12
    X1 = 0: Y1 = kk
    X2 = tempnum: Y2 = kk
    pl.Line (X1, Y1)-(X2, Y2), QBColor(6)
    kk = kk + 5
  Next i
  pl.DrawWidth = 2
  For i = 1 To dustnum - 1
    X1 = (i - 1): Y1 = Val(dusttemp(i - 1, 1))
    X2 = i: Y2 = Val(dusttemp(i, 1))
    pl.Line (X1, Y1)-(X2, Y2), QBColor(14)
  Next i
  bx = HS1.value
  pl.DrawWidth = 1
  pl.DrawStyle = 6
  pl.Line (bx, Val(dusttemp(bx, 1)))-(bx, 0), QBColor(15)
  Tenum.Text = dusttemp(bx, 10)
  Temp.Text = dusttemp(bx, 1)
hh:  Exit Sub
End Sub

Private Sub Cqx2_Click()
  pl.Visible = False
  HS1.Visible = False
  Pdata1.Visible = False
  Pl2.Visible = True
  HS2.Visible = True
  Pdata2.Visible = True
  Call HisForm2.get_hisdata
  Call xxd_Lx2
  Call tabinit2
  Call cal2
  tabgrid = 1
  Grid2.Visible = False
  distable.Caption = "显示数据表"
  HS2.Min = 0: HS2.Max = tempnum: HS2.value = 0
  Tenum2.Text = tempdata(bx2, 10)
  Temp2.Text = tempdata(bx2, 1)
End Sub

Public Sub xxd_Lx2()
On Error GoTo hh
  If tempnum = 0 Then Exit Sub
  Pl2.Cls
  Pl2.DrawWidth = 1
  'Pl2.BackColor = QBColor(15)
  Pl2.Scale (0, 60)-(tempnum, 0)
  kk = 5
  For i = 1 To 12
    X1 = 0: Y1 = kk
    X2 = tempnum: Y2 = kk
    Pl2.Line (X1, Y1)-(X2, Y2), QBColor(6)
    kk = kk + 5
  Next i
  Pl2.DrawWidth = 2
  For i = 1 To tempnum - 1
    X1 = (i - 1): Y1 = Val(tempdata(i - 1, 1))
    X2 = i: Y2 = Val(tempdata(i, 1))
    Pl2.Line (X1, Y1)-(X2, Y2), QBColor(14)
  Next i
hh:  Exit Sub
End Sub

Sub cal2()
  On Error GoTo hh
  If tempnum = 0 Then Exit Sub
  Sum = 0
  Max = Val(tempdata(0, 1)): Min = Max
  For i = 0 To tempnum - 1
    If Val(tempdata(i, 1)) >= Max Then Max = Val(tempdata(i, 1))
    If Val(tempdata(i, 1)) <= Min Then Min = Val(tempdata(i, 1))
    Sum = Sum + Val(tempdata(i, 1))
  Next i
  aver = Sum / tempnum
  maxTemp2.Text = Format$(Max, "0.0")
  minTemp2.Text = Format$(Min, "0.0")
  averTemp2.Text = Format$(aver, "0.0")
hh:  Exit Sub
End Sub

Private Sub HS2_Change()
On Error GoTo hh
  Pl2.DrawWidth = 1
  Pl2.Line (bx2, Val(tempdata(bx2, 1)))-(bx2, 0), QBColor(3)
  kk = 5
  Pl2.DrawWidth = 1
  For i = 1 To 12
    X1 = 0: Y1 = kk
    X2 = tempnum: Y2 = kk
    Pl2.Line (X1, Y1)-(X2, Y2), QBColor(6)
    kk = kk + 5
  Next i
  Pl2.DrawWidth = 2
  For i = 1 To tempnum - 1
    X1 = (i - 1): Y1 = Val(tempdata(i - 1, 1))
    X2 = i: Y2 = Val(tempdata(i, 1))
    Pl2.Line (X1, Y1)-(X2, Y2), QBColor(14)
  Next i
  bx2 = HS2.value
  Pl2.DrawWidth = 1
  Pl2.DrawStyle = 6
  Pl2.Line (bx2, Val(tempdata(bx2, 1)))-(bx2, 0), QBColor(15)
  Tenum2.Text = tempdata(bx2, 10)
  Temp2.Text = tempdata(bx2, 1)
hh:  Exit Sub
End Sub

Sub tabinit2()
  On Error GoTo hh
  Grid2.Cols = 3
  Grid2.Rows = tempnum + 1
  Grid2.ColWidth(0) = 800
  Grid2.ColWidth(1) = 2800
  Grid2.ColWidth(2) = 1000
  Grid2.Col = 0
  For i = 1 To tempnum
    Grid2.Row = i
    Grid2.Text = " " + Str$(i)
  Next i
  Grid2.Row = 0
  Grid2.Col = 0: Grid2.Text = " 序号"
  Grid2.Col = 1: Grid2.Text = "         记录时间"
  Grid2.Col = 2: Grid2.Text = "  温度"
  Grid2.TopRow = 1
  Grid2.LeftCol = 1
  For i = 1 To tempnum
    Grid2.Row = i
    Grid2.Col = 1
    Grid2.Text = tempdata(i - 1, 10)
    Grid2.Col = 2
    Grid2.Text = tempdata(i - 1, 1)
  Next i
hh:  Exit Sub
End Sub

Private Sub Cstop_Click()
  getbz = getbz + 1
  If getbz = 1 Then
    Timer1.Enabled = False
    HS1.Enabled = True
    Cstop.Caption = "开始绘图"
  End If
  If getbz = 2 Then
    Timer1.Enabled = True
    HS1.Enabled = False
    Cstop.Caption = "停止绘图"
  End If
  If getbz = 2 Then getbz = 0
End Sub

Private Sub Timer1_Timer()
  delaytime = delaytime + 1
  If delaytime > 1 Then
    Call xxd_Lx1
    Call cal1
    delaytime = 0
  End If
End Sub

Private Sub distable_Click()
  tabgrid = tabgrid + 1
  If tabgrid > 2 Then tabgrid = 1
  If pl.Visible = True Then
    If tabgrid = 1 Then
      Grid.Visible = False
      distable.Caption = "显示数据表"
    End If
    If tabgrid = 2 Then
      Grid.Visible = True
      distable.Caption = "关闭数据表"
    End If
  End If
  If Pl2.Visible = True Then
    If tabgrid = 1 Then
      Grid2.Visible = False
      distable.Caption = "显示数据表"
    End If
    If tabgrid = 2 Then
      Grid2.Visible = True
      distable.Caption = "关闭数据表"
    End If
  End If
End Sub

Private Sub Cquit_Click()
  xxForm.Show
  'Unload Me
End Sub

Private Sub Cmdbz_Click()
  TeamForm.Show
End Sub

Private Sub Cmdzt_Click()
  filedForm.Show
End Sub

Private Sub Cdata_Click()
  HisForm.Show
  Call HisForm.get_cdata
End Sub

Private Sub Cmdxx_Click()
  xxForm.Show
End Sub

Private Sub Cmdset_Click()
  commandbz = 2
  PassForm.Show
End Sub

Private Sub Cmdzn_Click()
  GuideForm.Show
End Sub

Private Sub Cmdquit_Click()
  commandbz = 3
  PassForm.Show
End Sub

Private Sub Timer2_Timer()
  Label14.Caption = Date
  Label16.Caption = Time
End Sub

⌨️ 快捷键说明

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