Example #1
0
        private void Fetch()
        {
            recipeSet.Fetch();
            RecNo  = recipeSet.RecNo;
            Code   = recipeSet.Name;
            Memo   = recipeSet.Memo;
            ST1_X  = recipeSet.ST1_X;
            ST1_Y  = recipeSet.ST1_Y;
            ST1_QR = recipeSet.ST1_QR;
            ST2_X  = recipeSet.ST2_X;
            ST2_Y  = recipeSet.ST2_Y;
            ST2_QR = recipeSet.ST2_QR;

            Work    = new WorkObject(RecNo);
            Pattern = new PatternList(RecNo);
            Rank    = new RankList(RecNo);
            Bin     = new BinList(RecNo);

            List <BinObject> bins = Bin.ToList();

            foreach (BinObject bin in bins)
            {
                foreach (BinFormulaObject formula in bin.Formulas)
                {
                    if (string.IsNullOrWhiteSpace(formula.Token.ItemName) == false)
                    {
                        if (string.IsNullOrWhiteSpace(Work.Reports[formula.Token.ItemName].ItemRef) == false)
                        {
                            int refNo = (int)AppHelper.ExtractRecNo(Work.Reports[formula.Token.ItemName].ItemRef);
                            formula.Type = Work.Tests[refNo].ItemType;
                        }
                    }
                }
            }
        }
Example #2
0
        public bool Load(string code)
        {
            if ((RecNo > 0) && (code == Code))
            {
                return(false);
            }

            recipeSet.SelectName(code);
            if (recipeSet.Empty == true)
            {
                RecNo  = 0;
                Code   = "None";
                Memo   = "";
                ST1_X  = 0;
                ST1_Y  = 0;
                ST1_QR = "";
                ST2_X  = 0;
                ST2_Y  = 0;
                ST2_QR = "";

                Work    = null;
                Pattern = null;
                Rank    = null;
                Bin     = null;

                return(false);
            }
            Fetch();

            return(true);
        }
Example #3
0
        public RecipeObject()
        {
            RecNo = 0;
            Code  = "";
            Memo  = "";

            Pattern = null;
            Rank    = null;
            Work    = null;
            Bin     = null;

            recipeSet = new RecipeDataSet(AppRes.DB.Connect, null, null);
        }
        public void Load(string code)
        {
            if ((RecNo > 0) && (code == Code))
            {
                return;
            }

            recipeSet.SelectName(code);
            if (recipeSet.Empty == true)
            {
                RecNo  = 0;
                Code   = "None";
                Memo   = "";
                ST1_X  = 0;
                ST1_Y  = 0;
                ST1_QR = "";
                ST2_X  = 0;
                ST2_Y  = 0;
                ST2_QR = "";

                Work    = null;
                Pattern = null;
                Rank    = null;
                Bin     = null;
            }
            else
            {
                recipeSet.Fetch();
                RecNo  = recipeSet.RecNo;
                Code   = recipeSet.Name;
                Memo   = recipeSet.Memo;
                ST1_X  = recipeSet.ST1_X;
                ST1_Y  = recipeSet.ST1_Y;
                ST1_QR = recipeSet.ST1_QR;
                ST2_X  = recipeSet.ST2_X;
                ST2_Y  = recipeSet.ST2_Y;
                ST2_QR = recipeSet.ST2_QR;

                Work    = new Dictionary <EWorkType, WorkItem>();
                Pattern = new PatternList(RecNo);
                Rank    = new RankList(RecNo);
                Bin     = new BinList(RecNo);

                Work.Add(EWorkType.Full, new WorkItem(RecNo, EWorkType.Full));
                Work.Add(EWorkType.Sampling, new WorkItem(RecNo, EWorkType.Sampling));
            }
        }
Example #5
0
        public void SetBinItems()
        {
            BinList   bins  = context.Recipe.Bin;
            Worksheet sheet = binBook.Document.Worksheets[0];

            binBook.BeginUpdate();
            try
            {
                sheet.ClearContents(sheet["A1:J20"]);

                for (int i = 0; i < 10; i++)
                {
                    for (int j = 0; j < 10; j++)
                    {
                        if (i * 10 + j < bins.Count)
                        {
                            sheet.Cells[i * 2 + 0, j].FillColor = bins[i * 10 + j + 1].Mark;

                            int    index = bins[i * 10 + j + 1].Index;
                            string name  = bins[i * 10 + j + 1].Name;

                            if (string.IsNullOrWhiteSpace(name) == true)
                            {
                                sheet.Cells[i * 2 + 0, j].Value = $"{index}";
                            }
                            else
                            {
                                sheet.Cells[i * 2 + 0, j].Value = $"{name}({index})";
                            }
                        }
                        else
                        {
                            sheet.Cells[i * 2 + 0, j].FillColor = Color.FromKnownColor(KnownColor.Transparent);
                            sheet.Cells[i * 2 + 0, j].Value     = "";
                        }
                    }
                }
            }
            finally
            {
                binBook.EndUpdate();
            }
        }