(function(){return {
	"formats": {
		"ODB": {},
		"ODB_1": { 
			"comments": "", 
			"arrStep": "stp",
			"isMerge": "yes"
		 },
		"Gerber274x_1": { 
			"nf1": 3,
			"nf2": 4,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Gerber274x_2": {   
			"nf1": 3,
			"nf2": 5,
			"units": "inch",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Gerber274x_3": {
			"nf1": 3,
			"nf2": 5,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Gerber274x_4": {
			"nf1": 2,
			"nf2": 3,
			"units": "mm",
			"zeroes": "none",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Gerber274x_5": {
			"nf1": 2,
			"nf2": 3,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon1_1":{ 
			"nf1": 3,
			"nf2": 0,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "yes",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_1": {   
			"nf1": 3,
			"nf2": 5,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_2": {
			"nf1": 2,
			"nf2": 3,
			"units": "inch",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_3": { 
			"nf1": 2,
			"nf2": 5,
			"units": "inch",
			"zeroes": "trailing",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_4": { 
			"nf1": 2,
			"nf2": 3,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_5": { 
			"nf1": 2,
			"nf2": 3,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_6": { 
			"nf1": 3,
			"nf2": 4,
			"units": "mm",
			"zeroes": "leading",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "mm",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_7": { 
			"nf1": 3,
			"nf2": 4,
			"units": "inch",
			"zeroes": "none",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"Excellon2_8": { 
			"nf1": 2,
			"nf2": 5,
			"units": "inch",
			"zeroes": "none",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "nl",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		},
		"IPC356_1": {  
			"nf1": 2,
			"nf2": 4,
			"units": "inch",
			"zeroes": "none",
			"decimal": "no",
			"nf_comp": 0,
			"break_sr": "yes",
			"data_type": "ascii",
			"separator": "*",
			"threshold": 200,
			"drill_only": "no",
			"multiplier": 1,
			"resolution": 3,
			"tool_units": "inch",
			"coordinates": "absolute",
			"merge_by_rule": "no",
			"signed_coords": "no",
			"text_line_width": 0.0024
		}
	},
	"customer": {
		"2171": {
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.art$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_2",
					"format_params": function(props){
						var params = props.params
						if(params.art_param){
							var leading = params.art_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.art_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							var nf1,nf2
							if(params.art_param.hasOwnProperty("FORMAT")){
								var tmp = params.art_param["FORMAT"].split(".")
								if(/\d+/ig.test(tmp[0])){nf1 = Number(tmp[0])}
								if(/\d+/ig.test(tmp[1])){nf2 = Number(tmp[1])}
							}
							return {
								"nf1": nf1 || 3,
								"nf2": nf2 || 5,
								"units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "*",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": "absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_1",
					"format_params": function(props){
						var params = props.params
						if(params.nc_param){
							var leading = params.nc_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.nc_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							return {
								"nf1": params.nc_param["INTEGER_PLACES"]? Number(params.nc_param["INTEGER_PLACES"]) : 3,
								"nf2": params.nc_param["DECIMAL_PLACES"]? Number(params.nc_param["DECIMAL_PLACES"]) : 5,
								"units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "nl",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": params.nc_param["COORDINATES"]? params.nc_param["COORDINATES"].toLowerCase() :"absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drd$/ig.test(file.name)
					},  
					"type": "Excellon1",		
					"format": "Excellon1_1"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.phd$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_1"
				}
			],
			"tl_name": [
				{"orig_name" : ["top_enig","top-enig","enig_top"], "tl_name" : "enig_top" }, 
				{"orig_name" : ["bot_enig","bot-enig","enig_bot"], "tl_name" : "enig_bot" }, 
				{"orig_name" : ["top_paste","^spt$","^past_top$"], "tl_name" : "past_top" }, 
				{"orig_name" : ["bottom_paste","^spb$","^past_botm$"], "tl_name" : "past_botm" },
				{"orig_name" : ["top_silk","^sst$","^silk_top$"], "tl_name" : "silk_top" },
				{"orig_name" : ["bottom_silk","^ssb$","^silk_bot$"], "tl_name" : "silk_bot" },
				{"orig_name" : ["top_solder","^smt$","^sm_top$"], "tl_name" : "sm_top" },
				{"orig_name" : ["bottom_solder","^smb$","^sm_botm$"], "tl_name" : "sm_botm" },
				{"orig_name" : "^top$", "tl_name" : "top" },
				{"orig_name" : "^drill$", "tl_name" : "drill" },
				{"orig_name" : ["^board_outline$","outline.art","^outline$"], "tl_name" : "outline" },
				{"orig_name" : ["^rout$","\\.rou$"], "tl_name" : "rout" },
				{"orig_name" : "^bottom$", "tl_name" : "bottom" },
				{"orig_name" : ["^l(\\d+)","^isl(\\d+)$","^layer_(\\d+)$"], "tl_name" : "l_($1)"},
				{"orig_name" : ["_isl(\\d+)_isl(\\d+)","d(\\d+)-(\\d+)"], "tl_name" : "d_($1)-($2)"},
				{"orig_name" : ["_top_isl(\\d+)"], "tl_name" : "d_1-($1)"},
				{"orig_name" : ["_isl(\\d+)_bottom"], "tl_name" : "d_($1)-($1+1)"}
			]
		},
		"Yucca": {
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.ipc$/ig.test(file.name)
					},  
					"type": "IPC356",		
					"format": "IPC356_1"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.rou$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_3"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.art$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_2",
					"format_params": function(props){
						var params = props.params
						if(params.art_param){
							var leading = params.art_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.art_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							var nf1,nf2
							if(params.art_param.hasOwnProperty("FORMAT")){
								var tmp = params.art_param["FORMAT"].split(".")
								if(/\d+/ig.test(tmp[0])){nf1 = Number(tmp[0])}
								if(/\d+/ig.test(tmp[1])){nf2 = Number(tmp[1])}
							}
							return {
								"nf1": nf1 || 3,
								"nf2": nf2 || 5,
								"units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "*",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": "absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_1",
					"format_params": function(props){
						var params = props.params
						if(params.nc_param){
							var leading = params.nc_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.nc_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							return {
								"nf1": params.nc_param["INTEGER_PLACES"]? Number(params.nc_param["INTEGER_PLACES"]) : 3,
								"nf2": params.nc_param["DECIMAL_PLACES"]? Number(params.nc_param["DECIMAL_PLACES"]) : 5,
								"units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "nl",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": params.nc_param["COORDINATES"]? params.nc_param["COORDINATES"].toLowerCase() :"absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				}
			],
			"tl_name": [
				{"orig_name" : ["^pm_top","paste.pri","assytop\\.art","past_top","paste_top"], "tl_name" : "past_top" },
				{"orig_name" : ["^pm_bot","paste.sec","assybot\\.art","past_bot","paste_bot"], "tl_name" : "past_botm" },
				{"orig_name" : ["silk.pri","pleg\\.art","^ss_top","silk_top"], "tl_name" : "silk_top" },
				{"orig_name" : ["silk.sec","sleg\\.art","^ss_bot","silk_bot"], "tl_name" : "silk_bot" },
				{"orig_name" : ["mask.top\\.art","mask.pri\\.art","psm\\.art","sm_top"], "tl_name" : "sm_top" },
				{"orig_name" : ["mask.bot\\.art","mask.sec\\.art","ssm\\.art","sm_bot"], "tl_name" : "sm_botm" },
				{"orig_name" : ["^top$","^top.art$"], "tl_name" : "top" },
				{"orig_name" : ["\\.l(\d+)$","^l(\\d+).*\\.art$","^0?(\\d+)_.*\\.art$","^l(\\d+)\\.art$","^0(\\d+).*ccp_ms","^s(\\d+)\\.art","lay(\\d+)\\.art","layer_(\\d+)"], "tl_name" : "l_($1)"},
				{"orig_name" : ["^bottom$","^bottom\\.art$"], "tl_name" : "bottom" },
				{"orig_name" : ["\\.d(\\d+)-(\\d+)$","-(\\d+)-(\\d+)\\.drl$","(\\d+)-(\\d+)-laser\\.drl$","d(\\d+)-(\\d+)"], "tl_name" : "d_($1)-($2)"},
				{"orig_name" : ["\\.rou$","^rout$"], "tl_name" : "rout" },
				{"orig_name" : "fab.art", "tl_name" : "fab.art" },
				{"orig_name" : ["multipack.art","^array$"], "tl_name" : "array" },
				{"orig_name" : ["outline"], "tl_name" : "outline" },
				{"orig_name" : ["^pst\\.art$","top-enig","enig_top"], "tl_name" : "enig_top" },
				{"orig_name" : ["^sst\\.art$","bot-enig","enig_bot"], "tl_name" : "enig_bot" }
			],
			"mergerule" : {
				profile:["past_top"]
			},
			"extra": [
				{
					"verification": function(info){
						if(!info.type){return false}
						return /gerber/ig.test(info.type)
					},
					"fn": function(props){
						var fileInfo = props.fileInfo;
						var step = props.step;
						fileInfo.forEach(function(item){
							var layer = item.file.name.toLowerCase().split(" ").join("-")
							var path = item.file.path
							var filectx = fs.readFile(path)
							var tmp = filectx.match(/Holesize \d\. = [\d\.]+ Tolerance = [\S]+ [\S]+ [\S]+ Quantity = \d+\n/igm)
							if(tmp && tmp.length) {
								var res = tmp.map(function(v,i) {
									var tmp2 = /Holesize \d\. = ([\d\.]+) Tolerance = ([\S]+) ([\S]+) ([\S]+) Quantity = \d+\n/igm.exec(v);
									return {
										size: tmp2[1],
										tolerance: tmp2[2],
										type: tmp2[3],
										unit: tmp2[4],
										row: i+1
									}
								})
								// [{"size":"0.100300","tolerance":"+0.020000/-0.020000","type":"PLATED","unit":"MM","row":1}]
								GEN.units({type:"mm"})
								var toolsInfo = GEN.getTool({job:job, step:step, layer:layer, units:"mm"})
								GEN.COM("tools_show,layer="+layer)
// {"1":{"count":"01156","num":"1","type":"plated","min_tol":"0","max_tol":"0","finish_size":"1","drill_size":"1","slot_len":"0","type2":"standard","shape":"hole","bit":0}}
								GEN.COM("tools_tab_reset")
								var alltype = {
									plated: "plate",
									non_plated: "nplate",
									laser: "via",
									via: "via"
								}
								Object.keys(toolsInfo).forEach(function(row){
									var info = toolsInfo[row];
									var numberrow = row - 1;
									var type = res[numberrow]? res[numberrow].type.toLowerCase() : info.type.toLowerCase();
									var min_tol = res[numberrow]? Math.abs( res[numberrow].tolerance.split("/")[1] * 1000 ): info.min_tol;
									var max_tol = res[numberrow]? Math.abs(res[numberrow].tolerance.split("/")[0] * 1000) : info.max_tol;
									var drill_size = res[numberrow]? res[numberrow].size * 1000 : info.drill_size;
									
									GEN.COM("tools_tab_add,num="+row+",shape="+info.shape+",type="+alltype[type]
									+",min_tol="+min_tol+",max_tol="+max_tol+",bit=,finish_size="+drill_size+",drill_size="+drill_size);
								})
								GEN.COM("tools_set,layer="+layer+",thickness=0,user_params=,slots=by_length")
								// {"layer":"gfp2_1216_lte_rl03_am_m1610201_r01-bl-2-3-laser.drl",
								// "info":[{"size":"0.090300","tolerance":"+0.020000/-0.020000","type":"PLATED","unit":"MM","row":1}]}
							}
						})
					}
				}
			]
		},
		"New_data": {
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.art$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_2",
					"format_params": function(props){
						var params = props.params
						if(params.art_param){
							var leading = params.art_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.art_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							var nf1,nf2
							if(params.art_param.hasOwnProperty("FORMAT")){
								var tmp = params.art_param["FORMAT"].split(".")
								if(/\d+/ig.test(tmp[0])){nf1 = Number(tmp[0])}
								if(/\d+/ig.test(tmp[1])){nf2 = Number(tmp[1])}
							}
							return {
								"nf1": nf1 || 3,
								"nf2": nf2 || 5,
								"units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "*",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": "absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_1",
					"format_params": function(props){
						var params = props.params
						if(params.nc_param){
							var leading = params.nc_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.nc_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							return {
								"nf1": params.nc_param["INTEGER_PLACES"]? Number(params.nc_param["INTEGER_PLACES"]) : 3,
								"nf2": params.nc_param["DECIMAL_PLACES"]? Number(params.nc_param["DECIMAL_PLACES"]) : 5,
								"units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "nl",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": params.nc_param["COORDINATES"]? params.nc_param["COORDINATES"].toLowerCase() :"absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				}
			],
			"tl_name": [
				{"orig_name" : ["pasttop.art","^past_top$","top_solderpaste"], "tl_name" : "past_top" },
				{"orig_name" : ["^silk_top\\.art$","pleg\\.art","^silk_top$","top_silkscreen"], "tl_name" : "silk_top" },
				{"orig_name" : ["_r1\\.phd$","_r1\\.fph$","^smt\\.art$","soldtop.art","^sm_top$","top_soldermask"], "tl_name" : "sm_top" },
				{"orig_name" : ["^top\\.art$","^top$"], "tl_name" : "top" },
				{"orig_name" : ["_l(\\d+)\\.phd$","_l(\\d+)\\.fph$","^in_(\\d+)\\.art$","^l(\\d+)\\.art$","inner_(\\d+)\\.art","layer_(\\d+)"], "tl_name" : "l_($1)"},
				{"orig_name" : ["^bot\\.art$","^bottom\\.art","^bottom$"], "tl_name" : "bottom" },
				{"orig_name" : ["_r\\d\\.phd$","_r\\d\\.fph$","^smb\\.art$","soldbotm.art","^sm_botm$","bot_soldermask"], "tl_name" : "sm_botm" },
				{"orig_name" : ["^silk_bottom\\.art$","sleg\\.art","^silk_bot$","bot_silkscreen"], "tl_name" : "silk_bot" },
				{"orig_name" : ["pastbotm\\.art","^past_botm$","bot_solderpaste"], "tl_name" : "past_botm" },
				{"orig_name" : ["^nc_drill$","^drill$"], "tl_name" : "drill" },
				{"orig_name" : "multipack\\.art", "tl_name" : "array" },
				{"orig_name" : ["\\.rou$","^rout$"], "tl_name" : "rout" },
				{"orig_name" : ["outline.art","^outline$"], "tl_name" : "outline" },
				{"orig_name" : ["fab.art","fab"], "tl_name" : "fab" },
				{"orig_name" : "top-enig", "tl_name" : "top-enig" },
				{"orig_name" : "bot-enig", "tl_name" : "bot-enig" },
				{"orig_name" : "fab_page2", "tl_name" : "fab_page2" },
				{"orig_name" : ["_d(\\d)(\\d+)\\.drd","_d(\\d)(\\d+)\\.fdr","^d(\\d)(\\d+)\\.art$","(\\d+)-(\\d+)-laser\\.drl","d(\\d+)-(\\d+)"], "tl_name" : "d_($1)-($2)"}
			]
		},
		"Wistron":{
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.btd$/ig.test(file.name)
					},  
					"type": "IPC356",		
					"format": "IPC356_1"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.ger$/ig.test(file.name) || /\.gdo$|\.bol$|\.gdo$|\.pma$|\.sma$|\.smb$|\.ssa$|\.ssb$/ig.test(file.name) ||
						/.+\.l\d+$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_3"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.ncd$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_4"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.d\d+$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_6"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.art$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_3",
					"format_params": function(props){
						var params = props.params
						if(params.art_param){
							var leading = params.art_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.art_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							var nf1,nf2
							if(params.art_param.hasOwnProperty("FORMAT")){
								var tmp = params.art_param["FORMAT"].split(".")
								if(/\d+/ig.test(tmp[0])){nf1 = Number(tmp[0])}
								if(/\d+/ig.test(tmp[1])){nf2 = Number(tmp[1])}
							}
							return {
								"nf1": nf1 || 3,
								"nf2": nf2 || 5,
								"units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "*",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.art_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": "absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl$|\.rou$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_4",
					"format_params": function(props){
						var params = props.params
						if (params.ncdrill && !params.nc_param){params.nc_param = params.ncdrill}
						if(params.nc_param){
							var leading = params.nc_param["SUPPRESS_LEAD_ZEROES"]
							var trailing = params.nc_param["SUPPRESS_TRAIL_ZEROES"]
							var zeroes = "none"
							if(/yes/ig.test(leading)){
								zeroes = "leading"
							}
							if(/yes/ig.test(trailing)){
								zeroes = "trailing"
							}
							return {
								"nf1": params.nc_param["INTEGER_PLACES"]? Number(params.nc_param["INTEGER_PLACES"]) : 3,
								"nf2": params.nc_param["DECIMAL_PLACES"]? Number(params.nc_param["DECIMAL_PLACES"]) : 5,
								"units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"zeroes": zeroes,
								"decimal": "no",
								"nf_comp": 0,
								"break_sr": "yes",
								"data_type": "ascii",
								"separator": "nl",
								"threshold": 200,
								"drill_only": "no",
								"multiplier": 1,
								"resolution": 3,
								"tool_units": /METRIC|MM/ig.test(params.nc_param["OUTPUT_UNITS"])? "mm" :"inch",
								"coordinates": params.nc_param["COORDINATES"]? params.nc_param["COORDINATES"].toLowerCase() :"absolute",
								"merge_by_rule": "no",
								"signed_coords": "no",
								"text_line_width": 0.0024
							}
						}
					}
				}
			],
			"tl_name": [
				{"orig_name" : ["^pmt\\.art$","\\.pma$","SoldPasteTop\\.ger","past_top"], "tl_name" : "past_top" },
				{"orig_name" : ["^pmb\\.art$","\\.pmb$","SoldPasteBot\\.ger","past_botm"], "tl_name" : "past_botm" },
				{"orig_name" : ["tsilk","^sst\\.art$","\\.ssa$","SilkScrnTop\\.ger","silk_top"], "tl_name" : "silk_top" },
				{"orig_name" : ["bsilk","^ssb\\.art$","\\.ssb$","SilkScrnBot\\.ger","silk_bot"], "tl_name" : "silk_bot" },
				{"orig_name" : ["tmask","^smt\\.art$","\\.sma$","SoldMask1Top\\.ger","sm_top"], "tl_name" : "sm_top" },
				{"orig_name" : ["bmask","^smb\\.art$","\\.smb$","SoldMask1Bot\\.ger","sm_bot"], "tl_name" : "sm_botm" },
				{"orig_name" : ["^top$","^top.art$"], "tl_name" : "top" },
				{"orig_name" : ["^l(\\d+).*\\.art$","^v(\\d+)\\.art$","^g(\\d+)\\.art$","^s(\\d+)\\.art$","\\.l(\\d+)$","Copper(\\d+)\\.ger$","^layer_(\\d+)"], "tl_name" : "l_($1)"},
				{"orig_name" : ["^bot\\.art$","^bottom$","^bottom.art$"], "tl_name" : "bottom" },
				{"orig_name" : ["\\.d(\\d+)$"], "tl_name" : "d_($1)-($1+1)"},
				{"orig_name" : ["thruHolePlated_(\\d+)_(\\d+)\\.ncd","(\\d+)-(\\d+)\\.drl$","^drill(\\d+)-(\\d+)$","^d_(\\d+)-(\\d+)$"], "tl_name" : "d_($1)-($2)"},
				{"orig_name" : ["ThruHoleNonPlated\\.ncd$","^drill$"], "tl_name" : "drill" },
				{"orig_name" : ["\\.rou$","^rout$"], "tl_name" : "rout" },
				{"orig_name" : "fab.art", "tl_name" : "fab.art" },
				{"orig_name" : ["multipack.art","^array$"], "tl_name" : "array" },
				{"orig_name" : ["outline\\.art$","\\.bol$","PnlContourNonPlated\\.ger","^outline"], "tl_name" : "outline" },
				{"orig_name" : ["top-enig","enig_top"], "tl_name" : "enig_top" },
				{"orig_name" : ["bot-enig","enig_bot"], "tl_name" : "enig_bot" },
			]
		},
		"Vivo":{
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.btd$|.+\.rou$/ig.test(file.name)
					},  
					"type": "IPC356A",		
					"format": "IPC356A_1"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /\.gdo$|\.pho$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_4"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.ncd$/ig.test(file.name) || /.+\.d\d+$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_5"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl/ig.test(file.name) || /.+\.d\d+$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_7"
				}
			],
			"tl_name": [
				{"orig_name" : ["osp-top\\.pho","solderpastetop","past_top"], "tl_name" : "past_top" },
				{"orig_name" : ["osp-bottom\\.pho","solderpastebottom","past_botm"], "tl_name" : "past_botm" },
				{"orig_name" : ["pleg\\.art","^ss_top","silk_top"], "tl_name" : "silk_top" },
				{"orig_name" : ["sleg\\.art","^ss_bot","silk_bot"], "tl_name" : "silk_bot" },
				{"orig_name" : ["soldermask-top","top-solder-mask\\.pho","soldermasktop","sm_top"], "tl_name" : "sm_top" },
				{"orig_name" : ["soldermask-bottom","bottom-solder-mask\\.pho","soldermaskbottom","sm_bot"], "tl_name" : "sm_botm" },
				{"orig_name" : ["top\\.pho","^top$","layertop"], "tl_name" : "top" },
				{"orig_name" : ["^lay(\\d+)","layer(\\d+)\\.gdo","layer_(\\d+)"], "tl_name" : "l_($1)"},
				{"orig_name" : ["^bottom\\.pho$","^bottom$","layerbottom"], "tl_name" : "bottom" },
				{"orig_name" : ["^drill(\\d+)-(\\d+)$","^d(\\d+)-(\\d+)$"], "tl_name" : "d_($1)-($2)"},
				{"orig_name" : ["^drill$"], "tl_name" : "drill" },
				{"orig_name" : ["\\.rou$","^rout$"], "tl_name" : "rout" },
				{"orig_name" : "fab.art", "tl_name" : "fab.art" },
				{"orig_name" : ["pcb-set\\.gdo","^pcb-set\\.pho$","^pcb-set$","^array$"], "tl_name" : "array" },
				{"orig_name" : ["^outline"], "tl_name" : "outline" },
				{"orig_name" : ["au_mask-bottom\\.gdo","au_mask_bottom\\.gdo","enig_top"], "tl_name" : "enig_top" },
				{"orig_name" : ["au_mask-top\\.gdo","au_mask_top\\.gdo","enig_bot"], "tl_name" : "enig_bot" },
				{"orig_name" : ["cavitytop","cavity_top"], "tl_name" : "cavity_top" },
				{"orig_name" : ["cavitybottom","cavity_bot"], "tl_name" : "cavity_bot" },
			],
			"mergerule" : {
				drill_second: ["(\\d+)-(\\d+)\\.drl$"],
				drill: [
					{orig_rule:["contournonplated"],drill_type:"non_plated",shape:"slot"},
					{orig_rule:["contourplated"],drill_type:"plated",shape:"slot"},
					{orig_rule:["thruholenonplated"],drill_type:"non_plated",shape:"hole"},
					{orig_rule:["thruholeplated"],drill_type:"plated",shape:"hole"},
				],
				profile:["enig_bot","past_top"],
				laser : {
					tl_name: "drill($1)-($2)",
					regs: ["(\\d+)-(\\d+)plated\\.ncd$","(\\d+)-(\\d+)\\.drl$"]
				}
			}
		},
		"1352":{
			"step": "cad",
			"rules": [
				{ 
					"valid": function(props){
						var file = props.file;
						return /.+\.tgz$/ig.test(file.name)
					}, 
					"type": "ODB",		
					"format": "ODB"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.ipc$/ig.test(file.name)
					},  
					"type": "IPC356",		
					"format": "IPC356_1"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.art$/ig.test(file.name)
					},  
					"type": "Gerber274x",		
					"format": "Gerber274x_5"
				},
				{
					"valid": function(props){
						var file = props.file;
						return /.+\.drl$/ig.test(file.name)
					},  
					"type": "Excellon2",		
					"format": "Excellon2_8"
				}
			],
			"tl_name": [
				{"orig_name" : ["pasttop\\.art","past_top"], "tl_name" : "past_top" },
				{"orig_name" : ["pastbotm\\.art","past_botm"], "tl_name" : "past_botm" },
				{"orig_name" : ["^silktop\\.art$","silk_top"], "tl_name" : "silk_top" },
				{"orig_name" : ["^silkbotm\\.art$","silk_bot"], "tl_name" : "silk_bot" },
				{"orig_name" : ["soldtop.art","sm_top"], "tl_name" : "sm_top" },
				{"orig_name" : ["soldbotm\\.art","sm_bot"], "tl_name" : "sm_botm" },
				{"orig_name" : ["^top$","^top.art$"], "tl_name" : "top" },
				{"orig_name" : ["^pgp(\\d+)\\.art$","^art(\\d+)\\.art$","^l_(\\d+)"], "tl_name" : "l_($1)"},
				{"orig_name" : ["^bot\\.art$","^bottom$","^bottom.art$"], "tl_name" : "bottom" },
				{"orig_name" : ["\\.d(\\d+)$"], "tl_name" : "d_($1)-($1+1)"},
				{"orig_name" : ["^drill(\\d+)-(\\d+)$","^d_(\\d+)-(\\d+)$"], "tl_name" : "d_($1)-($2)"},
				{"orig_name" : ["^drill$"], "tl_name" : "drill" },
				{"orig_name" : ["\\.rou$","^rout$"], "tl_name" : "rout" },
				{"orig_name" : "fab.art", "tl_name" : "fab.art" },
				{"orig_name" : ["multipack.art","^array$"], "tl_name" : "array" },
				{"orig_name" : ["\\.bol$","PnlContourNonPlated\\.ger","^outline"], "tl_name" : "outline" },
				{"orig_name" : ["top-enig","enig_top"], "tl_name" : "enig_top" },
				{"orig_name" : ["bot-enig","enig_bot"], "tl_name" : "enig_bot" },
			],
			"mergerule" : {
				drill:["(\\d+)-(\\d+)\\.drl$"],
				profile:["sm_top"],
				laser : {
					tl_name: "drill($1)-($2)",
					regs: ["(\\d+)-(\\d+)\\.drl$"]
				}
			}
		}
	},
	"data_format": [
		{"tl_name":"enig_top" , "new_name":"enig_top" , "attr":{ "context":"board", "type":"document" }},
		{"tl_name":"past_top" , "new_name":"past_top" , "attr":{ "context":"board", "type":"solder_paste" }},
		{"tl_name":"silk_top" , "new_name":"silk_top" , "attr":{ "context":"board", "type":"silk_screen" }},
		{"tl_name":"sm_top" , "new_name":"sm_top" , "attr":{ "context":"board", "type":"solder_mask" }},
		{"tl_name":"^top$" , "new_name":"top" , "attr":{ "context":"board", "type":"signal" }},
		{"tl_name":"l_(\\d+)","new_name":"l($1)" ,"attr":{"context":"board","type":"signal"}},
		{"tl_name":"^bottom$","new_name":"bottom" ,"attr":{"context":"board","type":"signal"}},
		{"tl_name":"sm_botm" , "new_name":"sm_botm" , "attr":{ "context":"board", "type":"solder_mask" }},
		{"tl_name":"silk_bot" , "new_name":"silk_bot" , "attr":{ "context":"board", "type":"silk_screen" }},
		{"tl_name":"past_botm" , "new_name":"past_botm" , "attr":{ "context":"board", "type":"solder_paste" }},
		{"tl_name":"enig_bot" , "new_name":"enig_bot" , "attr":{ "context":"board", "type":"document" }},
		{"tl_name":"d_(\\d+)-(\\d+)","new_name":"ftdrill($1)-($2)l" ,"attr":{"context":"board","type":"drill"}},
		{"tl_name":"drill","new_name":"ftdrill" ,"attr":{"context":"board","type":"drill"}},
		{"tl_name":"rout","new_name":"rout" ,"attr":{"context":"board","type":"rout"}},
		{"tl_name":"outline","new_name":"outline" ,"attr":{"context":"board","type":"rout"}},
		{"tl_name":"array","new_name":"array" ,"attr":{"context":"misc"}},
		{"tl_name":"cavity_top","new_name":"cavity_top" ,"attr":{"context":"misc"}},
		{"tl_name":"cavity_bot","new_name":"cavity_bot" ,"attr":{"context":"misc"}},
		{"tl_name":"fab.art","new_name":"fab.art" ,"attr":{"context":"misc"}}
	],
	"delSameJob": "yes"
}})()