Skip to content

Commit 6943b61

Browse files
derekheCopilot
andauthored
Update src/js/tabs/motors.js
Co-authored-by: Copilot <[email protected]>
1 parent cea9bbc commit 6943b61

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/js/tabs/motors.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -654,20 +654,20 @@ motors.initialize = async function (callback) {
654654
const currentAmperage = FC.ANALOG.amperage;
655655

656656
// 5 seconds average
657-
TABS.motors.amperageHistory5s.push(currentAmperage);
658-
if (TABS.motors.amperageHistory5s.length > TABS.motors.amperageHistorySize5s) {
659-
TABS.motors.amperageHistory5s.shift();
657+
self.amperageHistory5s.push(currentAmperage);
658+
if (self.amperageHistory5s.length > self.amperageHistorySize5s) {
659+
self.amperageHistory5s.shift();
660660
}
661-
const amperageSum5s = TABS.motors.amperageHistory5s.reduce((sum, value) => sum + value, 0);
662-
const amperageAverage5s = amperageSum5s / TABS.motors.amperageHistory5s.length;
661+
const amperageSum5s = self.amperageHistory5s.reduce((sum, value) => sum + value, 0);
662+
const amperageAverage5s = amperageSum5s / self.amperageHistory5s.length;
663663

664664
// 10 seconds average
665-
TABS.motors.amperageHistory10s.push(currentAmperage);
666-
if (TABS.motors.amperageHistory10s.length > TABS.motors.amperageHistorySize10s) {
667-
TABS.motors.amperageHistory10s.shift();
665+
self.amperageHistory10s.push(currentAmperage);
666+
if (self.amperageHistory10s.length > self.amperageHistorySize10s) {
667+
self.amperageHistory10s.shift();
668668
}
669-
const amperageSum10s = TABS.motors.amperageHistory10s.reduce((sum, value) => sum + value, 0);
670-
const amperageAverage10s = amperageSum10s / TABS.motors.amperageHistory10s.length;
669+
const amperageSum10s = self.amperageHistory10s.reduce((sum, value) => sum + value, 0);
670+
const amperageAverage10s = amperageSum10s / self.amperageHistory10s.length;
671671

672672
// Display average amperages
673673
motorAmperageAverage5sElement.text(

0 commit comments

Comments
 (0)