Tải bản đầy đủ (.pdf) (1,423 trang)

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

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.64 MB, 1,423 trang )

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


17/12/2007



HÀ NỘI - 2007


15
CHƯƠNG TRÌNH NGUỒN

Chương trình in:
1. In trang bìa BKT1:

Option Explicit
Option Compare Text

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdPrint_Click()
If Trim(txtSTNO.Text) = "" Or Trim(txtYear.Text) = "" Or Trim(txtMonth.Text) = ""
Then Exit Sub

Printer.ScaleMode = vbPoints
Printer.Orientation = 1

Page_BKT1_1 txtSTNO.Text, txtName.Text, CInt(txtYear.Text), CInt(txtMonth.Text)
Print_BKT1_1_Data txtSTNO.Text, txtName.Text, CInt(txtYear.Text),
CInt(txtMonth.Text)


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


Private Sub txtSTNO_GotFocus()
With txtSTNO
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub

Private Sub txtSTNO_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case vbKey0 To vbKey9, 8, 47, 67, 99, 80, 112
Case 13
Case Else
KeyAscii = 0
End Select
End Sub

Private Sub txtSTNO_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 txtYear_Change()
If Len(txtYear.Text) = 4 Then
If Check_Number(Trim(txtYear.Text), "2100", "2000") Then
SendKeys ("{tab}")
Else
MsgBox "Xem l¹i n¨m", vbInformation, "Khi tuong be mat"
End If
Else


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}")

Else
MsgBox "Xem l¹i th¸ng", vbInformation, "Khi tuong be mat"
End If
Else

End If
End Sub

Private Sub txtMonth_GotFocus()
With txtMonth
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub

Private Sub txtMonth_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case vbKey0 To vbKey9, 8
Case 13
SendKeys ("{tab}")
Case 43
KeyAscii = 0
txtYear.SetFocus
Case Else
KeyAscii = 0
End Select
End Sub

Sub Delete_Data()
txtProvince.Text = ""


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 = ""

txtStationManeger.Text = ""
txtObservator.Text = ""
End Sub

Sub Save(ByVal STNO As String)
Dim rsStation_mas As dao.Recordset
Dim strSQL As String
strSQL = ""
strSQL = "SELECT STATION_MAS.STNO, STATION_MAS.DayVVFocus,
STATION_MAS.NightVVForcus, STATION_MAS.ReporterName, "
strSQL = strSQL & "STATION_MAS.ControlerName,
STATION_MAS.LastControlerName "
strSQL = strSQL & "FROM STATION_MAS "
strSQL = strSQL & "WHERE (((STATION_MAS.STNO)='" & STNO & "'));"

Set rsStation_mas = db.OpenRecordset(strSQL)

With rsStation_mas

19
If Not .EOF Then
.MoveFirst
.Edit
If Trim(txtReporter.Text) <> "" Then
!ReporterName = txtReporter.Text
Else
!ReporterName = Null
End If

If Trim(txtControler.Text) <> "" Then

!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


Sub Show_Data(STNO As String, Year As Integer, Month As Integer)
Dim datBgMonth As Date
Dim datEnMonth As Date
Dim rsStation_mas As dao.Recordset
Dim rsInstruments As dao.Recordset

20
Dim rsObservator As dao.Recordset
Dim strSQL As String
Delete_Data

strSQL = ""
strSQL = strSQL & "SELECT STATION_MAS.STNO, STATION_MAS.NAME,
STATION_MAS.Level, "
strSQL = strSQL & "Area.AreaName , Province.ProvinceName, STATION_MAS.AL,
"
strSQL = strSQL & "STATION_MAS.LA, STATION_MAS.Lon,
STATION_MAS.DIST, STATION_MAS.Notes, "
strSQL = strSQL & "STATION_MAS.DayVVFocus,
STATION_MAS.NightVVForcus, STATION_MAS.ReporterName, "
strSQL = strSQL & "STATION_MAS.ControlerName,
STATION_MAS.LastControlerName "
strSQL = strSQL & "FROM (STATION_MAS INNER JOIN AREA "
strSQL = strSQL & "ON STATION_MAS.AreaID = AREA.AreaID) "
strSQL = strSQL & "INNER JOIN PROVINCE ON STATION_MAS.ProvinceID =
PROVINCE.ProvinceID "
strSQL = strSQL & "WHERE (((STATION_MAS.STNO)='" & STNO & "'));"

