package art.servers.rtzserver.reports;
|
|
import art.library.model.devices.colors.controller.RTZ32.configuration.RTZ32_Configuration_Group;
|
import art.library.model.devices.colors.controller.RTZ32.configuration.RTZ32_Configuration_Program;
|
import art.library.model.devices.colors.controller.RTZ32.configuration.constants.RTZ32_Constants;
|
import art.library.model.devices.colors.controller.RTZ32.types.RTZ32_Report_Information;
|
import art.library.utils.resources.Resources;
|
import art.servers.ServerException;
|
import art.servers.rtzserver.Shared;
|
import java.io.File;
|
import java.io.FileInputStream;
|
import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator;
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
public class Report_Configuration extends XLS
|
{
|
public Report_Configuration(String language) throws Exception
|
{
|
this.language = language;
|
String filename = "data/" + Shared.getApplicationName() + "/templates/template_configuration." + language + ".xls";
|
File file = new File(filename);
|
if (file.exists() == false) file = Resources.getResourceFile(filename);
|
if (file.exists() == false) throw new ServerException("Template not found");
|
workbook = new HSSFWorkbook(new FileInputStream(new File(filename)));
|
}
|
|
public byte[] generate(String format, RTZ32_Report_Information reportInformation) throws ServerException
|
{
|
byte[] data = null;
|
|
try
|
{
|
// Table 1
|
int sheetNumber = 0;
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.groups[i].type);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 2
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].cycle);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 3
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].offset);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 4
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
for (int j=0; j<6; j++)
|
{
|
if (reportInformation.configuration.programs[i].variablePhases[j] != null)
|
{
|
sheet.getRow(i+1).getCell((j*2)+1).setCellValue(reportInformation.configuration.programs[i].variablePhases[j].startTime);
|
sheet.getRow(i+1).getCell((j*2)+2).setCellValue(reportInformation.configuration.programs[i].variablePhases[j].endTime);
|
}
|
else
|
{
|
sheet.getRow(i+1).getCell((j*2)+1).setCellValue(0);
|
sheet.getRow(i+1).getCell((j*2)+2).setCellValue(0);
|
}
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 5
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.startup.plan);
|
sheet.getRow(2).getCell(1).setCellValue(reportInformation.configuration.startup.timeFlashing);
|
sheet.getRow(3).getCell(1).setCellValue(reportInformation.configuration.startup.timeYellow);
|
sheet.getRow(4).getCell(1).setCellValue(reportInformation.configuration.startup.timeRed);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 6
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
int value1 = 0;
|
{
|
value1 = value1 + (reportInformation.configuration.operationMode.synchronismType & 0x03);
|
|
if (reportInformation.configuration.operationMode.synchronismTable78 == true)
|
{
|
value1 = value1 + 0x04;
|
}
|
|
if (reportInformation.configuration.operationMode.synchronismMode != 0)
|
{
|
value1 = value1 + 0x08;
|
}
|
|
if (reportInformation.configuration.operationMode.masterSynchronizable == true)
|
{
|
value1 = value1 + 0x020;
|
}
|
|
value1 = value1 + (reportInformation.configuration.operationMode.semiactuatedMode << 6);
|
}
|
|
sheet.getRow(1).getCell(1).setCellValue(value1);
|
sheet.getRow(2).getCell(1).setCellValue(reportInformation.configuration.operationMode.cycleExtensionSynchronismType1);
|
sheet.getRow(3).getCell(1).setCellValue(reportInformation.configuration.operationMode.cycleReductionSynchronismType1);
|
sheet.getRow(4).getCell(1).setCellValue(reportInformation.configuration.operationMode.inhibitionExtendsSynchronismType2);
|
sheet.getRow(5).getCell(1).setCellValue(reportInformation.configuration.operationMode.inhibitionExtendsSynchronismType3);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 7
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<4; i++)
|
{
|
for (int j=0; j<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; j++)
|
{
|
if (reportInformation.configuration.groups[j].transitions[i] != null)
|
{
|
sheet.getRow(j+1).getCell((i*2)+1).setCellValue(reportInformation.configuration.groups[j].transitions[i].yellowTimeSimple);
|
sheet.getRow(j+1).getCell((i*2)+2).setCellValue(reportInformation.configuration.groups[j].transitions[i].yellowTimeSimple);
|
}
|
else
|
{
|
sheet.getRow(j+1).getCell((i*2)+1).setCellValue(0);
|
sheet.getRow(j+1).getCell((i*2)+2).setCellValue(0);
|
}
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
for (int p=11; p<=28; p++)
|
{
|
// Tables 11 to 28
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
RTZ32_Configuration_Program program = reportInformation.configuration.programs[p-11];
|
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
try
|
{
|
int cell = 1;
|
for (int j=0; j<program.groups[i].impulses.size(); j++)
|
{
|
try
|
{
|
RTZ32_Configuration_Group groupCfg = reportInformation.configuration.getGroup(program.groups[i].group);
|
boolean es30 = ((groupCfg != null) && (groupCfg.getType() == 30));
|
if ((es30 == true) && ((j%2)==0))
|
{
|
sheet.getRow(i+1).getCell(cell++).setCellValue(program.groups[i].impulses.get(j));
|
}
|
else if ((es30 == true) && (program.groups[i].impulses.size()==3))
|
{
|
sheet.getRow(i+1).getCell(cell++).setCellValue(program.groups[i].impulses.get(j));
|
}
|
else if (es30 == false)
|
{
|
sheet.getRow(i+1).getCell(cell++).setCellValue(program.groups[i].impulses.get(j));
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
try
|
{
|
for (int j=program.groups[i].impulses.size(); j<6; j++)
|
{
|
try
|
{
|
sheet.getRow(i+1).getCell(j+1).setCellValue("-");
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
}
|
|
// Table 31
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<50; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.inputs[i].type1);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.inputs[i].code1);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.inputs[i].type2);
|
sheet.getRow(i+1).getCell(4).setCellValue(reportInformation.configuration.inputs[i].code2);
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.inputs[i].type3);
|
sheet.getRow(i+1).getCell(6).setCellValue(reportInformation.configuration.inputs[i].code3);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 32
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<16; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.outputs[i].type);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.outputs[i].code);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 33
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<9; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.emergencyTransitions[i].transitions[0]);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.emergencyTransitions[i].transitions[1]);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.emergencyTransitions[i].transitions[2]);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 34
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<6; i++)
|
{
|
sheet.getRow(1).getCell(i+1).setCellValue(reportInformation.configuration.structuresTransitions[i].duration);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 35
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].typeGroupsTable);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.programs[i].structure);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.programs[i].subtableApproachingTimesTW);
|
sheet.getRow(i+1).getCell(4).setCellValue(reportInformation.configuration.programs[i].subtableToleranceTimesTW);
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.programs[i].subtableGroupTransitions);
|
sheet.getRow(i+1).getCell(6).setCellValue(0);
|
sheet.getRow(i+1).getCell(7).setCellValue(0);
|
sheet.getRow(i+1).getCell(8).setCellValue(0);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 36
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<16; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.groupsType2[i].group);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.groupsType2[i].type);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 37
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<16; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.groupsType3[i].group);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.groupsType3[i].type);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 38
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int j=0; j<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; j++)
|
{
|
sheet.getRow(j+1).getCell(1).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[0].color);
|
sheet.getRow(j+1).getCell(2).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[1].color);
|
sheet.getRow(j+1).getCell(3).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[3].color);
|
sheet.getRow(j+1).getCell(4).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[2].color);
|
sheet.getRow(j+1).getCell(5).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[4].color);
|
sheet.getRow(j+1).getCell(6).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[5].color);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 41
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
/*
|
for (int j=0; j<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; j++)
|
{
|
sheet.getRow(j+1).getCell(1).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[0].color);
|
sheet.getRow(j+1).getCell(2).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[1].color);
|
sheet.getRow(j+1).getCell(3).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[2].color);
|
sheet.getRow(j+1).getCell(4).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[3].color);
|
sheet.getRow(j+1).getCell(5).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[4].color);
|
sheet.getRow(j+1).getCell(6).setCellValue(reportInformation.configuration.groups[j].structuresTransitions[5].color);
|
}
|
*/
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 42
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].vehicleDemands.demands1);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.programs[i].vehicleDemands.demands2);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 43
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].pedestianDemands.demands1);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.programs[i].pedestianDemands.demands2);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.programs[i].pedestianDemands.demands3);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 44
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].spareTimes.phases);
|
}
|
|
sheet.getRow(RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS+1).getCell(1).setCellValue(reportInformation.configuration.sparesTimesActuated);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 45
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].increments.increment1);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.programs[i].increments.increment2);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.programs[i].increments.increment3);
|
sheet.getRow(i+1).getCell(4).setCellValue(reportInformation.configuration.programs[i].increments.increment4);
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.programs[i].increments.increment5);
|
sheet.getRow(i+1).getCell(6).setCellValue(reportInformation.configuration.programs[i].increments.increment6);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 46
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.groups[i].fictitious);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 50
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.weekDays.monday);
|
sheet.getRow(1).getCell(2).setCellValue(reportInformation.configuration.weekDays.tuesday);
|
sheet.getRow(1).getCell(3).setCellValue(reportInformation.configuration.weekDays.wednesday);
|
sheet.getRow(1).getCell(4).setCellValue(reportInformation.configuration.weekDays.thursday);
|
sheet.getRow(1).getCell(5).setCellValue(reportInformation.configuration.weekDays.friday);
|
sheet.getRow(1).getCell(6).setCellValue(reportInformation.configuration.weekDays.saturday);
|
sheet.getRow(1).getCell(7).setCellValue(reportInformation.configuration.weekDays.sunday);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 51
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.fixedProgram.fixedProgram);
|
sheet.getRow(1).getCell(2).setCellValue(reportInformation.configuration.fixedProgram.fixedProgramDay);
|
sheet.getRow(1).getCell(3).setCellValue(reportInformation.configuration.fixedProgram.fixedTable);
|
sheet.getRow(1).getCell(4).setCellValue(reportInformation.configuration.fixedProgram.fixedTableDay);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 52
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<30; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.specialDays[i].day);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.specialDays[i].month);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.specialDays[i].timetable);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
for (int p=53; p<=60; p++)
|
{
|
// Tables 53 to 60
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<10; i++) // Cambios
|
{
|
int index = ((p - 53) * 10) + i;
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.timetables[index].hour);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.timetables[index].minute);
|
int value3 = 0;
|
{
|
value3 = value3 + (reportInformation.configuration.timetables[index].timeSelection << 7);
|
value3 = value3 + (reportInformation.configuration.timetables[index].synchronismType << 5);
|
value3 = value3 + (reportInformation.configuration.timetables[index].operationMode << 4);
|
value3 = value3 + (reportInformation.configuration.timetables[index].program);
|
}
|
sheet.getRow(i+1).getCell(3).setCellValue(value3);
|
|
// En excel enviado por Pedro estos campos se ponen a 0
|
sheet.getRow(i+1).getCell(5).setCellValue(0);
|
sheet.getRow(i+1).getCell(6).setCellValue(0);
|
sheet.getRow(i+1).getCell(7).setCellValue(0);
|
sheet.getRow(i+1).getCell(8).setCellValue(0);
|
|
/*
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.timetables[index].timeSelection);
|
sheet.getRow(i+1).getCell(6).setCellValue(reportInformation.configuration.timetables[index].synchronismType);
|
sheet.getRow(i+1).getCell(7).setCellValue(reportInformation.configuration.timetables[index].operationMode);
|
sheet.getRow(i+1).getCell(8).setCellValue(reportInformation.configuration.timetables[index].program);
|
*/
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
}
|
|
// Table 64
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<16; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(0);
|
sheet.getRow(i+1).getCell(2).setCellValue(0);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 65
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<8; i++) // 8 accesses
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.microregulation.accesses[i].levelA);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.microregulation.accesses[i].levelB);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.microregulation.accesses[i].levelC);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 66
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<8; i++) // 8 accesses
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.microregulation.accesses[i].phase);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 67
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.microregulation.levelF1);
|
sheet.getRow(1).getCell(2).setCellValue(reportInformation.configuration.microregulation.levelF2);
|
sheet.getRow(1).getCell(3).setCellValue(reportInformation.configuration.microregulation.levelF3);
|
sheet.getRow(1).getCell(4).setCellValue(reportInformation.configuration.microregulation.priorityF1);
|
sheet.getRow(1).getCell(5).setCellValue(reportInformation.configuration.microregulation.priorityF2);
|
sheet.getRow(1).getCell(6).setCellValue(reportInformation.configuration.microregulation.priorityF3);
|
sheet.getRow(1).getCell(7).setCellValue(reportInformation.configuration.microregulation.congestionF1);
|
sheet.getRow(1).getCell(8).setCellValue(reportInformation.configuration.microregulation.congestionF2);
|
sheet.getRow(1).getCell(9).setCellValue(reportInformation.configuration.microregulation.congestionF3);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 68
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<8; i++) // 8 accesses
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.microregulation.accesses[i].delay);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 69
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.microregulation.abort1);
|
sheet.getRow(1).getCell(2).setCellValue(reportInformation.configuration.microregulation.abort2);
|
sheet.getRow(1).getCell(3).setCellValue(reportInformation.configuration.microregulation.recover);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 70
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
int row = 1;
|
for(int i=0; i<4; i++) // 4 tablas de tiempos
|
{
|
for(int j=0; j<4; j++) // 4 tranvías
|
{
|
sheet.getRow(row).getCell(1).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].announcementTime);
|
sheet.getRow(row).getCell(2).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].approachTimePosition1);
|
sheet.getRow(row).getCell(3).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].timeoutTimePosition1);
|
sheet.getRow(row).getCell(4).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].approachTimePosition2);
|
sheet.getRow(row).getCell(5).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].timeoutTimePosition2);
|
sheet.getRow(row).getCell(6).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].approachTimePosition3);
|
sheet.getRow(row).getCell(7).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].timeoutTimePosition3);
|
sheet.getRow(row).getCell(8).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].approachTimePosition4);
|
sheet.getRow(row).getCell(9).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].timeoutTimePosition4);
|
sheet.getRow(row).getCell(10).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].timeoutTimeTrafficLight);
|
sheet.getRow(row).getCell(11).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].delayTimeTrafficLight);
|
sheet.getRow(row).getCell(12).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].detectionTimeDouble);
|
sheet.getRow(row).getCell(13).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].cancellationTimeout);
|
sheet.getRow(row).getCell(14).setCellValue(reportInformation.configuration.trolleys.trolleys[j].approachTimes[i].delayTimeDetectionCancellation);
|
row++;
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 71
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
int row = 1;
|
for(int i=0; i<4; i++) // 4 tablas de tiempos
|
{
|
for(int j=0; j<4; j++) // 4 tranvías
|
{
|
sheet.getRow(row).getCell(1).setCellValue(reportInformation.configuration.trolleys.trolleys[j].groupTimes[i].pregreenTime);
|
sheet.getRow(row).getCell(2).setCellValue(reportInformation.configuration.trolleys.trolleys[j].groupTimes[i].minimumPassTime);
|
sheet.getRow(row).getCell(3).setCellValue(reportInformation.configuration.trolleys.trolleys[j].groupTimes[i].minimumPassTimeDegraded);
|
sheet.getRow(row).getCell(4).setCellValue(reportInformation.configuration.trolleys.trolleys[j].groupTimes[i].minimumPassTimeDegradedContrary);
|
row++;
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 72
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
RTZ32_Configuration_Program program = reportInformation.configuration.programs[i];
|
|
for (int j=0; j<8; j++)
|
{
|
sheet.getRow(i+1).getCell((j*2)+1).setCellValue(program.trolley.times1[j].type);
|
sheet.getRow(i+1).getCell((j*2)+2).setCellValue(program.trolley.times1[j].maximumWaitTime);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 73
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
RTZ32_Configuration_Program program = reportInformation.configuration.programs[i];
|
|
int column = 1;
|
for(int j=0; j<3; j++)
|
{
|
sheet.getRow(i+1).getCell(column++).setCellValue(program.trolley.retractables[j].startTime);
|
sheet.getRow(i+1).getCell(column++).setCellValue(program.trolley.retractables[j].endTime);
|
}
|
|
for(int j=0; j<4; j++)
|
{
|
sheet.getRow(i+1).getCell(column++).setCellValue(program.trolley.cancellations[j].time);
|
sheet.getRow(i+1).getCell(column++).setCellValue(program.trolley.cancellations[j].timeout);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 74
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<6; i++) // 6 grupos peatones
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.trolleys.trolleys[0].pedestrians[i].minimumGreenTime);
|
|
for(int j=0; j<4; j++) // 4 grupos tranvía
|
{
|
sheet.getRow(i+1).getCell((j*2)+2).setCellValue(reportInformation.configuration.trolleys.trolleys[j].pedestrians[i].safetyTime1);
|
sheet.getRow(i+1).getCell((j*2)+3).setCellValue(reportInformation.configuration.trolleys.trolleys[j].pedestrians[i].safetyTime2);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 75
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<4; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.trolleys.times[i].toleranceTime);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.trolleys.times[i].inhibitionTime);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 78
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
RTZ32_Configuration_Program program = reportInformation.configuration.programs[i];
|
sheet.getRow(i+1).getCell(1).setCellValue(program.trolley.times2.synchronizationDirection);
|
sheet.getRow(i+1).getCell(2).setCellValue(program.trolley.times2.synchronizationMaximumAdjustTime);
|
sheet.getRow(i+1).getCell(3).setCellValue(program.trolley.times2.synchronizationType);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 79
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
for (int j=0; j<2; j++)
|
{
|
sheet.getRow(i+1).getCell((j*2)+1).setCellValue(reportInformation.configuration.programs[i].variablePhases[6 + j].startTime);
|
sheet.getRow(i+1).getCell((j*2)+2).setCellValue(reportInformation.configuration.programs[i].variablePhases[6 + j].endTime);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 80
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
RTZ32_Configuration_Program program = reportInformation.configuration.programs[i];
|
|
for (int j=0; j<4; j++)
|
{
|
sheet.getRow(i+1).getCell(j+1).setCellValue(program.trolley.correlationsMaster[j].time);
|
}
|
|
for (int j=0; j<4; j++)
|
{
|
sheet.getRow(i+1).getCell(j+5).setCellValue(program.trolley.correlationsSlave[j].timeout);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
// Table 81
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<4; i++) // 4 zonas de saturación
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.trolleys.saturations[i].detectors[0]);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.trolleys.saturations[i].detectors[1]);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.trolleys.saturations[i].detectors[2]);
|
sheet.getRow(i+1).getCell(4).setCellValue(reportInformation.configuration.trolleys.saturations[i].detectors[3]);
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.trolleys.saturations[i].presenceTimes[0]);
|
sheet.getRow(i+1).getCell(6).setCellValue(reportInformation.configuration.trolleys.saturations[i].presenceTimes[1]);
|
sheet.getRow(i+1).getCell(7).setCellValue(reportInformation.configuration.trolleys.saturations[i].presenceTimes[2]);
|
sheet.getRow(i+1).getCell(8).setCellValue(reportInformation.configuration.trolleys.saturations[i].presenceTimes[3]);
|
sheet.getRow(i+1).getCell(9).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsClosing[0]);
|
sheet.getRow(i+1).getCell(10).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsClosing[1]);
|
sheet.getRow(i+1).getCell(11).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsClosing[2]);
|
sheet.getRow(i+1).getCell(12).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsOpening[0]);
|
sheet.getRow(i+1).getCell(13).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsOpening[1]);
|
sheet.getRow(i+1).getCell(14).setCellValue(reportInformation.configuration.trolleys.saturations[i].groupsOpening[2]);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
for (int p=82; p<=85; p++)
|
{
|
// Tables 82 to 85
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for(int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_PROGRAMS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].startTime);
|
sheet.getRow(i+1).getCell(2).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].endTime);
|
sheet.getRow(i+1).getCell(3).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesClosing[0]);
|
sheet.getRow(i+1).getCell(4).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesClosing[1]);
|
sheet.getRow(i+1).getCell(5).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesClosing[2]);
|
sheet.getRow(i+1).getCell(6).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesOpening[0]);
|
sheet.getRow(i+1).getCell(7).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesOpening[1]);
|
sheet.getRow(i+1).getCell(8).setCellValue(reportInformation.configuration.programs[i].trolley.saturations[p - 82].timesOpening[2]);
|
}
|
}
|
catch (Exception e)
|
{
|
|
}
|
}
|
|
// Table 86
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 87
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 88
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 89
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
}
|
catch (Exception e)
|
{
|
|
}
|
|
// Table 91
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
for (int j=0; j<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; j++)
|
{
|
if (i == j)
|
{
|
sheet.getRow(i+1).getCell(j+1).setCellValue("X");
|
}
|
else
|
{
|
if (reportInformation.configuration.groups[i].incompatibilities[j] == true)
|
{
|
if (sheet.getRow(i+1).getCell(j+1) == null)
|
{
|
sheet.getRow(i+1).createCell(j+1);
|
}
|
sheet.getRow(i+1).getCell(j+1).setCellValue(1);
|
}
|
}
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
// Table 92
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
if (reportInformation.configuration.groups[i].incompatibilityNoRed == true)
|
{
|
if (sheet.getRow(1).getCell(i+1) == null)
|
{
|
sheet.getRow(1).createCell(i+1);
|
}
|
sheet.getRow(1).getCell(i+1).setCellValue(1);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
// Table 93
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
if (reportInformation.configuration.groups[i].redLampFlashing == true)
|
{
|
if (sheet.getRow(1).getCell(i+1) == null)
|
{
|
sheet.getRow(1).createCell(i+1);
|
}
|
sheet.getRow(1).getCell(i+1).setCellValue(1);
|
}
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
// Table 94
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
for (int i=0; i<RTZ32_Constants.MAXIMUM_NUMBER_GROUPS; i++)
|
{
|
sheet.getRow(i+1).getCell(1).setCellValue(reportInformation.configuration.groups[i].minimumRedLampFlashing);
|
}
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
// Table 95
|
try
|
{
|
HSSFSheet sheet = workbook.getSheetAt(sheetNumber++);
|
sheet.getRow(1).getCell(1).setCellValue(reportInformation.configuration.controllerNumber);
|
sheet.getRow(1).getCell(2).setCellValue(reportInformation.configuration.numberGroups);
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
}
|
|
workbook.setForceFormulaRecalculation(true);
|
HSSFFormulaEvaluator.evaluateAllFormulaCells(workbook);
|
return saveAndClose(format);
|
}
|
catch (Exception e)
|
{
|
Shared.printstack("Report", e);
|
throw new ServerException(e);
|
}
|
}
|
|
}
|