public object Parse(string filepath) { Htgd_PrinterData ret = new Htgd_PrinterData(); try { XElement Htgd = XElement.Load(filepath); ret.ModelName = Htgd.getValue("ModelName"); ret.PrintTime = Htgd.getValue("PrintTime"); ret.SN = Htgd.getValue("SN"); ret.Barcode = Htgd.getValue("Barcode"); ret.Direction = Htgd.getValue("Direction"); ret.Thickness = Htgd.getValue("Thickness"); double thickness = 0.1; if (double.TryParse(Htgd.getValue("StencilThickness"), out thickness) == true) { StencilThickness = thickness; } } catch (Exception exception) { Log4.PrinterLogger.ErrorFormat("Htgd Printer Data Pasre Exception: {0}", filepath); Log4.PrinterLogger.ErrorFormat("Message: {0}", exception.Message); return(null); } return(ret); }
public bool IsBarcodeMatched(object fileobj, string barcode) { Htgd_PrinterData data = fileobj as Htgd_PrinterData; if (data.Barcode == barcode) { return(true); } else { return(false); } }
public override object Match(InspectedPanel currentPanel) { Htgd_PrinterData tmpTool = new Htgd_PrinterData(); return((Htgd_PrinterData)Match(currentPanel, (IParser)tmpTool, WatchedFolder)); }