Skip to content

Commit

Permalink
Fixed usage of default density
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Aug 16, 2024
1 parent 9d6f350 commit ef13c78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class AppSettingsComponent implements OnInit {
public resetToDefault(): void {
this.settingsForm.patchValue({
imperialUnits: false,
// needs to be always in metric, because we reset to metric
maxDensity: Precision.round(this.appSettings.defaultMaxGasDensity, 1),
// needs to be in current units, because range is not applied yet
maxDensity: Precision.round(this.appSettings.defaultMaxGasDensity, this.ranges.densityRounding),
icdIgnored: false,
densityIgnored: false,
noDecoIgnored: false
Expand Down
5 changes: 3 additions & 2 deletions projects/planner/src/app/shared/ApplicationSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ export class ApplicationSettingsService {
return this.appSettings;
}

/** in current units **/
public get maxGasDensity(): number {
return this.units.fromGramPerLiter(this.appSettings.maxGasDensity);
}

/** in metric **/
/** in current units **/
public get defaultMaxGasDensity(): number {
return GasDensity.recommendedMaximum;
return this.units.fromGramPerLiter(GasDensity.recommendedMaximum);
}

public get icdIgnored(): boolean {
Expand Down

0 comments on commit ef13c78

Please sign in to comment.