| | |
| | | assert.equal(step.data.recordNo, 'step:1:1') |
| | | assert.equal(step.data.recordedAt, 1683521083000) |
| | | assert.equal(step.data.stepDuration, 3752) |
| | | assert.equal(step.data.chargePeakVoltage, null) |
| | | assert.equal(step.data.dischargeValleyVoltage, null) |
| | | assert.equal(step.data.chargeMedianVoltage, 0) |
| | | assert.equal(step.data.dischargeMedianVoltage, 1.1709) |
| | | // 中值空格和缺列不变成零,也不回退读取同一文件的峰谷值。 |
| | | XLSX.utils.sheet_add_aoa(workbook.Sheets.step, [['', '', '充电峰值电压(V)', '放电谷值电压(V)'], ['', '', 1.8, 0.8]], { origin: 'I1' }) |
| | | const absent = parseConsoleImport(workbook, 'STEP', ['BAT-1'])[0] |
| | | assert.deepEqual(absent.errors, []) |
| | | assert.equal(absent.data.chargeMedianVoltage, null) |
| | | assert.equal(absent.data.dischargeMedianVoltage, null) |
| | | XLSX.utils.sheet_add_aoa(workbook.Sheets.step, [['充电中值电压(V)', '放电中值电压(V)'], ['', '不是数字']], { origin: 'I1' }) |
| | | const invalid = parseConsoleImport(workbook, 'STEP', ['BAT-1'])[0] |
| | | assert.equal(invalid.data.chargeMedianVoltage, null) |
| | | assert.match(invalid.errors.join(), /放电中值电压.*必须是数字或空值/) |
| | | const cycle = parseConsoleImport(workbook, 'CYCLE', ['BAT-1'])[0] |
| | | assert.deepEqual(cycle.errors, []) |
| | | assert.equal(cycle.data.recordNo, 'cycle:1') |