log.debug("Startting Time ========="+projectForm.getProStartTime());
log.debug("Life Time ========="+projectForm.getProLifeTime());
log.debug("Time Division ========="+projectForm.getProTd());
SampleEngineImpl sampleEngine = new SampleEngineImpl();
SampleBean samplebean = new SampleBean();
//2012-01-13 정재우 실장님의 요청으로 추가함
ActionMessages msg = new ActionMessages();
int message = -1;
message = (Integer) sqlMap.update("Project.simulatorUpdate", projectForm);
/**
* Project.simulatorUpdate query
* UPDATE PROJECT
SET PRO_ITERNUM = #proIterNum#
,PRO_STARTTIME = #proStartTime#
,PRO_LIFETIME = #proLifeTime#
,PRO_TD = #proTd#
,PRO_OUTPUT = #proOutput#
,PRO_ANNUALRATE = #proAnnualRate#
WHERE PRO_UID = #proUid#
*/
if(message == 0){
msg.add("message", new ActionMessage("저장에 실패했습니다."));
}else if(message > 0){
msg.add("message", new ActionMessage("저장에 성공했습니다."));
}
saveMessages(request, msg);
List modelingList = sqlMap.queryForList("Modeling.getModeling", ""+projectForm.getProUid()); // Project Uid Modeling Get
/***
* List<Modeling> 으로 안하고 List로 했는지(?)
*/
/** Modeling.getModeling query
*
* SELECT MO_UID AS moUid
,MO_PROJECT AS moProject
,MO_BR AS moBr
,MO_SELF AS moSelf
,MO_PRE AS moPre
,MO_DEPTH AS moDepth
,MO_ORDER AS moOrder
,MO_TYPE AS moType
,MO_IMG AS moImg
,MO_POSX AS moPosx
,MO_POSY AS moPosy
,MO_NAME AS moName
,MO_PU_EA AS moPuEa
,MO_PU_NAME AS moPuName
,MO_PU_VALUE AS moPuValue
,MO_PU_ORDER AS moPuOrder
,MO_IN AS moIn
,MO_OUT AS moOut
,MO_TREE AS moTree
,MO_TAG_ID AS moTagId
,MO_PU_CONNECT AS moPuConnect
,MO_PB_UID AS moPbUid
FROM MODELING
WHERE MO_PROJECT = #value#
*/
HashMap<String, ArrayList<Modeling>> cenarioMap = new HashMap<String, ArrayList<Modeling>>();
Vector<Modeling> modelingVector = new Vector<Modeling>(modelingList.size()); //modelingList를 Vetor로 변경하기 위한 객체 선언
ArrayList<SampleBean> sampleBean = new ArrayList<SampleBean>();
modelingVector.addAll(modelingList); //Vetor 에 List 값 적용
for (int i=0;i<modelingVector.size();i++) {
ArrayList<Modeling> cenarioModeling = (ArrayList<Modeling>)sqlMap.queryForList("Modeling.getSNModeling", ""+modelingVector.get(i).getMoSelf());
/**
* Modeling.getSNModeling query
* SELECT * FROM (SELECT SNMO_UID AS moUid
,SNMO_PROJECT AS moProject
,SNMO_BR AS moBr
,SNMO_SELF AS moSelf
,SNMO_PRE AS moPre
,SNMO_DEPTH AS moDepth
,SNMO_ORDER AS moOrder
,SNMO_TYPE AS moType
,SNMO_IMG AS moImg
,SNMO_POSX AS moPosx
,SNMO_POSY AS moPosy
,SNMO_NAME AS moName
,SNMO_PU_EA AS moPuEa
,SNMO_PU_NAME AS moPuName
,SNMO_PU_VALUE AS moPuValue
,SNMO_PU_ORDER AS moPuOrder
,SNMO_IN AS moIn
,SNMO_OUT AS moOut
,SNMO_TREE AS moTree
,SNMO_TAG_ID AS moTagId
,SNMO_PU_CONNECT AS moPuConnect
,SNMO_PB_UID AS moPbUid
FROM SCENARIOMODELING
WHERE MO_PK = #value#
UNION ALL
SELECT MO_UID AS moUid
,MO_PROJECT AS moProject
,MO_BR AS moBr
,MO_SELF AS moSelf
,MO_PRE AS moPre
,MO_DEPTH AS moDepth
,MO_ORDER AS moOrder
,MO_TYPE AS moType
,MO_IMG AS moImg
,MO_POSX AS moPosx
,MO_POSY AS moPosy
,MO_NAME AS moName
,MO_PU_EA AS moPuEa
,MO_PU_NAME AS moPuName
,MO_PU_VALUE AS moPuValue
,MO_PU_ORDER AS moPuOrder
,MO_IN AS moIn
,MO_OUT AS moOut
,MO_TREE AS moTree
,MO_TAG_ID AS moTagId
,MO_PU_CONNECT AS moPuConnect
,MO_PB_UID AS moPbUid
FROM MODELING
WHERE MO_SELF = #value#)
ORDER BY moSelf ASC
*/
if (cenarioModeling != null) {
cenarioMap.put(modelingVector.get(i).getMoSelf(), cenarioModeling);
}
if (modelingVector.get(i).getSamplesList().size()>0) {
sampleBean.addAll(modelingVector.get(i).getSamplesList());
}
}
//cenarioList.add(sampleBean);
//System.out.println("가로사이즈-->"+modelingVector.size());
//System.out.println(sampleBean.size());
//System.out.println(sampleBean.size());
ArrayList<String> keyArr = new ArrayList<String>();
//ArrayList<ArrayList<SampleBean>> cenarioList = new ArrayList<ArrayList<SampleBean>>(); // 시나리오 관련 최종 데이터 저장소
//ArrayList<SampleBean> tempSampleBean = new ArrayList<SampleBean>(); // 시나리오 데이터 임시 저장소
// 시나리오 관련 모드일경우
if (true) {
this.fnCenario(modelingVector, keyArr, cenarioMap, sampleEngine, projectForm, sampleBean);
}
System.out.println("keyArr.length : " + keyArr.size());
//시나리오 관련 종료
ArrayList<Figures> figList = (ArrayList<Figures>) sqlMap.queryForList("Figures.figures", new Figures(projectForm));
samplebean.setFigProjectUid(projectForm.getProUid());
//sampleBean = (ArrayList<SampleBean>) sqlMap.queryForList("Sample.figures",samplebean);
//System.out.println("sampleBean.size() : " + sampleBean.size());
Sampleform sampleform = sampleEngine.engineCore(projectForm,sampleBean,simulationArr);
//시작 경제성 계산