Hello Guest it is December 26, 2024, 07:54:55 AM

Author Topic: Loading/selecting gcode files  (Read 8404 times)

0 Members and 1 Guest are viewing this topic.

Loading/selecting gcode files
« on: April 17, 2013, 07:14:37 AM »
Hi Guys
I am starting to write a new screen for a touchscreen, and I am try to work out something that has been bugging me for some time.
I am wanting to be able to have a screen where I can display all the gcode files in a certain folder, then using a pair of buttons (up and down) be able to scroll through the programs and then select the one I want. I am trying to get away from the dialog box that opens up to choose a program from.
Has anyone done something like this??? if so how.  I did find a flash based screen that can do this, but I really don't want to use flash.

Thanks
Andrew

Offline BR549

*
  •  6,965 6,965
Re: Loading/selecting gcode files
« Reply #1 on: April 17, 2013, 10:46:09 AM »
IF you look in the cypress for mach3 manual I believe it gives an example of what you want.

(;-) TP
Re: Loading/selecting gcode files
« Reply #2 on: April 17, 2013, 05:25:28 PM »
Hi
Thanks for the info - I will have a play.
Regards
Andrew

Offline BR549

*
  •  6,965 6,965
Re: Loading/selecting gcode files
« Reply #3 on: April 17, 2013, 10:25:13 PM »
Let me know if you cannot work it out I may have a working example here somewhere.

(;-) TP

Offline BR549

*
  •  6,965 6,965
Re: Loading/selecting gcode files
« Reply #4 on: April 18, 2013, 11:24:40 AM »
I ran across the Code while working on something else . Hope it helps. You can also customize it to only show certain file types.

'Gcode Selection Box
Sub GcodeSelect
    Dim MyList()
    Begin Dialog GcodeFileDlg 60, 60, 190, 220, "Gcode file selection", .DlgFunc
        ListBox 10, 10, 150, 180, MyList(), .List1, 2
        CancelButton 42, 198, 40, 12
   
    End Dialog
   
    Dim frame As GcodeFileDlg
 
    ' Show the GcodeFile dialog
    Dialog frame
End Sub
 
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
 
    DlgFunc = 1  ' Keep dialog active
 
    Select Case action
    Case 1 ' Initialize
        temp = Dir( "c:\Mach3\Gcode\*.*" )
        count = 0 
        While temp <> ""
            count = count + 1
            temp = Dir
        Wend
        Dim x() As String
        ReDim x(count)
        x(0) = Dir( "c:\Mach3\Gcode\*.*" )
        For i = 1 To count
            x(i) = Dir
        Next i
        DlgListBoxArray "List1", x()
       
    Case 2 ' select
    Fname = (DlgText("List1"))
    LoadFIle("c:\Mach3\Gcode\" &DlgText("List1"))
    End
   
     
    End Select
End Function
End

Re: Loading/selecting gcode files
« Reply #5 on: April 18, 2013, 05:22:30 PM »
Thanks heaps for that.  I will have a good play this weekend to see if I can get it to look like what I want.

Thanks again
Andrew