Subversion Repositories Projects

Rev

Rev 414 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 414 Rev 415
Line 98... Line 98...
98
//
98
//
99
// Returnvalue: '1' if document was initialized
99
// Returnvalue: '1' if document was initialized
100
//________________________________________________________________________________________________________________________________________
100
//________________________________________________________________________________________________________________________________________
Line 101... Line 101...
101
 
101
 
102
uint8_t KML_DocumentInit(KML_Document_t *doc)
102
uint8_t KML_DocumentInit(KML_Document_t *doc)
103
{                                                                                                              
103
{
104
        doc->state       = KML_DOC_CLOSED;                                                                                                      // state of the kml-document
104
        doc->state       = KML_DOC_CLOSED;                                                                                                      // state of the kml-document
105
        doc->file        = NULL;
105
        doc->file        = NULL;
106
        return(1);
106
        return(1);
Line 314... Line 314...
314
                                if(GPSData.Position.Longitude < 0) sign = '-';
314
                                if(GPSData.Position.Longitude < 0) sign = '-';
315
                                else sign = '+';
315
                                else sign = '+';
316
                                i1 = (int16_t)(GPSData.Position.Longitude/10000000L);
316
                                i1 = (int16_t)(GPSData.Position.Longitude/10000000L);
317
                                i2 = abs((int16_t)((GPSData.Position.Longitude%10000000L)/10000L));
317
                                i2 = abs((int16_t)((GPSData.Position.Longitude%10000000L)/10000L));
318
                                i3 = abs((int16_t)(((GPSData.Position.Longitude%10000000L)%10000L)/10L));
318
                                i3 = abs((int16_t)(((GPSData.Position.Longitude%10000000L)%10000L)/10L));
319
                                sprintf(string,"\r\n%c%d.%.3d%",sign, i1, i2, i3);
319
                                sprintf(string,"\r\n%c%d.%.3d%.3d,",sign, i1, i2, i3);
320
                                fputs_(string, doc->file);
320
                                fputs_(string, doc->file);
321
                                if(GPSData.Position.Latitude < 0) sign = '-';
321
                                if(GPSData.Position.Latitude < 0) sign = '-';
322
                                else sign = '+';
322
                                else sign = '+';
323
                                i1 = (int16_t)(GPSData.Position.Latitude/10000000L);
323
                                i1 = (int16_t)(GPSData.Position.Latitude/10000000L);
324
                                i2 = abs((int16_t)((GPSData.Position.Latitude%10000000L)/10000L));
324
                                i2 = abs((int16_t)((GPSData.Position.Latitude%10000000L)/10000L));
325
                                i3 = abs((int16_t)(((GPSData.Position.Latitude%10000000L)%10000L)/10L));
325
                                i3 = abs((int16_t)(((GPSData.Position.Latitude%10000000L)%10000L)/10L));
326
                                sprintf(string,"\r\n%c%d.%.3d%",sign, i1, i2, i3);
326
                                sprintf(string,"%c%d.%.3d%.3d,",sign, i1, i2, i3);
327
                                fputs_(string, doc->file);
327
                                fputs_(string, doc->file);
-
 
328
                                sign = '+';
328
                                sprintf(string,"\r\n%c%d.%.3d%",0.0 );
329
                                sprintf(string,"%c%d.%.3d",sign, 0, 0);
329
                                fputs_(string, doc->file);
330
                                fputs_(string, doc->file);
330
                                retvalue = 1;
331
                                retvalue = 1;
331
                        }
332
                        }
332
                }
333
                }
333
        }
334
        }