Graphicswindow Graphicswindow: Height Width
Graphicswindow Graphicswindow: Height Width
Graphicswindow Graphicswindow: Height Width
Aspilan
AE – 713 Basic Programming
mainmenu()
GraphicsWindow.Height = 500
GraphicsWindow.Width = 600
Sub mainmenu
GraphicsWindow.Height = 1200
GraphicsWindow.Width = 600
GraphicsWindow.Show()
GraphicsWindow.Title = "Channel Design Calculation"
Controls.ButtonClicked = whichbutton
butCancel = Controls.AddButton("Cancel",350,350)
Controls.ButtonClicked= anybutton
EndSub
Sub anybutton
linker= Controls.LastClickedButton
Sub trapezoidalanalysis
GraphicsWindow.Clear()
GraphicsWindow.BrushColor = "Dark"
GraphicsWindow.DrawText(25, 25,"Side Slopes")
GraphicsWindow.DrawText(50, 45,"Z1:")
Z1box = Controls.AddTextBox(75,41)
GraphicsWindow.DrawText(50, 75,"Z2:")
Z2box = Controls.AddTextBox(75,72)
butACalculate = Controls.AddButton("Area",315,125)
CalculationA = Controls.AddMultiLineTextBox(315, 150)
Controls.SetSize(CalculationA,150,25)
butVCalculate = Controls.AddButton("Velocity",315,240)
CalculationV = Controls.AddMultiLineTextBox(315, 265)
Controls.SetSize(CalculationV,250,25)
butQCalculate = Controls.AddButton("Discharge",315,295)
CalculationQ = Controls.AddMultiLineTextBox(315, 320)
Controls.SetSize(CalculationQ,250,25)
butTetaCalculate = Controls.AddButton("Angle",315,350)
CalculationTeta = Controls.AddMultiLineTextBox(315, 375)
Controls.SetSize(CalculationTeta,250,25)
Controls.ButtonClicked= whichbutton
EndSub
Sub whichbutton
button = Controls.LastClickedButton
Z1 = Controls.GetTextBoxText(Z1box)
Z2 = Controls.GetTextBoxText(Z2box)
Y = Controls.GetTextBoxText(Ybox)
b = Controls.GetTextBoxText(bbox)
n = Controls.GetTextBoxText(nbox)
S = Controls.GetTextBoxText(sbox)
P = b + Y * ((Math.SquareRoot(1 + Math.Power(Z1,2))) +
(Math.SquareRoot(1 + Math.Power(Z2,2))))
T = b + Y * (Z1 + Z2)
A = Y/2 * (b + T)
R = A/P
V = ((Math.Power(R,2/3)) * (Math.Power(S,1/2)))/n
Q = V*A
Teta = (S*180)/Math.Pi
F = V * Math.SquareRoot((T/(Q*A *Math.Cos(Teta))))
EndIf
EndSub
Sub rectangularbutton
linkerR= Controls.LastClickedButton
EndIf
EndSub
Sub rectangularanalysis
GraphicsWindow.Clear()
GraphicsWindow.BrushColor = "Dark"
butRVCalculate = Controls.AddButton("Velocity",315,250)
CalculationRV = Controls.AddMultiLineTextBox(315, 275)
Controls.SetSize(CalculationRV,250,25)
butRVCalculate = Controls.AddButton("Discharge",315,325)
CalculationRV = Controls.AddMultiLineTextBox(315, 350)
Controls.SetSize(CalculationRV,250,25)
Controls.ButtonClicked= rectangularwhichbutton
EndSub
Sub rectangularwhichbutton
Rbutton = Controls.LastClickedButton
RY = Controls.GetTextBoxText(RYbox)
Rb = Controls.GetTextBoxText(Rbbox)
Rn = Controls.GetTextBoxText(Rnbox)
RS = Controls.GetTextBoxText(RSbox)
A = (RY) * (Rb)
P = (2*RY) + Rb
R = A/P
EndIf
EndSub