private void SetTestWorkDataSet(FbTransaction trans, TestWorkDataSet set, TestWorkRow row)
        {
            set.RecNo          = AppRes.DB.GetGenNo("GN_TESTWORK");
            set.RecipeNo       = recipeNo;
            set.SlavePatternNo = AppHelper.ExtractRecNo(row.TestPattern);
            set.Index          = row.Index;
            set.ItemType       = row.ItemType;
            set.ItemCode       = row.ItemCode;
            set.ItemName       = row.ItemName;
            set.ItemRef        = row.ItemRef;
            set.BiasValue      = row.BiasValue;
            set.BiasRange      = row.BiasRange;
            set.BiasCH         = row.BiasCH;
            set.ApplyTime      = row.ApplyTime;
            set.TransientTime  = row.TransientTime;
            set.HumCount       = row.HumCounter;
            set.Optical        = row.Optical;
            set.IntegVL        = row.IntegVL;
            set.IntegX1        = row.IntegX1;
            set.IntegX2        = row.IntegX2;
            set.IntegZ         = row.IntegZ;
            set.Gain           = row.Gain;
            set.Offset         = row.Offset;
            set.LvGain         = row.LvGain;
            set.LvOffset       = row.LvOffset;
            set.CxGain         = row.CxGain;
            set.CxOffset       = row.CxOffset;
            set.CyGain         = row.CyGain;
            set.CyOffset       = row.CyOffset;

            set.Insert(trans);
        }
Beispiel #2
0
        private void workRankButton_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            if (RecipeNo <= 0)
            {
                return;
            }

            EReportItemCode code   = (EReportItemCode)workGrid.GetCellValue(workGrid.VisibleRows[(int)EReportWorkItem.ItemCode], workGrid.FocusedRecord);
            string          rank   = (string)workGrid.GetCellValue(workGrid.VisibleRows[(int)EReportWorkItem.Rank], workGrid.FocusedRecord);
            Int64           rankNo = AppHelper.ExtractRecNo(rank);

            DialogRankList dialog = new DialogRankList(RecipeNo, rankNo, code);

            try
            {
                dialog.ShowDialog();
            }
            finally
            {
                if (dialog.DialogResult == DialogResult.OK)
                {
                    workGrid.SetCellValue(workGrid.FocusedRow, workGrid.FocusedRecord, $"{dialog.Result.NameRecNo}");
                    workGrid.SetCellValue(workGrid.VisibleRows[(int)EReportWorkItem.Lower], workGrid.FocusedRecord, dialog.Result.Lower);
                    workGrid.SetCellValue(workGrid.VisibleRows[(int)EReportWorkItem.Upper], workGrid.FocusedRecord, dialog.Result.Upper);
                }
            }
        }
Beispiel #3
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;
                        }
                    }
                }
            }
        }
        private void workGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            if (workGridView.FocusedRowHandle < 0)
            {
                rankGrid.DataSource = null;
                return;
            }

            DataRow row = workGridView.GetDataRow(workGridView.FocusedRowHandle);

            workSet.Fetch(row);

            Int64           rankNo = AppHelper.ExtractRecNo(workSet.Rank);
            EReportItemCode code   = workSet.ItemCode;

            if (rankNo < 1)
            {
                rankGrid.DataSource = null;
                return;
            }

            rankRowSet.Select(rankNo);
            rankGrid.DataSource = (rankRowSet.Empty == true) ? null : rankRowSet.DataSet.Tables[0];
            rankGridView.ClearSelection();
            AppHelper.RefreshGridData(rankGridView);

            SetRankRowColumnVisible(code);
        }