Exemple #1
0
        HObject _hoFullImg = null; //Recipe全图

        void UpdateMapCtrl()
        {
            string currSelRecipeID = cbRecipeID.Text;

            if (string.IsNullOrEmpty(currSelRecipeID))
            {
                mapDetectCells.Initial(1, 1, _dctDieStateColor, "未检测");
                htFullImg.Refresh();
                return;
            }
            JFDLAFRecipeManager rm = JFHubCenter.Instance.RecipeManager as JFDLAFRecipeManager;

            if (null == rm || !rm.IsInitOK)
            {
                mapDetectCells.Initial(1, 1, _dctDieStateColor, "未检测");
                htFullImg.Refresh();
                return;
            }
            JFDLAFProductRecipe recipe = rm.GetRecipe("Product", currSelRecipeID) as JFDLAFProductRecipe;

            if (null == recipe)
            {
                mapDetectCells.Initial(1, 1, _dctDieStateColor, "未检测");
                htFullImg.Refresh();
                return;
            }

            {
                int row = recipe.RowCount;
                int col = recipe.ColCount * recipe.FovCount;
                mapDetectCells.Initial(row, col, _dctDieStateColor, "未检测");
            }

            string fullImgPath = recipe.GetFrameMapImgFullPath(currSelRecipeID);

            if (string.IsNullOrEmpty(fullImgPath))
            {
                htFullImg.Refresh();
                return;
            }

            if (!File.Exists(fullImgPath))
            {
                htFullImg.Refresh();
                return;
            }

            if (null != _hoFullImg)
            {
                _hoFullImg.Dispose();
                _hoFullImg = null;
            }
            HOperatorSet.GenEmptyObj(out _hoFullImg);
            HOperatorSet.ReadImage(out _hoFullImg, fullImgPath);
            htFullImg.DispImage(_hoFullImg);
        }