File tree Expand file tree Collapse file tree
nodejs-assets/nodejs-project Expand file tree Collapse file tree Original file line number Diff line number Diff line change 541541 sections . innerHTML += element ;
542542 } ;
543543
544+ let cellStartValues = [ ] ;
545+
544546 const estimateBalanceCells = [ ] ;
545547 function createCellsSection ( balanceStatus , cellVolts ) {
546548 if ( ! balanceStatus || ! cellVolts ) return ;
569571 { id : 'cell-avg' , name : 'Avg' , value : averageVoltage . toFixed ( 3 ) } ,
570572 ] ;
571573
574+ if ( ! cellStartValues . length ) {
575+ cellStartValues = cellVolts ;
576+ }
577+
578+ const cellDiffs = cellStartValues . map ( ( v , i ) => {
579+ const diff = cellVolts [ i ] - v ;
580+ return diff . toFixed ( 3 ) ;
581+ } ) ;
582+
572583 const element = `
573584 <div id="cellsSection">
574585
671682 return '🟢' ;
672683 }
673684
674- return off ;
685+ if ( isLow ) {
686+ return off ;
687+ }
688+
689+ return '🔵' ;
675690 } ) ( ) }
676- <span title="Balance Status" style="${
677- ! v ? 'filter: grayscale(100%);' : ''
678- } ">⚖️</span>
691+ <span title="Balance Status" style="${
692+ ! v ? 'filter: grayscale(100%); opacity: 0.4 ' : ''
693+ } ">⚖️</span>
679694 </span>
680-
681-
695+ <span title="Changes" style="opacity: 0.5">${
696+ cellDiffs [ i ] > 0 ? '+' : ''
697+ } ${ cellDiffs [ i ] } </span>
682698 </div>
683699 ` ;
684700 } )
You can’t perform that action at this time.
0 commit comments