/// <summary> /// 设置/保存 Task视觉参数配置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btTaskVcEditSave_Click(object sender, EventArgs e) { if (!_isTaskVcEditting) { string taskName = cbTaskName.Text; if (string.IsNullOrEmpty(taskName)) { MessageBox.Show("请选择需要设置的Task"); return; } _isTaskVcEditting = true; cbTaskName.Enabled = false; cbTaskVc.Enabled = true; btTaskVcEditSave.Text = "保存"; btTaskVcEditCancel.Enabled = true; } else { string taskVcName = cbTaskVc.Text; if (string.IsNullOrEmpty(taskVcName)) { MessageBox.Show("请选择需要保存的视觉配置名称"); return; } _isTaskVcEditting = false; cbTaskName.Enabled = true; cbTaskVc.Enabled = false; btTaskVcEditSave.Text = "编辑"; btTaskVcEditCancel.Enabled = false; JFDLAFRecipeManager rm = JFHubCenter.Instance.RecipeManager as JFDLAFRecipeManager; JFDLAFProductRecipe recipe = rm.GetRecipe(CategoteProduct, cbRecipeID.Text) as JFDLAFProductRecipe; recipe.SetVisionCfgName(cbFovName.Text, cbTaskName.Text, taskVcName); JFTipsDelayClose.Show("已保存\"taskVcName\" 到:" + cbTaskName.Text, 1); } }