Results 1 to 16 of 16

Thread: remove specific line using readLine()

  1. #1
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default remove specific line using readLine()

    Hi to all.

    I want to find a specific string between lines to remove it, I'm usign readLine() to read a text with TextStream.
    for example:

    Qt Code:
    1. QTextStream text(&file);
    2. while(!text.atEnd()){
    3. vectorData[ii] = text.readLine();
    4. ...
    5. ii++;
    6. }
    To copy to clipboard, switch view to plain text mode 

    the read is something like:

    Banana
    Kiwi
    Apple
    Banana
    Banana
    Apple
    Mango
    Apple
    Mango

    so, I want to remove the Apple line just after the Banana line.

    Banana
    Kiwi
    Apple
    Banana
    Banana
    Apple <--- This one
    Mango
    Apple
    Mango

    First I need to locate the specific line, I tried:

    Qt Code:
    1. if(vectorData[ii].contains("Banana\0Apple")) // Do something
    To copy to clipboard, switch view to plain text mode 

    but didn't work.
    Qt Code:
    1. "Banana\nApple"
    To copy to clipboard, switch view to plain text mode 
    and
    Qt Code:
    1. "Banana\n\rApple"
    To copy to clipboard, switch view to plain text mode 
    neither. I can't use readAll() because the rest of the code breaks down. Must be taken into account every time I read the text, all the lines are in different position (the textfile is randomly modified). Thanks, I'm super newbie.

  2. #2
    Join Date
    Jul 2008
    Posts
    386
    Thanks
    9
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: remove specific line using readLine()

    Hi,

    as the docs say:
    The returned line has no trailing end-of-line characters ("\n" or "\r\n")
    , and readLine returns only one line, so you can't use checks like the ones you tried.

    Just set a variable when you find a "Banana" (and unset it if you find something else). Then when you find "Apple" check if the variable is set.

    You can also check if the previous element (vectorData[ii-1]) is "Banana" when you find an "Apple", but you will have to take care of some cases, e.g. Apple being the first entry.

    Ginsengelf

  3. #3
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    Thank you Ginsengelf for your clear reply. The solution was very simple, but I forgot to specify some extra conditions.

    The banana-apple sequence can happen many times but I just needed to replace it in the last event.

    Banana
    Apple
    ...
    Banana
    Apple
    ...
    Banana
    Apple <-This one
    end

    So, based on your suggestion the solution was:

    Qt Code:
    1. QTextStream text(&file);
    2. int line = 0;
    3. while(!text.atEnd()){
    4. vectorData[ii] = text.readLine();
    5. if((vectorData[ii].contains("Apple") && vectorData[ii-1].contains("Banana")){
    6. line = ii;
    7. }
    8. QString Fruit = "Grape";
    9. conflict = vectorData[line].replace(0, line, Fruit); // conflict is a QString global variable
    10. ...
    11. ii++;
    12. }
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    How do you know that "vectorData" will be large enough to hold all the lines in the file? You keep incrementing "ii" with every new line and assign the string to "vectorData[ii]". What happens if you have vectorData sized to hold 20 items, and there are 21 lines in the file?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    I think the condition "!text.atEnd()" in the while loop deals with, but maybe I'm not understanding the question well. Anyway, I have not had any problems with that.

    I did not add the solution to the extra condition that I mentioned earlier because it is more complex than bananas and apples thing and there are more functions involved in the process. But if someone has a similar doubt I can show my solution.

  6. #6
    Join Date
    Jul 2008
    Posts
    386
    Thanks
    9
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: remove specific line using readLine()

    Hi, d_stranz meant that you store each line in vectorData (which looks like it has a fixed size), but what happens if you have a really large file with loooots of lines?

    Ginsengelf

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    @Ginsengelf - Exactly. If there is even one more line in the file than the size of the vectorData array, then the program can crash. So:

    it is more complex than bananas and apples thing
    if we can find a potentially fatal error in the simplified code you posted, then it might be a good idea to understand what the two of us are talking about.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  8. #8
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    Now I understand, both of you are right. If the size of the text is very large the program crashes and it's a really big problem for what I'm trying to doing.
    I said that the code was modified randomly to simplify that I am working with different files with similar coding but different location of their parameters. To be more precise I am decoding gerber files to generate their corresponding image, supporting me with openCV libraries. If it were not for your question I would not have noticed that the files that exceed a thousand lines cause conflict because I had only been working with a few compact files (six different gerber files with an extension of 100-800 lines). You make a good point!.
    Now I'm trying to enlarge the vectorData size but it only causes the program to be slower and the problem persists.
    What do you recommend for these cases? Concatenation?
    Thanks for your attention.

  9. #9
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,430
    Thanked 264 Times in 259 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: remove specific line using readLine()

    1. What vectorData definition looks like ?
    2. Do you want to delete lines from a file or from a vector?

  10. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    Now I'm trying to enlarge the vectorData size but it only causes the program to be slower and the problem persists.
    In addition to what Lesiok asks, do you actually need to keep all the data that you read from the file? Or can you convert the gerber instructions into the corresponding image pixels on the fly? If you need to discard lines from the gerber file, but the decision to discard depends on some context (eg. a series of lines must match a pattern, otherwise the lines are OK), then you could implement something that accumulates only a small number of lines until you can make the "keep or discard" decision. If the decision is keep, you convert what you have to pixels, other wise you discard, but in either case you can empty the vector out.

    Maybe this is also an oversimplification and won't work. If you do need to keep all the lines, maybe you can read the whole file into a QByteArray, parse it into individual lines and keep a index to the byte position of the start of each line. When you come to a line you don't want, you don't store the index (or change it to a negative number to act as a flag while still being able to determine how long each line is). (Length of line "n" is the abs(offset) of line "n + 1" minus abs(offset) of line "n"). QByteArray can easily handle sizes in the megabytes.

    In any case, you can avoid a size restriction on "vectorData" by defining it as either a QStringList or a QVector< QString >. As you read each line, you call the push_back() method of either class to append the new line to the end of the collection. Both classes will grow the size automatically when needed to add more lines.
    Last edited by d_stranz; 9th February 2019 at 18:33.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  11. #11
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    Hi Lesiok.

    1. What vectorData definition looks like ?
    vectorData is a QString array and it is initialized:

    Qt Code:
    1. QString vectorData[100000]
    To copy to clipboard, switch view to plain text mode 

    I'm also working with a set of variables that stores a specific parameter like:

    Qt Code:
    1. QString X[10000], Y[10000], infoNumber[10000], infoD[10000], infoShape[100]
    To copy to clipboard, switch view to plain text mode 
    ... etc, etc.

    The array size is large because I'm trying to get the right amount for read large files.

    So vectorData is a line and column reader of all the text, and the rest of the variables mentioned are column reader from specific lines section of the text to extract a definited parameter. To put it clearly I give the example of how I get the coordinates in X and I list each value obtained

    Qt Code:
    1. void MainWindow::on_pushButtonCargarGerber_clicked()
    2. {
    3. QString nombreArchivo = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath(), tr("Files (*.grb *.txt)"),0,QFileDialog::DontUseNativeDialog);
    4. QFile archivo(nombreArchivo.toUtf8().constData());
    5. QTextStream Texto(&archivo);
    6. int ii = 0;
    7. int jj = 0;
    8. if(!archivo.open(QIODevice::ReadOnly | QFile::Text)){
    9. qDebug()<<"No se puede abrir " << nombreArchivo;
    10. exit(1);
    11. }
    12. else{
    13. QString separatorX = "X";
    14. ...
    15. while (!Texto.atEnd()){
    16. vectorData[ii] = Texto.readLine();
    17. int posicionX = vectorData[ii].indexOf(separatorX);
    18. ...
    19. int tamanioFila = vectorData[ii].length();
    20. // ************************** COORDENADAS XY ************************** //
    21. int tamXY;
    22. if(F2.toInt()==4) tamXY=18; if(F2.toInt()==5) tamXY=20;
    23. if(tamanioFila == tamXY){
    24. QString temporal = vectorData[ii].mid(0, posicionX+1);
    25. if(temporal==separatorX){
    26. temporal.insert(0, QString::number(jj+1));
    27. infoNumero[jj] = temporal;
    28. int c;
    29. if(jj>=0 && jj<9) c = 1;
    30. else if(jj>=9 && jj<99) c = 2;
    31. else if(jj>=99 && jj<999) c = 3;
    32. else c = 4;
    33. temporal = infoNumero[jj].mid(0, c);
    34. infoNumero[jj] = temporal;
    35. // X
    36. temporal = vectorData[ii].mid(posicionX+1, posicionY-1);
    37. infoX[jj] = temporal;
    38. // Y
    39. ...
    40. jj++;
    41. }
    42. }
    43. ii++;
    44. }
    45. }
    46. }
    To copy to clipboard, switch view to plain text mode 

    --

    2. Do you want to delete lines from a file or from a vector?
    In the first instance I thought that removing a particular line from the vector would be a good idea but it is not, now I am using a Ginsengelf advices to locate and ignore a specific line.

    --

    At the moment, the program looks like:

    imageGerberProgram.jpg
    Last edited by jasif; 9th February 2019 at 19:18.

  12. #12
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    QString vectorData[100000];
    QString X[10000], Y[10000], infoNumber[10000], infoD[10000], infoShape[100];
    Change all of these to QStringList or QVector<QString> and you will never have to worry about the size being too small.

    Qt Code:
    1. void MainWindow::on_pushButtonCargarGerber_clicked()
    2. {
    3. QString nombreArchivo = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::currentPath(), tr("Files (*.grb *.txt)"),0,QFileDialog::DontUseNativeDialog);
    4. QFile archivo(nombreArchivo.toUtf8().constData());
    5. QTextStream Texto(&archivo);
    6. int ii = 0;
    7. int jj = 0;
    8. if(!archivo.open(QIODevice::ReadOnly | QFile::Text)){
    9. qDebug()<<"No se puede abrir " << nombreArchivo;
    10. exit(1);
    11. }
    12. else{
    13. QString separatorX = "X";
    14. ...
    15. vectorData.clear(); // First easy change - ensure vectors start empty
    16. infoNumeral.clear();
    17. infoX.clear();
    18. infoY.clear();
    19. // ... etc.
    20.  
    21. while (!Texto.atEnd()){
    22. vectorData.push_back( Texto.readLine() ); // Second easy change: vectorData will grow if needed
    23. int posicionX = vectorData[ii].indexOf(separatorX);
    24. ...
    25. int tamanioFila = vectorData[ii].length();
    26. // ************************** COORDENADAS XY ************************** //
    27. int tamXY;
    28. if(F2.toInt()==4) tamXY=18; if(F2.toInt()==5) tamXY=20;
    29. if(tamanioFila == tamXY){
    30. QString temporal = vectorData[ii].mid(0, posicionX+1);
    31. if(temporal==separatorX){
    32. temporal.insert(0, QString::number(jj+1));
    33. infoNumero.push_back( temporal ); // Next change
    34. int c;
    35. if(jj>=0 && jj<9) c = 1;
    36. else if(jj>=9 && jj<99) c = 2;
    37. else if(jj>=99 && jj<999) c = 3;
    38. else c = 4;
    39. temporal = infoNumero[jj].mid(0, c);
    40. infoNumero[jj] = temporal;
    41. // X
    42. temporal = vectorData[ii].mid(posicionX+1, posicionY-1);
    43. infoX.push_back( temporal ); // Next change
    44. // Y
    45. ... // etc. for decoding other parameters
    46. jj++;
    47. }
    48. }
    49. ii++;
    50. }
    51. }
    52. }
    To copy to clipboard, switch view to plain text mode 

    You are using "jj" to index several arrays - are each of these arrays exactly matched (in other words, when you decode a line, if it contains "X" will it also contain Y, infoNumber, and infoD? If not, then these vectors will not be synchonized - the entries will refer to different lines, so you can't say X[n] matches with Y[n].

    If each line contains all of these parameters, then you would be better off using a struct instead of separate vectors:

    Qt Code:
    1. struct ParameterLine
    2. {
    3. QString infoX;
    4. QString infoY;
    5. QString infoNumber;
    6. QString infoD;
    7. };
    8.  
    9. QVector< ParameterLine > parameterLines;
    10.  
    11. // ...
    12. if(temporal==separatorX){
    13. ParameterLine currentLine;
    14.  
    15. temporal.insert(0, QString::number(jj+1));
    16. currentLine. infoNumero = temporal; // Next change
    17. int c;
    18. if(jj>=0 && jj<9) c = 1;
    19. else if(jj>=9 && jj<99) c = 2;
    20. else if(jj>=99 && jj<999) c = 3;
    21. else c = 4;
    22. temporal = currentLine.infoNumero.mid(0, c);
    23. currentLine.infoNumero = temporal;
    24. // X
    25. temporal = vectorData[ii].mid(posicionX+1, posicionY-1);
    26. currentLine.infoX = temporal; // Next change
    27. // Y
    28. ... // etc. for decoding other parameters
    29.  
    30. parameterLines.push_back( currentLine );
    31. jj++;
    32. }
    33.  
    34. // And you can retrieve any field using parametersLines[ n ].infoX, etc.
    To copy to clipboard, switch view to plain text mode 

    One more trick: instead of the multiple if / else statements to determine the number of digits in jj, try this:

    Qt Code:
    1. int c= 1 + int( std::log10( float( jj ) ) );
    To copy to clipboard, switch view to plain text mode 
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  13. #13
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    Wow d_stranz, thank you for your time and your knowledge imparted, you have given me very useful tips. I will start right now with the suggested modifications.

    One Question: If I use QStringList or QVector<QString> the "jj" index number will no be longer necessary?... but can I use indexOf() and mid() in the same way?. Also to get the list of the values of "X", "Y" and "infoD" in another function, I would need to do something like:

    Qt Code:
    1. X.append();
    2. for(int i=0; i<X.size(); i++){
    3. ...
    4. }
    To copy to clipboard, switch view to plain text mode 

    right?

    are each of these arrays exactly matched (in other words, when you decode a line, if it contains "X" will it also contain Y, infoNumber, and infoD?
    Yes, the same line contains the info for "X", "Y" and "infoD"; that's why are in the same "jj" index.

    An example of a really compact gerber file is such the next code:

    Qt Code:
    1. G75* // from here,...
    2. %MOIN*%
    3. %OFA0B0*%
    4. %FSLAX25Y25*%
    5. %IPPOS*%
    6. %LPD*%
    7. %AMOC8*
    8. 5,1,8,0,0,1.08239X$1,22.5*
    9. %
    10. %ADD10C,0.00000*% // ...to here are the "header info"
    11. D10* // this line is about the thick of the drill, the "jj" counter starts
    12. X0001800Y0001800D02* // here starts the coordinates X-Y. D02 means just position of the drill
    13. X0001800Y0119910D01* // D01 means a point to drawn
    14. X0119910Y0119910D01*
    15. X0119910Y0001800D01*
    16. X0001800Y0001800D01*
    17. D11* // another thickness
    18. X0001800Y0001800D03* // and D03 means the position of the pads
    19. M02* // the end of the text
    To copy to clipboard, switch view to plain text mode 

    The header is read by vectorData but is not necessary to index it, with indexOf() and mid() and put it on their respective variables it's enough. The line that starts with "%ADD" may appear many times with different numbers, and requires a different indexation, like "kk".

    I think it's necessary to index D10*, D11* to Dnn* lines with the "jj" counter, because they imply a change in the thickness of the following indications, but it generate a not wanted line from (0,0) coordinate to the last D03 position. So ---D03* were the Bananas and D10*-Dnn* were the Apples. This problem has already been solved.

    One more trick: ...
    c increases 1 each jj increases by a power of 10... Clean and clever! d_stranz you rock!

    Finally, it is also necessary to emphasize that my grammatical level of english is very poor, so thanks for your patience and understanding.

  14. #14
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    OK, you got me curious, so I downloaded the Gerber file specification and some examples. I do not think your code will parse these files correctly.

    For one thing, the example you give for a Gerber file uses a fixed format for every "operation" line: X0001800Y0001800D02*

    However, the format line (%FSLAX25Y25*%) means this:

    "%FS" - the line is a format specification
    "L" - leading zeros can be omitted from coordinates
    "A" - the coordinates will be absolute (not relative) values
    "X25" - X coordinates have the format IIDDDDD (2 digits in the integer part, 5 digits in the fraction part)
    "Y25" - Y coordinates also have the format IIDDDDD

    So according to this, the following is a legal sequence of operation lines in this format:

    Qt Code:
    1. X7494499Y2058998D02*
    2. Y2325500D01*
    3. X7243499Y2576498D01*
    4. Y2730998D01*
    5. X8234497Y2062998D02*
    6. Y1914500D01*
    7. X8189999Y1869999D01*
    8. X7824999D01*
    9. X7635997Y2058998D01*
    10. X7494499D01*
    11. X7494499Y1558999D02*
    12. Y1745498D01*
    To copy to clipboard, switch view to plain text mode 

    But these lines are also legal:

    Qt Code:
    1. X0Y0D02* < set current point to 0, 0
    2. X0D01* < draw to X= 0, Y = current Y from current point
    3. Y0D01* < draw to X = current X, Y = 0 from current point
    4. X50000Y0D01* < draw to X= 0.5, Y = 0
    5. X0Y25000D02* < draw to X = 0, Y = 0.25
    6. X0Y-12400D03* < create flash at X = 0, Y = -1.24
    To copy to clipboard, switch view to plain text mode 

    So, not every line will contain X, Y, and D; not every X or Y coordinate will be the same length; some coordinates do not have an integer part (Y250000 -> Y = 0.25); some coordinates are zero (X0); some coordinates can have a "+" or "-" sign.

    The Gerber manual says the coordinates should be handled like this:

    Coordinate data is string of one or more digits representing a fixed-point decimal number. Explicit decimal points are not allowed. Leading zeroes may be omitted, as in human number writing. The FS command - see 4.1 - specifies the max number of integer (I) and decimal (D) digits. I and D must each be ? 6. Signs are allowed; the ‘+’ sign is optional. Coordinate data must have at least one digit - zero therefore must be encoded as “0”.

    <coordinate data> = [(-|+)]<digit>{<digit>}

    To interpret the coordinate string, it is first padded with leading zeros until the total number of digits is I+D; then the decimal point is placed at I integer and D decimal digits. For example, the format 26 specifies 2 integer and 6 decimal digits. The coordinate string “01500” is padded in front to reach 2+6 = 8 digits, or “00001500”; the decimal point is placed to have 2 integer and 6 decimal digits, or "00.001500"; the coordinate "015" therefore represents the decimal number 0.0015.
    Your parsing needs to be much more flexible, and because an X or a Y value might be omitted from a line, your code needs to "remember" the current X and Y values so that if one of them is missing from the new line, you can copy it from the current line.

    Your code also needs to know which aperture or function (D10, D11, G02, etc.) applies to each operations line. If you simply keep arrays of operations and arrays of apertures as you parse the file, you lose that relationship.

    Unless you intend to convert the Gerber commands into the image on-the-fly (as you read the file), I think you should design a data structure that can handle this aperture + set of operations relationship. I think you should also convert the strings into numbers instead of storing strings only in the data structure. (In other words, convert Y25000 into a Y coordinate with the value 0.25). Otherwise, every time you need an actual coordinate value, you have to convert from the string.

    You should take a look at QString::indexOf() to help in parsing the strings:

    Qt Code:
    1. QString line = "X7494499Y2058998D02*";
    2.  
    3. int posX = line.indexOf( 'X' );
    4. int posY = line.indexOf( 'Y' );
    5. int posD = line.indexOf( 'D' );
    To copy to clipboard, switch view to plain text mode 

    If there is no X or Y, posX or posY = -1, so you know you need to substitute the current value for the new value.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  15. #15
    Join Date
    Feb 2019
    Posts
    7
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: remove specific line using readLine()

    Hello again d_stranz.
    That kind of commands belong to polygons forms or interpolations what I'm not using, or maybe those gerber files that you downloaded belong to another standard that I am using. I'm working with the RS274X standard, which writes the X-Y coordinates and the operation code in a single row, except for the polygons. I chose that standard because it's the same one that the CNC machine of my school work with. For now my code only works with two different lengths -18 or 20 chars per line- (format FSLAX24Y24 or FSLAX25Y25), two different G Codes (G75 and G74) and only includes circles, oval and rectangles (for the pads). Once I can perform a successful coding (I've almost got it) I will try to add the rest of the features to share it.

    As you mentioned, I have already converted from the reading of coordinates to millimeters and pixels. By the way, I was able to make the improvements that you suggested, now the code is more compact, the for conditions and the number of global variables it were significantly reduced.
    Last edited by jasif; 11th February 2019 at 05:41. Reason: spelling corrections

  16. #16
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    3,927
    Thanks
    229
    Thanked 615 Times in 605 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: remove specific line using readLine()

    Great, I am glad your problem is more simple than the examples I saw. Those came from the official Gerber documentation and examples on the Ucamco web site and are supposed to be RS-274X (Gerber X2), but maybe your CNC uses a more simplified version.

    I am able to use a CNC machine that is driven by gcode, so now you have made me interested to see if I can design PCB boards in gerber, then convert to gcode for cutting.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Read a file after a specific line
    By kahlenberg in forum Qt Programming
    Replies: 4
    Last Post: 20th September 2018, 19:35
  2. To jump to a specific line in a textedit
    By aaditya190 in forum Newbie
    Replies: 4
    Last Post: 21st November 2013, 11:51
  3. How do I set a QTextEdit to a specific line by line number?
    By Coolname007 in forum Qt Programming
    Replies: 8
    Last Post: 1st February 2013, 06:18
  4. Replies: 1
    Last Post: 30th March 2012, 16:35
  5. Read a specific line from a file
    By rleojoseph in forum Qt Programming
    Replies: 11
    Last Post: 21st March 2011, 12:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.