Hello Guest it is April 19, 2024, 02:31:01 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DazTheGas

31
Mach4 General Discussion / Re: 3d cutting simulator
« on: July 18, 2019, 04:16:47 AM »
Hav`nt tried the sim in a long time but see if this is of any help.

https://www.machsupport.com/forum/index.php?topic=35089.0

DazTheGas

32
Mach4 General Discussion / Re: number of registers
« on: June 18, 2019, 04:14:47 AM »
I have 29 in mine at moment....

DazTheGas

33
Quote
I have no idea where GetXin() comes from.  :(

GetXin() is a function I included with the examples for the Lua version of XBox Controller, so unless you are running the plugin for the controller etc that will not work.

DazTheGas

34
Mach4 General Discussion / Re: Mach4 Timer Script Error
« on: April 25, 2019, 04:11:47 PM »
take another look at your code

Code: [Select]
if timer == 0 then
timer(0)
elseif timer == 1 then
timer(1)

should be
Code: [Select]
if timer == 0 then
timer0()
elseif timer == 1 then
timer1()

your code is looking for a function called timer() and possing a value to it.

DazTheGas

35
Mach4 Videos / Re: Creating an M6 Toolchange in Mach4 (Part 3)
« on: April 15, 2019, 04:34:34 PM »
At the time of creating the M6 Macro the tool table was limited, but as time has progressed so has mach4 and the tool table. You now have the ability to create custom user fields, this makes things much more easier and expandable.

lets say in the tool table you were to create a custom field called m6Height and make this a float value,

instead of using "toollen = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, tool)"  you would use instead "toollen = mc.mcToolGetDataExDbl(inst,   tool,   "m6Height")

Hope that makes sense and what you were looking for...

DazTheGas

36
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 29, 2019, 05:21:20 AM »
You dont have to use a button click event  to initiate wx.wxID_OK,  within wxFB change the id of the button from wx.wxID_ANY to wx.wxID_OK and it will automatically quit the dialog for you and return the appropiate msg, also if you add a close event to the dialog as well as a cancel button you can have this return the wx.ID_CANCEL using the EndModal method and passing back wx.ID_CANCEL this should be the default return for the close but for some reason wxlUA passes back wx.wxID_OK instead??.

Code: [Select]
UI = {}


-- create MyDialog
UI.MyDialog = wx.wxDialog (wx.NULL, wx.wxID_ANY, "", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxDEFAULT_DIALOG_STYLE )
UI.MyDialog:SetSizeHints( wx.wxSize( -1,-1 ), wx.wxSize( -1,-1 ) )

UI.MyDialogSizer = wx.wxBoxSizer( wx.wxVERTICAL )

UI.DataEntry = wx.wxTextCtrl( UI.MyDialog, wx.wxID_ANY, "", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
UI.MyDialogSizer:Add( UI.DataEntry, 0, wx.wxALL, 5 )

UI.m_button9 = wx.wxButton( UI.MyDialog, wx.wxID_OK, "OK", wx.wxDefaultPosition, wx.wxDefaultSize, 0 )
UI.MyDialogSizer:Add( UI.m_button9, 0, wx.wxALL, 5 )


UI.MyDialog:SetSizer( UI.MyDialogSizer )
UI.MyDialog:Layout()
UI.MyDialogSizer:Fit( UI.MyDialog )

UI.MyDialog:Centre( wx.wxBOTH )

UI.MyDialog:Connect( wx.wxEVT_CLOSE_WINDOW, function(event)
UI.MyDialog:EndModal(wx.wxID_CANCEL) --End the dialog and pass back wxID_CANCEL

end )

local rc=UI.MyDialog:ShowModal()
if rc==wx.wxID_OK then wx.wxMessageBox('success') end
if rc==wx.wxID_CANCEL then wx.wxMessageBox('failure')end


DazTheGas

37
Use the sigLib script in the screen load script and activate the estop if input0 is pressed

Code: [Select]
[mc.ISIG_INPUT0] = function (state)
    if (state == 1) then   
        mc.mcCntlEStop(inst)
    end
end,

DazTheGas

38
You can see how its done from this video...

https://www.youtube.com/watch?v=jTzYotLTJkY

DazTheGas

39
Mach4 General Discussion / Re: lua panel and scripting help
« on: January 27, 2019, 09:45:51 AM »
Dialogblocks is very good for the screen eliments, oh and lots of coffee ;-)

DazTheGas

40
Mach4 General Discussion / Re: Un-Supported wxNumberEntryDialog
« on: January 27, 2019, 03:25:46 AM »
Code: [Select]
-- Grid
UI.m_grid1:CreateGrid( 8, 1 )
UI.m_grid1:EnableEditing( True )
UI.m_grid1:EnableGridLines( True )
UI.m_grid1:EnableDragGridSize( False )
UI.m_grid1:SetMargins( 0, 0 )

wxFormbuilder is nice software but it does have its quirks, although created with wxFB the code above is actually incorrect and should be

Code: [Select]
-- Grid
UI.m_grid1:CreateGrid( 8, 1 )
UI.m_grid1:EnableEditing( true )
UI.m_grid1:EnableGridLines( true )
UI.m_grid1:EnableDragGridSize( false )
UI.m_grid1:SetMargins( 0, 0 )

true and false in lua is all lower case, try this simple example to show the effects.

Code: [Select]
local test = True -- change to true and see the difference

if test then
wx.wxMessageBox('true')
else
wx.wxMessageBox('false')
end

DazTheGas