Skip to content

Adding option to run the test from right to left #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions ExtrusionTestCode.vba
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Function writeLine(writeString As String)
End Function

Sub GenerateGCode()
Dim direction As Integer
Dim direction, xdirection, startColIndex, endColIndex, steps As Integer
Dim bedWidth, bedLength, bedMargin, filamentDiameter, primeLength, primeAmount, primeSpeed, retractionDistance, retractionSpeed, xSpacing, ySpacing, startFlow, flowOffset, flowSteps, endFlow, startTemp, tempOffset, tempSteps, movementSpeed, stabilizationTime, wipeLength, blobHeight, extrusionAmount, extrusionSpeed, fanSpeed, bedTemp, bedLengthSave As Double

currentOutputLine = 1
Expand All @@ -32,19 +32,20 @@ retractionSpeed = Worksheets("Settings").Cells(16, 2).Value
blobHeight = Worksheets("Settings").Cells(18, 2).Value
extrusionAmount = Worksheets("Settings").Cells(19, 2).Value

xSpacing = Worksheets("Settings").Cells(22, 2).Value
ySpacing = Worksheets("Settings").Cells(23, 2).Value
xSpacing = Worksheets("Settings").Cells(23, 2).Value
ySpacing = Worksheets("Settings").Cells(24, 2).Value

startFlow = Worksheets("Settings").Cells(27, 2).Value
flowOffset = Worksheets("Settings").Cells(28, 2).Value
flowSteps = Worksheets("Settings").Cells(29, 2).Value
endFlow = Worksheets("Settings").Cells(30, 2).Value
startFlow = Worksheets("Settings").Cells(28, 2).Value
flowOffset = Worksheets("Settings").Cells(29, 2).Value
flowSteps = Worksheets("Settings").Cells(30, 2).Value
endFlow = Worksheets("Settings").Cells(31, 2).Value

startTemp = Worksheets("Settings").Cells(33, 2).Value
tempOffset = Worksheets("Settings").Cells(34, 2).Value
tempSteps = Worksheets("Settings").Cells(35, 2).Value
startTemp = Worksheets("Settings").Cells(34, 2).Value
tempOffset = Worksheets("Settings").Cells(35, 2).Value
tempSteps = Worksheets("Settings").Cells(36, 2).Value

direction = Worksheets("Settings").Cells(21, 2).Value
xdirection = Worksheets("Settings").Cells(22, 2).Value

'Clear output sheet
Sheets("Output").Cells.Clear
Expand Down Expand Up @@ -79,6 +80,7 @@ writeLine ("; startTemp = " & startTemp)
writeLine ("; tempOffset = " & tempOffset)
writeLine ("; tempSteps = " & tempSteps)
writeLine ("; direction = " & direction)
writeLine ("; xdirection = " & xdirection)
writeLine ("")

'Create the output
Expand Down Expand Up @@ -108,8 +110,18 @@ If direction = 1 Then
ySpacing = ySpacing * -1
End If

If xdirection = -1 Then
startColIndex = tempSteps
endColIndex = 1
steps = -1
Else
startColIndex = 1
endColIndex = tempSteps
steps = 1
End If

'DoE column
For c = 1 To tempSteps
For c = startColIndex To endColIndex Step steps
'Check if "Fill Mode" is active
If tempOffset = 0 And c > 1 Then
startFlow = startFlow + flowSteps * flowOffset
Expand Down
Binary file modified FlowTestTool.xlsm
Binary file not shown.