?? mjianding.bas
字號:
Attribute VB_Name = "mJianDing"
Public JDData As JianDingYaLi '檢定數據
Public YMData As JianDingYeMian '液面檢定數據
Const JianDingTitle = "液面自動監測儀檢定記錄"
Const YeMianJianDing = "液面自動監測儀液面檢定記錄"
Function drawJianDingYeMianBaoBiao(pic As PictureBox, Optional BaoBiao = True)
'**********************************************************************
'* 函數名稱: drawJianDingYeMianBaoBiao
'* 函數描述: 繪制液面檢定報表
'* 參數列表: pic畫圖控件
'* 作 者:
'* 創建日期: 2008-03-10
'**********************************************************************
'On Error Resume Next
Dim tempPiont As Long
Dim avgPiont As Single
Dim oldFontSize As Long
Dim strTemp As String
Dim curx As Single, curY As Single, curWidth As Single, curHeight As Single '繪圖區域
Dim rowHeight As Single, colWidth As Single
Dim x1 As Single, x2 As Single, y1 As Single, y2 As Single
Dim bx As Single, byh As Single, byl As Single
Dim i As Integer, j As Integer
If BaoBiao Then '打印報表
'打印標題
curx = pic.Width * 0.1
curWidth = pic.Width * 0.8
curY = pic.Height * 0.9
curHeight = pic.Height * 0.8
oldFontSize = pic.FontSize
pic.FontSize = 18
pic.FontBold = True
strTemp = YeMianJianDing
pic.CurrentX = curx + (curWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = ((curY - curHeight) - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
pic.FontSize = 12
pic.FontBold = False
'繪制說明
rowHeight = curHeight / 10
colWidth = curWidth / 6
For i = 1 To 6
strTemp = YMData.JianDingYeMianCol(i) & YMData.JianDianYeMianColData(i)
pic.CurrentX = curx + colWidth * (i - 1) '+ (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = YMData.JianDingYeMianCol(6 + i) & YMData.JianDianYeMianColData(6 + i)
pic.CurrentX = curx + colWidth * (i - 1)
pic.CurrentY = curY - curHeight + rowHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
Next
strTemp = YMData.JianDingYeMianCol(13) & YMData.JianDianYeMianColData(13)
pic.CurrentX = curx + colWidth * 4
pic.CurrentY = curY - rowHeight / 2
pic.Print strTemp
curHeight = curHeight - rowHeight * 4
curY = curY - rowHeight
pic.FontSize = oldFontSize
Else '在pic上顯示
curx = 0
curWidth = pic.Width
curY = pic.Height
curHeight = pic.Height
'
End If
pic.Line (curx, curY)-(curx + curWidth, curY - curHeight), , B
''畫高低頻曲線
tempPiont = UBound(YMData.JianDingYeMiandata, 1) - 1
'tempPiont = 5500
bx = curWidth / tempPiont
byh = (curHeight / 12) / YMData.GaoPinZuiDa '高頻比例
byl = (curHeight / 12) / YMData.DiPinZuiDa '低頻比例
YMData.JianDingYeMiandata(0, 3) = curx
For i = 1 To tempPiont
x1 = curx + (i - 1) * bx
x2 = curx + i * bx
y1 = (curY - curHeight * 8 / 12) - YMData.JianDingYeMiandata(i - 1, 1) * byl
y2 = (curY - curHeight * 8 / 12) - YMData.JianDingYeMiandata(i, 1) * byl
pic.Line (x1, y1)-(x2, y2), vbBlue
'----------------
' 真的
y1 = (curY - curHeight * 3 / 12) - YMData.JianDingYeMiandata(i - 1, 2) * byh
y2 = (curY - curHeight * 3 / 12) - YMData.JianDingYeMiandata(i, 2) * byh
'' 假的
' y1 = (curY - curHeight * 3 / 12) - YMData.JianDingYeMiandata(i - 1, 1) * byl
' y2 = (curY - curHeight * 3 / 12) - YMData.JianDingYeMiandata(i, 1) * byl
''---------
pic.Line (x1, y1)-(x2, y2), vbRed
YMData.JianDingYeMiandata(i, 3) = x2
Next
'繪制刻度
If BaoBiao Then
If YMData.DianYi <> "" And YMData.DianWuShi <> "" Then
avgPiont = (YMData.DianWuShi - YMData.DianYi) / 20
For i = 1 To 21
x1 = curx + (YMData.DianYi + avgPiont * (i - 1)) * bx
pic.Line (x1, curY - curHeight)-(x1, curY - curHeight - 100)
pic.Line (x1, curY)-(x1, curY + 100)
If (i Mod 2) = 1 Then
strTemp = Format(0.1 * (i \ 2), "0.0")
pic.CurrentX = x1
pic.CurrentY = curY + 100
pic.Print strTemp
pic.CurrentX = x1
pic.CurrentY = curY - curHeight + 50
pic.Print strTemp
End If
Next
End If
Else
End If
'繪制直線
If YMData.DianYi <> "" Then
x1 = curx + YMData.DianYi * bx
pic.Line (x1, curY - pic.TextHeight("A"))-(x1, curY - curHeight + pic.TextHeight("A"))
strTemp = "0"
pic.CurrentX = x1 + pic.TextWidth("A")
pic.CurrentY = curY - curHeight + pic.TextHeight("A") * 2.5
pic.Print strTemp
End If
If YMData.DianWuShi <> "" Then
x1 = curx + YMData.DianWuShi * bx
pic.Line (x1, curY - pic.TextHeight("A"))-(x1, curY - curHeight + pic.TextHeight("A"))
strTemp = "50"
pic.CurrentX = x1 + pic.TextWidth("A")
pic.CurrentY = curY - curHeight + pic.TextHeight("A") * 2.5
pic.Print strTemp
End If
End Function
Function drawJianDingBaoBiao(pic As Object)
'**********************************************************************
'* 函數名稱: drawJianDingBaoBiao
'* 函數描述: 繪制壓力檢定報告
'* 參數列表: pic畫圖控件
'* 作 者:
'* 創建日期: 2008-03-07
'**********************************************************************
Dim i As Integer, j As Integer
Dim strTemp As String
Dim oldFont As Long
Dim curx As Single, curY As Single, curX1 As Single, curY1 As Single, curWidth As Single, curHeight As Single '繪圖區域
Dim colWidth As Single, rowHeight As Single
'---繪圖區域
curx = pic.Width * 0.1
curWidth = pic.Width * 0.8
curY = pic.Height * 0.95
curHeight = pic.Height * 0.9
'繪制標題
oldFont = pic.FontSize
pic.FontSize = 18
pic.FontBold = True
strTemp = JianDingTitle
curHeight = curHeight - pic.TextHeight(strTemp) * 1.25
colWidth = curWidth / 10.5
rowHeight = curHeight / 17
pic.CurrentX = curx + (curWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = ((curY - curHeight) - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
pic.FontSize = 12
pic.FontBold = False
'繪制網格
'繪制橫線
For i = 1 To 17
Select Case i
Case 2, 17
pic.Line (curx, curY - curHeight + rowHeight * i)-(curx, curY - curHeight + rowHeight * i)
Case 4
pic.Line (curx + colWidth * 0.5, curY - curHeight + rowHeight * i)-(curx + colWidth * 6.5, curY - curHeight + rowHeight * i)
Case 5
pic.Line (curx + colWidth * 0.5, curY - curHeight + rowHeight * i)-(curx + colWidth * 8.5, curY - curHeight + rowHeight * i)
Case Else
pic.Line (curx, curY - curHeight + rowHeight * i)-(curx + curWidth, curY - curHeight + rowHeight * i)
End Select
Next
'繪制豎線
For i = 1 To 12
Select Case i
Case 1
pic.Line (curx, curY - rowHeight)-(curx, curY - rowHeight * 16)
Case 12
pic.Line (curx + curWidth, curY - rowHeight)-(curx + curWidth, curY - rowHeight * 16)
Case 2, 8, 10, 11
pic.Line (curx + colWidth * (i - 1.5), curY - rowHeight * 2)-(curx + colWidth * (i - 1.5), curY - rowHeight * 14)
Case 3
pic.Line (curx + colWidth * (i - 1.5), curY - rowHeight)-(curx + colWidth * (i - 1.5), curY - rowHeight * 12)
Case 4, 6
pic.Line (curx + colWidth * (i - 1.5), curY - rowHeight * 2)-(curx + colWidth * (i - 1.5), curY - rowHeight * 13)
Case Else
pic.Line (curx + colWidth * (i - 1.5), curY - rowHeight * 2)-(curx + colWidth * (i - 1.5), curY - rowHeight * 12)
End Select
Next
'繪制文字
'1
strTemp = JDData.JianDingYaLiCol(1) & JDData.JainDingYaLiColData(1)
pic.CurrentX = curx
pic.CurrentY = curY - curHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(2) & JDData.JainDingYaLiColData(2)
pic.CurrentX = curx + colWidth * 7.5
pic.CurrentY = curY - curHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'2
strTemp = JDData.JianDingYaLiCol(3) & JDData.JainDingYaLiColData(3)
pic.CurrentX = curx + 10
pic.CurrentY = curY - curHeight + rowHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(4) & JDData.JainDingYaLiColData(4)
pic.CurrentX = curx + colWidth * 2.5
pic.CurrentY = curY - curHeight + rowHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(5) & JDData.JainDingYaLiColData(5)
pic.CurrentX = curx + colWidth * 5
pic.CurrentY = curY - curHeight + rowHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(6) & JDData.JainDingYaLiColData(6)
pic.CurrentX = curx + colWidth * 7.5
pic.CurrentY = curY - curHeight + rowHeight + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'3
strTemp = JDData.JianDingYaLiCol(7) & JDData.JainDingYaLiColData(7)
pic.CurrentX = curx + 10
pic.CurrentY = curY - curHeight + rowHeight * 2 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(8) & JDData.JainDingYaLiColData(8)
pic.CurrentX = curx + colWidth * 2.5
pic.CurrentY = curY - curHeight + rowHeight * 2 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(9) & JDData.JainDingYaLiColData(9)
pic.CurrentX = curx + colWidth * 5
pic.CurrentY = curY - curHeight + rowHeight * 2 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'4
strTemp = "試驗"
pic.CurrentX = curx + (colWidth * 0.5 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 3 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "壓 力 示 值 MPa"
pic.CurrentX = curx + colWidth * 0.5 + (colWidth * 6 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 3 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "平 均 值"
pic.CurrentX = curx + colWidth * 6.5 + (colWidth * 2 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 3 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "最 大"
pic.CurrentX = curx + colWidth * 8.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 3 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "示 值"
pic.CurrentX = curx + colWidth * 9.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 3 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'5
strTemp = "套壓"
pic.CurrentX = curx + (colWidth * 0.5 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "一次"
pic.CurrentX = curx + colWidth * 0.5 + (colWidth * 2 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "兩次"
pic.CurrentX = curx + colWidth * 2.5 + (colWidth * 2 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "三次"
pic.CurrentX = curx + colWidth * 4.5 + (colWidth * 2 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "MPa"
pic.CurrentX = curx + colWidth * 6.5 + (colWidth * 2 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "誤 差"
pic.CurrentX = curx + colWidth * 8.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "誤 差"
pic.CurrentX = curx + colWidth * 9.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 4 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'6
strTemp = "MPa"
pic.CurrentX = curx + (colWidth * 0.5 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 5 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
For i = 0 To 3
strTemp = "加載"
pic.CurrentX = curx + colWidth * (0.5 + i * 2) + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 5 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "減載"
pic.CurrentX = curx + colWidth * (0.5 + i * 2 + 1) + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 5 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
Next
strTemp = "Sx"
pic.CurrentX = curx + colWidth * 8.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 5 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = "MPa"
pic.CurrentX = curx + colWidth * 9.5 + (colWidth - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 5 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
'16
strTemp = "檢定結果"
pic.CurrentX = curx + (colWidth * 1.5 - pic.TextWidth(strTemp)) / 2
pic.CurrentY = curY - curHeight + rowHeight * 15 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(10) & JDData.JainDingYaLiColData(10)
pic.CurrentX = curx + colWidth * 1.5 + 50
pic.CurrentY = curY - curHeight + rowHeight * 15 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(11) & JDData.JainDingYaLiColData(11)
pic.CurrentX = curx + colWidth * 4.5
pic.CurrentY = curY - curHeight + rowHeight * 15 + (rowHeight - pic.TextHeight(strTemp)) / 2
pic.Print strTemp
strTemp = JDData.JianDingYaLiCol(12) & JDData.JainDingYaLiColData(12)
pic.CurrentX = curx + colWidth * 7.5
pic.CurrentY = curY - curHeight + rowHeight * 15 + (rowHeight - pic.TextHeight(strTemp)) / 2
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -