//--------------------------------------------------------------------------- private void bnConnect_Click(object sender, RoutedEventArgs e) { if (m_nIndex < 0) { return; } if (m_nIndex == 0) // TOP { } else if (m_nIndex == 1) // Bottom { //if (!LDCBTM.fn_Open(FM.m_stMasterOpt.sLoadCellSN)) return; if (LDCBTM.fn_GetSN() == "" || LDCBTM.fn_GetSN() == "Error") { fn_UserMsg("[LOADCELL] Serial No Error!"); return; } if (!LDCBTM.fn_Open()) { fn_UserMsg("[LOADCELL] Connection Error!"); return; } _textOffset.Text = LDCBTM._nOffset.ToString(); _textFullScaleValue.Text = LDCBTM._nFullScaleValue.ToString(); _textFullScaleLoadValue.Text = LDCBTM._nFullScaleLoadValue.ToString(); _textDecimalPoint.Text = LDCBTM._nDecimalPoint.ToString(); _textUnitCode.Text = LDCBTM._sUnit; } }
//--------------------------------------------------------------------------- //LoadCell private void THREAD_PROCESS_4() { bool bGo = false; double Start = 0; double Scan = 0; // try { while (m_bThreadRun[TH4]) { Thread.Sleep(1); if (!bGo) { Start = TICK._GetTickTime(); m_bWatchDog[TH4] = false; //Load Cell Update LDCBTM.fn_Update(); //Top Cell Data IO.fn_UpdateTopLDC(); m_bWatchDog[TH4] = true; Scan = TICK._GetTickTime() - Start; bGo = true; m_tDelayTimer[TH4].Clear(); } if (Scan < THREAD_INTERVAL4) { if (!m_tDelayTimer[TH4].OnDelay(bGo, THREAD_INTERVAL4 - Scan)) { continue; } } bGo = false; //Scan Time Check m_nScanTime [TH4] = (uint)(TICK._GetTickTime() - m_nStartTime[TH4]); m_nStartTime[TH4] = (uint)TICK._GetTickTime(); } } catch (System.Exception ex) { m_bWatchDog[TH4] = false; System.Diagnostics.Trace.WriteLine(ex.Message); LOG.ExceptionTrace("[THREAD_PROCESS_4]", ex); } }
//--------------------------------------------------------------------------- private void bnSetCalibration_Click(object sender, RoutedEventArgs e) { if (m_nIndex < 0) { return; } if (m_nIndex == 1) { LDCBTM.fn_TareCalibration(); } }
//--------------------------------------------------------------------------- private void bnDisconnect_Click(object sender, RoutedEventArgs e) { if (m_nIndex < 0) { return; } if (m_nIndex == 0) { } else if (m_nIndex == 1) { // LDCBTM.fn_Close(); } }
//--------------------------------------------------------------------------- //Update Timer private void fn_tmUpdate(object sender, EventArgs e) { //m_UpdateTimer.Stop(); // switch (m_nStep) { case 0: tbLoadMsg.Text = " Now Loading System Data..."; if (!m_tDelayTimer.OnDelay(true, 300)) { return; } m_tDelayTimer.Clear(); m_nStep++; break; case 1: //Load Default file Info. tbLoadMsg.Text = " Loading the Information..."; FM.fn_LoadLastInfo(true); tbLoadMsg.Text = " Loading the Project Info..."; FM.fn_LoadProject(true, FM._sCurrJob); tbLoadMsg.Text = " Loading the System Option..."; FM.fn_LoadSysOptn(true); tbLoadMsg.Text = " Loading the Master Option..."; FM.fn_LoadMastOptn(true); tbLoadMsg.Text = " Loading the Recipe Data..."; FM.fn_LoadRecipeInfo(true, FM._sRecipeName); tbLoadMsg.Text = " Loading the Password..."; FM.fn_LoadPassWord(true); tbLoadMsg.Text = " Loading SPC Data..."; SPC.Load(true); m_tDelayTimer.Clear(); m_nStep++; break; case 2: if (!m_tDelayTimer.OnDelay(true, 100)) { return; } tbLoadMsg.Text = " Loading the IO List..."; IO.fn_LoadIO(true); tbLoadMsg.Text = " Loading the Lamp/Buzzer Data..."; LAMP.fn_Load(true); tbLoadMsg.Text = " Loading the Actuator Data..."; ACTR.fn_Load(true); //tbLoadMsg.Text = " ACS IO Connection...(SIM)" ; IO.fn_ACSConnect(UserConst.ACS_CON_SIM); tbLoadMsg.Text = " ACS IO Connection..."; IO.fn_ACSConnect(UserConst.ACS_CON_NOR); m_tDelayTimer.Clear(); m_nStep++; break; case 3: //if (!m_tDelayTimer.OnDelay(true, 100)) return; tbLoadMsg.Text = " Loading the Error List..."; EPU.fn_LoadErrorData(true); tbLoadMsg.Text = " Loading the Lamp/Buzzer Data..."; EPU.fn_LoadLampData(true); m_tDelayTimer.Clear(); m_nStep++; break; case 4: if (!m_tDelayTimer.OnDelay(true, 500)) { return; } //tbLoadMsg.Text = " Loading the Motor List...(SIM)"; MOTR.fn_InitMotor(UserConst.ACS_CON_SIM); tbLoadMsg.Text = " Loading the Motor List..."; MOTR.fn_InitMotor(UserConst.ACS_CON_NOR); tbLoadMsg.Text = " Loading the Vision Recipe..."; g_VisionManager.fn_LoadVision(FM._sRecipeName); //tbLoadMsg.Text = " Loading the Motor Data..." ; FM.fn_LoadMastOptn(true); //tbLoadMsg.Text = " Loading the Motor DSTB..." ; MOTR.fn_LoadMotrDisturb(true); m_tDelayTimer.Clear(); m_nStep++; break; case 5: //if (!m_tDelayTimer.OnDelay(true, 500)) return; tbLoadMsg.Text = " Loading the Data Manager Map Data..."; DM.fn_LoadMap(true); tbLoadMsg.Text = " Loading the Sequence Data..."; SEQ.fn_LoadWorkInfo(true); m_tDelayTimer.Clear(); m_nStep++; break; case 6: //Row, Col Setting... tbLoadMsg.Text = " Apply Project..."; FM.ApplyProject(FM._sCurrJob); m_nStep++; break; case 7: //LoadCell tbLoadMsg.Text = " Initial Load Cell ..."; LDCBTM.fn_SetParam(); LDCBTM.fn_Open(LDCBTM._sSerialNo); //LDCBTM.fn_Open (FM.m_stMasterOpt.sLoadCellSN); LDCBTM.fn_Close(); //JUNG/201014/Retry LDCBTM.fn_Open(LDCBTM._sSerialNo); //PMC, Slurry Init //tbLoadMsg.Text = " Initial PMC IP,Port ..." ; PMC.fn_SetIpAddress(FM.m_stSystemOpt.sPMCIp, FM.m_stSystemOpt.nPMCPort); tbLoadMsg.Text = " Initial REST API ..."; REST.fn_SetURL(FM.m_stSystemOpt.sRestApiUrl); tbLoadMsg.Text = " Initial RFID Reader ..."; m_nStep++; break; case 8: if (IO._bConnect) { //RFID tbLoadMsg.Text = " Initial RFID Reader ..."; RFID.fn_Connect(); } m_nStep++; break; case 9: //if (!m_tDelayTimer.OnDelay(true, 500)) return; //Main Load fn_MainFormLoad(); m_UpdateTimer.Stop(); m_nStep++; break; default: break; } //Step Inc. pbStep.Value = m_nStep * 10; //m_UpdateTimer.Start(); }
private void fn_tmUpdate(object sender, EventArgs e) { //Timer //m_UpdateTimer.Stop(); m_UpdateTimer.IsEnabled = false; //Update Tool Info DM.STOR[(int)EN_STOR_ID.POLISH].fn_UpdateMap(ref lbStorg); DM.STOR[(int)EN_STOR_ID.CLEAN].fn_UpdateMap(ref lbStorg1); //Plate DM.MAGA[(int)EN_MAGA_ID.POLISH].fn_UpdateMap(ref lbPoliPlate); DM.MAGA[(int)EN_MAGA_ID.CLEAN].fn_UpdateMap(ref lbClenPlate); DM.MAGA[(int)EN_MAGA_ID.LOAD].fn_UpdateMap(ref lbLoadPlate); DM.MAGA[(int)EN_MAGA_ID.TRANS].fn_UpdateMap(ref lbTransPlate); //Magazine DM.MAGA[(int)EN_MAGA_ID.MAGA01].fn_UpdateMap(ref lbMagz01); DM.MAGA[(int)EN_MAGA_ID.MAGA02].fn_UpdateMap(ref lbMagz02); // DM.TOOL.fn_UpdateMap(ref lbSpdlPlate, ref lbSpdlTool, ref lbSpdlToolFce, ref lbNeedCheck); lbCrntRcpName.Text = string.Format("[{0}] {1}", LOT._bLotOpen ? "OPEN" : "", FM._sRecipeName); //lbCrntRcpName.Background = LOT._bLotOpen? Brushes.Lime : Brushes.WhiteSmoke; //SEQ._bRecipeOpen lbRcp.Background = LOT._bLotOpen ? Brushes.LimeGreen : Brushes.WhiteSmoke; lbReqPoli.Background = SEQ_SPIND._bReqUtil_Polish ? Brushes.Lime : Brushes.LightGray; lbReqPoli.Visibility = FM.fn_IsLvlMaster() ? Visibility.Visible : Visibility.Hidden; //JUNG/210113 lbSpdlToolFce.Visibility = FM.fn_IsLvlMaster() ? Visibility.Visible : Visibility.Hidden; lbNeedCheck.Visibility = FM.fn_IsLvlMaster() ? Visibility.Visible : Visibility.Hidden; //LDCBTM._dLoadCellValue * ONEGRAM_TO_NEWTON upLoadCell.UPValue = string.Format($"{LDCBTM.fn_GetBtmLoadCell(true)} N [{LDCBTM.fn_GetBtmLoadCell()} g]"); lbRPM.Content = string.Format("SPINDLE RPM : {0} / {1}", SEQ_SPIND.fn_GetSpindleSpeed(), SEQ_SPIND.fn_GetSpindleDir() ? "DIR : FWD" : "DIR : BWD"); //lbCrntFos.Content = string.Format($"[LOAD CELL] TOP : {IO.fn_GetTopLoadCell(true)} N"); lbCrntFos.Content = string.Format($"[LOAD CELL] TOP : {IO.fn_GetTopLoadCellAsBTM(true)} N"); //JUNG/200910/ lbUTLevel.Content = string.Format($"UTIL LEVEL : {IO.fn_GetUTAvgValue():F1}"); //JUNG/200423/Avg Value //JUNG/201119/Min,Max Reset if (SEQ_SPIND._bReqResetGraph) { SEQ_SPIND._bReqResetGraph = false; fn_SetGraphRange(); } // AddGraph if (nGraphTick > ug_LoadCellTop.UGDataCount) { ug_LoadCellTop.RemoveFirst(); } double dTopLoadCell = IO.fn_GetTopLoadCellAsBTM(true); //IO.fn_GetTopLoadCell(true); ug_LoadCellTop.UGValue = $"{dTopLoadCell} N"; //ug_LoadCellTop.UGMaxValue = 10; ug_LoadCellTop.AddPoint(new Point(nGraphTick++, dTopLoadCell)); ug_LoadCellTop.Refresh(); lbDCOM.Content = string.Format($"[DCOM] SET: {SEQ_SPIND._dForceRatio:F2} / READ: {IO.fn_GetDCOMValue()}"); if (SEQ_SPIND._bDrngPolishing) { lbPoliCnt.Content = string.Format($"POLISHING COUNT : {SEQ_SPIND.fn_GetCurrMillCnt(true)} / CYCLE: {SEQ_SPIND._nPolCycle+1} / STEP : {SEQ_SPIND._nPoliCnt+1}"); } else if (SEQ_SPIND._bDrngCleaning) { lbPoliCnt.Content = string.Format($"CLEANING COUNT : {SEQ_SPIND.fn_GetCurrMillCnt(true)} / CYCLE : {SEQ_SPIND._nClnCycle+1} / STEP : {SEQ_SPIND._nPoliCnt+1}"); } //lbFlowMT1.Content = string.Format($"[FLOW] POLISHING SLURY : {IO.fn_GetFlowMeter(EN_AINPUT_ID.aiPOL_SlurryFlow ):F1}"); //lbFlowMT2.Content = string.Format($"[FLOW] POLISHING DI : {IO.fn_GetFlowMeter(EN_AINPUT_ID.aiPOL_DIWaterFlow):F1}"); //lbFlowMT3.Content = string.Format($"[FLOW] CLEANING DI : {IO.fn_GetFlowMeter(EN_AINPUT_ID.aiCLN_DIWaterFlow):F1}"); lbLotNo.Text = string.Format($"LOT No : {LOT._sLotNo}"); lbStartTime.Content = string.Format($"[TOTAL] START TIME : {SEQ_TRANS._sStartTime}"); lbEndTime.Content = string.Format($"[TOTAL] END TIME : { SEQ_TRANS._sEndTime }"); lbMillStartTime.Content = (SEQ._bFlick3) ? string.Format($"[POL]START TIME : {SEQ_SPIND._sMillStartTime}") : string.Format($"[CLN]START TIME : {SEQ_SPIND._sCleanStartTime}"); lbMillEndTime.Content = (SEQ._bFlick3) ? string.Format($"[POL]END TIME : {SEQ_SPIND._sMillEndTime}") : string.Format($"[CLN]END TIME : { SEQ_SPIND._sCleanEndTime }"); if (SEQ_SPIND._bDrngPolishing) { pbPoli.Visibility = Visibility.Visible; tbPolibar.Visibility = Visibility.Visible; pbPoli.Value = SEQ_SPIND.fn_GetMillPercent(); } else { pbPoli.Visibility = Visibility.Hidden; tbPolibar.Visibility = Visibility.Hidden; } if (SEQ_SPIND._bDrngCleaning) { //pbClen .Visibility = Visibility.Hidden; //삭제 //tbClenbar.Visibility = Visibility.Hidden; //pbClen.Value = ((IO.DATA_ACS_TO_EQ[(int)EN_ACS_TO_EQ.ATE_Milling_Cnt] + (100 * SEQ_SPIND._nCleanCnt)) / 400.0) * 100.0; } else { pbClen.Visibility = Visibility.Hidden; tbClenbar.Visibility = Visibility.Hidden; } // lbSpdlState.Content = SEQ_SPIND.fn_GetSeqMsg(); lbPoliState.Content = SEQ_POLIS.fn_GetSeqMsg(); lbClenState.Content = SEQ_CLEAN.fn_GetSeqMsg(); lbTranState.Content = SEQ_TRANS.fn_GetSeqMsg(); // //m_UpdateTimer.Start(); m_UpdateTimer.IsEnabled = true; }
//--------------------------------------------------------------------------- private void bnGetSerial_Click(object sender, RoutedEventArgs e) { _textSerialNo.Text = LDCBTM.fn_GetSN(); }