Esempio n. 1
0
        public void ShowWIRE_SETTING(WIRE_SETTING_T wire)
        {
            //检测模式
            ANAL_TYPE type = wire.tol.analEN;

            ckBoxCorePos.Checked   = tools.IS_ANAL_CORE_POS(type);
            ckBoxCoreWidth.Checked = tools.IS_ANAL_CORE_WIDTH(type);
            ckBoxSealPos.Checked   = tools.IS_ANAL_SEAL_POS(type);
            ckBoxSealWidth.Checked = tools.IS_ANAL_SEAL_WIDTH(type);
            ckBoxStripPos.Checked  = tools.IS_ANAL_STRIP_POS(type);
            ckBoxStripLen.Checked  = tools.IS_ANAL_STRIP_LEN(type);
            ckBoxSplay.Checked     = tools.IS_ANAL_SPLAY(type);
            //ckBoxSeal.Checked = tools.IS_ANAL_SEAL(type);
            ckBoxSeal.Checked    = tools.IS_ANAL_IS_SEAL(type);
            ckBoxSealOri.Checked = tools.IS_ANAL_SEAL_ORI(type);
            //检测参数设置
            tBoxCorePosN.Text        = wire.tol.corePosN.ToString() + "mm";
            tBoxCorePosP.Text        = wire.tol.corePosP.ToString() + "mm";
            tBoxSealPosN.Text        = wire.tol.sealPosN.ToString() + "mm";
            tBoxSealPosP.Text        = wire.tol.sealPosP.ToString() + "mm";
            tBoxStripPosN.Text       = wire.tol.stripPosN.ToString() + "mm";
            tBoxStripPosP.Text       = wire.tol.stripPosP.ToString() + "mm";
            tBoxStripLenN.Text       = wire.tol.stripLenN.ToString() + "mm";
            tBoxStripLenP.Text       = wire.tol.stripLenP.ToString() + "mm";
            tBoxCoreWidthN.Text      = wire.tol.coreWidthN.ToString() + "%";
            tBoxCoreWidthP.Text      = wire.tol.coreWidthP.ToString() + "%";
            tBoxSealWidthN.Text      = wire.tol.sealWidthN.ToString() + "%";
            tBoxSealWidthP.Text      = wire.tol.sealWidthP.ToString() + "%";
            tBoxVariationFilter.Text = wire.tol.variationFilter.ToString() + "mm";
            tBoxSealLimit.Text       = wire.tol.sealLimit.ToString() + "%";
            tBoxStripLimit.Text      = wire.tol.stripLimit.ToString() + "%";
            tBoxSealRatio.Text       = wire.tol.sealRatio.ToString() + "%";
        }
Esempio n. 2
0
        public void UpdateShow(CFG_T cfg)
        {
            //modelNum
            cBoxModelNum.Text = cfg.modelNum.ToString();

            //如果只有一个基准线型,则基准线型2相关设置灰化
            if (cBoxModelNum.Text == "1")
            {
                gBoxModel2.Enabled        = false;
                gBoxAdvanceModel2.Enabled = false;
            }
            else
            {
                gBoxModel2.Enabled        = true;
                gBoxAdvanceModel2.Enabled = false;
            }

            ckBoxAutoAdjSpeed.Checked  = (cfg.isSpeedAdj != 0);     //速度补偿
            cBoxLearnNum.Text          = cfg.learnNum.ToString();   //学习数量
            tBoxSensorSensitivity.Text = cfg.senThresh.ToString();  //传感器灵敏度%


            //检测模式
            ANAL_TYPE type = cfg.wire[0].tol.analEN;

            ckBoxCorePos1.Checked   = IS_ANAL_CORE_POS(type);
            ckBoxCoreWidth1.Checked = IS_ANAL_CORE_WIDTH(type);
            ckBoxSealPos1.Checked   = IS_ANAL_SEAL_POS(type);
            ckBoxSealWidth1.Checked = IS_ANAL_SEAL_WIDTH(type);
            ckBoxStripPos1.Checked  = IS_ANAL_STRIP_POS(type);
            ckBoxStripLen1.Checked  = IS_ANAL_STRIP_LEN(type);
            ckBoxSplay1.Checked     = IS_ANAL_SPLAY(type);
            ckBoxSeal1.Checked      = IS_ANAL_SEAL(type);

            type = cfg.wire[1].tol.analEN;
            ckBoxCorePos2.Checked   = IS_ANAL_CORE_POS(type);
            ckBoxCoreWidth2.Checked = IS_ANAL_CORE_WIDTH(type);
            ckBoxSealPos2.Checked   = IS_ANAL_SEAL_POS(type);
            ckBoxSealWidth2.Checked = IS_ANAL_SEAL_WIDTH(type);
            ckBoxStripPos2.Checked  = IS_ANAL_STRIP_POS(type);
            ckBoxStripLen2.Checked  = IS_ANAL_STRIP_LEN(type);
            ckBoxSplay2.Checked     = IS_ANAL_SPLAY(type);
            ckBoxSeal2.Checked      = IS_ANAL_SEAL(type);

            //检测参数设置
            tBoxCorePosN1.Text = cfg.wire[0].tol.corePosN.ToString() + "mm";
            tBoxCorePosN2.Text = cfg.wire[1].tol.corePosN.ToString() + "mm";
            tBoxCorePosP1.Text = cfg.wire[0].tol.corePosP.ToString() + "mm";
            tBoxCorePosP2.Text = cfg.wire[1].tol.corePosP.ToString() + "mm";

            tBoxSealPosN1.Text = cfg.wire[0].tol.sealPosN.ToString() + "mm";
            tBoxSealPosN2.Text = cfg.wire[1].tol.sealPosN.ToString() + "mm";
            tBoxSealPosP1.Text = cfg.wire[0].tol.sealPosP.ToString() + "mm";
            tBoxSealPosP2.Text = cfg.wire[1].tol.sealPosP.ToString() + "mm";

            tBoxStripPosN1.Text = cfg.wire[0].tol.stripPosN.ToString() + "mm";
            tBoxStripPosN2.Text = cfg.wire[1].tol.stripPosN.ToString() + "mm";
            tBoxStripPosP1.Text = cfg.wire[0].tol.stripPosP.ToString() + "mm";
            tBoxStripPosP2.Text = cfg.wire[1].tol.stripPosP.ToString() + "mm";

            tBoxStripLenN1.Text = cfg.wire[0].tol.stripLenN.ToString() + "mm";
            tBoxStripLenN2.Text = cfg.wire[1].tol.stripLenN.ToString() + "mm";
            tBoxStripLenP1.Text = cfg.wire[0].tol.stripLenP.ToString() + "mm";
            tBoxStripLenP2.Text = cfg.wire[1].tol.stripLenP.ToString() + "mm";

            tBoxCoreWidthN1.Text = cfg.wire[0].tol.coreWidthN.ToString() + "%";
            tBoxCoreWidthN2.Text = cfg.wire[1].tol.coreWidthN.ToString() + "%";
            tBoxCoreWidthP1.Text = cfg.wire[0].tol.coreWidthP.ToString() + "%";
            tBoxCoreWidthP2.Text = cfg.wire[1].tol.coreWidthP.ToString() + "%";

            tBoxSealWidthN1.Text = cfg.wire[0].tol.sealWidthN.ToString() + "%";
            tBoxSealWidthN2.Text = cfg.wire[1].tol.sealWidthN.ToString() + "%";
            tBoxSealWidthP1.Text = cfg.wire[0].tol.sealWidthP.ToString() + "%";
            tBoxSealWidthP2.Text = cfg.wire[1].tol.sealWidthP.ToString() + "%";

            tBoxVariationFilter1.Text = cfg.wire[0].tol.variationFilter.ToString() + "mm";
            tBoxVariationFilter2.Text = cfg.wire[1].tol.variationFilter.ToString() + "mm";
            tBoxSealLimit1.Text       = cfg.wire[0].tol.sealLimit.ToString() + "%";
            tBoxSealLimit2.Text       = cfg.wire[1].tol.sealLimit.ToString() + "%";
            tBoxStripLimit1.Text      = cfg.wire[0].tol.stripLimit.ToString() + "%";
            tBoxStripLimit2.Text      = cfg.wire[1].tol.stripLimit.ToString() + "%";
            tBoxSealRatio1.Text       = cfg.wire[0].tol.sealRatio.ToString() + "%";
            tBoxSealRatio2.Text       = cfg.wire[1].tol.sealRatio.ToString() + "%";

            //输入 怎样使用控件数组防止代码拷贝?
            TYPE_INPUT input = cfg.inputMode[0];

            if (IS_INPUT_LEARN(input))
            {
                cBoxInputModeLvl1.Text = "进入学习模式";
            }
            else if (IS_INPUT_FIRING(input))
            {
                cBoxInputModeLvl1.Text = "触发采样";
            }
            else if (IS_INPUT_SETUP(input))
            {
                cBoxInputModeLvl1.Text = "进入设置模式";
            }
            if (IS_INPPUT_POS(input))
            {
                cBoxInputPolLvl1.Text = "上升沿触发";
            }
            else
            {
                cBoxInputPolLvl1.Text = "下降沿触发";
            }


            input = cfg.inputMode[1];
            if (IS_INPUT_LEARN(input))
            {
                cBoxInputModeLvl2.Text = "进入学习模式";
            }
            else if (IS_INPUT_FIRING(input))
            {
                cBoxInputModeLvl2.Text = "触发采样";
            }
            else if (IS_INPUT_SETUP(input))
            {
                cBoxInputModeLvl2.Text = "进入设置模式";
            }
            if (IS_INPPUT_POS(input))
            {
                cBoxInputPolLvl2.Text = "上升沿触发";
            }
            else
            {
                cBoxInputPolLvl2.Text = "下降沿触发";
            }

            input = cfg.inputMode[2];
            if (IS_INPUT_LEARN(input))
            {
                cBoxInputModeLvl3.Text = "进入学习模式";
            }
            else if (IS_INPUT_FIRING(input))
            {
                cBoxInputModeLvl3.Text = "触发采样";
            }
            else if (IS_INPUT_SETUP(input))
            {
                cBoxInputModeLvl3.Text = "进入设置模式";
            }
            if (IS_INPPUT_POS(input))
            {
                cBoxInputPolLvl3.Text = "上升沿触发";
            }
            else
            {
                cBoxInputPolLvl3.Text = "下降沿触发";
            }

            input = cfg.inputMode[3];
            if (IS_INPUT_LEARN(input))
            {
                cBoxInputModeLvl4.Text = "进入学习模式";
            }
            else if (IS_INPUT_FIRING(input))
            {
                cBoxInputModeLvl4.Text = "触发采样";
            }
            else if (IS_INPUT_SETUP(input))
            {
                cBoxInputModeLvl4.Text = "进入设置模式";
            }
            if (IS_INPPUT_POS(input))
            {
                cBoxInputPolLvl4.Text = "上升沿触发";
            }
            else
            {
                cBoxInputPolLvl4.Text = "下降沿触发";
            }

            //输出
            TYPE_OUTPUT output = cfg.outputMode[0];

            if (IS_OUTPUT_NO(output))
            {
                rBtnNO1.Checked = true;
            }
            else
            {
                rBtnNC1.Checked = true;
            }

            if (IS_OUTPUT_ANY(output))
            {
                cBoxOutMode1.Text = "合格/不良品都输出脉冲";
            }
            else if (IS_OUTPUT_PASS(output))
            {
                cBoxOutMode1.Text = "合格品输出脉冲";
            }
            else if (IS_OUTPUT_FAIL(output))
            {
                cBoxOutMode1.Text = "不良品输出脉冲";
            }

            if (IS_OUTPUT_ING_FIRST(output))
            {
                rBtnIgnoreFirst1.Checked = true;
            }
            else if (IS_OUTPUT_ING_LEARN(output))
            {
                rBtnIgnoreLearn1.Checked = true;
            }
            else
            {
                rBtnNormal1.Checked = true;
            }
            tBoxOutDelay1.Text = cfg.outputDelay[0].ToString();
            tBoxDuration1.Text = cfg.outputWidth[0].ToString();

            output = cfg.outputMode[1];
            if (IS_OUTPUT_NO(output))
            {
                rBtnNO2.Checked = true;
            }
            else
            {
                rBtnNC2.Checked = true;
            }

            if (IS_OUTPUT_PASS(output))
            {
                cBoxOutMode2.Text = "合格品输出脉冲";
            }
            else if (IS_OUTPUT_FAIL(output))
            {
                cBoxOutMode2.Text = "不良品输出脉冲";
            }
            else if (IS_OUTPUT_ANY(output))
            {
                cBoxOutMode2.Text = "合格/不良品都输出脉冲";
            }

            if (IS_OUTPUT_ING_FIRST(output))
            {
                rBtnIgnoreFirst2.Checked = true;
            }
            else if (IS_OUTPUT_ING_LEARN(output))
            {
                rBtnIgnoreLearn2.Checked = true;
            }
            else
            {
                rBtnNormal2.Checked = true;
            }
            tBoxOutDelay2.Text = cfg.outputDelay[1].ToString();
            tBoxDuration2.Text = cfg.outputWidth[1].ToString();

            //输出有效期间忽略输入(忽略返程阶段)
            checkBoxOutIgnoreWhileOutActive.Checked = (cfg.isIgnInWhenOut != 0);
        }
