igc.cc
changeset 11 d927333c8ffe
parent 10 e1abdc480485
child 12 84b0f3ca474a
equal deleted inserted replaced
10:e1abdc480485 11:d927333c8ffe
     9 	    case 'A': theAuthor = in.readLine(); break;
     9 	    case 'A': theAuthor = in.readLine(); break;
    10 	    case 'H': {
    10 	    case 'H': {
    11 		      QString line  = in.readLine();
    11 		      QString line  = in.readLine();
    12 		      QString key   = line.section(':', 0, 0);
    12 		      QString key   = line.section(':', 0, 0);
    13 		      QString value = line.section(':', 1, 1).simplified();
    13 		      QString value = line.section(':', 1, 1).simplified();
    14 		      qDebug() << key << "--" << value;
    14 		      if (key.startsWith("FPLT")) thePilot = value;
    15 		      if (key == "FPLTPILOT") thePilot = value;
    15 		      if (key.startsWith("FGTY")) theGlider = value;
    16 		      if (key == "FGTYGLIDERTYPE") theGlider = value;
       
    17 		      }
    16 		      }
    18 		      break;
    17 		      break;
    19 	    case 'B': points << in.readLine(); break;
    18 	    case 'B': fixes << in.readLine(); break;
    20 	}
    19 	}
    21     }
    20     }
    22 }
    21 }
       
    22 
       
    23 Fix::Fix(const QString &s)
       
    24 {
       
    25     int pos = 0;
       
    26     theTime = s.mid(pos, 6); pos += 6;
       
    27     gps.lat = s.mid(pos, 8); pos += 8;
       
    28     gps.lon = s.mid(pos, 9); pos += 9;
       
    29     valid = s.mid(pos, 1); pos += 1;
       
    30     theAlt.press = s.mid(pos, 5).toInt(); pos += 5;
       
    31     theAlt.gps = s.mid(pos, 5).toInt(); pos += 5;
       
    32 
       
    33     qDebug() << theAlt.press << " | " << theAlt.gps;
       
    34 }