Esempio n. 1
0
 void refresh()
 {
     if (this.InvokeRequired)
     {
         refresh_Call d = new refresh_Call(refresh);
         this.BeginInvoke(d, new object[] { });
     }
     else
     {
         BT_SpeedXY.Text     = "±" + dX.ToString();
         BT_SpeedZ.Text      = "±" + dZ.ToString();
         TB_DataX_Org.Text   = _dataX.value.ToString();
         TB_DataY_Org.Text   = _dataY.value.ToString();
         TB_DataZ_Org.Text   = _dataZ.value.ToString();
         TB_DataX.Text       = dataX.value.ToString();
         TB_DataY.Text       = dataY.value.ToString();
         TB_DataZ.Text       = dataZ.value.ToString();
         TB_LowerLimitX.Text = dataX.lowerLimit.ToString();
         TB_LowerLimitY.Text = dataY.lowerLimit.ToString();
         TB_LowerLimitZ.Text = dataZ.lowerLimit.ToString();
         TB_UpperLimitX.Text = dataX.upperLimit.ToString();
         TB_UpperLimitY.Text = dataY.upperLimit.ToString();
         TB_UpperLimitZ.Text = dataZ.upperLimit.ToString();
         BT_ESC.Focus();
     }
 }
Esempio n. 2
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                //if (mc.main.THREAD_ALIVE || mc.main.THREAD_RUNNING) TS_Menu.Enabled = false; else TS_Menu.Enabled = true;
                TS_Menu.BringToFront();
                TS_Menu.Focus();

                if (mc.para.ETC.unloaderControl.value == 1)
                {
                    BT_MAGAZINE.Visible         = true;
                    BT_PUSHER.Visible           = true;
                    toolStripSeparator6.Visible = true;
                }
                else
                {
                    BT_MAGAZINE.Visible         = false;
                    BT_PUSHER.Visible           = false;
                    toolStripSeparator6.Visible = false;
                }
            }
        }
Esempio n. 3
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                for (int i = 0; i < 5; i++)
                {
                    tmp[i] = Math.Round(height[i], 3);
                }

                TB_LT.Text = tmp[1].ToString();
                TB_LB.Text = tmp[2].ToString();
                //TB_CENTER.Text = tmp[0].ToString();
                TB_RT.Text = tmp[3].ToString();
                TB_RB.Text = tmp[4].ToString();

                TB_JIGSIZE_X.Text  = mc.para.CAL.JigSize.x.value.ToString();
                TB_JIGSIZE_Y.Text  = mc.para.CAL.JigSize.y.value.ToString();
                TB_JIG_OFFSET.Text = mc.para.CAL.JigOffset.value.ToString();

                BT_ESC.Focus();
            }
        }
Esempio n. 4
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (firstdisp)
                {
                    TB_MPC_IpAddr.Text         = mc.para.DIAG.ipAddr.description;
                    TB_MPC_NAME.Text           = mc.para.DIAG.mpcName.description;
                    TB_INPUT_TMS_PC_NAME.Text  = mc.para.DIAG.inputTmsPCName.description;
                    TB_OUTPUT_TMS_PC_NAME.Text = mc.para.DIAG.outputTmsPCName.description;
                    firstdisp = false;
                }
                TB_MPC_PORT.Text = mc.para.DIAG.portNum.value.ToString();

                if (mc.commMPC._connect_flag)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_Status.Image = image;

                if (mc.para.DIAG.SecsGemUsage.value == 0)
                {
                    BT_SGUsage_OnOff.Text  = BT_SGUsage_OnOff_Off.Text;
                    BT_SGUsage_OnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_SGUsage_OnOff.Text  = BT_SGUsage_OnOff_On.Text;
                    BT_SGUsage_OnOff.Image = Properties.Resources.Yellow_LED;
                }

                RB_SG_OFFLINE.Checked = false;
                RB_SG_LOCAL.Checked   = false;
                RB_SG_REMOTE.Checked  = false;

                if ((MPCMODE)mc.para.DIAG.controlState.value == MPCMODE.OFFLINE)
                {
                    RB_SG_OFFLINE.Checked = true;
                }
                else if ((MPCMODE)mc.para.DIAG.controlState.value == MPCMODE.LOCAL)
                {
                    RB_SG_LOCAL.Checked = true;
                }
                else
                {
                    RB_SG_REMOTE.Checked = true;
                }

                //LB_.Focus();
            }
        }
Esempio n. 5
0
 private void refresh()
 {
     if (this.InvokeRequired)
     {
         refresh_Call d = new refresh_Call(refresh);
         this.BeginInvoke(d, new object[] { });
     }
     else
     {
         if ((int)mc.para.MT.padCount.x.value != btnPad.GetLength(0) || (int)mc.para.MT.padCount.y.value != btnPad.GetLength(1))
         {
             RemoveButton();
             row = (int)mc.para.MT.padCount.x.value;
             col = (int)mc.para.MT.padCount.y.value;
             ShowButton();
         }
         for (int i = 0; i < row; i++)                      // WorkArea가 없는 경우 문제될 소지가 있기 때문에 초기 배열크기를 크게 해놓고, refresh 할 때에는 실 자재에 대한 것만 실행함.
         {
             for (int j = 0; j < col; j++)
             {
                 if (WorkAreaControl.workArea[i, j] == 0)
                 {
                     btnPad[i, j].BackColor = Color.White;
                 }
                 else
                 {
                     btnPad[i, j].BackColor = Color.LimeGreen;
                 }
             }
         }
     }
 }
Esempio n. 6
0
 void refresh()
 {
     if (this.InvokeRequired)
     {
         refresh_Call d = new refresh_Call(refresh);
         this.BeginInvoke(d, new object[] { });
     }
     else
     {
         BT_Speed.Text = "±" + dX.ToString(); // 단위 갱신
         if (Corner13Teach)                   // 코너 방향 따라서
         {
             TB_Offset_X1.Text = Offset[0].x.value.ToString();
             TB_Offset_Y1.Text = Offset[0].y.value.ToString();
             TB_Offset_X2.Text = Offset[2].x.value.ToString();
             TB_Offset_Y2.Text = Offset[2].y.value.ToString(); // Offset 값 갱신
         }
         else
         {
             TB_Offset_X1.Text = Offset[1].x.value.ToString();
             TB_Offset_Y1.Text = Offset[1].y.value.ToString();
             TB_Offset_X2.Text = Offset[3].x.value.ToString();
             TB_Offset_Y2.Text = Offset[3].y.value.ToString();
         }
         BT_ESC.Focus();
     }
 }
Esempio n. 7
0
 void refresh()
 {
     if (this.InvokeRequired)
     {
         refresh_Call d = new refresh_Call(refresh);
         this.BeginInvoke(d, new object[] { });
     }
     else
     {
         BT_SKIP.BackColor              = UtilityControl.colorCode[(int)COLORCODE.SKIP];
         BT_READY.BackColor             = UtilityControl.colorCode[(int)COLORCODE.READY];
         BT_PCB_SIZE_ERR.BackColor      = UtilityControl.colorCode[(int)COLORCODE.PCB_SIZE_ERR];
         BT_BARCODE_ERR.BackColor       = UtilityControl.colorCode[(int)COLORCODE.BARCODE_ERR];
         BT_NO_EPOXY.BackColor          = UtilityControl.colorCode[(int)COLORCODE.NO_EPOXY];
         BT_EPOXY_UNDERFILL.BackColor   = UtilityControl.colorCode[(int)COLORCODE.EPOXY_UNDERFLOW];
         BT_EPOXY_OVERFILL.BackColor    = UtilityControl.colorCode[(int)COLORCODE.EPOXY_OVERFLOW];
         BT_EPOXY_POS_ERR.BackColor     = UtilityControl.colorCode[(int)COLORCODE.EPOXY_POS_ERR];
         BT_EPOXY_SHAPE_ERR.BackColor   = UtilityControl.colorCode[(int)COLORCODE.EPOXY_SHAPE_ERROR];
         BT_ATTACH_OK.BackColor         = UtilityControl.colorCode[(int)COLORCODE.ATTACH_OK];
         BT_ATTACH_OVERPRESS.BackColor  = UtilityControl.colorCode[(int)COLORCODE.ATTACH_OVERPRESS];
         BT_ATTACH_UNDERPRESS.BackColor = UtilityControl.colorCode[(int)COLORCODE.ATTACH_UNDERPRESS];
         BT_PEDESATL_VAC_FAIL.BackColor = UtilityControl.colorCode[(int)COLORCODE.PEDESTAL_SUC_ERR];
         BT_ATTACH_FAIL.BackColor       = UtilityControl.colorCode[(int)COLORCODE.ATTACH_FAIL];
         BT_TILT_OK.BackColor           = UtilityControl.colorCode[(int)COLORCODE.TILT_OK];
     }
 }
Esempio n. 8
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (mc.user.logInDone == true)
                {
                    groupBox1.Visible = true;
                }
                else
                {
                    groupBox1.Visible = false;
                }

                if (mc.user.logInDone)
                {
                    TB_CurrentUserName.Text = mc.user.logInUserName;
                }
                else
                {
                    TB_CurrentUserName.Text = "";
                }

                LB_.Focus();
            }
        }
Esempio n. 9
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                BT_PositionSelect_MG.Text   = unitCodeMGSelect.ToString();
                BT_PositionSelect_Slot.Text = "SLOT(#" + selectSlot.ToString() + ")";

                mc.IN.MG.MG_AREA_SENSOR1(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_AREA_SENSOR.Image = image;

                mc.IN.MG.MG_RESET(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG_RESET.Image = image;

                mc.IN.MG.MG_IN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG_IN.Image = image;
            }
        }
Esempio n. 10
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                //if (mc.main.THREAD_ALIVE || mc.main.THREAD_RUNNING) TS_Menu.Enabled = false; else TS_Menu.Enabled = true;
                if (mc.commMPC._connect_flag)
                {
                    LB_SECSGEM.ForeColor = Color.Yellow;
                }
                else
                {
                    LB_SECSGEM.ForeColor = Color.White;
                }

                if (mc.board.loading.tmsInfo.readOK.Type == HTupleType.STRING)
                {
                    LB_TMS.ForeColor = Color.White;
                }
                else
                {
                    if (mc.board.loading.tmsInfo.readOK.I == 1)
                    {
                        LB_TMS.ForeColor = Color.Yellow;
                    }
                    else
                    {
                        LB_TMS.ForeColor = Color.White;
                    }
                }
                if (mc.user.logInDone == false)
                {
                    TB_USERNAME.Text      = "Operator";
                    TB_USERNAME.ForeColor = Color.Black;
                }
                else
                {
                    if (mc.user.userLevel[mc.user.userNumber] == 1)
                    {
                        TB_USERNAME.Text      = mc.user.logInUserName;
                        TB_USERNAME.ForeColor = Color.Blue;
                    }
                    else
                    {
                        TB_USERNAME.Text      = mc.user.logInUserName;
                        TB_USERNAME.ForeColor = Color.Red;
                    }
                }
            }
        }
