| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.zy.ai.domain.autotune.AutoTuneParameterSnapshot; |
| | | import com.zy.ai.domain.autotune.AutoTuneRuleDefinition; |
| | | import com.zy.ai.domain.autotune.AutoTuneRuleSnapshotItem; |
| | | import com.zy.ai.domain.autotune.AutoTuneSnapshot; |
| | | import com.zy.ai.domain.autotune.AutoTuneStationRuntimeItem; |
| | | import com.zy.ai.domain.autotune.AutoTuneTaskSnapshot; |
| | |
| | | snapshot.setCycleLoadSnapshot(buildCycleLoadSnapshot()); |
| | | snapshot.setFlowTopologySnapshot(flowTopologySnapshotService.buildSnapshot(stationRuntimeSnapshot)); |
| | | snapshot.setCurrentParameterSnapshot(buildCurrentParameterSnapshot()); |
| | | snapshot.setRuleSnapshot(buildRuleSnapshot()); |
| | | snapshot.setSnapshotTime(new Date()); |
| | | return snapshot; |
| | | } |
| | | |
| | | List<AutoTuneRuleSnapshotItem> buildRuleSnapshot() { |
| | | List<AutoTuneRuleSnapshotItem> result = new ArrayList<>(); |
| | | for (AutoTuneRuleDefinition.Rule rule : AutoTuneRuleDefinition.rules().values()) { |
| | | AutoTuneRuleSnapshotItem item = new AutoTuneRuleSnapshotItem(); |
| | | item.setTargetType(rule.getTargetType().getCode()); |
| | | item.setTargetKey(rule.getTargetKey()); |
| | | item.setMinValue(rule.getMinValue()); |
| | | item.setMaxValue(rule.getMaxValue()); |
| | | item.setMaxStep(rule.getMaxStep()); |
| | | item.setCooldownMinutes(rule.getCooldownMinutes()); |
| | | item.setDynamicMaxValue(rule.isDynamicMaxValue()); |
| | | item.setDynamicMaxSource(rule.getDynamicMaxSource()); |
| | | item.setNote(rule.getNote()); |
| | | result.add(item); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | private AutoTuneTaskSnapshot buildTaskSnapshot() { |
| | | List<WrkMast> activeTasks = loadActiveTasks(); |
| | | |