Batteries Modules
- Source:
Classes
Members
(inner, constant) MAX_VOLTAGE :Number
- Source:
Maximum nominal voltage
Type:
- Number
(inner, constant) MIN_VOLTAGE :Number
- Source:
Minimum nominal voltage
Type:
- Number
(inner, constant) NUM_CELLS :Number
- Source:
Number of Cells to be in Battery Index
Type:
- Number
(inner, constant) TABLE :HTMLElement
- Source:
HTML Element of Table
Type:
- HTMLElement
(inner, constant) TABLE_HEIGHT :Number
- Source:
Height of battery table
Type:
- Number
(inner, constant) TABLE_WIDTH :Number
- Source:
Width of battery table
Type:
- Number
Methods
(inner) checkMinMax()
- Source:
Checks if a cell's voltage is within the nominal values
(inner) createRow(rowNum, numCells)
- Source:
Creates a row filled with battery cells
Parameters:
Name | Type | Description |
---|---|---|
rowNum |
Number | Row number to create |
numCells |
Number | Number of cells in row to create |
(inner) createTable(numRows, numCells)
- Source:
Creates battery table
Parameters:
Name | Type | Description |
---|---|---|
numRows |
Number | Number of rows in table |
numCells |
* | Number of cells per row |
(inner) fillCell(batteryIndex, row, col)
- Source:
Fills cell with battery cell data
Parameters:
Name | Type | Description |
---|---|---|
batteryIndex |
Number | Index of battery to fill |
row |
Number | Row of cell to fill |
col |
Number | Column of cell to fill |
(inner) initBatteries()
- Source:
Creates table of batteries with given dimentions
(inner) updateBattery(batteryIndex, voltage)
- Source:
Updates battery cell with voltage
Parameters:
Name | Type | Description |
---|---|---|
batteryIndex |
Number | Index of battery to update |
voltage |
Number | Voltage to put into battery |
(inner) updateBatteryAndRender(batteryIndex, voltage)
- Source:
Updates battery cell with voltage and renders it on the table
Parameters:
Name | Type | Description |
---|---|---|
batteryIndex |
Number | Index of battery to update |
voltage |
Number | Voltage to put into battery |
(inner) updateCell(batteryIndex)
- Source:
Update table cell with battery cell info
Parameters:
Name | Type | Description |
---|---|---|
batteryIndex |
Number | index of battery |
(inner) updateTemps(min, avg, max)
- Source:
Updates the label at bottom of screen with temperatures
Parameters:
Name | Type | Description |
---|---|---|
min |
Number | Minimum temperature of battery pack |
avg |
Number | Average temperature of battery pack |
max |
Number | Maximum termperature of battery pack |