Esempio n. 1
0
        internal async Task <bool> ShowShimChk(frmMain.PlcReference refplc, double chkkshim, string strindex = "G4")
        {
            bool bReturn = false;

            try
            {
                TB_FrontSetting sETTING = frmMain.G_Data._SETTING;
                if (refplc.AlcCode != frmMain.G_Data._SETTING.ALC_Code)
                {
                    using (GEN2_MEASUREDBEntities db = new GEN2_MEASUREDBEntities())
                    {
                        sETTING = await db.TB_FrontSetting.FindAsync(refplc.AlcCode);
                    }
                }

                BeginInvoke((Action)(() =>
                {
                    double dSelShim = double.Parse(lbl_FSG4_SelVal.Text);
                    lbl_FSG4_ChkVal.Text = chkkshim.ToString("0.000");
                    if (chkkshim >= dSelShim && chkkshim < (double)(dSelShim + sETTING.Shim_G4_Range))
                    {
                        lbl_FSG4_ChkVal.ForeColor = Color.DarkBlue;
                        lbl_FSG4_ChkVal.BackColor = SystemColors.Window;
                        bReturn = true;
                    }
                    else
                    {
                        lbl_FSG4_ChkVal.ForeColor = Color.Red;
                        lbl_FSG4_ChkVal.BackColor = Color.Yellow;
                        I_Home.ProcessLog(($"[ShimConfirmValue(G4) Error] " +
                                           $" 선택 값 :  {dSelShim}, 확인 값 : {chkkshim}"));
                        bReturn = false;
                    }
                }));
                using (GEN2_MEASUREDBEntities db = new GEN2_MEASUREDBEntities())
                {
                    TB_FrontShim tbShim = await db.TB_FrontShim.FindAsync(refplc.WorkDate, refplc.Barcode);

                    if (tbShim != null)
                    {
                        tbShim.ShimG4_Chk_Val = chkkshim;

                        await db.SaveChangesAsync();
                    }
                }
            }
            catch (Exception ex)
            {
                StackTrace trace      = new StackTrace(ex, true);
                StackFrame stackFrame = trace.GetFrame(trace.FrameCount - 1);
                int        lineNumber = stackFrame.GetFileLineNumber();

                I_Home.ErrorLog(($" ({lineNumber})[ShowShimChk({strindex}) Error] : {ex.ToString()}"));
            }
            return(bReturn);
        }
Esempio n. 2
0
        internal async Task ShowShim(frmMain.PlcReference refplc, int shimno, double selshim, WorkStep index = WorkStep.FrontShim)
        {
            try
            {
                BeginInvoke((Action)(() =>
                {
                    lbl_FSG4_Bar.Text = refplc.Barcode;
                    lbl_FSG4_Part.Text = refplc.PartName;
                    lbl_FSG4_WorkDate.Text = refplc.WorkDate.ToString();
                    lbl_FSG4_WorkNo.Text = refplc.WorkNo.ToString();
                    lbl_FSG4_SelVal.Text = selshim.ToString("0.000");
                    lbl_FSG4_Plcno.Text = shimno.ToString();
                }));
            }
            catch (Exception ex)
            {
                StackTrace trace      = new StackTrace(ex, true);
                StackFrame stackFrame = trace.GetFrame(trace.FrameCount - 1);
                int        lineNumber = stackFrame.GetFileLineNumber();

                I_Home.ErrorLog(($" ({lineNumber})[ShowShim({index.ToString()}) Error] : {ex.ToString()}"));
            }
        }
Esempio n. 3
0
 internal void ShowShim(frmMain.PlcReference refplc, int shimno, double selshim, WorkStep index = WorkStep.FrontShim)
 {
     Task.Run(() => uC_Measure.ShowShim(refplc, shimno, selshim, index));
     Task.Run(() => uC_Measure.ShowShimVal(shimno, selshim, index));
     Task.Run(() => uC_Measure.ShowShimDGV(refplc.WorkDate, uC_Measure.DGVShim_Fc, refplc.WorkNo));
 }