Example #1
0
        private List <XElement> CreateFiducails(Ekra_PrinterData printerData, EkraFiducailOffsetResult ekraFMOffset)
        {
            List <XElement> fiducailList = new List <XElement>();

            fiducailList.Clear();

            for (int i = 0; i < printerData.EkraFMs.Count; i++)
            {
                string name = printerData.EkraFMs[i].Name;
                System.Windows.Point origin = printerData.EkraFMs[i].P;
                System.Windows.Point offset = ekraFMOffset.FiducialsOffset[i];
                //WriteFiducial(writer, name, origin, offset);
                fiducailList.Add(
                    new XElement("Fiducial"
                                 , new XAttribute("Name", name)
                                 , new XElement("X", new XAttribute("Offset", string.Format("{0:0.000000}", offset.X * 0.001))
                                                , new XAttribute("Origin", string.Format("{0:0.000000}", origin.X * 0.001)))
                                 , new XElement("Y", new XAttribute("Offset", string.Format("{0:0.000000}", offset.Y * 0.001))
                                                , new XAttribute("Origin", string.Format("{0:0.000000}", origin.Y * 0.001)))
                                 )
                    );
            }



            return(fiducailList);
        }
Example #2
0
        public override void Calculate(InspectedPanel currentPanel, object file)
        {
            try
            {
                Ekra_PrinterData Ekradata = file as Ekra_PrinterData;
                _CenterOffsetResult       = null;
                _RotationResult           = null;
                _StretchResult            = null;
                _DefectStatisticResult    = null;
                _EkraFiducailOffsetResult = null;
                var Boxes = GetCandidateBoxes(currentPanel, PrinterCommonSetting);

                //Calculate
                CenterOffsetCorrectionAlgorithm cocAlgo = new CenterOffsetCorrectionAlgorithm(PrinterCommonSetting.Clone());
                RotationCorrectionAlgorithm     rcAlgo  = new RotationCorrectionAlgorithm(PrinterCommonSetting.Clone());
                StretchAlgorithm   sAlgo      = new StretchAlgorithm();
                DefectStatistic    dsAlgo     = new DefectStatistic();
                EkraFiducailOffset ekraFMAlgo = new EkraFiducailOffset();

                _CenterOffsetResult    = (CenterOffsetResult)cocAlgo.Calculate(Boxes, currentPanel, null);
                _RotationResult        = (RotationResult)rcAlgo.Calculate(Boxes, currentPanel, _CenterOffsetResult);
                _StretchResult         = (StretchResult)sAlgo.Calculate(null, currentPanel, null);
                _DefectStatisticResult = (DefectStatisticResult)dsAlgo.Calculate(Boxes, currentPanel, null);

                var input = new EkraFiducailOffsetInputPara(Ekradata, _RotationResult, _CenterOffsetResult);
                _EkraFiducailOffsetResult = (EkraFiducailOffsetResult)ekraFMAlgo.Calculate(null, null, input);
                _WipeReason = JudgeWipeHelper.JudgeWipeByPriorityStrategy(currentPanel, Boxes);
            }
            catch (Exception e)
            {
                throw new CaculateException(e.Message);
            }
        }