tbinias / heekscnc

Automatically exported from code.google.com/p/heekscnc
Other
0 stars 0 forks source link

option for line endings with 'Save NC File' #312

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is really just a pet issue for me, since I use a linux computer to create 
files for a DOS based controller. 
I would like to have the option of creating files with DOS line endings (\r\n I 
think) from my linux box. Right now I change the file with vi (set ff=dos) or 
'todos' just before copying to the machine. 
It looks like 'Save NC File' uses the native wxWidgets 'Write' function, so 
this might not be a quick one, but I'm up for suggestions. I will work on this 
issue myself, if someone can push me in the right direction. 
Thanks,
Dan

Original issue reported on code.google.com by ddfalck2...@yahoo.com on 1 Jun 2011 at 2:20

GoogleCodeExporter commented 8 years ago
I figured out how to do this from within HeeksCNC.cpp. I won't be adding it to 
svn, because I don't know how useful it will be for others, but here is what I 
did:

                long line_num= 0;
                bool ok = true;
                int nLines = theApp.m_output_canvas->m_textCtrl->GetNumberOfLines();
            for ( int nLine = 0; ok && nLine < nLines; nLine ++)
                {   
                    ok = ofs.Write(theApp.m_output_canvas->m_textCtrl->GetLineText(line_num) + _T("\r\n") );
                    line_num = line_num+1;
                }

There's probably a more sensible way of doing this in the post processor - 
maybe in the CODES section of iso.py for instance.

Original comment by ddfalck2...@yahoo.com on 3 Jul 2011 at 10:12

GoogleCodeExporter commented 8 years ago
I think I have this one working properly in HeeksCNC.

Original comment by ddfalck2...@yahoo.com on 4 Jul 2011 at 1:02