Esempio n. 11
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                TB_SFZSpeed.Text     = mc.sf.Z.config.speed.rate.ToString();
                TB_1stDownPitch.Text = mc.para.SF.firstDownPitch.value.ToString();
                TB_1stDownVel.Text   = mc.para.SF.firstDownVel.value.ToString();
                TB_2ndUpPitch.Text   = mc.para.SF.secondUpPitch.value.ToString();
                TB_2ndUpVel.Text     = mc.para.SF.secondUpVel.value.ToString();
                TB_DownPitch.Text    = mc.para.SF.downPitch.value.ToString();
                TB_DownVel.Text      = mc.para.SF.downVel.value.ToString();

                if (mc.para.SF.useBlow.value == (int)ON_OFF.ON)
                {
                    BT_UseBlow_SelectOnOff.Text  = BT_UseBlow_SelectOnOff_On.Text;
                    BT_UseBlow_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                }
                else
                {
                    BT_UseBlow_SelectOnOff.Text  = BT_UseBlow_SelectOnOff_Off.Text;
                    BT_UseBlow_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }

                if (mc.para.SF.useMGZ1.value == (int)ON_OFF.ON)
                {
                    BT_UseMGZ1_SelectOnOff.Text  = BT_UseMGZ1_SelectOnOff_On.Text;
                    BT_UseMGZ1_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                }
                else
                {
                    BT_UseMGZ1_SelectOnOff.Text  = BT_UseMGZ1_SelectOnOff_Off.Text;
                    BT_UseMGZ1_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }

                if (mc.para.SF.useMGZ2.value == (int)ON_OFF.ON)
                {
                    BT_UseMGZ2_SelectOnOff.Text  = BT_UseMGZ2_SelectOnOff_On.Text;
                    BT_UseMGZ2_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                }
                else
                {
                    BT_UseMGZ2_SelectOnOff.Text  = BT_UseMGZ2_SelectOnOff_Off.Text;
                    BT_UseMGZ2_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }

                LB_.Focus();
            }
        }
Esempio n. 12
0
 void refresh()
 {
     if (this.InvokeRequired)
     {
         refresh_Call d = new refresh_Call(refresh);
         this.BeginInvoke(d, new object[] { });
     }
     else
     {
         //if (mc.main.THREAD_ALIVE || mc.main.THREAD_RUNNING) TS_Menu.Enabled = false; else TS_Menu.Enabled = true;
         TS_Menu.BringToFront();
         TS_Menu.Focus();
     }
 }
Esempio n. 13
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                try
                {
                    TB_PUSHER_X.Text = mc.para.UD.PusherPos.value.ToString();

                    BT_Magazine_Select.Text = unitCodeBoatMGSelect.ToString();
                    TB_MG_POS.Text          = mc.para.UD.MagazinePos[(int)unitCodeBoatMGSelect, (int)unitCodeSlotSelect].z.value.ToString();

                    BT_Slot_Select.Text = unitCodeSlotSelect.ToString();

                    TB_SLOT_COUNT.Text = mc.para.UD.slotCount.value.ToString();
                    TB_SLOT_PITCH.Text = mc.para.UD.slotPitch.value.ToString();

                    TB_MG_READY_POS.Text = mc.para.UD.ReadyPos.value.ToString();

                    if ((int)mc.para.UD.MagazineInCheck.value == 0)
                    {
                        BT_MG_IN_SENSOR_CHECK.Text = "OFF"; BT_MG_IN_SENSOR_CHECK.Image = Properties.Resources.YellowLED_OFF;
                    }
                    else
                    {
                        BT_MG_IN_SENSOR_CHECK.Text = "ON"; BT_MG_IN_SENSOR_CHECK.Image = Properties.Resources.Yellow_LED;
                    }

                    if ((int)mc.para.UD.AreaCheck.value == 0)
                    {
                        BT_MG_AREA_SENSOR_CHECK.Text = "OFF"; BT_MG_AREA_SENSOR_CHECK.Image = Properties.Resources.YellowLED_OFF;
                    }
                    else
                    {
                        BT_MG_AREA_SENSOR_CHECK.Text = "ON"; BT_MG_AREA_SENSOR_CHECK.Image = Properties.Resources.Yellow_LED;
                    }
                }
                catch (Exception error)
                {
                    mc.log.debug.write(mc.log.CODE.ERROR, "CenterRight_Unloader Error : (" + error.Message + "), " + error.StackTrace + "," + error.TargetSite + ", " + error.Source);
                }
            }
        }
Esempio n. 14
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                TB_BoardSizeX.Text = mc.para.MT.boardSize.x.value.ToString();
                TB_BoardSizeY.Text = mc.para.MT.boardSize.y.value.ToString();

                TB_PadSizeX.Text = mc.para.MT.padSize.x.value.ToString();
                TB_PadSizeY.Text = mc.para.MT.padSize.y.value.ToString();
                TB_PadSizeT.Text = mc.para.MT.padSize.h.value.ToString();

                TB_PadCountX.Text = mc.para.MT.padCount.x.value.ToString();
                TB_PadCountY.Text = mc.para.MT.padCount.y.value.ToString();

                TB_PadPitchX.Text = mc.para.MT.padPitch.x.value.ToString();
                TB_PadPitchY.Text = mc.para.MT.padPitch.y.value.ToString();

                TB_EdgeToPadCenterX.Text = mc.para.MT.edgeToPadCenter.x.value.ToString();
                TB_EdgeToPadCenterY.Text = mc.para.MT.edgeToPadCenter.y.value.ToString();


                TB_LidSizeX.Text = mc.para.MT.lidSize.x.value.ToString();
                TB_LidSizeY.Text = mc.para.MT.lidSize.y.value.ToString();
                TB_LidSizeH.Text = mc.para.MT.lidSize.h.value.ToString();

                TB_PAD_CHECK_LIMIT.Text       = mc.para.MT.padCheckLimit.value.ToString();
                TB_PAD_CHECK_CENTERLIMIT.Text = mc.para.MT.padCheckCenterLimit.value.ToString();
                TB_LID_CHECK_SIZELIMIT.Text   = mc.para.MT.lidSizeLimit.value.ToString();
                TB_LID_CHECK_LIMIT.Text       = mc.para.MT.lidCheckLimit.value.ToString();

                TB_PedestalSizeX.Text = mc.para.MT.pedestalSize.x.value.ToString();
                TB_PedestalSizeY.Text = mc.para.MT.pedestalSize.y.value.ToString();

                TB_ToolSizeX.Text = mc.para.MT.flatCompenToolSize.x.value.ToString();
                TB_ToolSizeY.Text = mc.para.MT.flatCompenToolSize.y.value.ToString();

                LB_.Focus();
            }
        }
Esempio n. 15
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                double[] tmp = new double[5]; // 1~9
//                 for (int i = 1; i < 5; i++) tmp[i] = 0;			// 계속 0으로 초기화 시킬 필요가 있나..?
                for (int i = 0; i < 5; i++)
                {
                    tmp[i] = Math.Round(touchPosition[i], 3);
                }

                TB_UP.Text     = tmp[1].ToString();
                TB_LEFT.Text   = tmp[2].ToString();
                TB_CENTER.Text = tmp[0].ToString();
                TB_RIGHT.Text  = tmp[3].ToString();
                TB_DOWN.Text   = tmp[4].ToString();

                for (int k = 0; k < 5; k++)
                {
                    if (tiltMin > touchPosition[k])
                    {
                        tiltMin = touchPosition[k];
                    }
                    if (tiltMax < touchPosition[k])
                    {
                        tiltMax = touchPosition[k];
                    }
                }

                TB_TOOLSIZE_X.Text  = mc.para.CAL.ToolSize.x.value.ToString();
                TB_TOOLSIZE_Y.Text  = mc.para.CAL.ToolSize.y.value.ToString();
                TB_TOOL_OFFSET.Text = mc.para.CAL.ToolOffset.value.ToString();

                BT_ESC.Focus();
            }
        }
Esempio n. 16
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (mc.para.ETC.preMachine.value == (int)PRE_MC.INSPECTION || mc.para.ETC.preMachine.value == (int)PRE_MC.DISPENSER)
                {
                    modelName = "ATTACH #1";
                }
                else if (mc.para.ETC.preMachine.value == (int)PRE_MC.ATTACH)
                {
                    modelName = "ATTACH #2";
                }

                this.Text = mc.model + " (" + modelName + ") " + " [" + mc.para.mcType.FrRr.ToString() + "] - (Version [" + mc.version + "], SECSGEM [" + ((MPCMODE)mc.para.DIAG.controlState.value).ToString() + "]) " + mc.para.ETC.recipeName.description;
            }
        }
Esempio n. 17
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                TB_Force.Text = mc.para.HD.press.force.value.ToString();
                TB_Delay.Text = mc.para.HD.press.pressTime.value.ToString();

                if ((int)mc.para.MT.padCount.x.value != btnPad.GetLength(0) || (int)mc.para.MT.padCount.y.value != btnPad.GetLength(1))
                {
                    btnClicked = null;
                    RemoveButton();
                    row = (int)mc.para.MT.padCount.y.value;
                    col = (int)mc.para.MT.padCount.x.value;
                    ShowButton();
                }

                for (int i = 0; i < col; i++)      // WorkArea가 없는 경우 문제될 소지가 있기 때문에 초기 배열크기를 크게 해놓고, refresh 할 때에는 실 자재에 대한 것만 실행함.
                {
                    for (int j = 0; j < row; j++)
                    {
                        if (!btnClicked[i, j])
                        {
                            btnPad[i, j].BackColor = Color.White;
                        }
                        else
                        {
                            btnPad[i, j].BackColor = Color.LimeGreen;
                        }
                    }
                }
            }
        }
Esempio n. 18
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (!FormLoad)
                {
                    return;
                }
                int ix, iy;
                ix = CbB_PadIX.SelectedIndex;
                iy = CbB_PadIY.SelectedIndex;
                TB_PlaceOffsetX.Text = placeOffsetResultX[ix, iy].value.ToString();
                TB_PlaceOffsetY.Text = placeOffsetResultY[ix, iy].value.ToString();
                TB_PlaceOffsetZ.Text = placeOffsetResultZ[ix, iy].value.ToString();

                TB_LaserXOffset.Text = mc.para.CAL.placeOffsetLaserPos.x.value.ToString();
                TB_LaserYOffset.Text = mc.para.CAL.placeOffsetLaserPos.y.value.ToString();

                TB_ResultX.Visible = false; TB_ResultY.Visible = false; TB_ResultZ.Visible = false;
                TB_ResultX.Clear(); TB_ResultY.Clear(); TB_ResultZ.Clear();
                for (int i = 0; i < padCountX; i++)
                {
                    for (int j = 0; j < padCountY; j++)
                    {
                        TB_ResultX.AppendText("X [" + (i + 1).ToString() + " , " + (j + 1).ToString() + "] => " + placeOffsetResultX[i, j].value.ToString() + "\n");
                        TB_ResultY.AppendText("Y [" + (i + 1).ToString() + " , " + (j + 1).ToString() + "] => " + placeOffsetResultY[i, j].value.ToString() + "\n");
                        TB_ResultZ.AppendText("Z [" + (i + 1).ToString() + " , " + (j + 1).ToString() + "] => " + placeOffsetResultZ[i, j].value.ToString() + "\n");
                    }
                }
                TB_ResultX.Visible = true; TB_ResultY.Visible = true; TB_ResultZ.Visible = true;
            }
        }
