FIX: voltageStr shows absolute values now
This commit is contained in:
parent
c68217b595
commit
d62aab85ea
@ -26,7 +26,7 @@ export class Battery extends Part {
|
||||
}
|
||||
|
||||
get voltageStr(): string {
|
||||
return siPrefix(this.voltage, 'V', 2);
|
||||
return siPrefix(Math.abs(this.voltage), 'V', 2);
|
||||
}
|
||||
|
||||
get current(): number {
|
||||
@ -34,8 +34,7 @@ export class Battery extends Part {
|
||||
}
|
||||
|
||||
get currentStr(): string {
|
||||
const current = Math.abs(this.current) || 0;
|
||||
return siPrefix(current, 'A', 2);
|
||||
return siPrefix(Math.abs(this.current) || 0, 'A', 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ export class Light extends Part {
|
||||
}
|
||||
|
||||
get voltageStr(): string {
|
||||
return siPrefix(this.voltage, 'V', 2);
|
||||
return siPrefix(Math.abs(this.voltage), 'V', 2);
|
||||
}
|
||||
|
||||
get current(): number {
|
||||
@ -50,8 +50,7 @@ export class Light extends Part {
|
||||
}
|
||||
|
||||
get currentStr(): string {
|
||||
const current = Math.abs(this.current) || 0;
|
||||
return siPrefix(current, 'A', 2);
|
||||
return siPrefix(Math.abs(this.current) || 0, 'A', 2);
|
||||
}
|
||||
|
||||
fill(): string {
|
||||
|
||||
@ -53,7 +53,7 @@ export class Relay extends Part {
|
||||
}
|
||||
|
||||
get voltageStr(): string {
|
||||
return siPrefix(this.voltage, 'V', 2);
|
||||
return siPrefix(Math.abs(this.voltage), 'V', 2);
|
||||
}
|
||||
|
||||
get current(): number {
|
||||
@ -64,8 +64,7 @@ export class Relay extends Part {
|
||||
}
|
||||
|
||||
get currentStr(): string {
|
||||
const current = Math.abs(this.current) || 0;
|
||||
return siPrefix(current, 'A', 2);
|
||||
return siPrefix(Math.abs(this.current) || 0, 'A', 2);
|
||||
}
|
||||
|
||||
override loop(): boolean {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user