Разобрался с форматами ячеек. числа надо было писать не переводя в String, тогда ошибки не показывает. Матрицы закинул в кавычки.
This commit is contained in:
2023-12-09 02:19:28 +03:00
parent 7dc687e0c6
commit 2b169392e6
3 changed files with 41 additions and 25 deletions

1
.idea/workspace.xml generated
View File

@@ -8,6 +8,7 @@
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/Component/Visualiser.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ExportTasksPackageToExcel.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/ExportTasksPackageToExcel.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />

View File

@@ -62,7 +62,7 @@ public class Visualiser extends Component {
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
@Override
public void GetVersionInfo() {
version = 1047;
version = 1048;
String pattern = "MMM dd yyyy HH:mm:ss";
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
date_text = df.format(getClassBuildTime());

View File

@@ -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();
}