Skip to content

Commit 295423d

Browse files
committed
Fix Drag and Lift values not updating properly when their units change (e.g. mN -> N) - reported by Kayser
1 parent 8aa74bc commit 295423d

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/MicroEngineer/Entries/FlightEntries.cs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,10 @@ public TotalLift()
244244

245245
public override void RefreshData()
246246
{
247-
EntryValue = AeroForces.TotalLift;
247+
EntryValue = AeroForces.TotalLift * 1000;
248248
}
249249

250-
public override string ValueDisplay
251-
{
252-
get
253-
{
254-
if (EntryValue == null)
255-
return "-";
256-
257-
double toReturn = (double)EntryValue * 1000;
258-
return String.IsNullOrEmpty(base.Formatting) ? toReturn.ToString() : String.Format(base.Formatting, toReturn);
259-
}
260-
}
250+
public override string ValueDisplay => base.ValueDisplay;
261251
}
262252

263253
public class TotalDrag : FlightEntry
@@ -279,20 +269,10 @@ public TotalDrag()
279269

280270
public override void RefreshData()
281271
{
282-
EntryValue = AeroForces.TotalDrag;
272+
EntryValue = AeroForces.TotalDrag * 1000;
283273
}
284274

285-
public override string ValueDisplay
286-
{
287-
get
288-
{
289-
if (EntryValue == null)
290-
return "-";
291-
292-
double toReturn = (double)EntryValue * 1000;
293-
return String.IsNullOrEmpty(base.Formatting) ? toReturn.ToString() : String.Format(base.Formatting, toReturn);
294-
}
295-
}
275+
public override string ValueDisplay => base.ValueDisplay;
296276
}
297277

298278
public class LiftDivDrag : FlightEntry

0 commit comments

Comments
 (0)