package kr.gmtc.tss.status;

import org.springframework.stereotype.Component;

@Component
public class CountingComponent {

	private int rcvPos=0;
	private int rcvStatic=0;
	private int savePos=0;
	private int failPos=0;
	private int saveStatic=0;
	private int failStatic=0;
	
	public int getRcvPos() {
		return rcvPos;
	}
	public void setRcvPos(int rcvPos) {
		this.rcvPos = rcvPos;
	}
	public int getRcvStatic() {
		return rcvStatic;
	}
	public void setRcvStatic(int rcvStatic) {
		this.rcvStatic = rcvStatic;
	}
	public int getSavePos() {
		return savePos;
	}
	public void setSavePos(int savePos) {
		this.savePos = savePos;
	}
	public int getFailPos() {
		return failPos;
	}
	public void setFailPos(int failPos) {
		this.failPos = failPos;
	}
	public int getSaveStatic() {
		return saveStatic;
	}
	public void setSaveStatic(int saveStatic) {
		this.saveStatic = saveStatic;
	}
	public int getFailStatic() {
		return failStatic;
	}
	public void setFailStatic(int failStatic) {
		this.failStatic = failStatic;
	}
	
	
		
	public void initZero() {
		rcvPos=0;
		rcvStatic=0;
		savePos=0;
		failPos=0;
		saveStatic=0;
		failStatic=0;
	}
	
	public String getCountLog() {	
		String log = "\r\n"
				   + "===============================================\r\n"
	               + "                   Count Info                  \r\n"
	               + "===============================================\r\n"
	               + "                 위치정보                \r\n"
	               + "-----------------------------------------------\r\n"
	               + "           수신 / 저장성공 / 저장실패          \r\n"
	               + "-----------------------------------------------\r\n"
	               + "    "+String.format(" %5s", rcvPos)+" / "+String.format(" %5s", savePos)+" / "+String.format(" %5s", failPos)+"\r\n"
	               + "===============================================\r\n"
	               + "                 정적정보                \r\n"
	               + "-----------------------------------------------\r\n"
	               + "           수신 / 저장성공 / 저장실패          \r\n"
	               + "-----------------------------------------------\r\n"
	               + "    "+String.format(" %5s", rcvStatic)+" / "+String.format(" %5s", saveStatic)+" / "+String.format(" %5s", failStatic)+"\r\n"
	               + "===============================================\r\n";
		
		initZero();
		
		return log;
	}
	
}