Esempio n. 19
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (mc.para.ETC.unloaderControl.value == 1)
                {
                    BT_PUSHER.Visible   = true;
                    BT_MAGAZINE.Visible = true;
                    BT_StandBy.Location = new System.Drawing.Point(206, 505);
                    BT_All.Location     = new System.Drawing.Point(345, 392);
                    BT_Vision.Location  = new System.Drawing.Point(74, 392);
                }
                else
                {
                    BT_PUSHER.Visible   = false;
                    BT_MAGAZINE.Visible = false;
                    BT_StandBy.Location = new System.Drawing.Point(206, 392);
                    BT_All.Location     = new System.Drawing.Point(345, 285);
                    BT_Vision.Location  = new System.Drawing.Point(74, 285);
                }

                if (mc.hd.reqMode == REQMODE.HOMING)
                {
                    BT_HD.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.HD)
                {
                    BT_HD.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_HD.Image = Properties.Resources.Fail;
                }

                if (mc.pd.reqMode == REQMODE.HOMING)
                {
                    BT_PD.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.PD)
                {
                    BT_PD.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_PD.Image = Properties.Resources.Fail;
                }

                if (mc.sf.reqMode == REQMODE.HOMING)
                {
                    BT_SF.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.SF)
                {
                    BT_SF.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_SF.Image = Properties.Resources.Fail;
                }

                if (mc.cv.reqMode == REQMODE.HOMING)
                {
                    BT_CV.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.CV)
                {
                    BT_CV.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_CV.Image = Properties.Resources.Fail;
                }

                if (mc.hdc.reqMode == REQMODE.HOMING || mc.ulc.reqMode == REQMODE.HOMING)
                {
                    BT_Vision.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.HDC && mc.init.success.ULC)
                {
                    BT_Vision.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_Vision.Image = Properties.Resources.Fail;
                }

                if (mc.ps.reqMode == REQMODE.HOMING)
                {
                    BT_PUSHER.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.PS)
                {
                    BT_PUSHER.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_PUSHER.Image = Properties.Resources.Fail;
                }

                if (mc.unloader.reqMode == REQMODE.HOMING)
                {
                    BT_MAGAZINE.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.MG)
                {
                    BT_MAGAZINE.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_MAGAZINE.Image = Properties.Resources.Fail;
                }

                if (mc.init.RUNING)
                {
                    BT_All.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.ALL)
                {
                    BT_All.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_All.Image = Properties.Resources.Fail;
                }

                if (mc.hd.reqMode == REQMODE.HOMING)
                {
                    BT_StandBy.Image = Properties.Resources.Refresh;
                }
                else if (mc.init.success.HD)
                {
                    BT_StandBy.Image = Properties.Resources.Complete;
                }
                else
                {
                    BT_StandBy.Image = Properties.Resources.Fail;
                }

                //LB_.Focus();
                //LB_.BringToFront();
            }
        }
Esempio n. 20
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                mc.IN.PS.UP(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_UP.Image = image;

                mc.IN.PS.DOWN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_DOWN.Image = image;

                mc.IN.PS.JAM(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_JAM.Image = image;

                mc.IN.PS.READY(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_READY.Image = image;

                mc.IN.PS.END(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_END.Image = image;

                mc.OUT.PS.PS_UPDOWN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_PS_UPDOWN.Image = image;
            }
        }
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (selectedHead == (int)UnitCodeHead.HD1)
                {
                    BT_HeadSelect.Text = BT_HeadSelect_Head1.Text;
                }
                else if (selectedHead == (int)UnitCodeHead.HD2)
                {
                    BT_HeadSelect.Text = BT_HeadSelect_Head2.Text;
                }

                if (mode == SELECT_FIND_MODEL.ULC_CORNER1)
                {
                    passScore   = mc.para.ULC.modelCorner1.passScore.value.ToString();
                    angleStart  = mc.para.ULC.modelCorner1.angleStart.value.ToString();
                    angleExtent = mc.para.ULC.modelCorner1.angleExtent.value.ToString();
                    exposure    = mc.para.ULC.modelCorner1.exposureTime.value.ToString();
                    lightCh1    = mc.para.ULC.modelCorner1.light.ch1.value.ToString();
                    lightCh2    = mc.para.ULC.modelCorner1.light.ch2.value.ToString();

                    LB_SelectModel.Text = BT_SelectModel_C1.Text;

                    if (mc.para.ULC.modelCorner1.isCreate.value == (int)BOOL.TRUE)
                    {
                        LB_Model_Created.BackColor = Color.Transparent;
                        LB_Model_Created.Text      = "Model Created";
                    }
                    else
                    {
                        LB_Model_Created.BackColor = Color.Red;
                        LB_Model_Created.Text      = "Model Uncreated";
                    }
                }
                if (mode == SELECT_FIND_MODEL.ULC_CORNER2)
                {
                    passScore           = mc.para.ULC.modelCorner2.passScore.value.ToString();
                    angleStart          = mc.para.ULC.modelCorner2.angleStart.value.ToString();
                    angleExtent         = mc.para.ULC.modelCorner2.angleExtent.value.ToString();
                    exposure            = mc.para.ULC.modelCorner2.exposureTime.value.ToString();
                    lightCh1            = mc.para.ULC.modelCorner2.light.ch1.value.ToString();
                    lightCh2            = mc.para.ULC.modelCorner2.light.ch2.value.ToString();
                    LB_SelectModel.Text = BT_SelectModel_C2.Text;

                    if (mc.para.ULC.modelCorner2.isCreate.value == (int)BOOL.TRUE)
                    {
                        LB_Model_Created.BackColor = Color.Transparent;
                        LB_Model_Created.Text      = "Model Created";
                    }
                    else
                    {
                        LB_Model_Created.BackColor = Color.Red;
                        LB_Model_Created.Text      = "Model Uncreated";
                    }
                }
                if (mode == SELECT_FIND_MODEL.ULC_CORNER3)
                {
                    passScore           = mc.para.ULC.modelCorner3.passScore.value.ToString();
                    angleStart          = mc.para.ULC.modelCorner3.angleStart.value.ToString();
                    angleExtent         = mc.para.ULC.modelCorner3.angleExtent.value.ToString();
                    exposure            = mc.para.ULC.modelCorner3.exposureTime.value.ToString();
                    lightCh1            = mc.para.ULC.modelCorner3.light.ch1.value.ToString();
                    lightCh2            = mc.para.ULC.modelCorner3.light.ch2.value.ToString();
                    LB_SelectModel.Text = BT_SelectModel_C3.Text;

                    if (mc.para.ULC.modelCorner3.isCreate.value == (int)BOOL.TRUE)
                    {
                        LB_Model_Created.BackColor = Color.Transparent;
                        LB_Model_Created.Text      = "Model Created";
                    }
                    else
                    {
                        LB_Model_Created.BackColor = Color.Red;
                        LB_Model_Created.Text      = "Model Uncreated";
                    }
                }
                if (mode == SELECT_FIND_MODEL.ULC_CORNER4)
                {
                    passScore           = mc.para.ULC.modelCorner4.passScore.value.ToString();
                    angleStart          = mc.para.ULC.modelCorner4.angleStart.value.ToString();
                    angleExtent         = mc.para.ULC.modelCorner4.angleExtent.value.ToString();
                    exposure            = mc.para.ULC.modelCorner4.exposureTime.value.ToString();
                    lightCh1            = mc.para.ULC.modelCorner4.light.ch1.value.ToString();
                    lightCh2            = mc.para.ULC.modelCorner4.light.ch2.value.ToString();
                    LB_SelectModel.Text = BT_SelectModel_C4.Text;

                    if (mc.para.ULC.modelCorner4.isCreate.value == (int)BOOL.TRUE)
                    {
                        LB_Model_Created.BackColor = Color.Transparent;
                        LB_Model_Created.Text      = "Model Created";
                    }
                    else
                    {
                        LB_Model_Created.BackColor = Color.Red;
                        LB_Model_Created.Text      = "Model Uncreated";
                    }
                }

                TB_PassScore.Text     = passScore;
                TB_AngleStart.Text    = angleStart;
                TB_AngleExtent.Text   = angleExtent;
                TB_ExposureTime.Text  = exposure;
                TB_Lighiting_Ch1.Text = lightCh1;
                TB_Lighiting_Ch2.Text = lightCh2;
                TB_CropArea.Text      = mc.para.ULC.cropArea.value.ToString();

                TB_ULC_RETRYNUM.Text = mc.para.ULC.failretry.value.ToString();

                if ((int)mc.para.ULC.chamferuse.value == 0)
                {
                    BT_CHAMFER_USE.Text = "OFF"; BT_CHAMFER_USE.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_CHAMFER_USE.Text = "ON"; BT_CHAMFER_USE.Image = Properties.Resources.Yellow_LED;
                }

                if ((int)mc.para.ULC.checkcircleuse.value == 0)
                {
                    BT_CHECK_CIRCLE.Text = "OFF"; BT_CHECK_CIRCLE.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_CHECK_CIRCLE.Text = "ON"; BT_CHECK_CIRCLE.Image = Properties.Resources.Yellow_LED;
                }

                if (mc.para.ULC.detectDirection.value == 0)
                {
                    BT_DetectDirection.Text = BT_DetectDirection_13.Text;
                }
                else
                {
                    BT_DetectDirection.Text = BT_DetectDirection_24.Text;
                }

                //TB_CHAMFER_INDEX.Text = mc.para.ULC.chamferindex.value.ToString();
                if (mc.para.ULC.chamferindex.value == 0)
                {
                    BT_ChamferNumber.Text  = BT_ChamferNumber_1.Text;
                    BT_ChamferNumber.Image = BT_ChamferNumber_1.Image;
                }
                else if (mc.para.ULC.chamferindex.value == 1)
                {
                    BT_ChamferNumber.Text  = BT_ChamferNumber_2.Text;
                    BT_ChamferNumber.Image = BT_ChamferNumber_2.Image;
                }
                else if (mc.para.ULC.chamferindex.value == 2)
                {
                    BT_ChamferNumber.Text  = BT_ChamferNumber_3.Text;
                    BT_ChamferNumber.Image = BT_ChamferNumber_3.Image;
                }
                else if (mc.para.ULC.chamferindex.value == 3)
                {
                    BT_ChamferNumber.Text  = BT_ChamferNumber_4.Text;
                    BT_ChamferNumber.Image = BT_ChamferNumber_4.Image;
                }

                if (mc.para.ULC.chamferShape.value == 0)
                {
                    BT_ChamferCheckMethod.Text = BT_ChamferCheckMethod_Chamfer.Text;
                    LB_ChamferDiameter.Visible = false; TB_ChamferDiameter.Visible = false;
                    LB_ChamferLength.Visible   = true; TB_ChamferLength.Visible = true;
                }
//              else
//              {
//                  BT_ChamferCheckMethod.Text = BT_ChamferCheckMethod_Circle.Text;
//                  LB_ChamferDiameter.Visible = true; TB_ChamferDiameter.Visible = true;
//                  LB_ChamferLength.Visible = false; TB_ChamferLength.Visible = false;
//              }

                TB_ChamferDiameter.Text = mc.para.ULC.chamferDiameter.value.ToString();
                TB_ChamferLength.Text   = mc.para.ULC.chamferLength.value.ToString();
                TB_ChamferScore.Text    = mc.para.ULC.chamferPassScore.value.ToString();

                if (mc.para.ULC.checkCirclePos.value == 0)
                {
                    BT_BottomCheckPos.Text = BT_BottomCheckPos_Corner.Text;
                }
                else
                {
                    BT_BottomCheckPos.Text = BT_BottomCheckPos_Side.Text;
                }

                TB_CircleDiameter.Text = mc.para.ULC.circleDiameter.value.ToString();
                TB_CircleScore.Text    = mc.para.ULC.circlePassScore.value.ToString();

                if (mc.para.ULC.imageSave.value == 0)
                {
                    BT_ImageSave.Text = BT_ImageSave_None.Text;
                }
                else if (mc.para.ULC.imageSave.value == 1)
                {
                    BT_ImageSave.Text = BT_ImageSave_Error.Text;
                }
                else
                {
                    BT_ImageSave.Text = BT_ImageSave_All.Text;
                }

                if (mc.para.ULC.model.algorism.value == (int)MODEL_ALGORISM.NCC)
                {
                    BT_AlgorismSelect.Text   = BT_AlgorismSelect_NccModel.Text;
                    LB_Model_Created.Visible = false;
                    hWC_Model.Visible        = false;

                    HOperatorSet.ClearWindow(hWC_Model.HalconID);
                    if (mc.para.ULC.model.isCreate.value == (int)BOOL.TRUE)
                    {
                        try
                        {
                            HTuple sizeX, sizeY, ratio;
                            sizeX = mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createColumn2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createColumn1;
                            sizeY = mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createRow2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createRow1;
                            ratio = sizeY / sizeX;
                            double height;
                            height           = hWC_Model.Width * ratio;
                            hWC_Model.Height = (int)height;
                            HOperatorSet.SetPart(hWC_Model.HalconID, 0, 0, mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createRow2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createRow1, mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createColumn2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].createColumn1);
                            HOperatorSet.DispImage(mc.ulc.cam.model[(int)ULC_MODEL.PKG_NCC].CropDomainImage, hWC_Model.HalconID);
                        }
                        catch
                        {
                        }
                    }
                }
                else if (mc.para.ULC.model.algorism.value == (int)MODEL_ALGORISM.SHAPE)
                {
                    BT_AlgorismSelect.Text   = BT_AlgorismSelect_ShapeModel.Text;
                    LB_Model_Created.Visible = false;
                    hWC_Model.Visible        = false;

                    HOperatorSet.ClearWindow(hWC_Model.HalconID);
                    if (mc.para.ULC.model.isCreate.value == (int)BOOL.TRUE)
                    {
                        try
                        {
                            HTuple sizeX, sizeY, ratio;
                            sizeX = mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createColumn2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createColumn1;
                            sizeY = mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createRow2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createRow1;
                            ratio = sizeY / sizeX;
                            double height;
                            height           = hWC_Model.Width * ratio;
                            hWC_Model.Height = (int)height;
                            HOperatorSet.SetPart(hWC_Model.HalconID, 0, 0, mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createRow2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createRow1, mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createColumn2 - mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].createColumn1);
                            HOperatorSet.DispImage(mc.ulc.cam.model[(int)ULC_MODEL.PKG_SHAPE].CropDomainImage, hWC_Model.HalconID);
                        }
                        catch
                        {
                        }
                    }
                }
                else if (mc.para.ULC.model.algorism.value == (int)MODEL_ALGORISM.RECTANGLE)
                {
                    BT_AlgorismSelect.Text   = BT_AlgorismSelect_RectangleModel.Text;
                    LB_Model_Created.Visible = false;
                    hWC_Model.Visible        = false;
                }
                else if (mc.para.ULC.model.algorism.value == (int)MODEL_ALGORISM.CIRCLE)
                {
                    BT_AlgorismSelect.Text   = BT_AlgorismSelect_CircleModel.Text;
                    LB_Model_Created.Visible = false;
                    hWC_Model.Visible        = false;
                }

                // user parameter -> camera parameter
                mc.ulc.cam.rectangleCenter.chamferFindFlag     = (int)mc.para.ULC.chamferuse.value;
                mc.ulc.cam.rectangleCenter.chamferFindIndex    = (int)mc.para.ULC.chamferindex.value;
                mc.ulc.cam.rectangleCenter.chamferFindMethod   = (int)mc.para.ULC.chamferShape.value;
                mc.ulc.cam.rectangleCenter.chamferFindLength   = mc.para.ULC.chamferLength.value;
                mc.ulc.cam.rectangleCenter.chamferFindDiameter = mc.para.ULC.chamferDiameter.value;

                mc.ulc.cam.rectangleCenter.bottomCircleFindFlag  = (int)mc.para.ULC.checkcircleuse.value;
                mc.ulc.cam.rectangleCenter.bottomCirclePos       = (int)mc.para.ULC.checkCirclePos.value;
                mc.ulc.cam.rectangleCenter.bottomCircleDiameter  = mc.para.ULC.circleDiameter.value;
                mc.ulc.cam.rectangleCenter.bottomCirclePassScore = mc.para.ULC.circlePassScore.value;

                if (mc.para.ULC.orientationUse.value == 0)
                {
                    BT_ORIENTATION_USE.Text = "OFF"; BT_ORIENTATION_USE.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_ORIENTATION_USE.Text = "ON"; BT_ORIENTATION_USE.Image = Properties.Resources.Yellow_LED;
                }

                if (mc.para.ULC.modelHSOrientation.algorism.value == (int)MODEL_ALGORISM.NCC)
                {
                    BT_ORIENTATION_METHOD.Text = BT_ORIENTATION_METHOD_NCC.Text;
                }
                else if (mc.para.ULC.modelHSOrientation.algorism.value == (int)MODEL_ALGORISM.SHAPE)
                {
                    BT_ORIENTATION_METHOD.Text = BT_ORIENTATION_METHOD_SHAPE.Text;
                }

                TB_ORIENTATION_PASS_SCORE.Text = mc.para.ULC.modelHSOrientation.passScore.value.ToString();
                LB_.Focus();
            }
        }
