Subversion Repositories NaviCtrl

Rev

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

Rev 41 Rev 51
Line 310... Line 310...
310
                if(doc->state == DOC_LINESTRING_OPENED)
310
                if(doc->state == DOC_LINESTRING_OPENED)
311
                {
311
                {
312
                        if(doc->file != NULL)
312
                        if(doc->file != NULL)
313
                        {
313
                        {
314
                                s32 i1, i2;
314
                                s32 i1, i2;
-
 
315
                                u8 sign;
-
 
316
                                if(pGPS_Position->Longitude < 0) sign = '-';
-
 
317
                                else sign = '+';
315
                                i1 = pGPS_Position->Longitude/10000000L;
318
                                i1 = abs(pGPS_Position->Longitude/10000000L);
316
                                i2 = abs(pGPS_Position->Longitude%10000000L);
319
                                i2 = abs(pGPS_Position->Longitude%10000000L);
317
                                sprintf(string,"\r\n%ld.%07ld,",i1, i2);
320
                                sprintf(string,"\r\n%c%ld.%07ld,",sign, i1, i2);
318
                                fputs_(string, doc->file);
321
                                fputs_(string, doc->file);
-
 
322
                                if(pGPS_Position->Latitude < 0) sign = '-';
-
 
323
                                else sign = '+';
319
                                i1 = pGPS_Position->Latitude/10000000L;
324
                                i1 = abs(pGPS_Position->Latitude/10000000L);
320
                                i2 = abs(pGPS_Position->Latitude%10000000L);
325
                                i2 = abs(pGPS_Position->Latitude%10000000L);
321
                                sprintf(string," %ld.%07ld,",i1, i2);
326
                                sprintf(string,"%c%ld.%07ld,",sign, i1, i2);
322
                                fputs_(string, doc->file);
327
                                fputs_(string, doc->file);
323
                                // calculate relative altitude with respect to the altitude of the home position
328
                                // calculate relative altitude with respect to the altitude of the home position
324
                                rel_altitude = pGPS_Position->Altitude - GPS_HomePosition.Altitude;
329
                                rel_altitude = pGPS_Position->Altitude - GPS_HomePosition.Altitude;
325
                                if(rel_altitude < 0) rel_altitude = 0; // avoid negative altitudes in log
330
                                if(rel_altitude < 0) rel_altitude = 0; // avoid negative altitudes in log
326
                                i1 = rel_altitude/1000L;
331
                                i1 = rel_altitude/1000L;