package com.sw.mes.yb.ipc.mapping;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sw.mes.yb.ipc.service.IBaseButtonHandler;
import com.sw.mes.yb.ipc.service.impl.AgvOperationClickServiceImpl;
import com.sw.mes.yb.ipc.service.impl.EquipmentStateUpdateClickServiceImpl;
import com.sw.mes.yb.ipc.service.impl.LgmgClickServiceImpl;
import com.sw.mes.yb.ipc.service.impl.MaterialOperationClickServiceImpl;
import com.sw.mes.yb.ipc.service.impl.WorkHoursClickServiceImpl;

public class ButtonType {
	
	@SuppressWarnings("rawtypes")
	private static Map<String,Class> types = new HashMap<String,Class>();
	
	
	@SuppressWarnings("rawtypes")
	private static Map<String,String> workhours = new HashMap<String,String>();
	
	static {
		types.put("漏硅焖锅", LgmgClickServiceImpl.class);
		types.put("开始待机", EquipmentStateUpdateClickServiceImpl.class);
		types.put("结束待机", EquipmentStateUpdateClickServiceImpl.class);
		types.put("开始煅烧", EquipmentStateUpdateClickServiceImpl.class);
		types.put("结束煅烧", EquipmentStateUpdateClickServiceImpl.class);
		types.put("异常停炉", EquipmentStateUpdateClickServiceImpl.class);
		types.put("异常停炉结束", EquipmentStateUpdateClickServiceImpl.class);
		types.put("拆清开始", WorkHoursClickServiceImpl.class);
		types.put("拆清结束", WorkHoursClickServiceImpl.class);
		types.put("吊料合炉盖开始", WorkHoursClickServiceImpl.class);
		types.put("取消叫料", MaterialOperationClickServiceImpl.class);
		types.put("生产退料", MaterialOperationClickServiceImpl.class);
		types.put("重新叫料", MaterialOperationClickServiceImpl.class);
		types.put("产出确认", MaterialOperationClickServiceImpl.class);
		types.put("库位解锁", AgvOperationClickServiceImpl.class);
		types.put("库位锁定", AgvOperationClickServiceImpl.class);
		types.put("吊料空车", AgvOperationClickServiceImpl.class);
		types.put("复投空车", AgvOperationClickServiceImpl.class);
		types.put("拆清车", AgvOperationClickServiceImpl.class);
		types.put("复拉提头运输", AgvOperationClickServiceImpl.class);
		types.put("送验车呼叫", AgvOperationClickServiceImpl.class);
		
		
		workhours.put("开始待机","待机工时");
		workhours.put("结束待机","待机工时");
		workhours.put("异常停炉","停炉工时");
		workhours.put("异常停炉结束","停炉工时");
		// workhours.put("拆清开始","拆清工时");
		workhours.put("吊料合炉盖开始","吊料合炉盖工时");
	}
	
	
	@SuppressWarnings("unchecked")
	public static Class<IBaseButtonHandler> get(String buttonName) {
		return types.get(buttonName);
	}
	
	public static Boolean isCalculationWorkHours(String buttonName) {
		return workhours.keySet().contains(buttonName);
	}
	
	public static String getType(String buttonName) {
		return workhours.get(buttonName);
	}
	
}