Set rsStation_mas = db.OpenRecordset(strSQL)


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 = ""

End If
If Not IsNull(!Level) Then
txtLevel.Text = !Level
Else
txtLevel.Text = ""
End If

If Not IsNull(!ReporterName) Then
txtReporter.Text = !ReporterName
Else
txtReporter.Text = ""
End If

If Not IsNull(!ControlerName) Then
txtControler.Text = !ControlerName
Else
txtControler.Text = ""
End If

If Not IsNull(!LastControlerName) Then
txtLastControler.Text = !LastControlerName
Else
txtLastControler.Text = ""
End If

If Not IsNull(!DayVVFocus) Then
txtDayVV.Text = !DayVVFocus
Else
txtDayVV.Text = ""
End If


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

Case 5 'Tg
txtSoil_temp_No.Text = !InstrNum
Case 6 'Tgx
txtMax_soil_temp_No.Text = !InstrNum
Case 7 'Tgn
txtMin_Soil_temp_No.Text = !InstrNum
Case 8 'P
txtAtmos_No.Text = !InstrNum
If Not IsNull(!InstrType) Then txtAtmos_Type.Text = !InstrType
If Not IsNull(!InstrMadeIn) Then txtAtmos_Madein.Text = !InstrMadeIn
If Not IsNull(!InstrCorr) Then txtAtmosCorrection.Text = !InstrCorr
If Not IsNull(!InstrHeight) Then txtAtmosHeight.Text = !InstrHeight & "
m"
Case 10 'light_vild
txtVild.Text = !InstrNum
If Not IsNull(!InstrHeight) Then txtVildHeight.Text = !InstrHeight & " m"
Case 11 'heavy_vild
txtVild.Text = !InstrNum
If Not IsNull(!InstrHeight) Then txtVildHeight.Text = !InstrHeight & " m"
Case 12 'auto_wind
txtAuto_wind_No.Text = !InstrNum
If Not IsNull(!InstrHeight) Then txtAutoWindHeight.Text = !InstrHeight
& " m"
Case 13 'write_wind
txtAuto_write_wind_No.Text = !InstrNum
If Not IsNull(!InstrHeight) Then txtAutoWriteWindHeight.Text =
!InstrHeight & " m"
Case 14 'Tank_rain
txtRain_Tank_No.Text = !InstrNum
If Not IsNull(!InstrType) Then txtRain_Tank_Type.Text = !InstrType


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

strObservator = strObservator & ", " & !Name
End If
.MoveNext
Loop Until .EOF

If strObservator <> "" Then txtObservator.Text = Right(strObservator,
Len(strObservator) - 2)

End If
.Close
End With

Set rsObservator = Nothing


End Sub



24
Sub ObservatorDefine(OBS As String, OBS1 As String, OBS2 As String, _
OBS3 As String, LineCount As Integer)
Dim intHyphenPos As Integer
Dim intOBSNumber As Integer
Dim intBeginString As Integer
OBS1 = OBS
OBS = OBS & ","
OBS2 = ""
OBS3 = ""
LineCount = 0

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

Integer)

Dim intX As Integer
Dim intY As Integer
Dim intTopMargin As Integer
Dim intLeftMargin As Integer

25
Dim intRightMargin As Integer
Dim intBottomMargin As Integer
Dim intLineSpace As Integer
Dim intLeftSpace As Integer
Dim intRowHeight As Integer


intLeftSpace = 20
intLineSpace = 3
intRowHeight = 16
intTopMargin = 20
intBottomMargin = 765
intLeftMargin = 60
intRightMargin = 550
intRowHeight = 18


