예제 #1
0
        public bool IsBarcodeMatched(object fileobj, string barcode)
        {
            Hanwha_PrinterData data = fileobj as Hanwha_PrinterData;

            if (data.Panel.BarcodeId == barcode)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #2
0
        private XElement PROCESS_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            DateTime now = DateTime.Now;
            XElement ret = new XElement(
                "PROCESS",
                new XElement("ProductName", currentPanel.Panel.ModelName),//目前用檢測的資料為主,SPEC沒有註明
                new XElement("Date", now.ToString("yyyy_MM_dd")),
                new XElement("Time", now.ToString("HH_mm_ss")),
                //new XElement("PanelState", PanelStatus == eClosedLoopSPIStatus.NonInspected ? "NOT_INSPECTED" : "INSPECTED")//有INSPECTED / NOT_INSPECTED
                new XElement("PanelState", "INSPECTED") //有INSPECTED / NOT_INSPECTED
                );

            return(ret);
        }
예제 #3
0
        private XElement DEFECT_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            //var tree = new TreeAccess(Panel);
            //int PanelIndex = ProjectManager.getInstance().GetCurrentCarrier().GetPanelIndex(Panel);

            var      _boxList  = GetBoxList(currentPanel);
            var      _failList = FailList(currentPanel);
            XElement ret       = new XElement(
                "DEFECT",
                new XElement("TotalCount", _boxList.Count),
                new XElement("DefectCount",
                             new XAttribute("count", _failList.Count),
                             new XElement("Height",
                                          new XAttribute("high", GetCount(_boxList, eOverallStatus.SOL_HEIGHTOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_HEIGHTUNDER))
                                          ),
                             new XElement("Volume",
                                          new XAttribute("heigh", GetCount(_boxList, eOverallStatus.SOL_VOLUMEOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_VOLUMEUNDER))
                                          ),
                             new XElement("Area",
                                          new XAttribute("heigh", GetCount(_boxList, eOverallStatus.SOL_AREAOVER)),
                                          new XAttribute("low", GetCount(_boxList, eOverallStatus.SOL_AREAUNDER))
                                          ),
                             new XElement("Bridge",
                                          new XAttribute("count", GetCount(_boxList, eOverallStatus.SOL_BRIDGE))
                                          )


                             ),
                //new XElement("WarningCount",
                //                            new XAttribute("count", InspectResultClass.getInstance().WarningCnt[PanelIndex])
                //                            //new XElement("Height", InspectResultClass.getInstance().Fail[PanelIndex].)
                //                            )
                new XElement("DefectPosition", from box in _boxList
                             let id                                                                                                                                                                                                                                      = box.FullName
                                                                                               let posx                                                                                                                                                                  = box.CadCenter.X * 0.001 //Pad Position
                                                                                                                                                        let posy                                                                                                         = box.CadCenter.Y * 0.001
                                                                                                                                                                                                      let sizex                                                          = box.CadRect.Width * 0.001
                                                                                                                                                                                                                                         let sizey                       = box.CadRect.Height * 0.001
                                                                                                                                                                                                                                                                let code = ToHanwhaPadType(box.Status)
                                                                                                                                                                                                                                                                           select new XElement("Pad", new XAttribute("id", id), new XAttribute("posx", posx), new XAttribute("posy", posy), new XAttribute("sizex", sizex), new XAttribute("sizey", sizey), new XAttribute("code", code))
                             )
                );

            return(ret);
        }
