 
 /* GenerateType: ManualInput/AutoGenerate */
var Barcodes ='{DUT:"DUT1-PORT1",Codes:[{"Label":"QR", "CodeType":"QRCode", "Enable":1, "Format": "V3", "Length": 0, "GenerateType": "ScanCode", "FixCode": "8928.800.316,355391090035308,01I_T4CHU9"}]}';

 
var Settings = new Object();

function Init() {
	//$('#DutNo').html(Settings.DUT);
    for (var i=0; i<Settings.Codes.length; i++) {
		if (Settings.Codes[i].Enable) {
			$(".inputWrapper").prepend('<tr class="inputGroup">' +
				'<td class="BarcodeName">' + Settings.Codes[i].Label + '</td>' +
				'<td>' +
					'<input type="text" class="BarcodeInputBox" id="' + Settings.Codes[i].Label + '" ' +
					'name="' + Settings.Codes[i].Label + '" ' +
					'index="' + i +'" ' + '>' +
				'</td>' +
			'</tr>');
			if (Settings.Codes[i].Length > 0) {
				$("#"+ Settings.Codes[i].Label).attr("maxlength", Settings.Codes[i].Length);
			}
			if(Settings.Codes[i].GenerateType == "ScanCode"){
				$("#"+ Settings.Codes[i].Label).attr("disabled", false);
				$("#"+ Settings.Codes[i].Label).focus();
			}
			else{
				$("#"+ Settings.Codes[i].Label).attr("disabled", true);
				$("#"+ Settings.Codes[i].Label).val(Settings.Codes[i].FixCode);
			}
		}
	}
}

$(function() {
	if (debug.DEBUG_IN_BROWSER) {
			Settings = eval("(" + Barcodes + ")");
        }
        else {
			Settings = AppHelp.LoadJson();
        }

	//Create input box
    Init();
});