BỘ TÀI NGUYÊN VÀ MÔI TRƯỜNG
TRUNG TÂM KHÍ TƯỢNG THỦY VĂN QUỐC GIA
BÁO CÁO TỔNG KẾT ĐỀ TÀI
NGHIÊN CỨU KHOA HỌC VÀ CÔNG NGHỆ CẤP BỘ:
NGHIÊN CỨU ỨNG DỤNG HỆ PHẦN MỀM
XỬ LÝ SỐ LIỆU KHÍ TƯỢNG BỀ MẶT
VÀ HỆ PHẦN MỀM XỬ LÝ SỐ LIỆU THUỶ VĂN
VÙNG SÔNG KHÔNG ẢNH HƯỞNG TRIỀU
hå s¬ kü thuËt
phÇn mÒm xö lý sè liÖu khÝ t−îng bÒ mÆt
6696-1
Printer.EndDoc
End Sub
Private Sub cmdSave_Click()
If Trim(txtSTNO.Text) = "" Then Exit Sub
Save Trim(txtSTNO.Text)
End Sub
Private Sub txtMonth_LostFocus()
If txtSTNO.Text <> "" And txtYear.Text <> "" And txtMonth.Text <> "" Then
Show_Data txtSTNO, CInt(txtYear.Text), CByte(txtMonth.Text)
End If
End Sub
Private Sub txtSTNO_Change()
If Len(txtSTNO.Text) = 5 Then
If LookForSTNO(Trim(txtSTNO.Text), txtName) Then
SendKeys ("{tab}")
Else
MsgBox "Khong co tram nay", vbInformation, "Hieu chinh khi ap ve muc tram"
End If
Else 16
End If
End Sub
End If
End Sub
Private Sub txtYear_GotFocus()
With txtYear
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Private Sub txtYear_KeyPress(KeyAscii As Integer)
17
Select Case KeyAscii
Case vbKey0 To vbKey9, 8
Case 13
SendKeys ("{tab}")
Case 43
KeyAscii = 0
SendKeys ("shift+{tab}")
Case Else
KeyAscii = 0
End Select
End Sub
Private Sub txtMonth_Change()
If Len(txtMonth.Text) = 2 Then
If Check_Number(Trim(txtMonth.Text), "12", "1") Then
SendKeys ("{tab}")
18
txtDistrict.Text = ""
txtAL.Text = ""
txtLA.Text = ""
txtLon.Text = ""
txtLevel.Text = ""
txtDry_temp_No.Text = ""
txtWet_temp_No.Text = ""
txtMax_temp_No.Text = ""
txtMin_temp_No.Text = ""
txtSoil_temp_No.Text = ""
txtMax_soil_temp_No.Text = ""
txtMin_Soil_temp_No.Text = ""
txtAtmos_No.Text = ""
txtAtmos_Type.Text = ""
txtAtmos_Madein.Text = ""
txtAtmosCorrection.Text = ""
txtAtmosHeight.Text = ""
txtVild.Text = ""
txtVildHeight.Text = ""
txtVild.Text = ""
txtVildHeight.Text = ""
txtAuto_wind_No.Text = ""
txtAutoWindHeight.Text = ""
txtAuto_write_wind_No.Text = ""
txtAutoWriteWindHeight.Text = ""
txtRain_Tank_No.Text = ""
txtRain_Tank_Type.Text = ""
txtPiche_No.Text = ""
!ControlerName = txtControler.Text
Else
!ControlerName = Null
End If
If Trim(txtLastControler.Text) <> "" Then
!LastControlerName = txtLastControler.Text
Else
!LastControlerName = Null
End If
If Trim(txtDayVV.Text) <> "" Then
!DayVVFocus = txtDayVV.Text
Else
!DayVVFocus = Null
End If
If Trim(txtNightVV.Text) <> "" Then
!NightVVForcus = txtNightVV.Text
Else
!NightVVForcus = Null
End If
.Update
End If
.Close
End With
Set rsStation_mas = Nothing
End Sub
With rsStation_mas
If .RecordCount > 0 Then
'If Not IsNull(!AreaName) Then rsCover!Region = !AreaName
If Not IsNull(!ProvinceName) Then
txtProvince.Text = !ProvinceName
Else
txtProvince.Text = ""
End If
If Not IsNull(!DIST) Then
txtDistrict.Text = !DIST
Else
txtDistrict.Text = ""
End If
If Not IsNull(!AL) Then
txtAL.Text = !AL & " m"
Else
txtAL.Text = ""
End If
If Not IsNull(!LA) Then
txtLA.Text = !LA
Else
txtLA.Text = ""
End If
21
If Not IsNull(!Lon) Then
txtLon.Text = !Lon
Else
txtLon.Text = ""
If Not IsNull(!NightVVForcus) Then
txtNightVV.Text = !NightVVForcus
Else
txtNightVV.Text = ""
End If
End If
.Close
End With
Set rsStation_mas = Nothing
strSQL = "select * from istruments "
22
strSQL = strSQL & "where stno='" & STNO & "'"
Set rsInstruments = db.OpenRecordset(strSQL)
With rsInstruments
If .RecordCount > 0 Then
.MoveFirst
Do
Select Case !InstrID
Case 1 'nhiet ke kho
txtDry_temp_No.Text = !InstrNum
Case 2 'tw
txtWet_temp_No.Text = !InstrNum
Case 3 'Tx
txtMax_temp_No.Text = !InstrNum
Case 4 'Tn
txtMin_temp_No.Text = !InstrNum
23
Case 15 'Piche
txtPiche_No.Text = !InstrNum
Case 42
txtRain_Cup_No.Text = !InstrNum
End Select
.MoveNext
Loop Until .EOF
End If
.Close
End With
Set rsInstruments = Nothing
strSQL = "SELECT * FROM observators"
strSQL = strSQL & " Where (STNO ='" & STNO & "')"
Set rsObservator = db.OpenRecordset(strSQL)
Dim strObservator As String
strObservator = ""
With rsObservator
If Not .EOF Then
.MoveFirst
Do
If !Position = 1 Then
txtStationManeger.Text = !Name
Else
intOBSNumber = 0
intBeginString = 1
For intHyphenPos = 1 To Len(OBS)
If Mid(OBS, intHyphenPos, 1) = "," Then
intOBSNumber = intOBSNumber + 1
If intOBSNumber = 3 Or intHyphenPos = Len(OBS) Then
LineCount = LineCount + 1
If LineCount = 1 Then
OBS1 = Mid(OBS, intBeginString, intHyphenPos - intBeginString)
intOBSNumber = 0
intBeginString = intHyphenPos + 1
Else
If LineCount = 2 Then
OBS2 = Mid(OBS, intBeginString, intHyphenPos - intBeginString)
intOBSNumber = 0
intBeginString = intHyphenPos + 1
Else
OBS3 = Mid(OBS, intBeginString, intHyphenPos - intBeginString)
intOBSNumber = 0
intBeginString = intHyphenPos + 1
End If
End If
End If
End If
Next
End Sub Sub Print_BKT1_1_Data(STNO As String, Name As String, Year As Integer, Month As
Printer.Font.Bold = False
Printer.Font.Size = 13
Printer.Font.Name = ".VnTime"
intY = 139
Printer.Font.Size = 13
If Trim(txtName.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 80
Printer.CurrentY = intY
Printer.Print txtName.Text
End If
If Trim(txtLevel.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 40
Printer.CurrentY = intY
Printer.Print txtLevel.Text
End If
If Trim(txtSTNO.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 350 + 50
Printer.CurrentY = intY
Printer.Print txtSTNO.Text
End If
intY = intY + intRowHeight
26
If Trim(txtLA.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 55
Printer.CurrentY = intY
Printer.Print txtLA.Text
End If
Dim strOBS As String
Dim strOBS1 As String
Dim strOBS2 As String
Dim strOBS3 As String
Dim intObsLine As Integer
intY = intY + intRowHeight
If Trim(txtObservator.Text) <> "" Then
strOBS = Trim(txtObservator.Text)
ObservatorDefine strOBS, strOBS1, strOBS2, strOBS3, intObsLine
27
Printer.CurrentX = intLeftMargin + intLeftSpace + 130
Printer.CurrentY = intY
Printer.Print strOBS1
If strOBS2 <> "" Then
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 130
Printer.CurrentY = intY
Printer.Print Trim(strOBS2)
End If
If strOBS3 <> "" Then
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 130
Printer.CurrentY = intY
Printer.Print Trim(strOBS3)
End If
End If
28
End If
intY = intY + intRowHeight
If Trim(txtVild.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 95
Printer.CurrentY = intY
Printer.Print txtVild.Text
End If
If Trim(txtVildHeight.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 115
Printer.CurrentY = intY
Printer.Print txtVildHeight.Text
End If
intY = intY + intRowHeight
If Trim(txtAuto_wind_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 105
Printer.CurrentY = intY
Printer.Print txtAuto_wind_No.Text
End If
If Trim(txtAutoWindHeight.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 115
Printer.CurrentY = intY
Printer.Print Trim(txtAutoWindHeight.Text)
End If
intY = intY + intRowHeight
If Trim(txtAuto_write_wind_No.Text) <> "" Then
If Trim(txtPiche_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 140
Printer.CurrentY = intY
Printer.Print txtPiche_No.Text
End If
intY = intY + intRowHeight
If Trim(txtDry_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 50 + 95
Printer.CurrentY = intY
Printer.Print txtDry_temp_No.Text
End If
If Trim(txtSoil_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 250 + 115
Printer.CurrentY = intY
Printer.Print txtSoil_temp_No.Text
End If
intY = intY + intRowHeight
If Trim(txtWet_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 50 + 95
Printer.CurrentY = intY
Printer.Print txtWet_temp_No.Text
End If
If Trim(txtMax_soil_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 250 + 115
Printer.CurrentY = intY
Printer.Print txtMax_soil_temp_No.Text
End If
intY = intY + intRowHeight
If Trim(txtDayVV.Text) <> "" Then
If InStr(1, txtDayVV.Text, Chr(13)) > 0 Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 85
Printer.CurrentY = intY
Printer.Print Mid(txtDayVV.Text, 1, InStr(1, txtDayVV.Text, Chr(13)))
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 85
Printer.CurrentY = intY
Printer.Print Mid(txtDayVV.Text, InStr(1, txtDayVV.Text, Chr(13)) + 2,
Len(txtDayVV.Text))
Else
Printer.CurrentX = intLeftMargin + intLeftSpace + 85
Printer.CurrentY = intY
Printer.Print txtDayVV.Text
intY = intY + intRowHeight
End If
Else
intY = intY + intRowHeight
End If
intY = intY + intRowHeight
31
Dim intCHR13 As Integer
Dim intCHR13_1 As Integer
intY = intY + intRowHeight
If Trim(txtNote.Text) <> "" Then
End If
Else
intY = intY + intRowHeight
intY = intY + intRowHeight
End If
intY = intY + intRowHeight
If Trim(txtReporter.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 125
Printer.CurrentY = intY
Printer.Print txtReporter.Text
End If
32
intY = intY + intRowHeight
If Trim(txtStationManeger.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 190
Printer.CurrentY = intY
Printer.Print txtStationManeger.Text
End If
intY = intY + intRowHeight
intY = intY + intRowHeight
If Trim(txtControler.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 205
Printer.CurrentY = intY
Printer.Print txtControler.Text
End If
33
intRightMargin = 550
intRowHeight = 18
With Printer.Font
.Name = ".VnArial Narrow"
.Size = 14
.Bold = False
End With
Printer.DrawWidth = 8
Printer.Line (intLeftMargin, intTopMargin)-(intRightMargin, intTopMargin)
Printer.Line (intLeftMargin, intTopMargin)-(intLeftMargin, intBottomMargin)
Printer.Line (intRightMargin, intTopMargin)-(intRightMargin, intBottomMargin)
Printer.Line (intLeftMargin, intBottomMargin)-(intRightMargin, intBottomMargin)
Printer.DrawWidth = 2
Printer.Line (435, 65)-(510, 65)
Printer.Line (435, 65)-(435, 95)
Printer.Line (510, 65)-(510, 95)
Printer.Line (435, 95)-(510, 95)
Printer.Line (intLeftMargin + intLineSpace, intTopMargin + intLineSpace)-
(intRightMargin - intLineSpace, intTopMargin + intLineSpace)
Printer.Line (intLeftMargin + intLineSpace, intTopMargin + intLineSpace)-
(intLeftMargin + intLineSpace, intBottomMargin - intLineSpace)
Printer.Line (intRightMargin - intLineSpace, intTopMargin + intLineSpace)-
(intRightMargin - intLineSpace, intBottomMargin - intLineSpace)
Printer.Line (intLeftMargin + intLineSpace, intBottomMargin - intLineSpace)-
Printer.CurrentX = 250
Printer.CurrentY = 105
Printer.Print "Tháng " & Month & " năm " & Year
intY = 139
Printer.Font.Name = ".VnTime"
Printer.Font.Size = 13
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Trạm (chữ): "
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "Hạng: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 330
Printer.CurrentY = intY
Printer.Print "(Mã trạm): "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Vĩ độ bắc:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 90
Printer.CurrentY = intY
Printer.Print "Kinh độ đông:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 210
Printer.CurrentY = intY
Printer.Print "Độ cao v-ờn quan trắc trên mặt biển:" intY = intY + intRowHeight
Printer.CurrentY = intY
Printer.Print "N-ớc sản xuất: "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Hiệu chính khí cụ:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "Độ cao chậu khí áp trên mặt biển: "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Máy gió Vild số:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "Độ cao trên mặt đất: "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Máy gió tự báo số:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
36
Printer.CurrentY = intY
Printer.Print "§é cao trªn mÆt ®Êt: "
intY = intY + intRowHeight
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "NhiÖt kÕ"
Printer.CurrentX = intLeftMargin + intLeftSpace + 50
Printer.CurrentY = intY
Printer.Print "NhiÖt kÕ -ít sè: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "NhiÖt kÕ"
Printer.CurrentX = intLeftMargin + intLeftSpace + 250
37
Printer.CurrentY = intY
Printer.Print "Nhiệt kế tối cao số: "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "trong lều"
Printer.CurrentX = intLeftMargin + intLeftSpace + 50
Printer.CurrentY = intY
Printer.Print "Nhiệt kế tối cao số: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "mặt đất"
Printer.CurrentX = intLeftMargin + intLeftSpace + 250
Printer.CurrentY = intY
Printer.Print "Nhiệt kế tối thấp số: "
38
Printer.FontSize = 12
Printer.Print "Ghi chú: (Thay đổi vị trí trạm, v-ờn quan trắc, máy thiết bị hoặc
điều chỉnh máy tự ghi v.v )"
Printer.FontSize = 13
intY = intY + intRowHeight
intY = intY + intRowHeight
intY = intY + intRowHeight
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Họ tên ng-ời lập bảng: "
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Họ tên và nhận xét của tr-ởng trạm "
intY = intY + intRowHeight
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Họ tên và nhận xét của kiểm soát viên: "
intY = intY + intRowHeight
intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY