Skip to content

Commit

Permalink
Update capx-state.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
geoyogesh committed Oct 4, 2020
1 parent 5fecefa commit db4199d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions projects/capx/src/app/capx/services/capx-state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CapxStateService {
zone4_west_vc: null,
zone5_center_clv: null,
zone5_center_vc: null,
all_vlc: null,
all_clv: null,
all_vc: null
};

Expand Down Expand Up @@ -744,48 +744,48 @@ export class CapxStateService {
this.updateRank();
}

public getClvRangeColor(zone_all_vlc: number | null): string {
public getClvRangeColor(zone_all_clv: number | null): string {
// update range text
const clv = this.inputParameters$.value.critical_lane_volume;
if (zone_all_vlc === null || clv === null) {
if (zone_all_clv === null || clv === null) {
return this.default_color;
}

if (zone_all_vlc < round(0.75 * clv)) {
if (zone_all_clv < round(0.75 * clv)) {
return '#ffffb2';
}
else if (zone_all_vlc >= round(0.75 * clv) && zone_all_vlc <= round(0.875 * clv) - 1) {
else if (zone_all_clv >= round(0.75 * clv) && zone_all_clv <= round(0.875 * clv) - 1) {
return '#fecc5c';
}
else if (zone_all_vlc >= round(0.875 * clv) && zone_all_vlc <= round(clv) - 1) {
else if (zone_all_clv >= round(0.875 * clv) && zone_all_clv <= round(clv) - 1) {
return '#fd8d3c';
}
else if (zone_all_vlc >= round(clv)) {
else if (zone_all_clv >= round(clv)) {
return '#e31a1c';
}
else {
return this.default_color;
}
}

public getCurrentClvRange(zone_all_vlc: string | number | null): number | null {
public getCurrentClvRange(zone_all_clv: string | number | null): number | null {
// update range text
console.log(zone_all_vlc);
console.log(zone_all_clv);
const clv = this.inputParameters$.value.critical_lane_volume;
if (zone_all_vlc === null || clv === null) {
if (zone_all_clv === null || clv === null) {
return null;
}

if (zone_all_vlc < round(0.75 * clv)) {
if (zone_all_clv < round(0.75 * clv)) {
return 1;
}
else if (zone_all_vlc >= round(0.75 * clv) && zone_all_vlc <= round(0.875 * clv) - 1) {
else if (zone_all_clv >= round(0.75 * clv) && zone_all_clv <= round(0.875 * clv) - 1) {
return 2;
}
else if (zone_all_vlc >= round(0.875 * clv) && zone_all_vlc <= round(clv) - 1) {
else if (zone_all_clv >= round(0.875 * clv) && zone_all_clv <= round(clv) - 1) {
return 3;
}
else if (zone_all_vlc >= round(clv)) {
else if (zone_all_clv >= round(clv)) {
return 4;
}
else {
Expand Down

0 comments on commit db4199d

Please sign in to comment.