발전시뮬레이션 엑셀/PDF 다운로드 API 추가
This commit is contained in:
parent
9e3a72d15e
commit
c99141b909
@ -78,19 +78,19 @@ public class PwrGnrSimService {
|
|||||||
// 태양 적위
|
// 태양 적위
|
||||||
double[] taiyousekii = readValuesFromFile("template/pwrGnrSimulation/taiyousekii.txt");
|
double[] taiyousekii = readValuesFromFile("template/pwrGnrSimulation/taiyousekii.txt");
|
||||||
|
|
||||||
static double[][] peakcut_by_pcs_data =
|
double[][] peakcut_by_pcs_data =
|
||||||
readValuesFromFile2("template/pwrGnrSimulation/peakcut_by_pcs_data.txt");
|
readValuesFromFile2("template/pwrGnrSimulation/peakcut_by_pcs_data.txt");
|
||||||
|
|
||||||
static double[][] tashounen_data_deg0 =
|
double[][] tashounen_data_deg0 =
|
||||||
readValuesFromFile2("template/pwrGnrSimulation/tashounen_data_deg0.txt");
|
readValuesFromFile2("template/pwrGnrSimulation/tashounen_data_deg0.txt");
|
||||||
|
|
||||||
static double[][] tashounen_data_deg90 =
|
double[][] tashounen_data_deg90 =
|
||||||
readValuesFromFile2("template/pwrGnrSimulation/tashounen_data_deg90.txt");
|
readValuesFromFile2("template/pwrGnrSimulation/tashounen_data_deg90.txt");
|
||||||
|
|
||||||
static double[][] amp_peakcut_data_deg0 =
|
double[][] amp_peakcut_data_deg0 =
|
||||||
readValuesFromFile2("template/pwrGnrSimulation/amp_peakcut_data_deg0.txt");
|
readValuesFromFile2("template/pwrGnrSimulation/amp_peakcut_data_deg0.txt");
|
||||||
|
|
||||||
static double[][] amp_peakcut_data_deg90 =
|
double[][] amp_peakcut_data_deg90 =
|
||||||
readValuesFromFile2("template/pwrGnrSimulation/amp_peakcut_data_deg90.txt");
|
readValuesFromFile2("template/pwrGnrSimulation/amp_peakcut_data_deg90.txt");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -515,7 +515,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 배열 변환 및 포맷 처리 메서드
|
// 배열 변환 및 포맷 처리 메서드
|
||||||
private static String[] formatAndPrintArray(double[] doubleArray) {
|
private String[] formatAndPrintArray(double[] doubleArray) {
|
||||||
return Arrays.stream(doubleArray)
|
return Arrays.stream(doubleArray)
|
||||||
.mapToInt(d -> (int) d) // double -> int 변환
|
.mapToInt(d -> (int) d) // double -> int 변환
|
||||||
.mapToObj(i -> String.format("%,d", i))
|
.mapToObj(i -> String.format("%,d", i))
|
||||||
@ -523,7 +523,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 설치면의 사면 일사량 계산
|
// 설치면의 사면 일사량 계산
|
||||||
public static double[] peakcut(
|
public double[] peakcut(
|
||||||
int simulationPointNumber,
|
int simulationPointNumber,
|
||||||
double koubai,
|
double koubai,
|
||||||
double houi,
|
double houi,
|
||||||
@ -620,7 +620,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 0도 방위 전력 피크 컷을 계산하는 방법 */
|
/** 0도 방위 전력 피크 컷을 계산하는 방법 */
|
||||||
private static double computePowerPeakCutDeg0(
|
private double computePowerPeakCutDeg0(
|
||||||
int simulationPointNumber, double sekisairitsu, double koubai) {
|
int simulationPointNumber, double sekisairitsu, double koubai) {
|
||||||
// 0度近似曲線係数
|
// 0度近似曲線係数
|
||||||
double[] x = {1, 5, 15, 20, 30, 40};
|
double[] x = {1, 5, 15, 20, 30, 40};
|
||||||
@ -715,7 +715,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 전류 피크 컷(5차) 90도 근사 곡선 계수 */
|
/** 전류 피크 컷(5차) 90도 근사 곡선 계수 */
|
||||||
private static double computeAmpPeakCutDeg90(
|
private double computeAmpPeakCutDeg90(
|
||||||
int simulationPointNumber, double koubai, double amp_delta) {
|
int simulationPointNumber, double koubai, double amp_delta) {
|
||||||
|
|
||||||
// 초기 설정
|
// 초기 설정
|
||||||
@ -816,8 +816,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 전류 피크 컷(5차) 0도 근사 곡선 계수 */
|
/** 전류 피크 컷(5차) 0도 근사 곡선 계수 */
|
||||||
private static double computeAmpPeakCutDeg0(
|
private double computeAmpPeakCutDeg0(int simulationPointNumber, double koubai, double amp_delta) {
|
||||||
int simulationPointNumber, double koubai, double amp_delta) {
|
|
||||||
double[] x = {5, 15, 20, 30, 40, 50};
|
double[] x = {5, 15, 20, 30, 40, 50};
|
||||||
double[] z2 = new double[6];
|
double[] z2 = new double[6];
|
||||||
|
|
||||||
@ -907,7 +906,7 @@ public class PwrGnrSimService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 0도 방위 전력 피크 컷을 계산하는 방법 */
|
/** 0도 방위 전력 피크 컷을 계산하는 방법 */
|
||||||
private static double computePowerPeakCutDeg90(
|
private double computePowerPeakCutDeg90(
|
||||||
int simulationPointNumber, double sekisairitsu, double koubai) {
|
int simulationPointNumber, double sekisairitsu, double koubai) {
|
||||||
// 데이터 초기화
|
// 데이터 초기화
|
||||||
double[] x = {1, 5, 15, 20, 30, 40};
|
double[] x = {1, 5, 15, 20, 30, 40};
|
||||||
@ -1194,7 +1193,7 @@ public class PwrGnrSimService {
|
|||||||
return shamenNissha;
|
return shamenNissha;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double[] readValuesFromFile(String fileName) {
|
public double[] readValuesFromFile(String fileName) {
|
||||||
List<Double> values = new ArrayList<>();
|
List<Double> values = new ArrayList<>();
|
||||||
|
|
||||||
try (InputStream inputStream =
|
try (InputStream inputStream =
|
||||||
@ -1217,7 +1216,7 @@ public class PwrGnrSimService {
|
|||||||
return values.stream().mapToDouble(Double::doubleValue).toArray();
|
return values.stream().mapToDouble(Double::doubleValue).toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[][] readValuesFromFileString2(String fileName) {
|
public String[][] readValuesFromFileString2(String fileName) {
|
||||||
|
|
||||||
List<String[]> values = new ArrayList<>();
|
List<String[]> values = new ArrayList<>();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -1255,7 +1254,7 @@ public class PwrGnrSimService {
|
|||||||
return values.toArray(new String[0][]);
|
return values.toArray(new String[0][]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double[][] readValuesFromFile2(String fileName) {
|
public double[][] readValuesFromFile2(String fileName) {
|
||||||
List<double[]> values = new ArrayList<>();
|
List<double[]> values = new ArrayList<>();
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -1313,7 +1312,7 @@ public class PwrGnrSimService {
|
|||||||
return guideResponse;
|
return guideResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Document pwrGnrSimPdfHtml(Document doc, PwrGnrSimResponse data)
|
public Document pwrGnrSimPdfHtml(Document doc, PwrGnrSimResponse data)
|
||||||
throws IOException, QcastException {
|
throws IOException, QcastException {
|
||||||
|
|
||||||
String[] pwrGnrSimList = data.getFrcPwrGnrList();
|
String[] pwrGnrSimList = data.getFrcPwrGnrList();
|
||||||
@ -1485,7 +1484,7 @@ public class PwrGnrSimService {
|
|||||||
return doc;
|
return doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int roundUpAuto(double value) {
|
public int roundUpAuto(double value) {
|
||||||
int length = (int) Math.log10(value) + 1; // 숫자의 자리수를 계산
|
int length = (int) Math.log10(value) + 1; // 숫자의 자리수를 계산
|
||||||
int place = (int) Math.pow(10, length - 1); // 자리수에 따른 올림 기준(10, 100, 1000 등)
|
int place = (int) Math.pow(10, length - 1); // 자리수에 따른 올림 기준(10, 100, 1000 등)
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user