Esempio n. 3
0
 public bool IS_ANAL_SEAL(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_SEAL == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_SEAL));
 }
Esempio n. 4
0
 public bool IS_ANAL_SPLAY(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_SPLAY == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_SPLAY));
 }
Esempio n. 5
0
 public bool IS_ANAL_STRIP_LEN(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_STRIP_LEN == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_STRIP_LEN));
 }
Esempio n. 6
0
 public bool IS_ANAL_STRIP_POS(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_STRIP_POS == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_STRIP_POS));
 }
Esempio n. 7
0
 public bool IS_ANAL_SEAL_WIDTH(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_SEAL_WIDTH == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_SEAL_WIDTH));
 }
Esempio n. 8
0
        }                                                                                                                                               //是否有防水栓

        public bool IS_ANAL_SEAL_ORI(ANAL_TYPE type)
        {
            return((UInt32)ANAL_TYPE.ANAL_SEAL_ORI == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_SEAL_ORI));
        }                                                                                                                                               //防水栓方向
Esempio n. 9
0
 public static bool IS_ANAL_IS_SEAL(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_IS_SEAL == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_IS_SEAL));
 }                                                                                                                                                      //是否有防水栓
Esempio n. 10
0
 public static bool IS_ANAL_CORE_WIDTH(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_CORE_WIDTH == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_CORE_WIDTH));
 }
Esempio n. 11
0
 //获取检测模式
 public static bool IS_ANAL_CORE_POS(ANAL_TYPE type)
 {
     return((UInt32)ANAL_TYPE.ANAL_CORE_POS == ((UInt32)type & (UInt32)ANAL_TYPE.ANAL_CORE_POS));
 }