| | |
| | | import java.math.BigDecimal; |
| | | import java.time.Instant; |
| | | import java.util.List; |
| | | import com.battery.device.model.ChannelIdentity; |
| | | import com.battery.device.model.Measurement; |
| | | import com.battery.device.api.model.ChannelIdentity; |
| | | import com.battery.device.api.model.Measurement; |
| | | |
| | | /** 供业务持久化使用的厂商无关测试数据观测扩展。 */ |
| | | public interface TestDataObservationAdapter extends DeviceObservationAdapter |
| | |
| | | CabinetRealtime latestCabinet(ChannelIdentity channel); |
| | | |
| | | /** 返回采集器独立实时快照;不得通过历史下载补采。 */ |
| | | CollectorRealtime latestCollector(long collectorId); |
| | | CollectorRealtime latestCollector(String collectorCode); |
| | | |
| | | /** 返回设备直接提供的工步统计,不从实时采样推导。 */ |
| | | List<StepRecord> stepRecords(ChannelIdentity channel); |
| | |
| | | /** 返回适配器定义的实时持久化槽位间隔。 */ |
| | | long persistenceIntervalMillis(ChannelIdentity channel); |
| | | |
| | | /** 返回设备计划方案;设备未提供时保持为空,不推导计划。 */ |
| | | default TestPlan testPlan(ChannelIdentity channel) { return null; } |
| | | |
| | | record TestPlan(int currentCycleNo, int currentStepNo, int plannedCycleCount, List<PlanRow> rows) { } |
| | | record PlanRow(String rowType, int stepNo, Integer cyclePosition, String stepName, double durationSeconds, |
| | | Double voltageV, String executionStatus, Integer cycleCount, Long recordCount) { } |
| | | |
| | | record CabinetRealtime(long sequenceId, Instant deviceTime, double currentA, double voltageV, |
| | | double capacityAh, double energyWh, int cycleNo, int stepNo, String stepName, String stepType, |
| | | Instant serverReceivedAt) { } |
| | | Instant serverReceivedAt, String deviceTimeRaw, String timezoneId) { } |
| | | |
| | | record CollectorRealtime(String collectorCode, boolean online, int sampleIntervalMs, |
| | | List<CollectorMeasurement> measurements) |
| | | List<CollectorMeasurement> measurements, String timezoneId) |
| | | { |
| | | public CollectorRealtime { measurements = measurements == null ? List.of() : List.copyOf(measurements); } |
| | | } |
| | |
| | | Instant serverReceivedAt, String metricCode, BigDecimal value, String unit) { } |
| | | |
| | | record StepRecord(String sourceRecordId, int cycleNo, int stepNo, String stepName, String stepType, |
| | | Instant startedAt, Instant endedAt, double endVoltageV, double capacityAh, double energyWh) { } |
| | | Instant startedAt, Instant endedAt, double endVoltageV, double capacityAh, double energyWh, |
| | | String deviceTimeRaw, String timezoneId, Instant serverReceivedAt, |
| | | java.util.Map<String, BigDecimal> measurements) { } |
| | | |
| | | record CycleRecord(String sourceRecordId, int cycleNo, Instant startedAt, Instant endedAt, |
| | | double chargeCapacityAh, double dischargeCapacityAh, double chargeEnergyWh, |
| | | double dischargeEnergyWh, double efficiency) { } |
| | | double dischargeEnergyWh, double efficiency, String deviceTimeRaw, String timezoneId, |
| | | Instant serverReceivedAt) { } |
| | | } |