computer-aid design for outdoor sports

91
รายงานโครงการหมายเลข EE2005-03 โปรแกรมชวยออกแบบแสงสวางสนามกีฬากลางแจง นายจาตุรงค วิเทห รหัสประจําตัว 453040639-6 นายโชคชัย เดชโยธิน รหัสประจําตัว 453040673-6 รายงานนี้เปนรายงาน งานโครงการของนักศึกษาชั้นปที4 ซึ่งเสนอเปนสวนหนึ่งใน หลักสูตรวิศวกรรมศาสตรบัณฑิต ภาควิชาวิศวกรรมไฟฟา คณะวิศวกรรมศาสตร มหาวิทยาลัยขอนแกน ..2548

Upload: komkit-srimanta

Post on 24-Nov-2015

42 views

Category:

Documents


3 download

DESCRIPTION

-

TRANSCRIPT

  • EE2005-03

    453040639-6 453040673-6 4

    ..2548

  • Project Report No. EE2005-03

    Computer-Aid Design for Outdoor Sports

    Mr. Jaturonk Withey ID 453040639-6 Mr. Chokchai Dechyotin ID 453040875-4

    This is the report of fourth year project assignment submitted in partial fulfillment of the requirement for the Degree of Bachelor of Engineering.

    Department of Electrical Engineering

    Faculty of Engineering, Khon Kaen University 2005

  • Computer-Aid Design for Outdoor Sports

    453040639-6 453040673-6

    (. )

    (.. )

    (. )

    8 2549

  • Visual Basic6

    3 2549

  • ABSTRACT

    Aid design for outdoor sports, which is a program, reserve for firm of product and has very high price. This project was happened in order to be used for next to the electrical engineer who understood a lot of a branch of knowledge. The first studied method so that designed illumination. The next studied that wrote program by visual basic6.the finally wrote program was succeeded by object. The program, which shows result of mathematics, is better than person immediately. It can select the designation to be appropriate and reproduce that suitable illumination for design is obvious.

  • Abstract 1 1 1.1 1

    1.2 1 1.3 2 1.4 2 1.5 3 1.6 3

    2 4 2.1 4

    2.2 (Food light) 5 2.3 NEMA 5 2.4 (Utilization Data) 6

    2.5 6 3 10 4 75 5 79 80 81

  • 1 5 2 7 3 H V 8 4 H V 8 5 9 6 Flow chart 10 7 Flow chart 11 8 Flow chart 12 9 12 10 2 13 11 1 13 12 2x 4x 13 13 frmMain 15 14 frmSubTen 19 15 frmSubTen2 22 16 frmCalTen1 27 17 75 18 76 19 77 20 (E) 78

  • 1 2 2 NEMA 5 3 5 4 IES 81

  • 1

    1.1 1.2 1. 2. 3. 4. 5.

  • 2

    1.3 1. 2. 3. 4. 5. 6. 1.4 1. IES-file 2. IES 3. CIE, IES 4. 5. 6.

  • 3

    1.5

    .. .. .. .. .. .. .. ..

    1.

    IES-file

    2. IES

    3. CIE , IES

    4. pre-project

    5.

    6.

    7.

    8. project

    1

    1.6 1. 2. 3. 4.

  • 4

    2

    2.1 2.1.1 (Luminous Intensity, I) (Candlepower) (Candela, Cd) 2.1.2 (Lumen, ) 2.1.3 (Foot-candle, fc) 1 1 1 1 1

  • 5

    2.2 (Food light) 2

    1

    2.3 NEMA (Food light) NEMA (National Electrical Manufactures Association) 7 1 80 60 5Hx4V

    ()

    NEMA

    10 - 18 1 18 - 29 2 29 - 46 3 46 - 70 4 70 - 100 5

    100 - 130 6 130 7

    2 NEMA

  • 6

    2.4 (Utilization Data)

    2

    2 MH 50 % 2 MH 50 % 3 MH 3 MH

    2 MH 40 % 2 MH 40 % 3 MH 30 % 3 MH 30 %

    3

    2.5 1. 2. 3. 4. 2.5.1 L = A = P = =

  • 7

    2

    P 1 1

    LPIE 2P= (3.1)

    EP P () I P (, Cd) I L P (, Cd) LP L P () 1 P 1 3.1 IcosI =

    LPLOcos =

    1

    3P LPLOIE = (3.2)

    3P dLOIE = (3.3)

    h () d ()

  • 8

    (Iso Candle Curves) / (V) / (H) 3.3

    3V)(H,P dLOIE = (3.4)

    2.5.2 H V

    3 H V 2 L P P H H = O V v = 0

    = LBBPtanH 1 (3.5)

    = LOOBtanV 1 (3.6)

    = LOOAtan 1

    4 H V

  • 9

    2.5.3 (I) H V 4

    5 4 P 50,000 P P 40,000 60,000 Q 75,000

  • 10

    3

    Flow chart

    6 Flow chart Flow chart

  • 11

    3.1 4 () IES

    7 Flow chart

  • 12

    3.2

    8 Flow chart

    3.2.1

    9

  • 13

    3.2.2 2 10 2

    3.2.3 1

    11 1

    3.2.4 2x 4x

    12 2x 4x

  • 14

    3.3 4 4 1. 2. 3. 1. 2. NEMA () 3.4 (Uniformity) 1. (Emin)

    2. (Eave) (Emin) 3:1 3.5 1. frmMain 2. frmSubTen 3. frmSubTen2 4. frmCalTen1

  • 15

    13 frmMain

  • 16

    Form FrmMain

    Form Name

    Caption frmMain CAD-For Outdoor Sports.

    Form frmMain CAD-For Outdoor Sports. Form

    Command Button Name Caption

    cmdFc

    Command Button Name Caption

    cmdBask

    Command Button Name Caption

    cmdTen

    Command Button Name Caption

    cmdVal

    Command Button Name Caption

    cmdBad

    Command Button Name Caption

    cmdSmIn (Indoor)

    (Indoor) (Indoor)

    Command Button Name Caption

    cmdSmOut (Outdoor)

    (Outdoor) (Outdoor)

    Command Button Name Caption

    cmdHg

    Command Button Name Caption

    cmdExit E&xit

    Exit

    Label Name Caption

    Label1 COMPUTER - AID DESIGN FOR OUTDOOR SPORTS

  • 17

    Form FrmMain Option Explicit --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdBad_Click() 'Event procedure cmdBad frmSubBad2.Show vbModal ' frmSubBad2 End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdBask_Click() 'Event procedure cmdBask frmSubBask.Show vbModal ' frmSubBask End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdExit_Click() 'Event procedure Exit Dim response As Variant response = MsgBox("?", _ vbQuestion + vbYesNo) If response = vbYes Then End End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdFc_Click() 'Event procedure cmdFc frmSubFc.Show vbModal ' frmSubFc End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdHg_Click() 'Event procedure cmdHg frmSubHg.Show vbModal ' frmSubHg End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdSmIn_Click() 'Event procedure cmdSmIn 'frmSubSmIn.Show vbModal ' frmSubSmln End Sub ---------------------------------------------------------------------------------------------------------------------------------------

  • 18

    Form FrmMain () --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdSmOut_Click() 'Event procedure cmdSmOut frmSubSmOut2.Show vbModal ' frmSubSmOut End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdTen_Click() 'Event procedure cmdTen frmSubTen.Show vbModal ' frmSubSmTen End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdVal_Click() 'Event procedure cmdVal frmSubVal2.Show vbModal ' frmSubSmVal End Sub ---------------------------------------------------------------------------------------------------------------------------------------

  • 19

    14 frmSubTen

  • 20

    Form frmSubTen

    Form Name

    Caption frmSubTen CAD-For Outdoor Sports.

    Form frmSubTen CAD-For Outdoor Sports. Form

    Command Button Name Caption

    Command1 4

    4 4

    Command Button Name Caption

    Command2

    Command Button Name Caption

    Command3

    Command Button Name Caption

    Command4 2X-4X

    2X-4X 2X-4X

    Command Button Name Caption

    cmdMain

    Command Button Name Caption

    cmdE&xit Exit

    Exit

    Text Box Name Text

    Text1

    Label Name Caption

    Label1 COMPUTER - AID DESIGN FOR OUTDOOR SPORTS

    COMPUTER - AID DESIGN FOR OUTDOOR SPORTS

    Label Name Caption

    Label2

  • 21

    Form FrmSubTen Option Explicit --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdExit_Click() 'Even procedure Exit Dim response As Variant response = MsgBox("?" _ , vbQuestion + vbYesNo) If response = vbYes Then End End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdMain_Click() 'Even procedure cmdMain Dim response As Variant response = MsgBox("?" _ , vbQuestion + vbYesNo) If response = vbYes Then Unload Me End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub Command1_Click() 'Even procedure Command1 Text1.Text = 1 ' Text1 1 frmSubTen2.Show vbModal ' frmSubTen2 End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub Command2_Click() 'Even procedure Command2 Text1.Text = 2 ' Text1 2 frmSubTen2.Show vbModal ' frmSubTen2 End Sub -------------------------------------------------------------------------------------------------------------------------------------- Private Sub Command4_Click() 'Even procedure Command4 Text1.Text = 4 ' Text1 4 frmSubTen2.Show vbModal ' frmSubTen2 End Sub ---------------------------------------------------------------------------------------------------------------------------------------

  • 22

    15 frmSubTen2

  • 23

    Form frmSubTen2

    Form Name

    Caption frmSubTen2 CAD-For Outdoor Sports.

    Form frmSubTen2 CAD-For Outdoor Sports. Form

    Label Name Caption

    Label1 COMPUTER - AID DESIGN FOR OUTDOOR SPORTS

    COMPUTER - AID DESIGN FOR OUTDOOR SPORTS

    Label Name Caption

    Label2

    Command Button Name Caption

    cmdNum1

    Command Button Name Caption

    cmdNum2

    Command Button Name Caption

    cmdNum3

    Command Button Name Caption

    cmdNext Next

    Next

    Command Button Name Caption

    cmdReturn Return

    Return

  • 24

    Form frmSubTen2 Option Explicit --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdReturn_Click() 'Even procedure cmdReturn Dim response As Variant response = MsgBox("Do you want to return?" _ , vbQuestion + vbYesNo) If response = vbYes Then Unload Me End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdNum1_Click() 'Even procedure cmdNum1 Picture7.Visible = True txtLux.Text = 300 Text1.Text = Round((300 / (0.9 * 0.85)), 0) txtLm1.Text = 50000 txtLp1.Text = 12 txtLm2.Text = 100000 txtLp2.Text = "5-6" txtLm3.Text = 150000 txtLp3.Text = "3-4" txtLm4.Visible = False txtLp4.Visible = False txtLm5.Visible = False txtLp5.Visible = False txtLm6.Visible = False txtLp6.Visible = False lbl4.Visible = False lbl5.Visible = False lbl6.Visible = False lbl10.Visible = False lbl11.Visible = False lbl12.Visible = False lbl16.Visible = False lbl17.Visible = False lbl18.Visible = False End Sub

  • 25

    Form frmSubTen2 () --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdNum2_Click() 'Even procedure cmdNum2 Picture7.Visible = True txtLux.Text = 200 Text1.Text = Round((200 / (0.9 * 0.85)), 0) txtLm1.Text = 50000 txtLp1.Text = "6-7" txtLm2.Text = 100000 txtLp2.Text = "3-4" txtLm3.Text = 150000 txtLp3.Text = 2 txtLm4.Visible = False txtLp4.Visible = False txtLm5.Visible = False txtLp5.Visible = False txtLm6.Visible = False txtLp6.Visible = False lbl4.Visible = False lbl5.Visible = False lbl6.Visible = False lbl10.Visible = False lbl11.Visible = False lbl12.Visible = False lbl16.Visible = False lbl17.Visible = False lbl18.Visible = False End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdNum3_Click() 'Even procedure cmdNum3 Picture7.Visible = True txtLux.Text = 100 Text1.Text = Round((100 / (0.9 * 0.85)), 0) txtLm4.Visible = True txtLp4.Visible = True txtLm5.Visible = True txtLp5.Visible = True txtLm6.Visible = True txtLp6.Visible = True

  • 26

    Form frmSubTen2 () lbl4.Visible = True lbl5.Visible = True lbl6.Visible = True lbl10.Visible = True lbl11.Visible = True lbl12.Visible = True lbl16.Visible = True lbl17.Visible = True lbl18.Visible = True txtLm1.Text = 5000 txtLp1.Text = 14 txtLm2.Text = 10000 txtLp2.Text = 7 txtLm3.Text = 15000 txtLp3.Text = "4-5" txtLm4.Text = 20000 txtLp4.Text = 3 txtLm5.Text = 30000 txtLp5.Text = 2 txtLm6.Text = 65000 txtLp6.Text = 1 End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdNext_Click() 'Even procedure cmdNext If frmSubTen.Text1.Text = 1 Then frmCalTen1.Show vbModal ElseIf frmSubTen.Text1.Text = 2 Then frmCalTen2.Show vbModal ElseIf frmSubTen.Text1.Text = 4 Then frmCalTen4.Show vbModal Else End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub Form_Load() 'Even procedure frmSubTen Picture7.Visible = False End Sub ---------------------------------------------------------------------------------------------------------------------------------------

  • 27

    16 frmCalTen1

  • 28

    Form frmCalTen1

    Form Name

    Caption frmCalTen1 CAD-For Outdoor Sports.

    Form frmCalTen1 CAD-For Outdoor Sports. Form

    MSFlexGrid Name MSFlexGrid1

    DataGrid Name DataGrid1

    DataCombo Name

    DataCombo1

    List Name

    List1

    Lumen

    ComboBox Name ComboBox

    Command Button Name Caption

    cmdGraph1 1

    1

    Command Button Name Caption

    cmdAngH H

    H

    Command Button Name Caption

    cmdAngV V

    V

    Command Button Name Caption

    cmdDist d (m)

    d (m)

    Command Button Name Caption

    cmdE E (lux)

    E (lux)

    Command Button Name Caption

    cmdReturn Return

    Return

    Command Button Name Caption

    cmdExit Exit

    Exit

  • 29

    Form frmCalTen1 ()

    Text Box Name

    Text txtWidth

    Text Box Name Text

    txtLong

    Text Box Name Text

    txtLampHigh1

    Text Box Name Text

    txtLampHigh2

    Text Box Name Text

    txtEmax

    Text Box Name Text

    txtEmin

    Text Box Name Text

    txtEave

    Text Box Name Text

    txtAvePerMin

    Text Box Name Text

    txtColumnAmount

    Text Box Name Text

    txtTotalLamp

    Text Box Name Text

    txtLampPerColumn

    Text Box Name Text

    txtSetPoint1

    1

    Text Box Name Text

    txtSetPoint2

    2

  • 30

    Form frmCalTen1 ()

    Text Box Name

    Text

    txtSetPoint3

    3

    Text Box Name Text

    txtAngT1

    1

    Text Box Name Text

    txtAngT2

    2

    Text Box Name Text

    txtAngT3

    3

    Text Box Name Text

    txtMP_1

    Text Box Name Text

    txtMP_2

    Text Box Name Text

    txtPM_1

    Text Box Name Text

    txtPM_2

    Text Box Name Text

    txtPlus_1

    Text Box Name Text

    txtPlus_2

    Text Box Name Text

    txtMinus_1

    Text Box Name Text

    txtMinus_2

    MsChart Name

    MsChart1

    Adodc Name Caption

    Adodc1 Adodc1

    Adodc Name Caption

    Adodc2 Adodc2

  • 31

    Form frmCalTen1 ()

    Adodc Name

    Caption Adodc3 Adodc3

    Adodc Name Caption

    Adodc4 Adodc4

    Adodc Name Caption

    Adodc5 Adodc5

    Adodc Name Caption

    Adodc6 Adodc6

    Adodc Name Caption

    Adodc7 Adodc7

    Adodc Name Caption

    Adodc8 Adodc8

    Adodc Name Caption

    Adodc9 Adodc9

  • 32

    Form frmCalTen1 Option Explicit Dim connTbl As String Dim C1 As Single, C2 As Single, LampHigh As Single Const pi = 3.141592654 Dim T1 As Single Dim T2 As Single Dim T3 As Single Dim AngH_V1(7, 13, 2) As Single Dim AngH_V2(7, 13, 2) As Single Dim AngH_V3(7, 13, 2) As Single Dim calDist(7, 13) As Single Dim Lux_Tot(7, 13) As Single Dim E_Ave As Single Dim sum As Single --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmbLampAmount_Click() txtLampPerColumn.Text = Val(cmbLampAmount.Text) / 4 txtTotalLamp.Text = Val(cmbLampAmount.Text) If cmbLampAmount.Text = "12" Then lbl1.Visible = True lbl2.Visible = True lbl3.Visible = True lbl4.Visible = True lbl5.Visible = True lbl6.Visible = True txtSetPoint1.Visible = True txtSetPoint2.Visible = True txtSetPoint3.Visible = True txtAngT1.Visible = True txtAngT2.Visible = True txtAngT3.Visible = True ElseIf cmbLampAmount.Text = "8" Then lbl1.Visible = True lbl2.Visible = True lbl3.Visible = False lbl4.Visible = True lbl5.Visible = True lbl6.Visible = False

  • 33

    Form frmCalTen1 () txtSetPoint1.Visible = True txtSetPoint2.Visible = True txtSetPoint3.Visible = False txtAngT1.Visible = True txtAngT2.Visible = True txtAngT3.Visible = False ElseIf cmbLampAmount.Text = "4" Then lbl1.Visible = True lbl2.Visible = False lbl3.Visible = False lbl4.Visible = True lbl5.Visible = False lbl6.Visible = False txtSetPoint1.Visible = True txtSetPoint2.Visible = False txtSetPoint3.Visible = False txtAngT1.Visible = True txtAngT2.Visible = False txtAngT3.Visible = False Else End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdAngH_Click() Dim I As Integer Dim AngH1 As Single, AngRd1 As Single Dim AngH2 As Single, AngRd2 As Single Dim AngH3 As Single, AngRd3 As Single T1 = (Val(txtAngT1.Text) * pi / 180) T2 = (Val(txtAngT2.Text) * pi / 180) T3 = (Val(txtAngT3.Text) * pi / 180) Dim dX As Single, dY As Single Dim W As Single, L As Single, H As Single Dim Up1 As Single, Down1 As Single Dim Up2 As Single, Down2 As Single Dim Up3 As Single, Down3 As Single

  • 34

    Form frmCalTen1 () Dim Lamp1 As Single, Lamp2 As Single Dim col As Single, Row As Single On Error GoTo check H = txtLampHigh1.Text W = txtWidth.Text L = txtLong.Text Lamp1 = (L / 8) * 2 Lamp2 = (L / 8) * 6 I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col dY = ((col - 1) * 3) - Lamp1 dX = ((I - 1) * 3) Up1 = ((dY * Cos(T1)) - (dX * Sin(T1))) Down1 = Sqr((dX * dX) + (H * H)) Up2 = ((dY * Cos(T2)) - (dX * Sin(T2))) Down2 = Sqr((dX * dX) + (H * H)) Up3 = ((dY * Cos(T3)) - (dX * Sin(T3))) Down3 = Sqr((dX * dX) + (H * H)) AngRd1 = Abs(Atn(Up1 / Down1)) AngH1 = (AngRd1 * 180) / pi AngH1 = Round(AngH1, 1) AngH_V1(I, col, 1) = AngH1 AngRd2 = Abs(Atn(Up2 / Down2)) AngH2 = (AngRd2 * 180) / pi AngH2 = Round(AngH2, 1) AngH_V2(I, col, 1) = AngH2 AngRd3 = Abs(Atn(Up3 / Down3)) AngH3 = (AngRd3 * 180) / pi AngH3 = Round(AngH3, 1) AngH_V3(I, col, 1) = AngH3 MSFlexGrid1.Text = AngH1 Next col Next I Exit Sub

  • 35

    check: MsgBox " (>:!", vbOKOnly, "" End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdAngV_Click() Dim Xa1 As Single, S1 As Single Dim Xa2 As Single, S2 As Single Dim Xa3 As Single, S3 As Single Dim AngSig1 As Single, AngV1 As Single, AngRd1 As Single Dim AngSig2 As Single, AngV2 As Single, AngRd2 As Single Dim AngSig3 As Single, AngV3 As Single, AngRd3 As Single Dim H As Single Dim dX As Single, dY As Single Dim W As Single, L As Single Dim Up1 As Single, Down1 As Single Dim Up2 As Single, Down2 As Single Dim Up3 As Single, Down3 As Single Dim Lamp1 As Single, Lamp2 As Single Dim col As Single, Row As Single Dim I As Integer H = txtLampHigh1.Text If txtLampPerColumn.Text = "3" Then Xa1 = txtSetPoint1.Text Xa2 = txtSetPoint2.Text Xa3 = txtSetPoint3.Text AngSig1 = Atn(H / Xa1) S1 = (AngSig1 * 180) / pi S1 = Round(S1, 2) AngSig2 = Atn(H / Xa2) S2 = (AngSig2 * 180) / pi S2 = Round(S2, 2) AngSig3 = Atn(H / Xa3) S3 = (AngSig3 * 180) / pi S3 = Round(S3, 2) W = txtWidth.Text L = txtLong.Text Lamp1 = (L / 8) * 2 Lamp2 = (L / 8) * 6 T1 = (Val(txtAngT1.Text) * pi / 180)

  • 36

    Form frmCalTen1 () T2 = (Val(txtAngT2.Text) * pi / 180) T3 = (Val(txtAngT3.Text) * pi / 180) I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col dY = ((col - 1) * 3) - Lamp1 dX = (I - 1) * 3 Up1 = (dX * Cos(T1)) + (dY * Sin(T1)) Down1 = H Up2 = (dX * Cos(T2)) + (dY * Sin(T2)) Down2 = H Up3 = (dX * Cos(T3)) + (dY * Sin(T3)) Down3 = H AngRd1 = (Atn(Up1 / Down1)) * 180 / pi AngV1 = AngRd1 - (90 - S1) AngV1 = Round(AngV1, 1) AngH_V1(I, col, 2) = AngV1 AngRd2 = (Atn(Up2 / Down2)) * 180 / pi AngV2 = AngRd2 - (90 - S2) AngV2 = Round(AngV2, 1) AngH_V2(I, col, 2) = AngV2 AngRd3 = (Atn(Up3 / Down3)) * 180 / pi AngV3 = AngRd3 - (90 - S3) AngV3 = Round(AngV3, 1) AngH_V3(I, col, 2) = AngV3 MSFlexGrid1.Text = AngV1 Next col Next I ElseIf txtLampPerColumn.Text = "2" Then Xa1 = txtSetPoint1.Text Xa2 = txtSetPoint2.Text AngSig1 = Atn(H / Xa1) S1 = (AngSig1 * 180) / pi S1 = Round(S1, 2) AngSig2 = Atn(H / Xa2)

  • 37

    Form frmCalTen1 () S2 = (AngSig2 * 180) / pi S2 = Round(S2, 2) W = txtWidth.Text L = txtLong.Text Lamp1 = (L / 8) * 2 Lamp2 = (L / 8) * 6 T1 = (Val(txtAngT1.Text) * pi / 180) T2 = (Val(txtAngT2.Text) * pi / 180) I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col dY = ((col - 1) * 3) - Lamp1 dX = (I - 1) * 3 Up1 = (dX * Cos(T1)) + (dY * Sin(T1)) Down1 = H Up2 = (dX * Cos(T2)) + (dY * Sin(T2)) Down2 = H AngRd1 = (Atn(Up1 / Down1)) * 180 / pi AngV1 = AngRd1 - (90 - S1) AngV1 = Round(AngV1, 1) AngH_V1(I, col, 2) = AngV1 AngRd2 = (Atn(Up2 / Down2)) * 180 / pi AngV2 = AngRd2 - (90 - S2) AngV2 = Round(AngV2, 1) AngH_V2(I, col, 2) = AngV2 MSFlexGrid1.Text = AngV1 Next col Next I ElseIf txtLampPerColumn.Text = "1" Then Xa1 = txtSetPoint1.Text AngSig1 = Atn(H / Xa1) S1 = (AngSig1 * 180) / pi S1 = Round(S1, 2) W = txtWidth.Text L = txtLong.Text

  • 38

    Form frmCalTen1 () Lamp1 = (L / 8) * 2 Lamp2 = (L / 8) * 6 T1 = (Val(txtAngT1.Text) * pi / 180) I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col dY = ((col - 1) * 3) - Lamp1 dX = (I - 1) * 3 Up1 = (dX * Cos(T1)) + (dY * Sin(T1)) Down1 = H AngRd1 = (Atn(Up1 / Down1)) * 180 / pi AngV1 = AngRd1 - (90 - S1) AngV1 = Round(AngV1, 1) AngH_V1(I, col, 2) = AngV1 MSFlexGrid1.Text = AngV1 Next col Next I Else End If End Sub Private Sub cmdDist_Click() Dim W As Single, L As Single Dim H1 As Single, H2 As Single Dim sum As Long Dim d As Single, I As Integer Dim col As Single, Row As Single W = txtWidth.Text L = txtLong.Text H1 = W / 4 H2 = L / 8 If H1 >= H2 Then LampHigh = H1 Else: LampHigh = H2 End If

  • 39

    Form frmCalTen1 () Dim H As Single, X As Single, Y As Single H = txtLampHigh1.Text L = H2 * 2 I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col X = ((col - 1) * 3) - L Y = (I - 1) * 3 d = Sqr((H * H) + (X * X) + (Y * Y)) d = Round(d, 1) calDist(I, col) = d MSFlexGrid1.Text = d Next col Next I End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdE_Click() Dim Lux_Av1(7, 13) As Single Dim Lux_1(7, 13) As Single Dim Lux_2(7, 13) As Single Dim Lux_3(7, 13) As Single Dim I_HV As Single Dim col As Single, Row As Single, I As Integer Dim K As String Dim V As Single Dim K2 As Single Dim V2 As Single Dim strCheck1(7, 13) As String Dim strCheck2(7, 13) As String Dim strCheck3(7, 13) As String Dim strCheck4(7, 13) As String Dim strCheck5(7, 13) As String Dim strCheck6(7, 13) As String Dim strCheck7(7, 13) As String

  • 40

    Form frmCalTen1 () Dim strCheck8(7, 13) As String Dim angH_P As Single Dim angV_P As Single Dim angH_M As Single Dim angV_M As Single Dim angH_MP As Single Dim angV_MP As Single Dim angH_PM As Single Dim angV_PM As Single Dim I_P As Single Dim I_M As Single Dim I_MP As Single Dim I_PM As Single Dim InterPulate1 As Single Dim InterPulate2 As Single Dim database_name As String Dim Lamp_H As Single Lamp_H = txtLampHigh1.Text database_name = App.Path If Right$(database_name, 1) "\" Then database_name = database_name & "\" End If database_name = database_name & "data1.mdb" With Adodc2 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc3 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc4 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With

  • 41

    Form frmCalTen1 () With Adodc5 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc6 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc7 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc8 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With With Adodc9 .ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;" & _ "Data Source=" & database_name & ";" & _ "Persist Security info=False" End With If txtLampPerColumn.Text = "3" Then I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh

  • 42

    Form frmCalTen1 () txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = "" angH_P = K angV_P = V I_P = Val(strCheck2(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh

  • 43

    Form frmCalTen1 () txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop txtMinus_2.Text = "" angH_M = K angV_M = V I_M = Val(strCheck4(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh

  • 44

    Form frmCalTen1 () txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = "" angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh

  • 45

    Form frmCalTen1 () txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = "" angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V1(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V1(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2

  • 46

    Form frmCalTen1 () ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V1(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_1(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) Next col Next I I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh

  • 47

    Form frmCalTen1 () txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = "" angH_P = K angV_P = V I_P = Val(strCheck2(I, col)) K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop

  • 48

    Form frmCalTen1 () txtMinus_2.Text = "" angH_M = K angV_M = V I_M = Val(strCheck4(I, col)) K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = "" angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col))

  • 49

    Form frmCalTen1 () K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = ""

  • 50

    Form frmCalTen1 () angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V2(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V2(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V2(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V2(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2 ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V2(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_2(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) Next col Next I I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V3(I, col, 1)), 0) V = Round((AngH_V3(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh

  • 51

    Form frmCalTen1 () txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = "" angH_P = K angV_P = V I_P = Val(strCheck2(I, col)) K = "" V = 0 K = Round((AngH_V3(I, col, 1)), 0) V = Round((AngH_V3(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh

  • 52

    Form frmCalTen1 () txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop txtMinus_2.Text = "" angH_M = K angV_M = V I_M = Val(strCheck4(I, col)) K = "" V = 0 K = Round((AngH_V3(I, col, 1)), 0) V = Round((AngH_V3(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh

  • 53

    Form frmCalTen1 () txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = "" angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col)) K = "" V = 0 K = Round((AngH_V3(I, col, 1)), 0) V = Round((AngH_V3(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh

  • 54

    Form frmCalTen1 () txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = "" angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V3(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V3(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V3(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V3(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2 ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V3(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_3(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) Next col Next I

  • 55

    Form frmCalTen1 () I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) Lux_Av1(I, col) = Lux_1(I, col) + Lux_2(I, col) + Lux_3(I, col) Lux_Av1(I, col) = Round((Lux_Av1(I, col)), 0) Next col Next I ElseIf txtLampPerColumn.Text = "2" Then I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh

  • 56

    Form frmCalTen1 () txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = "" angH_P = K angV_P = V I_P = Val(strCheck2(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh

  • 57

    Form frmCalTen1 () txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop txtMinus_2.Text = "" angH_M = K angV_M = V I_M = Val(strCheck4(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh

  • 58

    Form frmCalTen1 () txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = "" angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh

  • 59

    Form frmCalTen1 () txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = "" angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V1(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V1(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2 ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V1(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_1(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) MSFlexGrid1.Text = Round((Lux_1(I, col)), 0) Next col Next I

  • 60

    Form frmCalTen1 () I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = "" angH_P = K angV_P = V I_P = Val(strCheck2(I, col))

  • 61

    Form frmCalTen1 () K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop ' H_V 2 txtMinus_2.Text = "" angH_M = K angV_M = V I_M = Val(strCheck4(I, col))

  • 62

    Form frmCalTen1 () K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = "" angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col))

  • 63

    Form frmCalTen1 () K = "" V = 0 K = Round((AngH_V2(I, col, 1)), 0) V = Round((AngH_V2(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = ""

  • 64

    Form frmCalTen1 () angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V2(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V2(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V2(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V2(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2 ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V2(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_2(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) Next col Next I I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) Lux_Av1(I, col) = Lux_1(I, col) + Lux_2(I, col) + Lux_3(I, col) Lux_Av1(I, col) = Round((Lux_Av1(I, col)), 0) Next col Next I

  • 65

    Form frmCalTen1 () I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Do While strCheck1(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc2.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc2.Refresh txtPlus_1.DataField = "horizontal" strCheck1(I, col) = txtPlus_1.Text Loop txtPlus_1.Text = "" Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Do While strCheck2(I, col) = "" V2 = V + 1 V = V2 Adodc3.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc3.Refresh txtPlus_2.DataField = "H" & K strCheck2(I, col) = txtPlus_2.Text Loop txtPlus_2.Text = ""

  • 66

    Form frmCalTen1 () angH_P = K angV_P = V I_P = Val(strCheck2(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Do While strCheck3(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc4.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc4.Refresh txtMinus_1.DataField = "horizontal" strCheck3(I, col) = txtMinus_1.Text Loop txtMinus_1.Text = "" Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Do While strCheck4(I, col) = "" V2 = V - 1 V = V2 Adodc5.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc5.Refresh txtMinus_2.DataField = "H" & K strCheck4(I, col) = txtMinus_2.Text Loop txtMinus_2.Text = "" .

  • 67

    Form frmCalTen1 () angH_M = K angV_M = V I_M = Val(strCheck4(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Do While strCheck5(I, col) = "" K2 = Val(K) K2 = K2 - 1 K = K2 Adodc6.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc6.Refresh txtMP_1.DataField = "horizontal" strCheck5(I, col) = txtMP_1.Text Loop txtMP_1.Text = "" Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Do While strCheck6(I, col) = "" V2 = V + 1 V = V2 Adodc7.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc7.Refresh txtMP_2.DataField = "H" & K strCheck6(I, col) = txtMP_2.Text Loop txtMP_2.Text = ""

  • 68

    Form frmCalTen1 () angH_MP = K angV_MP = V I_MP = Val(strCheck6(I, col)) K = "" V = 0 K = Round((AngH_V1(I, col, 1)), 0) V = Round((AngH_V1(I, col, 2)), 0) Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Do While strCheck7(I, col) = "" K2 = Val(K) K2 = K2 + 1 K = K2 Adodc8.RecordSource = "select*From " & connTbl & " where horizontal = " & "'" & K & "'" & ";" Adodc8.Refresh txtPM_1.DataField = "horizontal" strCheck7(I, col) = txtPM_1.Text Loop txtPM_1.Text = "" Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Do While strCheck8(I, col) = "" V2 = V - 1 V = V2 Adodc9.RecordSource = "select H" & K & " From " & connTbl & " where vertical = " & V & ";" Adodc9.Refresh txtPM_2.DataField = "H" & K strCheck8(I, col) = txtPM_2.Text Loop txtPM_2.Text = ""

  • 69

    Form frmCalTen1 () angH_PM = K angV_PM = V I_PM = Val(strCheck8(I, col)) If (I_P = I_M) And (I_M = I_MP) And (I_MP = I_PM) Then I_HV = I_P ElseIf (I_P = I_PM) And (I_M = I_MP) Then I_HV = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M ElseIf (I_P I_M) And (I_M I_MP) And (I_MP I_PM) And (I_P I_MP) And (I_M I_PM) And (I_P I_PM) Then InterPulate1 = (((AngH_V1(I, col, 1) - angH_MP) / (angH_P - angH_MP)) * (I_P - I_MP)) + I_MP InterPulate2 = (((AngH_V1(I, col, 1) - angH_M) / (angH_PM - angH_M)) * (I_PM - I_M)) + I_M I_HV = (((AngH_V1(I, col, 2) - angV_M) / (angV_MP - angV_M)) * (InterPulate1 - InterPulate2)) + InterPulate2 ElseIf (I_P = I_MP) And (I_M = I_PM) Then I_HV = (((AngH_V1(I, col, 2) - angV_PM) / (angV_P - angV_PM)) * (I_P - I_PM)) + I_PM End If Lux_1(I, col) = (I_HV * Lamp_H) / (calDist(I, col) * calDist(I, col) * calDist(I, col)) Next col Next I I = 0 col = 0 For I = 1 To (C2 - 1) For col = 1 To (C1 - 1) Lux_Av1(I, col) = Lux_1(I, col) + Lux_2(I, col) + Lux_3(I, col) Lux_Av1(I, col) = Round((Lux_Av1(I, col)), 0) Next col Next I Else MsgBox "!", vbExclamation + vbOKOnly, ">>" End If Dim A As Single Dim B As Single Dim E_Max As Single Dim E_Min As Single E_Ave = 0 E_Max = 0 E_Min = 10000

  • 70

    Form frmCalTen1 () I = 0 col = 0 For I = 1 To (C2 - 1) MSFlexGrid1.Row = I For col = 1 To (C1 - 1) MSFlexGrid1.col = col A = C2 - I B = C1 - col Lux_Tot(I, col) = Lux_Av1(I, col) + Lux_Av1(I, B) + Lux_Av1(A, col) + Lux_Av1(A, B) If E_Max > Lux_Tot(I, col) Then E_Max = E_Max ElseIf E_Max < Lux_Tot(I, col) Then E_Max = Lux_Tot(I, col) Else End If If E_Min < Lux_Tot(I, col) Then E_Min = E_Min ElseIf E_Min > Lux_Tot(I, col) Then E_Min = Lux_Tot(I, col) Else End If MSFlexGrid1.Text = Lux_Tot(I, col) sum = sum + Lux_Tot(I, col) Next col Next I E_Ave = (sum) / ((C2 - 1) * (C1 - 1)) sum = 0 txtEave.Text = Round((E_Ave), 0) txtEmax.Text = E_Max txtEmin.Text = E_Min txtAvePerMin.Text = Round((E_Ave / E_Min), 1) End Sub

  • 71

    Form frmCalTen1 () --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdExit_Click() Dim response As Variant response = MsgBox("?", vbQuestion + vbYesNo, " >>") If response = vbYes Then End End If End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdGraph1_Click() Dim I As Integer Dim Row As Integer Dim col As Single Dim Graph_Ten As Single MSChart1.Visible = True MSChart1.chartType = VtChChartType3dBar MSChart1.RowCount = C2 - 1 MSChart1.ColumnCount = C1 - 1 For I = 1 To (C2 - 1) MSChart1.RowCount = I For col = 1 To (C1 - 1) MSChart1.ColumnCount = col Graph_Ten = Lux_Tot(I, col) MSChart1.Data = Graph_Ten Next col Next I End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub cmdReturn_Click() Dim response As Variant response = MsgBox("Do you want to return?", vbQuestion + vbYesNo, " >>") If response = vbYes Then Unload Me End If End Sub ---------------------------------------------------------------------------------------------------------------------------------------

  • 72

    Form frmCalTen1 () --------------------------------------------------------------------------------------------------------------------------------------- Private Sub DataCombo1_Click(Area As Integer) connTbl = DataCombo1.Text End Sub --------------------------------------------------------------------------------------------------------------------------------------- Private Sub Form_Load() Adodc1.Visible = False Dim cmd As ADODB.Command For Each cmd In DataEnvironment1.Commands List1.AddItem cmd.Name Next Dim W As Single, L As Single, H1 As Single, H2 As Single Dim col As Single, Row As Single, R As Single txtWidth.Text = (frmSubTen2.Label15.Caption) + 3.5 + 3.5 txtLong.Text = (frmSubTen2.Label16.Caption) + 6 + 6 W = txtWidth L = txtLong H1 = W / 4 H2 = L / 8 If H1 >= H2 Then LampHigh = H1 Else: LampHigh = H2 End If txtLamphigh2.Text = LampHigh C1 = (L