Sidebuttonsquare
This commit is contained in:
parent
2f2435e66a
commit
e8918a1310
|
|
@ -2,8 +2,8 @@
|
|||
Imports Excel = Microsoft.Office.Interop.Excel
|
||||
|
||||
Public Class GUI
|
||||
Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
||||
'Public Shared filepath As String = "C:\Users\xperd\Documents"
|
||||
'Public Shared filepath As String = "C:\Users\Anton\Documents\Exjobb"
|
||||
Public Shared filepath As String = "C:\Users\xperd\Documents"
|
||||
|
||||
Dim excelApp As Excel.Application = New Excel.Application
|
||||
Dim excelWB As Excel.Workbook
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
|
||||
Public Shared pointsMeasurements As New Dictionary(Of String, Integer())
|
||||
|
||||
Private Shared sideSquareValues As Integer() = {0, 0, 0}
|
||||
|
||||
Public Shared Sub AngleButton(sender As Object, e As EventArgs)
|
||||
GUI.Controls("AngleButton").Enabled = False
|
||||
GUI.Controls("Button_Square").Enabled = False
|
||||
|
|
@ -78,7 +80,7 @@
|
|||
|
||||
' Add option for corner or side
|
||||
|
||||
squareSideFunctionActive = True
|
||||
'squareSideFunctionActive = True
|
||||
End Sub
|
||||
|
||||
Private Shared Sub FunctionText_KeyPress(sender As Object, e As KeyPressEventArgs)
|
||||
|
|
@ -141,20 +143,19 @@
|
|||
|
||||
|
||||
Private Shared Sub FunctionTextSide_Changed(sender As TextBox, e As EventArgs)
|
||||
Dim value1, value2, value3 As Integer
|
||||
Try
|
||||
value1 = CInt(GUI.Controls("X_TextBox").Text)
|
||||
value2 = CInt(GUI.Controls("Y_TextBox").Text)
|
||||
value3 = CInt(GUI.Controls("Off_TextBox").Text)
|
||||
sideSquareValues(0) = CInt(GUI.Controls("X_TextBox").Text)
|
||||
sideSquareValues(1) = CInt(GUI.Controls("Y_TextBox").Text)
|
||||
sideSquareValues(2) = CInt(GUI.Controls("Off_TextBox").Text)
|
||||
Catch ex As Exception
|
||||
value1 = 0
|
||||
value2 = 0
|
||||
value3 = 0
|
||||
sideSquareValues(0) = 0
|
||||
sideSquareValues(1) = 0
|
||||
sideSquareValues(2) = 0
|
||||
End Try
|
||||
|
||||
If value1 > 0 AndAlso value2 > 0 AndAlso value3 > 0 Then
|
||||
If sideSquareValues(0) > 0 AndAlso sideSquareValues(1) > 0 AndAlso sideSquareValues(2) > 0 Then
|
||||
If GUI.DrawingPanel.Controls.Count = 2 Then
|
||||
For i = 1 To 4 ' Kommer behöva fungera generiskt
|
||||
For i = 1 To 4
|
||||
Dim sidePoints As New List(Of String)
|
||||
If i = 1 Then
|
||||
For j = 0 To GUI_Drawing_Panel.pointsOrder.Count - 1
|
||||
|
|
@ -163,9 +164,9 @@
|
|||
End If
|
||||
Next
|
||||
For j = 1 To sidePoints.Count / 2
|
||||
Create_SideButton(value1 / (GUI_Drawing_Panel.scaleDiff), 30,
|
||||
GUI_Drawing_Panel.pCon1(0) + value3 / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1) - 30 / 2, "Button_" & i & j)
|
||||
Create_SideButton(sideSquareValues(0) / (GUI_Drawing_Panel.scaleDiff), 30,
|
||||
GUI_Drawing_Panel.pCon1(0) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1) - 30 / 2, "Button_" & i & "_" & j)
|
||||
Next
|
||||
|
||||
ElseIf i = 2 Then
|
||||
|
|
@ -175,9 +176,9 @@
|
|||
End If
|
||||
Next
|
||||
For j = 1 To sidePoints.Count / 2
|
||||
Create_SideButton(30, value2 / (GUI_Drawing_Panel.scaleDiff),
|
||||
Create_SideButton(30, sideSquareValues(1) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon2(0) - 30 / 2,
|
||||
GUI_Drawing_Panel.pCon1(1) + value3 / (GUI_Drawing_Panel.scaleDiff), "Button_" & i & j)
|
||||
GUI_Drawing_Panel.pCon1(1) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff), "Button_" & i & "_" & j)
|
||||
Next
|
||||
|
||||
ElseIf i = 3 Then
|
||||
|
|
@ -187,9 +188,9 @@
|
|||
End If
|
||||
Next
|
||||
For j = 1 To sidePoints.Count / 2
|
||||
Create_SideButton(value1 / (GUI_Drawing_Panel.scaleDiff), 30,
|
||||
GUI_Drawing_Panel.pCon1(0) + value3 / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon3(1) - 30 / 2, "Button_" & i & j)
|
||||
Create_SideButton(sideSquareValues(0) / (GUI_Drawing_Panel.scaleDiff), 30,
|
||||
GUI_Drawing_Panel.pCon1(0) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon3(1) - 30 / 2, "Button_" & i & "_" & j)
|
||||
Next
|
||||
|
||||
Else
|
||||
|
|
@ -201,9 +202,9 @@
|
|||
sidePoints.Add(GUI_Drawing_Panel.pointsOrder(0))
|
||||
|
||||
For j = 1 To sidePoints.Count / 2
|
||||
Create_SideButton(30, value2 / (GUI_Drawing_Panel.scaleDiff),
|
||||
Create_SideButton(30, sideSquareValues(1) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(0) - 30 / 2,
|
||||
GUI_Drawing_Panel.pCon1(1) + value3 / (GUI_Drawing_Panel.scaleDiff), "Button_" & i & j)
|
||||
GUI_Drawing_Panel.pCon1(1) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff), "Button_" & i & "_" & j)
|
||||
Next
|
||||
|
||||
End If
|
||||
|
|
@ -212,17 +213,26 @@
|
|||
pointCounter = pointCounter + 1
|
||||
|
||||
Else
|
||||
|
||||
'flytta knapparna/ändra storlek
|
||||
For i = 2 To GUI.DrawingPanel.Controls.Count - 1
|
||||
Dim buttonSide As Integer = CInt(GUI.DrawingPanel.Controls(i).Name.Split("_")(1).Split("_")(0))
|
||||
If buttonSide = 1 OrElse buttonSide = 3 Then
|
||||
GUI.DrawingPanel.Controls(i).Width = sideSquareValues(0) / (GUI_Drawing_Panel.scaleDiff)
|
||||
GUI.DrawingPanel.Controls(i).Left = GUI_Drawing_Panel.pCon1(0) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff)
|
||||
Else
|
||||
GUI.DrawingPanel.Controls(i).Height = sideSquareValues(1) / (GUI_Drawing_Panel.scaleDiff)
|
||||
GUI.DrawingPanel.Controls(i).Top = GUI_Drawing_Panel.pCon1(1) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff)
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
ElseIf GUI.DrawingPanel.Controls.Count > 2 Then
|
||||
' FIXA HUR DESSA KNAPPAR TAS BORT
|
||||
For i = 0 To GUI_Drawing_Panel.pointsOrder.Count - 1
|
||||
If pointsFunc(GUI_Drawing_Panel.pointsOrder(i)) Then
|
||||
RemoveHandler GUI.DrawingPanel.Controls(GUI_Drawing_Panel.pointsOrder(i) & "_Button").Click,
|
||||
AddressOf PointButton_Click
|
||||
GUI.DrawingPanel.Controls.RemoveByKey(GUI_Drawing_Panel.pointsOrder(i) & "_Button")
|
||||
End If
|
||||
For i = 2 To GUI.DrawingPanel.Controls.Count - 1
|
||||
RemoveHandler GUI.DrawingPanel.Controls(2).Click, AddressOf SideButton_Click
|
||||
GUI.DrawingPanel.Controls.RemoveAt(2)
|
||||
Next
|
||||
|
||||
pointCounter = pointCounter - 1
|
||||
|
|
@ -230,29 +240,259 @@
|
|||
End Sub
|
||||
|
||||
Private Shared Sub Create_SideButton(bWidth As Integer, bHeight As Integer, bLeft As Integer, bTop As Integer, bName As String)
|
||||
Dim pointButton As New Button
|
||||
Dim sideButton As New Button
|
||||
|
||||
pointButton.Width = bWidth
|
||||
pointButton.Height = bHeight
|
||||
sideButton.Width = bWidth
|
||||
sideButton.Height = bHeight
|
||||
|
||||
pointButton.Left = bLeft
|
||||
pointButton.Top = bTop
|
||||
sideButton.Left = bLeft
|
||||
sideButton.Top = bTop
|
||||
|
||||
pointButton.Name = bName
|
||||
pointButton.Text = ""
|
||||
sideButton.Name = bName
|
||||
sideButton.Text = ""
|
||||
|
||||
pointButton.BackColor = Color.FromArgb(50, Color.Red)
|
||||
pointButton.FlatStyle = FlatStyle.Flat
|
||||
pointButton.FlatAppearance.BorderSize = 0
|
||||
pointButton.FlatAppearance.MouseOverBackColor = Color.Red
|
||||
pointButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
|
||||
sideButton.BackColor = Color.FromArgb(50, Color.Red)
|
||||
sideButton.FlatStyle = FlatStyle.Flat
|
||||
sideButton.FlatAppearance.BorderSize = 0
|
||||
sideButton.FlatAppearance.MouseOverBackColor = Color.Red
|
||||
sideButton.FlatAppearance.MouseDownBackColor = Color.DarkRed
|
||||
|
||||
GUI.DrawingPanel.Controls.Add(pointButton)
|
||||
GUI.DrawingPanel.Controls.Add(sideButton)
|
||||
|
||||
AddHandler pointButton.Click, AddressOf PointButton_Click
|
||||
AddHandler sideButton.Click, AddressOf SideButton_Click
|
||||
End Sub
|
||||
|
||||
' --- When a function button is pressed ---
|
||||
|
||||
' --- When a side function button is pressed ---
|
||||
Private Shared Sub SideButton_Click(sender As Button, e As EventArgs)
|
||||
'Determine which side is being pressed
|
||||
Dim sidePressed As Integer = CInt(sender.Name.Split("_")(1))
|
||||
Dim sideButtonPressed As Integer = CInt(sender.Name.Split("_")(2))
|
||||
|
||||
' Remove point buttons
|
||||
For i = 2 To GUI.DrawingPanel.Controls.Count - 1
|
||||
RemoveHandler GUI.DrawingPanel.Controls(2).Click, AddressOf SideButton_Click
|
||||
GUI.DrawingPanel.Controls.RemoveAt(2)
|
||||
Next
|
||||
|
||||
Dim numOfNewPoints As Integer
|
||||
|
||||
Dim sidePoints As New List(Of String)
|
||||
If sidePressed = 1 Then
|
||||
For j = 0 To GUI_Drawing_Panel.pointsOrder.Count - 1
|
||||
If GUI_Drawing_Panel.points(GUI_Drawing_Panel.pointsOrder(j))(1) = GUI_Drawing_Panel.pCon1(1) Then
|
||||
sidePoints.Add(GUI_Drawing_Panel.pointsOrder(j))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Dim index As Integer = GUI_Drawing_Panel.pointsOrder.IndexOf(sidePoints(sideButtonPressed * 2 - 2))
|
||||
'GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||
|
||||
If sidePressed = 1 Then
|
||||
GUI_Drawing_Panel.points.Add("pSS" & pointCounter * 4 - 3,
|
||||
{GUI_Drawing_Panel.pCon1(0) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1),
|
||||
GUI_Drawing_Panel.pCon1(2) + sideSquareValues(2),
|
||||
GUI_Drawing_Panel.pCon1(3)})
|
||||
GUI_Drawing_Panel.points.Add("pSS" & pointCounter * 4 - 2,
|
||||
{GUI_Drawing_Panel.pCon1(0) + sideSquareValues(2) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1) + sideSquareValues(1) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(2) + sideSquareValues(2),
|
||||
GUI_Drawing_Panel.pCon1(3) + sideSquareValues(1)})
|
||||
GUI_Drawing_Panel.points.Add("pSS" & pointCounter * 4 - 1,
|
||||
{GUI_Drawing_Panel.pCon1(0) + (sideSquareValues(2) + sideSquareValues(0)) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1) + sideSquareValues(1) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(2) + sideSquareValues(2) + sideSquareValues(0),
|
||||
GUI_Drawing_Panel.pCon1(3) + sideSquareValues(1)})
|
||||
GUI_Drawing_Panel.points.Add("pSS" & pointCounter * 4,
|
||||
{GUI_Drawing_Panel.pCon1(0) + (sideSquareValues(2) + sideSquareValues(0)) / (GUI_Drawing_Panel.scaleDiff),
|
||||
GUI_Drawing_Panel.pCon1(1),
|
||||
GUI_Drawing_Panel.pCon1(2) + sideSquareValues(2) + sideSquareValues(0),
|
||||
GUI_Drawing_Panel.pCon1(3)})
|
||||
End If
|
||||
|
||||
pointsFunc.Add("pSS" & pointCounter * 4 - 3, True)
|
||||
pointsFunc.Add("pSS" & pointCounter * 4 - 2, False)
|
||||
pointsFunc.Add("pSS" & pointCounter * 4 - 1, False)
|
||||
pointsFunc.Add("pSS" & pointCounter * 4, True)
|
||||
|
||||
'Insert four new points
|
||||
GUI_Drawing_Panel.pointsOrder.Insert(index + 1, "pSS" & pointCounter * 4 - 3)
|
||||
GUI_Drawing_Panel.pointsOrder.Insert(index + 2, "pSS" & pointCounter * 4 - 2)
|
||||
GUI_Drawing_Panel.pointsOrder.Insert(index + 3, "pSS" & pointCounter * 4 - 1)
|
||||
GUI_Drawing_Panel.pointsOrder.Insert(index + 4, "pSS" & pointCounter * 4)
|
||||
|
||||
numOfNewPoints = 4
|
||||
|
||||
'Redraw grating
|
||||
GUI.DrawingPanel.Refresh()
|
||||
|
||||
RemoveHandler GUI.Controls("X_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
|
||||
RemoveHandler GUI.Controls("X_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
GUI.Controls.RemoveByKey("X_TextBox")
|
||||
|
||||
RemoveHandler GUI.Controls("Y_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
|
||||
RemoveHandler GUI.Controls("Y_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
GUI.Controls.RemoveByKey("Y_TextBox")
|
||||
|
||||
RemoveHandler GUI.Controls("Off_TextBox").TextChanged, AddressOf FunctionTextSide_Changed
|
||||
RemoveHandler GUI.Controls("Off_TextBox").KeyPress, AddressOf FunctionText_KeyPress
|
||||
GUI.Controls.RemoveByKey("Off_TextBox")
|
||||
|
||||
GUI.Controls.RemoveByKey("X_Label")
|
||||
GUI.Controls.RemoveByKey("Y_Label")
|
||||
GUI.Controls.RemoveByKey("Off_Label")
|
||||
|
||||
GUI.Controls("AngleButton").Enabled = True
|
||||
GUI.Controls("Button_Square").Enabled = True
|
||||
GUI.Controls("Button_SquareSide").Enabled = True
|
||||
|
||||
'For i = 2 To pointsMeasurements.Count - 1
|
||||
' Dim mesName As String = pointsMeasurements.Keys(i)
|
||||
' If Index + 1 = pointsMeasurements(mesName)(0) Then
|
||||
' If GUI_Drawing_Panel.measureLabels(mesName)(3) = 1 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(1) = GUI_Drawing_Panel.measureLabels(mesName)(1) + d1P / 2
|
||||
' ElseIf GUI_Drawing_Panel.measureLabels(mesName)(3) = 2 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(2) = GUI_Drawing_Panel.measureLabels(mesName)(2) + d2P / 2
|
||||
' ElseIf GUI_Drawing_Panel.measureLabels(mesName)(3) = 3 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(1) = GUI_Drawing_Panel.measureLabels(mesName)(1) - d1P / 2
|
||||
' Else
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(2) = GUI_Drawing_Panel.measureLabels(mesName)(2) - d2P / 2
|
||||
' End If
|
||||
' ElseIf Index + 1 = pointsMeasurements(mesName)(1) Then
|
||||
' If GUI_Drawing_Panel.measureLabels(mesName)(3) = 1 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(2) = GUI_Drawing_Panel.measureLabels(mesName)(2) + d2P / 2
|
||||
' ElseIf GUI_Drawing_Panel.measureLabels(mesName)(3) = 2 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(1) = GUI_Drawing_Panel.measureLabels(mesName)(1) - d1P / 2
|
||||
' ElseIf GUI_Drawing_Panel.measureLabels(mesName)(3) = 3 Then
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("Y_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(2) = GUI_Drawing_Panel.measureLabels(mesName)(2) - d2P / 2
|
||||
' Else
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(0) = GUI_Drawing_Panel.measureLabels(mesName)(0) - GUI.Controls("X_TextBox").Text
|
||||
' GUI_Drawing_Panel.measureLabels(mesName)(1) = GUI_Drawing_Panel.measureLabels(mesName)(1) + d1P / 2
|
||||
' End If
|
||||
' End If
|
||||
'Next
|
||||
|
||||
|
||||
'Dim mesNum As Integer = pointsMeasurements.Count - 1
|
||||
'For i = 2 To pointsMeasurements.Count - 1
|
||||
' Dim mesName As String = pointsMeasurements.Keys(i)
|
||||
' If Index + 1 < pointsMeasurements(mesName)(0) Then
|
||||
' pointsMeasurements(mesName)(0) = pointsMeasurements(mesName)(0) + 1
|
||||
' pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 1
|
||||
' ElseIf Index + 1 = pointsMeasurements(mesName)(0) OrElse Index + 1 = pointsMeasurements(mesName)(1) Then
|
||||
' pointsMeasurements(mesName)(1) = pointsMeasurements(mesName)(1) + 1
|
||||
' End If
|
||||
' Next
|
||||
|
||||
'If pXP < GUI_Drawing_Panel.containerMidX Then
|
||||
' If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||
' 'Kvadrant 4
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
||||
|
||||
' 'Recess measuements
|
||||
' pointsMeasurements.Add("A_" & mesNum, {Index + 1, Index + 2, 3})
|
||||
' pointsMeasurements.Add("A_" & mesNum + 1, {Index + 1, Index + 2, 4})
|
||||
|
||||
' 'Panel recess measurements
|
||||
' GUI_Drawing_Panel.anglePoints.Add("A" & pointCounter * 2 - 1, {pXP + d1P, pYP - d2P})
|
||||
' GUI_Drawing_Panel.anglePointsComp.Add("A" & pointCounter * 2 - 1, {"pA" & pointCounter * 2 - 1, "pA" & pointCounter * 2})
|
||||
|
||||
' 'Label
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXP + d1P + 3,
|
||||
' pYP - d2P / 2 - 4, 4})
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXP + d1P / 2 - 8,
|
||||
' pYP - d2P - 12 - 3, 4})
|
||||
' Else
|
||||
' 'Kvadrant 1
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP + d1P, pYP, pXSW + d1SW, pYSW})
|
||||
|
||||
' 'Outer measuements
|
||||
' pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
||||
' pointsMeasurements("Wmes")(0) = pointsMeasurements("Wmes")(0) + 1
|
||||
' pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||
|
||||
' 'SW Recess measuements
|
||||
' pointsMeasurements.Add("A_" & mesNum, {Index + 1, Index + 2, 1})
|
||||
' pointsMeasurements.Add("A_" & mesNum + 1, {Index + 1, Index + 2, 4})
|
||||
|
||||
' 'Panel recess measurements
|
||||
' GUI_Drawing_Panel.anglePoints.Add("A" & pointCounter * 2 - 1, {pXP + d1P, pYP + d2P})
|
||||
' GUI_Drawing_Panel.anglePointsComp.Add("A" & pointCounter * 2 - 1, {"pA" & pointCounter * 2 - 1, "pA" & pointCounter * 2})
|
||||
|
||||
' 'Label
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXP + d1P / 2 - 8,
|
||||
' pYP + d2P + 3, 1})
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXP + d1P + 3,
|
||||
' pYP + d2P / 2 - 4, 1})
|
||||
' End If
|
||||
' Else
|
||||
' If pYP > GUI_Drawing_Panel.containerMidY Then
|
||||
' 'Kvadrant 3
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP, pYP - d2P, pXSW, pYSW + d2SW})
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||
|
||||
' pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||
|
||||
' 'Recess measuements
|
||||
' pointsMeasurements.Add("A_" & mesNum, {Index + 1, Index + 2, 2})
|
||||
' pointsMeasurements.Add("A_" & mesNum + 1, {Index + 1, Index + 2, 3})
|
||||
|
||||
' 'Panel recess measurements
|
||||
' GUI_Drawing_Panel.anglePoints.Add("A" & pointCounter * 2 - 1, {pXP - d1P, pYP - d2P})
|
||||
' GUI_Drawing_Panel.anglePointsComp.Add("A" & pointCounter * 2 - 1, {"pA" & pointCounter * 2 - 1, "pA" & pointCounter * 2})
|
||||
|
||||
' 'Label
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("X_TextBox").Text), pXP - d1P / 2 - 8,
|
||||
' pYP - d2P - 12 - 3, 3})
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("Y_TextBox").Text), pXP - d1P - 18 - 3,
|
||||
' pYP - d2P / 2 - 4, 3})
|
||||
' Else
|
||||
' 'Kvadrant 2
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2 - 1, {pXP - d1P, pYP, pXSW - d1SW, pYSW})
|
||||
' GUI_Drawing_Panel.points.Add("pA" & pointCounter * 2, {pXP, pYP + d2P, pXSW, pYSW - d2SW})
|
||||
|
||||
' pointsMeasurements("Lmes")(1) = pointsMeasurements("Lmes")(1) + 1
|
||||
' pointsMeasurements("Wmes")(1) = pointsMeasurements("Wmes")(1) + 1
|
||||
|
||||
' 'Recess measuements
|
||||
' pointsMeasurements.Add("A_" & mesNum, {Index + 1, Index + 2, 1})
|
||||
' pointsMeasurements.Add("A_" & mesNum + 1, {Index + 1, Index + 2, 2})
|
||||
|
||||
' 'Panel recess measurements
|
||||
' GUI_Drawing_Panel.anglePoints.Add("A" & pointCounter * 2 - 1, {pXP - d1P, pYP + d2P})
|
||||
' GUI_Drawing_Panel.anglePointsComp.Add("A" & pointCounter * 2 - 1, {"pA" & pointCounter * 2 - 1, "pA" & pointCounter * 2})
|
||||
|
||||
' 'Label
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum, {CInt(GUI.Controls("Y_TextBox").Text), pXP - d1P - 18 - 3,
|
||||
' pYP + d2P / 2 - 4, 2})
|
||||
' GUI_Drawing_Panel.measureLabels.Add("A_" & mesNum + 1, {CInt(GUI.Controls("X_TextBox").Text), pXP - d1P / 2 - 8,
|
||||
' pYP + d2P + 3, 2})
|
||||
' End If
|
||||
' End If
|
||||
' pointsFunc.Add("pA" & pointCounter * 2 - 1, False)
|
||||
' pointsFunc.Add("pA" & pointCounter * 2, False)
|
||||
|
||||
' 'Insert two new points
|
||||
' GUI_Drawing_Panel.pointsOrder.Insert(Index + 1, "pA" & pointCounter * 2 - 1)
|
||||
' GUI_Drawing_Panel.pointsOrder.Insert(Index + 2, "pA" & pointCounter * 2)
|
||||
|
||||
' numOfNewPoints = 2
|
||||
' angleFunctionActive = False
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
' --- When a corner function button is pressed ---
|
||||
Private Shared Sub PointButton_Click(sender As Button, e As EventArgs)
|
||||
'Determine which point is being pressed
|
||||
Dim pointPressed As String = sender.Name.Split("_")(0)
|
||||
|
|
@ -545,6 +785,7 @@
|
|||
|
||||
GUI.Controls("AngleButton").Enabled = True
|
||||
GUI.Controls("Button_Square").Enabled = True
|
||||
GUI.Controls("Button_SquareSide").Enabled = True
|
||||
End Sub
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue