|
@@ -1,7 +1,10 @@
|
|
|
package com.gyee.generation.util.math;
|
|
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
import java.util.Map;
|
|
|
|
|
|
+@Service
|
|
|
public class PowerIntegration {
|
|
|
|
|
|
/**
|
|
@@ -15,7 +18,7 @@ public class PowerIntegration {
|
|
|
* @return
|
|
|
*/
|
|
|
// 计算电量
|
|
|
- private static double calculateEnergy(Map<Integer, Double> powerData, double timeInterval) {
|
|
|
+ public double calculateEnergy(Map<Integer, Double> powerData, double timeInterval) {
|
|
|
double energy = 0.0;
|
|
|
for (int time = 0; time < powerData.size() - 1; time++) {
|
|
|
double power1 = powerData.get(time);
|