예제 #4
0
        private XElement MEASUREMENTS_SECTION(Hanwha_PrinterData data)
        {
            XElement ret = new XElement(
                "MEASUREMENTS",
                new XElement("SqueegeeDir", "FORWARD"),                        //版的序列Hanwha只有兩種選擇 : FORWARD 1)↓Rear to Front 2)→Left to Right   和 REVERSE1)↑Front to Rear 2)←Right to Left
                new XElement("CenterOfRotation", data.Panel.CenterOfRotation), //Fixed as PANEL_CENTER [Has Confirmed]
                new XElement("Rotation", Math.Round(_RotationResult.Theta, 6)),

                new XElement("OffsetX", Math.Round((_CenterOffsetResult.Dx * 0.001), 6)), //um=>mm
                new XElement("OffsetY", Math.Round((_CenterOffsetResult.Dy * 0.001), 6)),
                //new XElement("OffsetX", Math.Round((Dx * 0.00001), 6)),//單位mm [has confirmed] SPI是um
                //new XElement("OffsetY", Math.Round((Dy * 0.00001), 6)),//單位mm [has confirmed] SPI是um
                new XElement("Height", Math.Round((_HanwhaResult.avgHeight_pct * 0.001), 6)),
                new XElement("Area", Math.Round((_HanwhaResult.avgArea_pct * 0.001), 6)),
                new XElement("Volume", Math.Round((_HanwhaResult.avgVolume_pct * 0.001), 6))
                );

            return(ret);
        }
예제 #5
0
        private XElement HEADER_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            XElement ret = new XElement(
                "HEADER",
                new XElement("MachineName", "SPI"),              //SPI fixed
                new XElement("Reference", "BOTTOM_LEFT"),        //應依照象限,固定,所以請設定象限1  [Has Comfirmed]
                new XElement("Units",
                             new XElement("Distance", "mm"),     //固定 [Has Comfirmed]
                             new XElement("Angle", "degree"),    //固定 [Has Comfirmed]
                             new XElement("Time", "seconds"),    //固定 [Has Comfirmed]
                             new XElement("Ratio", "percentage") //固定 [Has Comfirmed]
                             ),

                new XElement("DefineDirection", data.Header.DefineDirection)//不確定是否要按照得來的資訊 // Use as DEFINE_VERTICAL固定 [Has Comfirmed]

                );

            return(ret);
        }
예제 #6
0
        public object Parse(string filepath)
        {
            Hanwha_PrinterData ret = new Hanwha_PrinterData();

            try
            {
                XElement Hanwha = XElement.Load(filepath);
                //取得Print_Direction

                ret.Header = new _HEADER(
                    Hanwha.getValue("MachineName"),

                    Hanwha.getValue("Reference"),
                    new __Unit(Hanwha.getValue("Distance"), Hanwha.getValue("Angle"), Hanwha.getValue("Time")),
                    Hanwha.getValue("DefineDirection")
                    );


                ret.Panel = new _PANEL(
                    Hanwha.getValue("PanelId"),
                    Hanwha.getValue("BarcodeId"),
                    Hanwha.getValue("SqueegeeDir"),
                    null,
                    Hanwha.getValue("CenterOfRotation")
                    );

                //目前只有需要PanelId
                //if (ret.Panel.PanelId == null && ret.Panel.BarcodeId == null)
                //    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);
        }
예제 #7
0
        private XElement PANEL_SECTION(InspectedPanel currentPanel, Hanwha_PrinterData data)
        {
            List <FiducialMark> fidList = currentPanel.Panel.FiducialMarks;
            XElement            ret     = new XElement(
                "PANEL",
                new XElement("PanelId", "0"),//Panel ID 取流水碼
                new XElement("BarcodeId", currentPanel.Panel.PanelBarcode),

                new XElement("Stencil", new XAttribute("thickness", "0.100")),
                new XElement("PanelSize", new XAttribute("width", currentPanel.Panel.FullCadRect.Width * 0.001), new XAttribute("height", currentPanel.Panel.FullCadRect.Height * 0.001)), //單位mm [has confirmed] SPI是um
                new XElement("Fiducials",
                             from fid in fidList
                             select new XElement("Fiducial", new XAttribute("id", fidList.IndexOf(fid)),
                                                 new XAttribute("pos_x", fid.CadRect.Location.X * 0.001),                       //單位mm [has confirmed] SPI是um
                                                 new XAttribute("pos_y", fid.CadRect.Location.Y * 0.001))                       //單位mm [has confirmed] SPI是um
                             )
                );

            return(ret);
        }
예제 #8
0
        public override object Match(InspectedPanel currentPanel)
        {
            Hanwha_PrinterData tmpTool = new Hanwha_PrinterData();

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