Changeset 61d052f61421516146ba7d7ec99116be4f1a8173
- Timestamp:
- 02/22/10 13:19:18 (5 months ago)
- Author:
- Tobias Bieniek <Tobias.Bieniek@…>
- Parents:
- 747293d7078a948297b9fce24aedf548962a5694
- Children:
- dfe3fe667598b6a509cb6e0cde6dc2e944d68c76
- git-committer:
- Tobias Bieniek <Tobias.Bieniek@gmx.de> / 2010-02-22T11:19:18Z+0100
- Message:
-
Dialogs/*: Replaced *MODIFY by ToSysUnit?()/ToUserUnit()
- Location:
- src
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r959be8
|
r61d052
|
|
| 126 | 126 | const GeoVector vec(ac_loc, closest_loc); |
| 127 | 127 | TCHAR buf[80]; |
| 128 | | _stprintf(buf,_T("%d%s"), (int)(vec.Distance * DISTANCEMODIFY), |
| | 128 | _stprintf(buf, _T("%d%s"), |
| | 129 | (int)Units::ToUserUnit(vec.Distance, Units::DistanceUnit), |
| 129 | 130 | Units::GetDistanceName()); |
| 130 | 131 | wp->SetText(buf); |
-
|
r6359ca
|
r61d052
|
|
| 232 | 232 | _T("%s:\r\n %d %s\r\n%s: %s\r\n%s: %d %s\r\n"), |
| 233 | 233 | gettext(_T("Distance")), |
| 234 | | (int)(DISTANCEMODIFY * XCSoarInterface::Calculated().common_stats.distance_olc), |
| | 234 | (int)Units::ToUserUnit(XCSoarInterface::Calculated().common_stats.distance_olc, Units::DistanceUnit), |
| 235 | 235 | Units::GetDistanceName(), |
| 236 | 236 | gettext(_T("Time")), |
| 237 | 237 | timetext1, |
| 238 | 238 | gettext(_T("Speed")), |
| 239 | | (int)(TASKSPEEDMODIFY * XCSoarInterface::Calculated().common_stats.speed_olc), |
| | 239 | (int)Units::ToUserUnit(XCSoarInterface::Calculated().common_stats.speed_olc, Units::TaskSpeedUnit), |
| 240 | 240 | Units::GetTaskSpeedName()); |
| 241 | 241 | } else { |
| … |
… |
|
| 243 | 243 | _T("%s: %d %s\r\n%s: %s\r\n%s: %d %s\r\n"), |
| 244 | 244 | gettext(_T("Distance")), |
| 245 | | (int)(DISTANCEMODIFY * XCSoarInterface::Calculated().common_stats.distance_olc), |
| | 245 | (int)Units::ToUserUnit(XCSoarInterface::Calculated().common_stats.distance_olc, Units::DistanceUnit), |
| 246 | 246 | Units::GetDistanceName(), |
| 247 | 247 | gettext(_T("Time")), |
| 248 | 248 | timetext1, |
| 249 | 249 | gettext(_T("Speed")), |
| 250 | | (int)(TASKSPEEDMODIFY * XCSoarInterface::Calculated().common_stats.speed_olc), |
| | 250 | (int)Units::ToUserUnit(XCSoarInterface::Calculated().common_stats.speed_olc, Units::TaskSpeedUnit), |
| 251 | 251 | Units::GetTaskSpeedName()); |
| 252 | 252 | } |
-
|
rc715f2
|
r61d052
|
|
| 90 | 90 | if (wp) { |
| 91 | 91 | _stprintf(Temp, _T("%.0f %s"), |
| 92 | | (double) TASKSPEEDMODIFY * Speed, Units::GetTaskSpeedName()); |
| | 92 | Units::ToUserUnit(Speed, Units::TaskSpeedUnit), |
| | 93 | Units::GetTaskSpeedName()); |
| 93 | 94 | wp->SetText(Temp); |
| 94 | 95 | } |
| … |
… |
|
| 97 | 98 | if (wp) { |
| 98 | 99 | _stprintf(Temp, _T("%.0f %s"), |
| 99 | | (double) Altitude*ALTITUDEMODIFY, Units::GetAltitudeName()); |
| | 100 | Units::ToUserUnit(Altitude, Units::AltitudeUnit), |
| | 101 | Units::GetAltitudeName()); |
| 100 | 102 | wp->SetText(Temp); |
| 101 | 103 | } |
-
|
rb600bd
|
r61d052
|
|
| 362 | 362 | wp = (WndProperty*)wf->FindByName(_T("prpSpeedRemaining")); |
| 363 | 363 | if (wp) { |
| 364 | | wp->GetDataField()->SetAsFloat(v1*TASKSPEEDMODIFY); |
| | 364 | wp->GetDataField()->SetAsFloat(Units::ToUserUnit(v1, Units::TaskSpeedUnit)); |
| 365 | 365 | wp->GetDataField()->SetUnits(Units::GetTaskSpeedName()); |
| 366 | 366 | wp->RefreshDisplay(); |
| … |
… |
|
| 369 | 369 | wp = (WndProperty*)wf->FindByName(_T("prpSpeedAchieved")); |
| 370 | 370 | if (wp) { |
| 371 | | wp->GetDataField()->SetAsFloat(XCSoarInterface::Calculated().TaskSpeed*TASKSPEEDMODIFY); |
| | 371 | wp->GetDataField()->SetAsFloat(Units::ToUserUnit( |
| | 372 | XCSoarInterface::Calculated().TaskSpeed, Units::TaskSpeedUnit)); |
| 372 | 373 | wp->GetDataField()->SetUnits(Units::GetTaskSpeedName()); |
| 373 | 374 | wp->RefreshDisplay(); |
-
|
rc5a94f
|
r61d052
|
|
| 164 | 164 | _stprintf(sTmp, _T("%s %.1f"), |
| 165 | 165 | way_points.get(tp.Index).Name, |
| 166 | | tp.AATCircleRadius*DISTANCEMODIFY); |
| | 166 | Units::ToUserUnit(tp.AATCircleRadius, Units::DistanceUnit)); |
| 167 | 167 | } else { |
| 168 | 168 | _stprintf(sTmp, _T("%s %.1f"), |
| 169 | 169 | way_points.get(tp.Index).Name, |
| 170 | | tp.AATSectorRadius*DISTANCEMODIFY); |
| | 170 | Units::ToUserUnit(tp.AATSectorRadius, Units::DistanceUnit)); |
| 171 | 171 | } |
| 172 | 172 | } else { |
| … |
… |
|
| 215 | 215 | |
| 216 | 216 | if (fai_ok) { |
| 217 | | _stprintf(sTmp, _T("%.0f %s FAI"), lengthtotal*DISTANCEMODIFY, |
| | 217 | _stprintf(sTmp, _T("%.0f %s FAI"), |
| | 218 | Units::ToUserUnit(lengthtotal, Units::DistanceUnit), |
| 218 | 219 | Units::GetDistanceName()); |
| 219 | 220 | } else { |
| 220 | | _stprintf(sTmp, _T("%.0f %s"), lengthtotal*DISTANCEMODIFY, |
| | 221 | _stprintf(sTmp, _T("%.0f %s"), |
| | 222 | Units::ToUserUnit(lengthtotal, Units::DistanceUnit), |
| 221 | 223 | Units::GetDistanceName()); |
| 222 | 224 | } |
| … |
… |
|
| 236 | 238 | gettext(_T("Total:")), |
| 237 | 239 | task.getSettings().AATTaskLength*1.0, |
| 238 | | DISTANCEMODIFY*lengthtotal, |
| 239 | | DISTANCEMODIFY*d1, |
| | 240 | Units::ToUserUnit(lengthtotal, Units::DistanceUnit), |
| | 241 | Units::ToUserUnit(d1, Units::DistanceUnit), |
| 240 | 242 | Units::GetDistanceName()); |
| 241 | 243 | canvas.text(rc.left + Layout::FastScale(2), |
-
|
r2d86f1
|
r61d052
|
|
| 118 | 118 | wp = (WndProperty*)wf->FindByName(_T("prpFinishMinHeight")); |
| 119 | 119 | if (wp) { |
| 120 | | wp->GetDataField()->SetAsFloat(iround(settings_task.FinishMinHeight*ALTITUDEMODIFY)); |
| | 120 | wp->GetDataField()->SetAsFloat(iround(Units::ToUserUnit( |
| | 121 | settings_task.FinishMinHeight, Units::AltitudeUnit))); |
| 121 | 122 | wp->GetDataField()->SetUnits(Units::GetAltitudeName()); |
| 122 | 123 | wp->RefreshDisplay(); |
| … |
… |
|
| 125 | 126 | wp = (WndProperty*)wf->FindByName(_T("prpStartMaxHeight")); |
| 126 | 127 | if (wp) { |
| 127 | | wp->GetDataField()->SetAsFloat(iround(settings_task.StartMaxHeight*ALTITUDEMODIFY)); |
| | 128 | wp->GetDataField()->SetAsFloat(iround(Units::ToUserUnit( |
| | 129 | settings_task.StartMaxHeight, Units::AltitudeUnit))); |
| 128 | 130 | wp->GetDataField()->SetUnits(Units::GetAltitudeName()); |
| 129 | 131 | wp->RefreshDisplay(); |
| … |
… |
|
| 132 | 134 | wp = (WndProperty*)wf->FindByName(_T("prpStartMaxSpeed")); |
| 133 | 135 | if (wp) { |
| 134 | | wp->GetDataField()->SetAsFloat(iround(settings_task.StartMaxSpeed*SPEEDMODIFY)); |
| | 136 | wp->GetDataField()->SetAsFloat(iround(Units::ToUserUnit( |
| | 137 | settings_task.StartMaxSpeed, Units::SpeedUnit))); |
| 135 | 138 | wp->GetDataField()->SetUnits(Units::GetHorizontalSpeedName()); |
| 136 | 139 | wp->RefreshDisplay(); |
-
|
r959be8
|
r61d052
|
|
| 195 | 195 | canvas.polygon(Arrow, 5); |
| 196 | 196 | |
| 197 | | short relalt = iround(traffic.RelativeAltitude * ALTITUDEMODIFY / 100); |
| | 197 | short relalt = iround(Units::ToUserUnit(traffic.RelativeAltitude / 100, |
| | 198 | Units::AltitudeUnit)); |
| 198 | 199 | |
| 199 | 200 | // if (relative altitude is other than zero) |
-
|
rb600bd
|
r61d052
|
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | | vval = Basic().TotalEnergyVario; |
| 210 | | |
| 211 | | double vvaldisplay = min(99.9,max(-99.9,vval*LIFTMODIFY)); |
| | 209 | vval = Units::ToUserUnit(Basic().TotalEnergyVario, Units::VerticalSpeedUnit); |
| | 210 | |
| | 211 | double vvaldisplay = min(99.9, max(-99.9, vval)); |
| 212 | 212 | |
| 213 | 213 | if (Appearance.GaugeVarioAvgText) { |
| … |
… |
|
| 215 | 215 | if (!Calculated().Circling) { |
| 216 | 216 | RenderValue(canvas, orgTop.x, orgTop.y, &diValueTop, &diLabelTop, |
| 217 | | Calculated().NettoAverage30s*LIFTMODIFY, TEXT("NetAvg")); |
| | 217 | Units::ToUserUnit(Calculated().NettoAverage30s, |
| | 218 | Units::VerticalSpeedUnit), TEXT("NetAvg")); |
| 218 | 219 | } else { |
| 219 | 220 | RenderValue(canvas, orgTop.x, orgTop.y, &diValueTop, &diLabelTop, |
| 220 | | Calculated().Average30s*LIFTMODIFY, TEXT("Avg")); |
| | 221 | Units::ToUserUnit(Calculated().Average30s, |
| | 222 | Units::VerticalSpeedUnit), TEXT("Avg")); |
| 221 | 223 | } |
| 222 | 224 | } |
| 223 | 225 | |
| 224 | 226 | if (Appearance.GaugeVarioMc) { |
| 225 | | double mc = Calculated().common_stats.current_mc*LIFTMODIFY; |
| | 227 | double mc = Units::ToUserUnit(Calculated().common_stats.current_mc, |
| | 228 | Units::VerticalSpeedUnit); |
| 226 | 229 | if (SettingsComputer().auto_mc) |
| 227 | 230 | RenderValue(canvas, orgBottom.x, orgBottom.y, |
| … |
… |
|
| 389 | 392 | int i; |
| 390 | 393 | if (!InitDone){ |
| 391 | | degrees_per_unit = |
| 392 | | (int)((GAUGEVARIOSWEEP/2.0)/(GAUGEVARIORANGE*LIFTMODIFY)); |
| 393 | | gmax = |
| 394 | | max(80,(int)(degrees_per_unit*(GAUGEVARIORANGE*LIFTMODIFY))+2); |
| | 394 | degrees_per_unit = (int)((GAUGEVARIOSWEEP * 0.5) / |
| | 395 | Units::ToUserUnit(GAUGEVARIORANGE, |
| | 396 | Units::VerticalSpeedUnit)); |
| | 397 | gmax = max(80, (int)(degrees_per_unit * |
| | 398 | Units::ToUserUnit(GAUGEVARIORANGE, |
| | 399 | Units::VerticalSpeedUnit)) + 2); |
| 395 | 400 | MakeAllPolygons(); |
| 396 | 401 | InitDone = true; |
| 397 | 402 | }; |
| 398 | | i = iround(Value*degrees_per_unit*LIFTMODIFY); |
| | 403 | i = iround(Units::ToUserUnit(Value * degrees_per_unit, |
| | 404 | Units::VerticalSpeedUnit)); |
| 399 | 405 | i = min(gmax,max(-gmax,i)); |
| 400 | 406 | return i; |