Skip to content
Snippets Groups Projects
Commit 1bf1c43e authored by Mikhail Polikarpov's avatar Mikhail Polikarpov
Browse files

Removed unnecessary return to initial position in the main loop

parent 5715edc1
No related branches found
No related tags found
No related merge requests found
...@@ -324,10 +324,10 @@ Public Class AssemblyTiers3 ...@@ -324,10 +324,10 @@ Public Class AssemblyTiers3
product1 = cRelevantProducts.Item(int_i) product1 = cRelevantProducts.Item(int_i)
'Remember initial position P_i (initPos) 'Remember initial position P_i (initPos)
Dim initPos(11) Dim initPos(11)
If bInitPosRecorded(int_i) = False Then
Dim oPosition1 As Object Dim oPosition1 As Object
oPosition1 = product1.Position oPosition1 = product1.Position
oPosition1.GetComponents(initPos) oPosition1.GetComponents(initPos)
If bInitPosRecorded(int_i) = False Then
Dim ip As Integer Dim ip As Integer
For ip = 0 To 11 For ip = 0 To 11
aInitPos(int_i, ip) = initPos(ip) aInitPos(int_i, ip) = initPos(ip)
...@@ -388,6 +388,7 @@ Public Class AssemblyTiers3 ...@@ -388,6 +388,7 @@ Public Class AssemblyTiers3
moveProduct(product1, int_j, True) moveProduct(product1, int_j, True)
If productReachedFinalPosition(product1, int_i) = True Then If productReachedFinalPosition(product1, int_i) = True Then
bDisassembled(int_i) = True bDisassembled(int_i) = True
disassDir(int_i, int_j) = 1
Debug.Print("Successful disassembly: [" & d1.Item(int_j) & "]") Debug.Print("Successful disassembly: [" & d1.Item(int_j) & "]")
End If End If
If collisionDetected(cClashes, group1, group2) = True Then If collisionDetected(cClashes, group1, group2) = True Then
...@@ -420,10 +421,6 @@ Public Class AssemblyTiers3 ...@@ -420,10 +421,6 @@ Public Class AssemblyTiers3
'as soon as secTier is not the direct higher tier, no reason to move further 'as soon as secTier is not the direct higher tier, no reason to move further
If secTier < intTier - 1 Or (intTier = 1 And secTier = 0) Then If secTier < intTier - 1 Or (intTier = 1 And secTier = 0) Then
disassDir(int_i, int_j) = 0 disassDir(int_i, int_j) = 0
'move product to initial position
Dim oPosition3 As Object
oPosition3 = product1.Position
oPosition3.SetComponents(initPos)
Exit While Exit While
End If End If
'if the disassembly tier is 1 lower (attention: tiers get reversed in the end to the assembly tiers!) 'if the disassembly tier is 1 lower (attention: tiers get reversed in the end to the assembly tiers!)
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment