comparison Discovery/Src/tInfoLog.c @ 570:701ead8dddab

Try to reduce legth of log entry string: The metric views of the log data did no longer fit into the line space (because of the change ' to "min"). This may be avoided / reduced by removing spaces depending on the view parameters
author Ideenmodellierer
date Mon, 30 Nov 2020 20:55:23 +0100
parents 1c95f811967c
children eecb52ab1fce
comparison
equal deleted inserted replaced
569:3508e6dc4f22 570:701ead8dddab
366 } 366 }
367 367
368 switch(logbookHeader.decoModel) 368 switch(logbookHeader.decoModel)
369 { 369 {
370 case 1: 370 case 1:
371 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017"); 371 if(!settingsGetPointer()->nonMetricalSystem) /* safe space to avoid cursor overlap */
372 {
373 if(settingsGetPointer()->amPMTime)
374 {
375 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017");
376 }
377 else
378 {
379 textPointer += snprintf(&text[textPointer],20,"\016\016GF \017");
380 }
381 }
382 else
383 {
384 textPointer += snprintf(&text[textPointer],20,"\016\016 GF \017");
385 }
372 break; 386 break;
373 case 2: 387 case 2:
374 textPointer += snprintf(&text[textPointer],20,"\016\016 VPM \017"); 388 textPointer += snprintf(&text[textPointer],20,"\016\016 VPM \017");
375 break; 389 break;
376 default: 390 default:
384 maxDepthFeet = unit_depth_float(((float)logbookHeader.maxDepth)/100); 398 maxDepthFeet = unit_depth_float(((float)logbookHeader.maxDepth)/100);
385 textPointer += snprintf(&text[textPointer], 20,"%3.0f\016\016ft\017 ", maxDepthFeet); 399 textPointer += snprintf(&text[textPointer], 20,"%3.0f\016\016ft\017 ", maxDepthFeet);
386 } 400 }
387 else 401 else
388 { 402 {
389 textPointer += snprintf(&text[textPointer], 20,"%3d.%d\016\016m\017 ", maxDepthMeter,maxDepthSubmeter); 403 textPointer += snprintf(&text[textPointer], 20,"%3d.%d\016\016m \017", maxDepthMeter,maxDepthSubmeter);
390 } 404 }
391 textPointer += snprintf(&text[textPointer], 20,"%3d\016\016min\017\n\r", divetime); 405 textPointer += snprintf(&text[textPointer], 20,"%3d\016\016min\017\n\r", divetime);
392 406
393 } 407 }
394 } 408 }