Skip to content

Commit

Permalink
Cleanup the macros and fix the error that made them not work
Browse files Browse the repository at this point in the history
  • Loading branch information
corbinstreehouse committed Apr 14, 2023
1 parent fdbf1e7 commit f67a790
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Profiles/AvidCNC/Macros/load_modules.mcs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ local inst = mc.mcGetInstance("load_modules.mcs")

local installPath = mc.mcCntlGetMachDir(inst)
package.path = string.format(
"%s;%s\\Modules\\?.lua;%s\\Modules\\AvidCNC\\?.luac;./Modules/CorbinsWorkshop/?.lua;",
"%s;%s\\Modules\\?.lua;%s\\Modules\\AvidCNC\\?.luac;%s\\Modules\\CorbinsWorkshop\\?.lua;",
package.path,
installPath,
installPath,
installPath
)

Expand Down
12 changes: 8 additions & 4 deletions Profiles/AvidCNC/Macros/m3.mcs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
-- Custom spindle control for HITECO ATC
-- Starting process
-- Custom spindle start control for HITECO ATC (or any other ATC spindle)
-- by corbin dunn
-- provided as-is! No warranty that it will work for you.

-- for debugging! Not needed under normal module load
-- package.path = package.path .. ";./Modules/CorbinsWorkshop/?.lua"

if CWUtilities == nil then
CWUtilities = require "CWUtilities"
Expand All @@ -26,7 +30,7 @@ function m3()
local dir = mc.mcSpindleGetDirection(inst)
-- only do something if it isn't running..or else we have to stop and change the dirction
if dir == mc.MC_SPINDLE_OFF then
if CWUtilities.UseCasePressurization() then
if CWUtilities.GetShouldUseCasePressurization() then
CWUtilities.SetAirPressure(1)
end

Expand Down Expand Up @@ -65,7 +69,7 @@ end

-- testing
if (mc.mcInEditor() == 1) then
--m3()
m3()

end

2 changes: 1 addition & 1 deletion Profiles/AvidCNC/Macros/m5.mcs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function m5()
-- save the time we turned off the spindle
ToolChange.lastSpindleStopTime = os.clock()

if CWUtilities.UseCasePressurization() then
if CWUtilities.GetShouldUseCasePressurization() then
CWUtilities.SetAirPressure(0)
end
end
Expand Down

0 comments on commit f67a790

Please sign in to comment.