Esempio n. 22
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                #region IN
                mc.IN.CV.BD_IN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_IN.Image = image;

                mc.IN.CV.BD_BUF(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_BUFF.Image = image;

                mc.IN.CV.BD_STOPER_ON(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_STOPPER_ON.Image = image;

                mc.IN.CV.BD_NEAR(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_NEAR.Image = image;

                //if (mc.swcontrol.useUnloaderControl)
                //{
                //    mc.IN.PS.BOAT_OUT(out ret.b, out ret.message);
                //    if (ret.message != RetMessage.OK) image = Properties.Resources.Fail;
                //    else if (ret.b) image = Properties.Resources.Green_LED;
                //    else image = Properties.Resources.Green_LED_OFF;
                //    LB_IN_OUT.Image = image;
                //}
                //else
                {
                    mc.IN.CV.BD_OUT(out ret.b, out ret.message);
                    if (ret.message != RetMessage.OK)
                    {
                        image = Properties.Resources.Fail;
                    }
                    else if (ret.b)
                    {
                        image = Properties.Resources.Green_LED;
                    }
                    else
                    {
                        image = Properties.Resources.Green_LED_OFF;
                    }
                    LB_IN_OUT.Image = image;
                }

                //mc.IN.PS.BOAT_IN(out ret.b, out ret.message);
                //if (ret.message != RetMessage.OK) image = Properties.Resources.Fail;
                //else if (ret.b) image = Properties.Resources.Green_LED;
                //else image = Properties.Resources.Green_LED_OFF;
                //LB_IN_BOAT_IN.Image = image;

                //mc.IN.MG.MG_IN(out ret.b, out ret.message);
                //if (ret.message != RetMessage.OK) image = Properties.Resources.Fail;
                //else if (ret.b) image = Properties.Resources.Green_LED;
                //else image = Properties.Resources.Green_LED_OFF;
                //LB_IN_MAGAZINE.Image = image;

                mc.IN.CV.BD_CL1_ON(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_CLAMP1_ON.Image = image;

                mc.IN.CV.BD_CL2_ON(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_CLAMP2_ON.Image = image;

                mc.IN.CV.BD_STOPER_ON(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_STOPPER_ON.Image = image;

                mc.IN.CV.SMEMA_PRE(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_SMEMA_PRE.Image = image;

                mc.IN.CV.SMEMA_NEXT(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_SMEMA_NEXT.Image = image;
                #endregion

                #region OUT
                mc.OUT.CV.SIDE_PUSHER(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_SIDEPUSHER.Image = image;

                mc.OUT.CV.BD_STOP(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_STOPPER.Image = image;

                mc.OUT.CV.FD_MTR1(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_MTR1.Image = image;

                mc.OUT.CV.FD_MTR2(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_MTR2.Image = image;

                mc.OUT.CV.FD_MTR3(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_MTR3.Image = image;

                mc.OUT.CV.SMEMA_PRE(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_SMEMA_PRE.Image = image;

                mc.OUT.CV.SMEMA_NEXT(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_SMEMA_NEXT.Image = image;
                #endregion
            }
        }
Esempio n. 23
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                TB_PROD_RecipeName.Text = mc.commMPC.WorkData.receipeName;

                if (mc.para.mmiOption.editMode)
                {
                    LB_WorkConv.ForeColor = Color.RoyalBlue;
                }
                else
                {
                    LB_WorkConv.ForeColor = Color.Black;
                }

                worktrayrefresh = false;

                //if (mc.user.IS_ABOVE.developer || dev.debug) BT_hWindowAdvanceMode.Visible = true;
                //else BT_hWindowAdvanceMode.Visible = false;

                if (mc.board.loading.tmsInfo.LotID.S == "INVALID")
                {
                    TB_PROD_Inbuf_LotID.Text = "";
                }
                else
                {
                    TB_PROD_Inbuf_LotID.Text = mc.board.loading.tmsInfo.LotID;
                }

                if (mc.board.loading.tmsInfo.TrayID.S == "INVALID")
                {
                    TB_PROD_Inbuf_TrayID.Text = "";
                }
                else
                {
                    TB_PROD_Inbuf_TrayID.Text = mc.board.loading.tmsInfo.TrayID;
                }

                //if (mc.board.loading.tmsInfo.LotQTY.Type == HTupleType.STRING)
                //    TB_PROD_Inbuf_TrayQty.Text = "0";
                //else
                //    TB_PROD_Inbuf_TrayQty.Text = mc.board.loading.tmsInfo.LotQTY.I.ToString();

                if (mc.board.loading.tmsInfo.TrayType.Type == HTupleType.STRING)
                {
                    TB_PROD_Inbuf_TrayType.Text = "";
                    GB_InputTray.ForeColor      = Color.DimGray;
                }
                else
                {
                    if (mc.board.loading.tmsInfo.TrayType.I == (int)TRAY_TYPE.COVER_TRAY)
                    {
                        TB_PROD_Inbuf_TrayType.Text = "COVER";
                    }
                    else if (mc.board.loading.tmsInfo.TrayType.I == (int)TRAY_TYPE.LAST_TRAY)
                    {
                        TB_PROD_Inbuf_TrayType.Text = "NORMAL END";
                    }
                    else if (mc.board.loading.tmsInfo.TrayType.I == (int)TRAY_TYPE.NOMAL_TRAY)
                    {
                        TB_PROD_Inbuf_TrayType.Text = "NORMAL";
                    }
                    else
                    {
                        TB_PROD_Inbuf_TrayType.Text = "";
                    }
                    GB_InputTray.ForeColor = Color.Black;
                }
                if (mc.board.loading.loadingTime.Type == HTupleType.STRING)
                {
                    if (mc.board.loading.loadingTime == "INVALID")
                    {
                        TB_PROD_Inbuf_ElapsedTime.Text = "";
                    }
                    else
                    {
                        loadTime = Convert.ToDateTime(mc.board.loading.loadingTime.S);
                        diffTime = DateTime.Now - loadTime;
                        TB_PROD_Inbuf_ElapsedTime.Text = String.Format("{0:d2}:{1:d2}:{2:d2}", diffTime.Hours, diffTime.Minutes, diffTime.Seconds);
                    }
                }

                if (mc.board.working.tmsInfo.LotID.S == "INVALID")
                {
                    TB_PROD_Work_LotID.Text = "";
                }
                else
                {
                    TB_PROD_Work_LotID.Text = mc.board.working.tmsInfo.LotID;
                }

                if (mc.board.working.tmsInfo.TrayID.S == "INVALID")
                {
                    TB_PROD_Work_TrayID.Text = "";
                }
                else
                {
                    TB_PROD_Work_TrayID.Text = mc.board.working.tmsInfo.TrayID;
                }

                // Display Tray Count
                TB_PROD_Work_TrayCount.Text = mc.para.runInfo.trayLotCount.ToString();

                if (mc.board.working.tmsInfo.LotQTY.Type == HTupleType.STRING)
                {
                    TB_PROD_Work_TrayQty.Text = "0";
                }
                else
                {
                    TB_PROD_Work_TrayQty.Text = mc.board.working.tmsInfo.LotQTY.I.ToString();
                }

                TB_PROD_Today_TrayCount.Text = mc.para.runInfo.trayTodayCount.ToString();

                // Display Working Area Tray Type
                if (mc.board.working.tmsInfo.TrayType.Type == HTupleType.STRING)
                {
                    TB_PROD_Work_TrayType.Text = "";
                    GB_WorkTray.ForeColor      = Color.DimGray;
                    GB_ProdSet.ForeColor       = Color.DimGray;
                    GB_TrayProd.ForeColor      = Color.DimGray;
                    GB_TrayCount.ForeColor     = Color.DimGray;
                }
                else
                {
                    if (mc.board.working.tmsInfo.TrayType.I == (int)TRAY_TYPE.COVER_TRAY)
                    {
                        TB_PROD_Work_TrayType.Text = "COVER";
                    }
                    else if (mc.board.working.tmsInfo.TrayType.I == (int)TRAY_TYPE.LAST_TRAY)
                    {
                        TB_PROD_Work_TrayType.Text = "NORMAL END";
                        worktrayrefresh            = true;
                    }
                    else if (mc.board.working.tmsInfo.TrayType.I == (int)TRAY_TYPE.NOMAL_TRAY)
                    {
                        TB_PROD_Work_TrayType.Text = "NORMAL";
                        worktrayrefresh            = true;
                    }
                    else
                    {
                        TB_PROD_Work_TrayType.Text = "";
                    }
                    GB_WorkTray.ForeColor  = Color.Black;
                    GB_ProdSet.ForeColor   = Color.Black;
                    GB_TrayProd.ForeColor  = Color.Black;
                    GB_TrayCount.ForeColor = Color.Black;
                }
                if (mc.board.working.loadingTime.Type == HTupleType.STRING)
                {
                    if (mc.board.working.loadingTime == "INVALID")
                    {
                        TB_PROD_Work_ElapsedTime.Text = "";
                    }
                    else
                    {
                        loadTime = Convert.ToDateTime(mc.board.working.loadingTime.S);
                        diffTime = DateTime.Now - loadTime;
                        TB_PROD_Work_ElapsedTime.Text = String.Format("{0:d2}:{1:d2}:{2:d2}", diffTime.Hours, diffTime.Minutes, diffTime.Seconds);
                    }
                }

                if (worktrayrefresh)
                {
                    mc.board.trayStatus(BOARD_ZONE.WORKING, out readyCnt, out skipCnt, out attachCnt, out failCnt, out totalCnt);

                    TB_PROD_Work_SkipCnt.Text   = skipCnt.ToString();
                    TB_PROD_Work_FailCnt.Text   = failCnt.ToString();
                    TB_PROD_Work_AttachCnt.Text = attachCnt.ToString();
                    TB_PROD_Work_Progress.Text  = String.Format("{0}/{1}", (skipCnt + attachCnt), totalCnt);

                    PB_AttachProgress.Visible = true;
                    if (totalCnt > 0)
                    {
                        PB_AttachProgress.Value = (int)((skipCnt + attachCnt) * 100 / (double)totalCnt);
                    }
                }
                else
                {
                    TB_PROD_Work_SkipCnt.Text   = "";
                    TB_PROD_Work_FailCnt.Text   = "";
                    TB_PROD_Work_AttachCnt.Text = "";
                    TB_PROD_Work_Progress.Text  = "";

                    PB_AttachProgress.Value   = 0;
                    PB_AttachProgress.Visible = false;
                }

                TB_PROD_Work_SetForce.Text = mc.para.HD.place.force.value.ToString();
                if (mc.hd.tool.placeForce < 0.01)
                {
                    TB_PROD_Work_PreForce.Text = "";
                }
                else
                {
                    TB_PROD_Work_PreForce.Text = Math.Round(mc.hd.tool.placeForce, 2).ToString("f2");
                }
                if (mc.hd.tool.placeForce < 0.01)
                {
                    TB_PROD_Work_PostForce.Text = "";
                }
                else
                {
                    TB_PROD_Work_PostForce.Text = Math.Round(mc.hd.tool.placeForce, 2).ToString("f2");
                }
                TB_PROD_Work_PlaceTime.Text = mc.para.HD.place.delay.value.ToString();
                TB_PROD_Work_SetSpeed1.Text = mc.para.HD.place.search.vel.value.ToString();
                TB_PROD_Work_SetSpeed2.Text = mc.para.HD.place.search2.vel.value.ToString();
                TB_PROD_Work_HDC_Score.Text = mc.para.HDC.modelPADC1.passScore.value.ToString();
                TB_PROD_Work_ULC_Score.Text = mc.para.ULC.model.passScore.value.ToString();

                if (mc.board.unloading.tmsInfo.LotID.S == "INVALID")
                {
                    TB_PROD_Outbuf_LotID.Text = "";
                }
                else
                {
                    TB_PROD_Outbuf_LotID.Text = mc.board.unloading.tmsInfo.LotID.S;
                }

                if (mc.board.unloading.tmsInfo.TrayID.S == "INVALID")
                {
                    TB_PROD_Outbuf_TrayID.Text = "";
                }
                else
                {
                    TB_PROD_Outbuf_TrayID.Text = mc.board.unloading.tmsInfo.TrayID.S;
                }

                //if (mc.board.unloading.tmsInfo.LotQTY.Type == HTupleType.STRING)
                //    TB_PROD_Outbuf_TrayQty.Text = "0";
                //else
                //    TB_PROD_Outbuf_TrayQty.Text = mc.board.unloading.tmsInfo.LotQTY.I.ToString();

                if (mc.board.unloading.tmsInfo.TrayType.Type == HTupleType.STRING)
                {
                    TB_PROD_Outbuf_TrayType.Text = "";
                    GB_OutputTray.ForeColor      = Color.DimGray;
                }
                else
                {
                    if (mc.board.unloading.tmsInfo.TrayType.I == (int)TRAY_TYPE.COVER_TRAY)
                    {
                        TB_PROD_Outbuf_TrayType.Text = "COVER";
                    }
                    else if (mc.board.unloading.tmsInfo.TrayType.I == (int)TRAY_TYPE.LAST_TRAY)
                    {
                        TB_PROD_Outbuf_TrayType.Text = "NORMAL END";
                    }
                    else if (mc.board.unloading.tmsInfo.TrayType.I == (int)TRAY_TYPE.NOMAL_TRAY)
                    {
                        TB_PROD_Outbuf_TrayType.Text = "NORMAL";
                    }
                    else
                    {
                        TB_PROD_Outbuf_TrayType.Text = "";
                    }

                    GB_OutputTray.ForeColor = Color.Black;
                }

                if (mc.board.unloading.loadingTime.Type == HTupleType.STRING)
                {
                    if (mc.board.unloading.loadingTime == "INVALID")
                    {
                        TB_PROD_Outbuf_ElapsedTime.Text = "";
                    }
                    else
                    {
                        loadTime = Convert.ToDateTime(mc.board.unloading.loadingTime.S);
                        diffTime = DateTime.Now - loadTime;
                        TB_PROD_Outbuf_ElapsedTime.Text = String.Format("{0:d2}:{1:d2}:{2:d2}", diffTime.Hours, diffTime.Minutes, diffTime.Seconds);
                    }
                }

                if (!mc.main.THREAD_RUNNING)
                {
                    //if (!mgResetOn)
                    //{
                    //    mc.IN.MG.MG_RESET(out ret.b, out ret.message);
                    //    if (ret.b)
                    //    {
                    //        mgResetOn = true;
                    //        for (int i = 0; i < mc.UnloaderControl.MG_COUNT; i++)
                    //        {
                    //            for (int j = 0; j < mc.UnloaderControl.MG_SLOT_COUNT; j++)
                    //            {
                    //                mc.idle(0);
                    //                mc.UnloaderControl.MG_Status[i, j] = (int)MG_STATUS.READY;
                    //                EVENT.refreshEditMagazine(i, j);
                    //            }
                    //        }
                    //        mc.UnloaderControl.writeconfig();
                    //    }
                    //}
                    //else
                    //{
                    //    mc.IN.MG.MG_RESET(out ret.b, out ret.message);
                    //    if (!ret.b)
                    //    {
                    //        mgResetOn = false;
                    //    }
                    //}
                }
            }
        }
Esempio n. 24
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                #region search
                if (mc.para.HD.place.search.enable.value == (int)ON_OFF.ON)
                {
                    LB_Search1st_Level.Visible     = true; TB_Search1st_Level.Visible = true;
                    LB_Search1st_Speed.Visible     = true; TB_Search1st_Speed.Visible = true;
                    LB_Search1st_Delay.Visible     = true; TB_Search1st_Delay.Visible = true;
                    BT_Search1st_SelectOnOff.Text  = BT_Search1st_SelectOnOff_On.Text;
                    BT_Search1st_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                    TB_Search1st_Level.Text        = mc.para.HD.place.search.level.value.ToString();
                    TB_Search1st_Speed.Text        = mc.para.HD.place.search.vel.value.ToString();
                    TB_Search1st_Delay.Text        = mc.para.HD.place.search.delay.value.ToString();
                }
                if (mc.para.HD.place.search.enable.value == (int)ON_OFF.OFF)
                {
                    LB_Search1st_Level.Visible     = false; TB_Search1st_Level.Visible = false;
                    LB_Search1st_Speed.Visible     = false; TB_Search1st_Speed.Visible = false;
                    LB_Search1st_Delay.Visible     = false; TB_Search1st_Delay.Visible = false;
                    BT_Search1st_SelectOnOff.Text  = BT_Search1st_SelectOnOff_Off.Text;
                    BT_Search1st_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion

                #region forceTracking
                if (mc.para.HD.place.forceTracking.enable.value == (int)ON_OFF.ON)
                {
                    LB_ForceTracking_Speed.Visible     = true; TB_ForceTracking_Speed.Visible = true;
                    BT_ForceTracking_SelectOnOff.Text  = BT_ForceTracking_SelectOnOff_On.Text;
                    BT_ForceTracking_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                    LB_ForceTracking_Force.Visible     = true; TB_ForceTracking_Force.Visible = true;
                    TB_ForceTracking_Force.Text        = mc.para.HD.place.forceTracking.force.value.ToString();
                    TB_ForceTracking_Speed.Text        = mc.para.HD.place.forceTracking.vel.value.ToString();
                }
                if (mc.para.HD.place.forceTracking.enable.value == (int)ON_OFF.OFF)
                {
                    LB_ForceTracking_Force.Visible     = false; TB_ForceTracking_Force.Visible = false;
                    LB_ForceTracking_Speed.Visible     = false; TB_ForceTracking_Speed.Visible = false;
                    BT_ForceTracking_SelectOnOff.Text  = BT_ForceTracking_SelectOnOff_Off.Text;
                    BT_ForceTracking_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion
                #region search2
                if (mc.para.HD.place.search2.enable.value == (int)ON_OFF.ON)
                {
                    LB_Search2nd_Level.Visible     = true; TB_Search2nd_Level.Visible = true;
                    LB_Search2nd_Speed.Visible     = true; TB_Search2nd_Speed.Visible = true;
                    LB_Search2nd_Delay.Visible     = true; TB_Search2nd_Delay.Visible = true;
                    BT_Search2nd_SelectOnOff.Text  = BT_Search2nd_SelectOnOff_On.Text;
                    BT_Search2nd_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                    TB_Search2nd_Level.Text        = mc.para.HD.place.search2.level.value.ToString();
                    TB_Search2nd_Speed.Text        = mc.para.HD.place.search2.vel.value.ToString();
                    TB_Search2nd_Delay.Text        = mc.para.HD.place.search2.delay.value.ToString();
                }
                if (mc.para.HD.place.search2.enable.value == (int)ON_OFF.OFF)
                {
                    LB_Search2nd_Level.Visible     = false; TB_Search2nd_Level.Visible = false;
                    LB_Search2nd_Speed.Visible     = false; TB_Search2nd_Speed.Visible = false;
                    LB_Search2nd_Delay.Visible     = false; TB_Search2nd_Delay.Visible = false;
                    BT_Search2nd_SelectOnOff.Text  = BT_Search2nd_SelectOnOff_Off.Text;
                    BT_Search2nd_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion

                if (mc.swcontrol.setupMode == 0)
                {
                    TB_Delay.Text           = mc.para.HD.place.delay.value.ToString();
                    TS_SUCTION_MODE.Visible = false;
                }
                else
                {
                    TB_Delay.Text           = mc.para.HD.place.delay.value.ToString();
                    TS_SUCTION_MODE.Visible = true;
                }
                TB_Force.Text       = mc.para.HD.place.force.value.ToString();
                TB_AirForce.Text    = mc.para.HD.place.airForce.value.ToString();
                TB_PRESS_FORCE.Text = mc.para.HD.press.force.value.ToString();
                TB_PRESS_TIME.Text  = mc.para.HD.press.pressTime.value.ToString();

                #region driver
                if (mc.para.HD.place.driver.enable.value == (int)ON_OFF.ON)
                {
                    LB_Drive1st_Level.Visible     = true; TB_Drive1st_Level.Visible = true;
                    LB_Drive1st_Speed.Visible     = true; TB_Drive1st_Speed.Visible = true;
                    LB_Drive1st_Delay.Visible     = true; TB_Drive1st_Delay.Visible = true;
                    BT_Drive1st_SelectOnOff.Text  = BT_Drive1st_SelectOnOff_On.Text;
                    BT_Drive1st_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                    TB_Drive1st_Level.Text        = mc.para.HD.place.driver.level.value.ToString();
                    TB_Drive1st_Speed.Text        = mc.para.HD.place.driver.vel.value.ToString();
                    TB_Drive1st_Delay.Text        = mc.para.HD.place.driver.delay.value.ToString();

                    if (mc.para.HD.place.driver.level.value < (300 - mc.para.HD.place.forceOffset.z.value - mc.para.HD.place.offset.z.value))
                    {
                        mc.message.inform("1st Drive Level is automatically changed to " + (300 - mc.para.HD.place.forceOffset.z.value - mc.para.HD.place.offset.z.value).ToString());
                        mc.para.HD.place.driver.level.value = 300 - mc.para.HD.place.forceOffset.z.value - mc.para.HD.place.offset.z.value;
                    }
                }
                if (mc.para.HD.place.driver.enable.value == (int)ON_OFF.OFF)
                {
                    LB_Drive1st_Level.Visible     = false; TB_Drive1st_Level.Visible = false;
                    LB_Drive1st_Speed.Visible     = false; TB_Drive1st_Speed.Visible = false;
                    LB_Drive1st_Delay.Visible     = false; TB_Drive1st_Delay.Visible = false;
                    BT_Drive1st_SelectOnOff.Text  = BT_Drive1st_SelectOnOff_Off.Text;
                    BT_Drive1st_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion

                #region driver2
                if (mc.para.HD.place.driver2.enable.value == (int)ON_OFF.ON)
                {
                    LB_Drive2nd_Level.Visible     = true; TB_Drive2nd_Level.Visible = true;
                    LB_Drive2nd_Speed.Visible     = true; TB_Drive2nd_Speed.Visible = true;
                    LB_Drive2nd_Delay.Visible     = true; TB_Drive2nd_Delay.Visible = true;
                    BT_Drive2nd_SelectOnOff.Text  = BT_Drive2nd_SelectOnOff_On.Text;
                    BT_Drive2nd_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                    TB_Drive2nd_Level.Text        = mc.para.HD.place.driver2.level.value.ToString();
                    TB_Drive2nd_Speed.Text        = mc.para.HD.place.driver2.vel.value.ToString();
                    TB_Drive2nd_Delay.Text        = mc.para.HD.place.driver2.delay.value.ToString();
                }
                if (mc.para.HD.place.driver2.enable.value == (int)ON_OFF.OFF)
                {
                    LB_Drive2nd_Level.Visible     = false; TB_Drive2nd_Level.Visible = false;
                    LB_Drive2nd_Speed.Visible     = false; TB_Drive2nd_Speed.Visible = false;
                    LB_Drive2nd_Delay.Visible     = false; TB_Drive2nd_Delay.Visible = false;
                    BT_Drive2nd_SelectOnOff.Text  = BT_Drive2nd_SelectOnOff_Off.Text;
                    BT_Drive2nd_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion

                #region offset
                TB_ForceOffset_Z.Text    = mc.para.HD.place.forceOffset.z.value.ToString();
                TB_PositionOffset_X.Text = mc.para.HD.place.offset.x.value.ToString();
                TB_PositionOffset_Y.Text = mc.para.HD.place.offset.y.value.ToString();
                TB_PositionOffset_Z.Text = mc.para.HD.place.offset.z.value.ToString();
                TB_PositionOffset_T.Text = mc.para.HD.place.offset.t.value.ToString();

                TB_PositionOffset_X2.Text = mc.para.HD.place.offset2.x.value.ToString();
                TB_PositionOffset_Y2.Text = mc.para.HD.place.offset2.y.value.ToString();
                TB_PositionOffset_T2.Text = mc.para.HD.place.offset2.t.value.ToString();
                #endregion

                #region suction
                if (mc.para.HD.place.suction.mode.value == (int)PLACE_SUCTION_MODE.SEARCH_LEVEL_OFF)
                {
                    BT_SuctionMode_Select.Text             = BT_SuctionMode_Select_SearchLevelOff.Text;
                    LB_SuctionMode_Level.Visible           = true; TB_SuctionMode_Level.Visible = true;
                    LB_SuctionMode_SuctionOffDelay.Visible = false; TB_SuctionMode_SuctionOffDelay.Visible = false;
                    TB_SuctionMode_Level.Text = mc.para.HD.place.suction.level.value.ToString();
                    TB_SuctionMode_Purse.Text = mc.para.HD.place.suction.purse.value.ToString();
                }
                if (mc.para.HD.place.suction.mode.value == (int)PLACE_SUCTION_MODE.PLACE_LEVEL_OFF)
                {
                    BT_SuctionMode_Select.Text             = BT_SuctionMode_Select_PlaceLevelOff.Text;
                    LB_SuctionMode_Level.Visible           = false; TB_SuctionMode_Level.Visible = false;
                    LB_SuctionMode_SuctionOffDelay.Visible = false; TB_SuctionMode_SuctionOffDelay.Visible = false;
                    TB_SuctionMode_Purse.Text = mc.para.HD.place.suction.purse.value.ToString();
                }
                if (mc.para.HD.place.suction.mode.value == (int)PLACE_SUCTION_MODE.PLACE_END_OFF)
                {
                    BT_SuctionMode_Select.Text             = BT_SuctionMode_Select_PlaceEndOff.Text;
                    LB_SuctionMode_Level.Visible           = false; TB_SuctionMode_Level.Visible = false;
                    LB_SuctionMode_SuctionOffDelay.Visible = true; TB_SuctionMode_SuctionOffDelay.Visible = true;
                    TB_SuctionMode_SuctionOffDelay.Text    = mc.para.HD.place.suction.delay.value.ToString();
                    TB_SuctionMode_Purse.Text = mc.para.HD.place.suction.purse.value.ToString();
                }
                if (mc.para.HD.place.suction.mode.value == (int)PLACE_SUCTION_MODE.PLACE_UP_OFF)
                {
                    BT_SuctionMode_Select.Text             = BT_SuctionMode_Select_PlaceUpOff.Text;
                    LB_SuctionMode_Level.Visible           = false; TB_SuctionMode_Level.Visible = false;
                    LB_SuctionMode_SuctionOffDelay.Visible = true; TB_SuctionMode_SuctionOffDelay.Visible = true;
                    TB_SuctionMode_SuctionOffDelay.Text    = mc.para.HD.place.suction.delay.value.ToString();
                    TB_SuctionMode_Purse.Text = mc.para.HD.place.suction.purse.value.ToString();
                }

                #endregion

                #region missCheck
                if (mc.para.HD.place.missCheck.enable.value == (int)ON_OFF.ON)
                {
                    BT_MissCheck_SelectOnOff.Text  = BT_MissCheck_SelectOnOff_On.Text;
                    BT_MissCheck_SelectOnOff.Image = Properties.Resources.Yellow_LED;
                }
                if (mc.para.HD.place.missCheck.enable.value == (int)ON_OFF.OFF)
                {
                    BT_MissCheck_SelectOnOff.Text  = BT_MissCheck_SelectOnOff_Off.Text;
                    BT_MissCheck_SelectOnOff.Image = Properties.Resources.YellowLED_OFF;
                }
                #endregion

                #region preForce
                //if (mc.para.HD.place.preForce.enable.value == (int)ON_OFF.ON)
                //{
                //    BT_PreForce_Select.Text = BT_PreForceChange_SelectOn.Text;
                //}
                //if (mc.para.HD.place.preForce.enable.value == (int)ON_OFF.OFF)
                //{
                //    BT_PreForce_Select.Text = BT_PreForceChange_SelectOff.Text;
                //}
                #endregion

                #region z down distance
                TB_DownDistance.Text = Math.Round(mc.hd.tool.tPos.z[0].XY_MOVING - mc.hd.tool.tPos.z[0].PLACE).ToString();
                #endregion

                TB_PressTiltLimit.Text = mc.para.HD.place.pressTiltLimit.value.ToString();

                LB_.Focus();
            }
        }
Esempio n. 25
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                #region IN
                mc.IN.PD.VAC_CHK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_VAC.Image = image;

                mc.IN.PD.UP_SENSOR_CHK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_UP_SENSOR.Image = image;

                mc.IN.PD.DOWN_SENSOR_CHK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_DOWN_SENSOR.Image = image;
                #endregion

                #region OUT
                mc.OUT.PD.SUC(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_SUCTION.Image = image;

                mc.OUT.PD.BLW(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_BLOW.Image = image;

                mc.OUT.PD.UP(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_UP.Image = image;

                mc.OUT.PD.DOWN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_DOWN.Image = image;
                #endregion

                padCountCheck();
            }
        }
Esempio n. 26
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                #region IN
                mc.IN.MAIN.MC2(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MC2.Image = image;

                mc.IN.MAIN.DOOR(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MAIN_DOOR.Image = image;

                mc.IN.MAIN.DOOR_ROCK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MAIN_DOOR_LOCK.Image = image;

                mc.IN.MAIN.SF_DOOR(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_SF_DOOR.Image = image;

                mc.IN.MAIN.LOW_DOOR(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_LOW_DOOR.Image = image;

                mc.IN.MAIN.IONIZER_MET(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_IONIZER_MET.Image = image;

                mc.IN.MAIN.BLOW_MET(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_BLOW_MET.Image = image;

                mc.IN.MAIN.AIR_MET(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MAIN_AIR_MET.Image = image;

                mc.IN.MAIN.VAC_MET(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_VACUUM_MET.Image = image;

                mc.IN.MAIN.MC2_CHK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MC2_CHK.Image = image;

                mc.IN.MAIN.IONIZER_CON(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_IONIZER_CON.Image = image;

                mc.IN.MAIN.IONIZER_ARM(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_IONIZER_ARM.Image = image;

                mc.IN.MAIN.IONIZER_LEV(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_IONIZER_LEV.Image = image;

                mc.SERVO.CHECKSERVO(out ret.b, out ret.message);
                if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_SERVO_STATE.Image = image;
                #endregion

                #region OUT
                mc.OUT.MAIN.SAFETY(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_SAFETY.Image = image;

                mc.OUT.MAIN.DOOR_OPEN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_DOOR_OPEN.Image = image;

                mc.OUT.MAIN.DOOR_LOCK(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_DOOR_LOCK.Image = image;

                mc.OUT.MAIN.IONIZER(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_IONIZER.Image = image;

                mc.OUT.MAIN.FLUORESCENT(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_FLUORESCENT.Image = image;

                mc.OUT.MAIN.T_RED(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TOWER_RED.Image = image;

                mc.OUT.MAIN.T_YELLOW(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TOWER_YELLOW.Image = image;

                mc.OUT.MAIN.T_GREEN(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TOWER_GREEN.Image = image;

                mc.OUT.MAIN.T_BUZZER(out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TOWER_BUZZER.Image = image;

                #endregion

                #region Current Position
                //RetValue ret;
                //mc.hd.tool.X.actualPosition(out ret.d, out ret.message);
                //LB_CURPOS_X.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.Y.actualPosition(out ret.d, out ret.message);
                //LB_CURPOS_Y.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.Z.actualPosition(out ret.d, out ret.message);
                //LB_CURPOS_Z.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.T.actualPosition(out ret.d, out ret.message);
                //LB_CURPOS_T.Text = Math.Round(ret.d, 3).ToString();

                //mc.hd.tool.X.commandPosition(out ret.d, out ret.message);
                //LB_CMDPOS_X.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.Y.commandPosition(out ret.d, out ret.message);
                //LB_CMDPOS_Y.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.Z.commandPosition(out ret.d, out ret.message);
                //LB_CMDPOS_Z.Text = Math.Round(ret.d, 3).ToString();
                //mc.hd.tool.T.commandPosition(out ret.d, out ret.message);
                //LB_CMDPOS_T.Text = Math.Round(ret.d, 3).ToString();

                #endregion
            }
        }
Esempio n. 27
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                #region IN
                mc.IN.SF.MG_DET(UnitCodeSFMG.MG1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG1.Image = image;

                mc.IN.SF.MG_DET(UnitCodeSFMG.MG2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG2.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE1.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE2.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF3, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE3.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF4, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE4.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF5, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE5.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF6, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE6.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF7, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE7.Image = image;

                mc.IN.SF.TUBE_GUIDE(UnitCodeSF.SF8, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_GUIDE8.Image = image;

                mc.IN.SF.MG_RESET(UnitCodeSFMG.MG1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG1_RESET.Image = image;

                mc.IN.SF.MG_RESET(UnitCodeSFMG.MG2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_MG2_RESET.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE1.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE2.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF3, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE3.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF4, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE4.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF5, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE5.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF6, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE6.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF7, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE7.Image = image;

                mc.IN.SF.TUBE_DET(UnitCodeSF.SF8, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.Green_LED;
                }
                else
                {
                    image = Properties.Resources.Green_LED_OFF;
                }
                LB_IN_TUBE8.Image = image;
                #endregion

                #region OUT
                mc.OUT.SF.MG_RESET(UnitCodeSFMG.MG1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_MG1_RESET.Image = image;

                mc.OUT.SF.MG_RESET(UnitCodeSFMG.MG2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_MG2_RESET.Image = image;

                mc.OUT.SF.TUBE_BLOW(UnitCodeSF.SF1, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TUBEBLOW1.Image = image;

                mc.OUT.SF.TUBE_BLOW(UnitCodeSF.SF2, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TUBEBLOW2.Image = image;

                mc.OUT.SF.TUBE_BLOW(UnitCodeSF.SF3, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TUBEBLOW3.Image = image;

                mc.OUT.SF.TUBE_BLOW(UnitCodeSF.SF4, out ret.b, out ret.message);
                if (ret.message != RetMessage.OK)
                {
                    image = Properties.Resources.Fail;
                }
                else if (ret.b)
                {
                    image = Properties.Resources.yellow_ball;
                }
                else
                {
                    image = Properties.Resources.gray_ball;
                }
                BT_OUT_TUBEBLOW4.Image = image;

                #endregion
            }
        }
Esempio n. 28
0
        private void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (threadForceCalibration != null)
                {
                    if (threadForceCalibration.IsAlive)
                    {
                        BT_STOP.Enabled = true;
                        //BT_AutoCalibration.Enabled = false;
                    }
                    else
                    {
                        BT_STOP.Enabled = false;
                        //BT_AutoCalibration.Enabled = false;
                    }
                }
                else
                {
                    BT_STOP.Enabled = false;
                    //BT_AutoCalibration.Enabled = true;
                }

                TB_Input_Force_0.Text  = force.forceLevel[0].value.ToString();
                TB_Input_Force_1.Text  = force.forceLevel[1].value.ToString();
                TB_Input_Force_2.Text  = force.forceLevel[2].value.ToString();
                TB_Input_Force_3.Text  = force.forceLevel[3].value.ToString();
                TB_Input_Force_4.Text  = force.forceLevel[4].value.ToString();
                TB_Input_Force_5.Text  = force.forceLevel[5].value.ToString();
                TB_Input_Force_6.Text  = force.forceLevel[6].value.ToString();
                TB_Input_Force_7.Text  = force.forceLevel[7].value.ToString();
                TB_Input_Force_8.Text  = force.forceLevel[8].value.ToString();
                TB_Input_Force_9.Text  = force.forceLevel[9].value.ToString();
                TB_Input_Force_10.Text = force.forceLevel[10].value.ToString();
                TB_Input_Force_11.Text = force.forceLevel[11].value.ToString();
                TB_Input_Force_12.Text = force.forceLevel[12].value.ToString();
                TB_Input_Force_13.Text = force.forceLevel[13].value.ToString();
                TB_Input_Force_14.Text = force.forceLevel[14].value.ToString();
                TB_Input_Force_15.Text = force.forceLevel[15].value.ToString();
                TB_Input_Force_16.Text = force.forceLevel[16].value.ToString();
                TB_Input_Force_17.Text = force.forceLevel[17].value.ToString();
                TB_Input_Force_18.Text = force.forceLevel[18].value.ToString();
                TB_Input_Force_19.Text = force.forceLevel[19].value.ToString();

                TB_Bottom_Force_0.Text  = force.bottomForce[0].value.ToString();
                TB_Bottom_Force_1.Text  = force.bottomForce[1].value.ToString();
                TB_Bottom_Force_2.Text  = force.bottomForce[2].value.ToString();
                TB_Bottom_Force_3.Text  = force.bottomForce[3].value.ToString();
                TB_Bottom_Force_4.Text  = force.bottomForce[4].value.ToString();
                TB_Bottom_Force_5.Text  = force.bottomForce[5].value.ToString();
                TB_Bottom_Force_6.Text  = force.bottomForce[6].value.ToString();
                TB_Bottom_Force_7.Text  = force.bottomForce[7].value.ToString();
                TB_Bottom_Force_8.Text  = force.bottomForce[8].value.ToString();
                TB_Bottom_Force_9.Text  = force.bottomForce[9].value.ToString();
                TB_Bottom_Force_10.Text = force.bottomForce[10].value.ToString();
                TB_Bottom_Force_11.Text = force.bottomForce[11].value.ToString();
                TB_Bottom_Force_12.Text = force.bottomForce[12].value.ToString();
                TB_Bottom_Force_13.Text = force.bottomForce[13].value.ToString();
                TB_Bottom_Force_14.Text = force.bottomForce[14].value.ToString();
                TB_Bottom_Force_15.Text = force.bottomForce[15].value.ToString();
                TB_Bottom_Force_16.Text = force.bottomForce[16].value.ToString();
                TB_Bottom_Force_17.Text = force.bottomForce[17].value.ToString();
                TB_Bottom_Force_18.Text = force.bottomForce[18].value.ToString();
                TB_Bottom_Force_19.Text = force.bottomForce[19].value.ToString();

                TB_Top_Force_0.Text  = force.topForce[0].value.ToString();
                TB_Top_Force_1.Text  = force.topForce[1].value.ToString();
                TB_Top_Force_2.Text  = force.topForce[2].value.ToString();
                TB_Top_Force_3.Text  = force.topForce[3].value.ToString();
                TB_Top_Force_4.Text  = force.topForce[4].value.ToString();
                TB_Top_Force_5.Text  = force.topForce[5].value.ToString();
                TB_Top_Force_6.Text  = force.topForce[6].value.ToString();
                TB_Top_Force_7.Text  = force.topForce[7].value.ToString();
                TB_Top_Force_8.Text  = force.topForce[8].value.ToString();
                TB_Top_Force_9.Text  = force.topForce[9].value.ToString();
                TB_Top_Force_10.Text = force.topForce[10].value.ToString();
                TB_Top_Force_11.Text = force.topForce[11].value.ToString();
                TB_Top_Force_12.Text = force.topForce[12].value.ToString();
                TB_Top_Force_13.Text = force.topForce[13].value.ToString();
                TB_Top_Force_14.Text = force.topForce[14].value.ToString();
                TB_Top_Force_15.Text = force.topForce[15].value.ToString();
                TB_Top_Force_16.Text = force.topForce[16].value.ToString();
                TB_Top_Force_17.Text = force.topForce[17].value.ToString();
                TB_Top_Force_18.Text = force.topForce[18].value.ToString();
                TB_Top_Force_19.Text = force.topForce[19].value.ToString();

                TB_HeightLevel_0.Text  = force.heightLevel[0].value.ToString();
                TB_HeightLevel_1.Text  = force.heightLevel[1].value.ToString();
                TB_HeightLevel_2.Text  = force.heightLevel[2].value.ToString();
                TB_HeightLevel_3.Text  = force.heightLevel[3].value.ToString();
                TB_HeightLevel_4.Text  = force.heightLevel[4].value.ToString();
                TB_HeightLevel_5.Text  = force.heightLevel[5].value.ToString();
                TB_HeightLevel_6.Text  = force.heightLevel[6].value.ToString();
                TB_HeightLevel_7.Text  = force.heightLevel[7].value.ToString();
                TB_HeightLevel_8.Text  = force.heightLevel[8].value.ToString();
                TB_HeightLevel_9.Text  = force.heightLevel[9].value.ToString();
                TB_HeightLevel_10.Text = force.heightLevel[10].value.ToString();
                TB_HeightLevel_11.Text = force.heightLevel[11].value.ToString();
                TB_HeightLevel_12.Text = force.heightLevel[12].value.ToString();
                TB_HeightLevel_13.Text = force.heightLevel[13].value.ToString();
                TB_HeightLevel_14.Text = force.heightLevel[14].value.ToString();
                TB_HeightLevel_15.Text = force.heightLevel[15].value.ToString();
                TB_HeightLevel_16.Text = force.heightLevel[16].value.ToString();
                TB_HeightLevel_17.Text = force.heightLevel[17].value.ToString();
                TB_HeightLevel_18.Text = force.heightLevel[18].value.ToString();
                TB_HeightLevel_19.Text = force.heightLevel[19].value.ToString();

                TB_Force_Test_Kilogram.Text = testKilogram.value.ToString();

                BT_ESC.Focus();
            }
        }
Esempio n. 29
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                if (mc.para.ETC.autoDoorControlUse.value == 0)
                {
                    BT_AutoDoorLockUse.Text = "OFF"; BT_AutoDoorLockUse.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_AutoDoorLockUse.Text = "ON"; BT_AutoDoorLockUse.Image = Properties.Resources.Yellow_LED;
                }
                if (mc.para.ETC.doorServoControlUse.value == 0)
                {
                    BT_DoorServoControlUse.Text = "OFF"; BT_DoorServoControlUse.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_DoorServoControlUse.Text = "ON"; BT_DoorServoControlUse.Image = Properties.Resources.Yellow_LED;
                }
                if (mc.para.ETC.passwordProtect.value == 0)
                {
                    BT_PasswordProtect.Text = "OFF"; BT_PasswordProtect.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_PasswordProtect.Text = "ON"; BT_PasswordProtect.Image = Properties.Resources.Yellow_LED;
                }
                if (mc.para.ETC.mccLogUse.value == 0)
                {
                    BT_MCCLogUse.Text = "OFF"; BT_MCCLogUse.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_MCCLogUse.Text = "ON"; BT_MCCLogUse.Image = Properties.Resources.Yellow_LED;
                }

                if (mc.para.ETC.unloaderControl.value == 0)
                {
                    BT_UnloaderControl.Text = "OFF"; BT_UnloaderControl.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_UnloaderControl.Text = "ON"; BT_UnloaderControl.Image = Properties.Resources.Yellow_LED;
                }

                if (mc.para.ETC.preMachine.value == (int)PRE_MC.INSPECTION)
                {
                    BT_PRE_MC.Text = BT_PREMC_ISP.Text;
                }
                else if (mc.para.ETC.preMachine.value == (int)PRE_MC.ATTACH)
                {
                    BT_PRE_MC.Text = BT_PREMC_ATTACH.Text;
                }
                else if (mc.para.ETC.preMachine.value == (int)PRE_MC.DISPENSER)
                {
                    BT_PRE_MC.Text = BT_PREMC_DISPENSOR.Text;
                }

                if (mc.para.ETC.useHeadMode.value == (int)UnitCodeHead.HD1)
                {
                    BT_USE_HEAD.Text = BT_HEAD_ONLY_1.Text;
                }
                else if (mc.para.ETC.useHeadMode.value == (int)UnitCodeHead.HD2)
                {
                    BT_USE_HEAD.Text = BT_HEAD_ONLY_2.Text;
                }
                else if (mc.para.ETC.useHeadMode.value == (int)UnitCodeHead.HD_MAX)
                {
                    BT_USE_HEAD.Text = BT_HEAD_DUAL.Text;
                }

                TB_HD.Text   = (mc.hd.tool.X.config.speed.rate * 100).ToString();
                TB_HD_X.Text = mc.hd.tool.X.config.speed.rate.ToString();
                TB_HD_Y.Text = mc.hd.tool.Y.config.speed.rate.ToString();
                TB_HD_T.Text = mc.hd.tool.T[0].config.speed.rate.ToString();
                TB_HD_Z.Text = mc.hd.tool.Z[0].config.speed.rate.ToString();

                //TB_PD.Text = (mc.pd.X.config.speed.rate * 100).ToString();
                //TB_PD_X.Text = mc.pd.X.config.speed.rate.ToString();
                //TB_PD_Y.Text = mc.pd.Y.config.speed.rate.ToString();
                //TB_PD_W.Text = mc.pd.W.config.speed.rate.ToString();

                TB_SF.Text    = (mc.sf.Z.config.speed.rate * 100).ToString();
                TB_SF_Z.Text  = mc.sf.Z.config.speed.rate.ToString();
                TB_SF_Z2.Text = mc.sf.Z2.config.speed.rate.ToString();

                TB_CV.Text   = (mc.cv.W.config.speed.rate * 100).ToString();
                TB_CV_W.Text = mc.cv.W.config.speed.rate.ToString();

                if (ClassChangeLanguage.mcLanguage == (int)LANGUAGE.KOREAN)
                {
                    BT_LANGUAGE.Text = BT_LAN_KOREAN.Text;
                }
                else if (ClassChangeLanguage.mcLanguage == (int)LANGUAGE.ENGLISH)
                {
                    BT_LANGUAGE.Text = BT_LAN_ENGLISH.Text;
                }

                LB_.Focus();
            }
        }
Esempio n. 30
0
        void refresh()
        {
            if (this.InvokeRequired)
            {
                refresh_Call d = new refresh_Call(refresh);
                this.BeginInvoke(d, new object[] { });
            }
            else
            {
                TB_TrayReverseXPos.Text        = mc.para.CV.trayReverseXPos.value.ToString();
                TB_TrayReverseYPos.Text        = mc.para.CV.trayReverseYPos.value.ToString();
                TB_REVERSE_PATTERN_SCORE1.Text = mc.para.HDC.modelTrayReversePattern1.passScore.value.ToString();

                TB_TrayReverseXPos2.Text       = mc.para.CV.trayReverseXPos2.value.ToString();
                TB_TrayReverseYPos2.Text       = mc.para.CV.trayReverseYPos2.value.ToString();
                TB_REVERSE_PATTERN_SCORE2.Text = mc.para.HDC.modelTrayReversePattern2.passScore.value.ToString();

                TB_LOADING_CONV_SPEED.Text   = mc.para.CV.loadingConveyorSpeed.value.ToString();
                TB_UNLOADING_CONV_SPEED.Text = mc.para.CV.unloadingConveyorSpeed.value.ToString();
                TB_WORK_CONV_SPEED.Text      = mc.para.CV.workConveyorSpeed.value.ToString();

                TB_TrayInpos_Delay.Text = mc.para.CV.trayInposDelay.value.ToString();
                TB_Stopper_Delay.Text   = mc.para.CV.StopperDelay.value.ToString();

                if ((int)mc.para.CV.trayReverseUse.value == 0)
                {
                    BT_TrayReverseUse.Text = "OFF"; BT_TrayReverseUse.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_TrayReverseUse.Text = "ON"; BT_TrayReverseUse.Image = Properties.Resources.Yellow_LED;
                }

                if ((int)mc.para.CV.trayReverseResult.value == 0)
                {
                    BT_TrayReverseResult.Text = "OFF"; BT_TrayReverseResult.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_TrayReverseResult.Text = "ON"; BT_TrayReverseResult.Image = Properties.Resources.Yellow_LED;
                }

                if ((int)mc.para.CV.trayReverseCheckMethod1.value == 0)
                {
                    BT_TrayReverseResult.Enabled = true;
                    TS_PATTERN_PARA1.Enabled     = false;
                    BT_CHECK_METHOD1.Text        = BT_USE_LASER.ToString();
                }
                else
                {
                    BT_TrayReverseResult.Enabled = false;
                    TS_PATTERN_PARA1.Enabled     = true;
                    BT_CHECK_METHOD1.Text        = BT_USE_PATTERN.ToString();
                }

                if ((int)mc.para.CV.trayReverseUse2.value == 0)
                {
                    BT_TrayReverseUse2.Text = "OFF"; BT_TrayReverseUse2.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_TrayReverseUse2.Text = "ON"; BT_TrayReverseUse2.Image = Properties.Resources.Yellow_LED;
                }

                if ((int)mc.para.CV.trayReverseResult2.value == 0)
                {
                    BT_TrayReverseResult2.Text = "OFF"; BT_TrayReverseResult2.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_TrayReverseResult2.Text = "ON"; BT_TrayReverseResult2.Image = Properties.Resources.Yellow_LED;
                }

                if ((int)mc.para.CV.trayReverseCheckMethod2.value == 0)
                {
                    BT_TrayReverseResult2.Enabled = true;
                    TS_PATTERN_PARA2.Enabled      = false;
                    BT_CHECK_METHOD2.Text         = BT_USE_LASER2.ToString();
                }
                else
                {
                    BT_TrayReverseResult2.Enabled = false;
                    TS_PATTERN_PARA2.Enabled      = true;
                    BT_CHECK_METHOD2.Text         = BT_USE_PATTERN2.ToString();
                }

                if ((int)mc.para.CV.homingSkip.value == 0)
                {
                    BT_ConvHomingSkip.Text = "OFF"; BT_ConvHomingSkip.Image = Properties.Resources.YellowLED_OFF;
                }
                else
                {
                    BT_ConvHomingSkip.Text = "ON"; BT_ConvHomingSkip.Image = Properties.Resources.Yellow_LED;
                }

                LB_.Focus();
            }
        }