//--------------------------------------------------------------------------- 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; } }
//--------------------------------------------------------------------------- //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(); }