Пример #1
0
        public bool IsBarcodeMatched(object fileobj, string barcode)
        {
            INOTIS_PrinterData data = fileobj as INOTIS_PrinterData;

            if (data.sPanel_ID == barcode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        public override bool Output(InspectedPanel currentPanel, object file)
        {
            string netDrive;

            if (!PrinterSFSetting.IsOutEnable)
            {
                return(false);
            }
            else
            {
                netDrive = WmiDiskHelper.ExtractDiskID(PrinterSFSetting.OutDriveInfo) + @"\";//Disk mapping;
            }
            string             path = netDrive + String.Format("{0:yyyyMMddHHmmss}.xml", currentPanel.InspectStartTime);
            INOTIS_PrinterData _INOTIS_PrinterData = file as INOTIS_PrinterData;

            try
            {
                XElement root = new XElement("Data",
                                             new XElement(
                                                 "Process",
                                                 new XElement("Direction", _INOTIS_PrinterData.sPrint_Direction),
                                                 new XElement("Offset_Correction",
                                                              new XElement("X", Math.Round((_CenterOffsetResult.Dx * 0.001), 6)),
                                                              new XElement("Y", Math.Round((_CenterOffsetResult.Dy * 0.001), 6)),
                                                              new XElement("Theta", new XAttribute("CoR_X", Math.Round((_RotationResult.Center.X * 0.001), 6)),
                                                                           new XAttribute("CoR_Y", Math.Round((_RotationResult.Center.Y * 0.001), 6)),
                                                                           Math.Round(_RotationResult.Theta, 6)),
                                                              new XElement("Stretch", Math.Round(_StretchResult.Stretch, 6))
                                                              ) //Offset_Correction
                                                 )              //Process
                                             );
                root.Save(path);
                Log4.PrinterLogger.InfoFormat("Save @ {0} [INOTIS]", path);
            }
            catch (Exception e)
            {
                Log4.PrinterLogger.InfoFormat("Save @ {0} Exception [INOTIS]", path);
                Log4.PrinterLogger.InfoFormat("{0}", e.Message);
                throw new OutputException(e.Message);
                //return false;
            }

            return(true);
        }
Пример #3
0
        //public static INOTIS_PrinterData Parse(string filepath)
        public object Parse(string filepath)
        {
            INOTIS_PrinterData ret = new INOTIS_PrinterData();

            try
            {
                XElement INOTIS = XElement.Load(filepath);

                //取得Print_Direction

                ret.sPrint_Direction = INOTIS.getValue("Print_Direction");

                if (ret.sPrint_Direction == null)
                {
                    Log4.PrinterLogger.Info("INOTIS Printer Data Pasre Fail on: 'Print_Direction' ");

                    return(null);
                }


                //取得Barcode = Panel_ID
                ret.sPanel_ID = INOTIS.getValue("Panel_ID");
                if (ret.sPanel_ID == null)
                {
                    Log4.PrinterLogger.Info("INOTIS Printer Data Pasre Fail on: 'Panel_ID' ");
                    return(null);
                }
            }
            catch (Exception exception)
            {
                Log4.PrinterLogger.ErrorFormat("INOTIS Printer Data Pasre Exception: {0}", filepath);
                Log4.PrinterLogger.ErrorFormat("Message: {0}", exception.Message);
                return(null);
            }

            return(ret);
        }
Пример #4
0
        public override object Match(InspectedPanel currentPanel)
        {
            INOTIS_PrinterData tmpTool = new INOTIS_PrinterData();

            return((INOTIS_PrinterData)Match(currentPanel, (IParser)tmpTool, WatchedFolder));
        }