v++
Разобрался с форматами ячеек. числа надо было писать не переводя в String, тогда ошибки не показывает. Матрицы закинул в кавычки.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.Themes.FreeFortranSPFTokenMaker;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Files.VDirectoryChooser;
|
||||
import Common.Utils.Index;
|
||||
@@ -32,7 +33,6 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
Vector<CellStyle> styles;
|
||||
//--
|
||||
Workbook book = null;
|
||||
// DataFormat format = null;
|
||||
Sheet sheet = null;
|
||||
//--
|
||||
LinkedHashMap<Long, Vector<TestRunTask>> packages_tasks = null;
|
||||
@@ -54,7 +54,6 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
book = null;
|
||||
sheet = null;
|
||||
styles = null;
|
||||
// format = null;
|
||||
packages_tasks = new LinkedHashMap<>();
|
||||
target = null;
|
||||
//--
|
||||
@@ -133,14 +132,13 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
Row row = sheet.createRow(row_num);
|
||||
int i = 0;
|
||||
for (Object value : values) {
|
||||
String cell_text = value.toString();
|
||||
// String cell_text = value.toString();
|
||||
Cell cell = row.createCell(i);
|
||||
int style_index = 1;
|
||||
switch (i) {
|
||||
case 4:
|
||||
case 5:
|
||||
TaskState state = (TaskState) value;
|
||||
cell_text = state.getDescription();
|
||||
switch (state) {
|
||||
case FailedToQueue:
|
||||
case NoSuchTask:
|
||||
@@ -166,10 +164,24 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
style_index = 6;
|
||||
break;
|
||||
}
|
||||
cell.setCellValue(state.getDescription());
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 15:
|
||||
cell.setCellValue((int)value);
|
||||
break;
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
cell.setCellValue((double) value);
|
||||
break;
|
||||
default:
|
||||
cell.setCellValue(value.toString());
|
||||
break;
|
||||
}
|
||||
cell.setCellStyle(styles.get(style_index));
|
||||
cell.setCellValue(cell_text);
|
||||
//--
|
||||
++i;
|
||||
}
|
||||
@@ -205,6 +217,9 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
String formatMatrix(String matrix){
|
||||
return Utils.DQuotes(matrix.trim());
|
||||
}
|
||||
void createStyles() {
|
||||
styles = new Vector<>();
|
||||
//0 - заголовок
|
||||
@@ -216,7 +231,7 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
//6 - серый
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
CellStyle style = book.createCellStyle();
|
||||
// style.setDataFormat(format.getFormat("@"));
|
||||
style.setAlignment(CellStyle.ALIGN_LEFT);
|
||||
Font font = book.createFont();
|
||||
switch (i) {
|
||||
case 0:
|
||||
@@ -279,7 +294,7 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
ShowMessage2(task.test_description);
|
||||
//---
|
||||
Integer NUM_THREADS = extractIntegerEnvironmentValue(task.environments, "DVMH_NUM_THREADS");
|
||||
if (NUM_THREADS !=null && NUM_THREADS ==0) NUM_THREADS = 1;
|
||||
if (NUM_THREADS != null && NUM_THREADS == 0) NUM_THREADS = 1;
|
||||
Integer NUM_CUDAS = extractIntegerEnvironmentValue(task.environments, "DVMH_NUM_CUDAS");
|
||||
//--
|
||||
Object num_threads = (NUM_THREADS != null) ? NUM_THREADS : "undef";
|
||||
@@ -287,22 +302,22 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
Object total_threads = (NUM_THREADS != null) ? NUM_THREADS * Utils.getMatrixProcessors(task.matrix) : "undef";
|
||||
//--
|
||||
addTaskRow(offset.getValue(),
|
||||
task.group_description,
|
||||
task.test_description,
|
||||
task.language.getDescription(),
|
||||
task.flags,
|
||||
task.compilation_state,
|
||||
task.state,
|
||||
num_threads,
|
||||
num_cudas,
|
||||
total_threads,
|
||||
task.matrix,
|
||||
task.environments,
|
||||
task.usr_par,
|
||||
task.compilation_time,
|
||||
task.Time,
|
||||
task.CleanTime,
|
||||
task.progress
|
||||
task.group_description, //0
|
||||
task.test_description,//1
|
||||
task.language.getDescription(), //2
|
||||
task.flags, //3
|
||||
task.compilation_state, //4
|
||||
task.state, //5
|
||||
num_threads, //6
|
||||
num_cudas, //7
|
||||
total_threads, //8
|
||||
formatMatrix(task.matrix), //9
|
||||
task.environments, //10
|
||||
task.usr_par, //11
|
||||
task.compilation_time, //12
|
||||
task.Time,//13
|
||||
task.CleanTime, //14
|
||||
task.progress //15
|
||||
);
|
||||
offset.Inc();
|
||||
}
|
||||
@@ -320,7 +335,7 @@ public class ExportTasksPackageToExcel extends Pass_2021<Vector<TasksPackage>> {
|
||||
Index offset = new Index();
|
||||
for (TasksPackage tasksPackage : target) {
|
||||
exportPackage(tasksPackage, offset);
|
||||
// UI.Info(String.valueOf(tasksPackage.id));
|
||||
// UI.Info(String.valueOf(tasksPackage.id));
|
||||
}
|
||||
//--
|
||||
for (int i = 0; i < max_columns; ++i)
|
||||
|
||||
Reference in New Issue
Block a user