With Printer.Font
.Name = ".VnArial Narrow"
.Size = 14
.Bold = False
End With


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
If Trim(txtLon.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 150 + 20
Printer.CurrentY = intY
Printer.Print txtLon.Text
End If
If Trim(txtAL.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 300 + 105
Printer.CurrentY = intY
Printer.Print txtAL.Text
End If


intY = intY + intRowHeight
If Trim(txtProvince.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 60
Printer.CurrentY = intY
Printer.Print txtProvince.Text
End If
If Trim(txtDistrict.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 290
Printer.CurrentY = intY
Printer.Print txtDistrict.Text
End If

intY = intY + intRowHeight
If Trim(txtStationManeger.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 110
Printer.CurrentY = intY
Printer.Print txtStationManeger.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


intY = intY + (4 - intObsLine) * intRowHeight
'intY = intY + intRowHeight
'intY = intY + intRowHeight
If Trim(txtAtmos_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 80
Printer.CurrentY = intY
Printer.Print txtAtmos_No.Text
End If
If Trim(txtAtmos_Type.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 35
Printer.CurrentY = intY
Printer.Print txtAtmos_Type.Text
End If
If Trim(txtAtmos_Madein.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 350 + 45
Printer.CurrentY = intY
Printer.Print txtAtmos_Madein.Text
End If

intY = intY + intRowHeight
If Trim(txtAtmosCorrection.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 110
Printer.CurrentY = intY
Printer.Print txtAtmosCorrection.Text
End If
If Trim(txtAtmosHeight.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 190
Printer.CurrentY = intY
Printer.Print txtAtmosHeight.Text


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

Printer.CurrentX = intLeftMargin + intLeftSpace + 105
Printer.CurrentY = intY
Printer.Print txtAuto_write_wind_No.Text
End If
If Trim(txtAutoWriteWindHeight.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 115
Printer.CurrentY = intY
Printer.Print txtAutoWriteWindHeight.Text
End If

intY = intY + intRowHeight
If Trim(txtRain_Tank_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 95
Printer.CurrentY = intY
Printer.Print txtRain_Tank_No.Text
End If
If Trim(txtRain_Tank_Type.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 200 + 30

29
Printer.CurrentY = intY
Printer.Print txtRain_Tank_Type.Text
End If
If Trim(txtRain_Cup_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 350 + 50
Printer.CurrentY = intY
Printer.Print txtRain_Cup_No.Text
End If

intY = intY + intRowHeight

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(txtMax_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 50 + 105
Printer.CurrentY = intY
Printer.Print txtMax_temp_No.Text
End If

30
If Trim(txtMin_Soil_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 250 + 115
Printer.CurrentY = intY
Printer.Print txtMin_Soil_temp_No.Text
End If

intY = intY + intRowHeight
If Trim(txtMin_temp_No.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 50 + 115
Printer.CurrentY = intY
Printer.Print txtMin_temp_No.Text
End If

intY = intY + intRowHeight
intY = intY + intRowHeight

intY = intY + intRowHeight
If Trim(txtNightVV.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 75
Printer.CurrentY = intY
Printer.Print txtNightVV.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

intCHR13 = InStr(1, txtNote.Text, Chr(13))
If intCHR13 > 0 Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 20
Printer.CurrentY = intY
Printer.Print Mid(txtNote.Text, 1, intCHR13)

intCHR13_1 = intCHR13 + 2
intY = intY + intRowHeight
intCHR13 = InStr(intCHR13_1, txtNote.Text, Chr(13))
If intCHR13 > 0 Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 20
Printer.CurrentY = intY
Printer.Print Mid(txtNote.Text, intCHR13_1, intCHR13 - intCHR13_1)

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 20
Printer.CurrentY = intY
Printer.Print Mid(txtNote.Text, intCHR13 + 2, Len(txtNote.Text))
Else
Printer.CurrentX = intLeftMargin + intLeftSpace + 20
Printer.CurrentY = intY
Printer.Print Mid(txtNote.Text, intCHR13_1, Len(txtNote.Text))
intY = intY + intRowHeight
End If
Else
Printer.CurrentX = intLeftMargin + intLeftSpace + 20
Printer.CurrentY = intY
Printer.Print txtNote.Text
intY = intY + intRowHeight
intY = intY + intRowHeight

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


intY = intY + intRowHeight
intY = intY + intRowHeight
If Trim(txtLastControler.Text) <> "" Then
Printer.CurrentX = intLeftMargin + intLeftSpace + 260
Printer.CurrentY = intY
Printer.Print txtLastControler.Text
End If

End Sub

Sub Page_BKT1_1(STNO As String, Name As String, Year As Integer, Month As
Integer)
Dim strPrinter As String

Dim intX As Integer
Dim intY As Integer
Dim intTopMargin As Integer
Dim intLeftMargin As Integer
Dim intRightMargin As Integer
Dim intBottomMargin As Integer
Dim intLineSpace As Integer
Dim intLeftSpace As Integer
Dim intRowHeight As Integer

intLeftSpace = 20
intLineSpace = 3
intRowHeight = 16
intTopMargin = 20
intBottomMargin = 765
intLeftMargin = 60


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)-

(intRightMargin - intLineSpace, intBottomMargin - intLineSpace)

Printer.Font.Name = ".VnTimeH"
Printer.CurrentX = 190
Printer.CurrentY = 30
Printer.Print "Bé tµi nguyªn vµ m«i tr-êng"

Printer.CurrentX = 145
Printer.CurrentY = 45
Printer.Print "Trung t©m khÝ t-îng thuû v¨n quèc gia"

Printer.CurrentX = 450
Printer.CurrentY = 70
Printer.Font.Name = ".VnTime"
Printer.Font.Bold = True
Printer.Print "BKT - 1"
Printer.Font.Name = ".VnTimeH"
Printer.Font.Bold = False

34

Printer.CurrentX = 196
Printer.CurrentY = 80
Printer.Font.Bold = True
Printer.Font.Size = 16
Printer.Print "Bảng số liệu khí t-ợng"

Printer.Font.Bold = False
Printer.Font.Size = 14
Printer.Font.Name = ".VnArial Narrow"

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.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Tỉnh (T.P):"
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "Huyện (Quận): "

35

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Họ, tên tr-ỏng trạm: "

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Họ, tên quan trắc viên: "

intY = intY + intRowHeight
intY = intY + intRowHeight

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Khí áp kế số: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "Kiểu:"
Printer.CurrentX = intLeftMargin + intLeftSpace + 310

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

Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "M¸y giã tù ghi 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 "Thïng ®o m-a sè: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 200
Printer.CurrentY = intY
Printer.Print "KiÓu: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 320
Printer.CurrentY = intY
Printer.Print "èng ®o m-a sè: "

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "èng ®o bèc h¬i Piche sè: "

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 50
Printer.CurrentY = intY
Printer.Print "NhiÖt kÕ kh« sè: "
Printer.CurrentX = intLeftMargin + intLeftSpace + 250
Printer.CurrentY = intY
Printer.Print "NhiÖt kÕ th-êng sè: "


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ố: "


intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace + 50
Printer.CurrentY = intY
Printer.Print "Nhiệt kế tối thấp số:"

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Đồng hồ kiểu: Để bàn Điều chỉnh theo giờ: Đài Tiếng nói Việt
Nam"

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "Các tiêu điểm tầm nhìn ngang: "

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "- Lúc trời tối:"

intY = intY + intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY
Printer.Print "- Lúc trời sáng:"

intY = intY + 2 * intRowHeight
Printer.CurrentX = intLeftMargin + intLeftSpace
Printer.CurrentY = intY


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

Printer.Print "Họ tên và nhận xét của ng-ời kiểm tra cuối cùng: "

End Sub

Private Sub txtYear_LostFocus()
If txtSTNO.Text <> "" And txtYear.Text <> "" And txtMonth.Text <> "" Then
Show_Data txtSTNO, CInt(txtYear.Text), CByte(txtMonth.Text)
End If
End Sub

×