跳到主要内容

参数模块配置

参数配置控件

工具箱中提供了两个参数配置控件.

  • VmParamsConfigControl是不带渲染的参数配置控件.
  • VmParamsConfigWithRenderControl是带渲染的参数配置控件.

1. VmParamsConfigWithRenderControl

  1. 配置模块数据源
        private void button3_Click(object sender, EventArgs e)
{
//模块的参数配置

IMVSOcrModuCs.IMVSOcrModuTool ocrTool = (IMVSOcrModuCs.IMVSOcrModuTool)VmSolution.Instance["流程1.字符识别1"];
VmParamsConfigWithRenderControl vmParamsConfigWithRenderControl1 = new VmParamsConfigWithRenderControl();
vmParamsConfigWithRenderControl1.Dock = DockStyle.Fill;
vmParamsConfigWithRenderControl1.ModuleSource = ocrTool;
groupBox5.Controls.Add(vmParamsConfigWithRenderControl1);

VmSolution.Instance.SyncRun();
listBox1.Items.Add("方案运行成功.");
listBox1.TopIndex = listBox1.Items.Count - 1;

//获取结果,分为渲染结果和数据结果

VmProcedure vmProcedure = (VmProcedure)VmSolution.Instance["流程1"];

vmRenderControl1.ModuleSource = vmProcedure;

string ocrResult = vmProcedure.ModuResult.GetOutputString("out").astStringVal[0].strValue;
string ocrNum = vmProcedure.ModuResult.GetOutputInt("out0").pIntVal[0].ToString();

listBox1.Items.Add("字符识别结果:"+ocrResult);
listBox1.TopIndex = listBox1.Items.Count - 1;
listBox1.Items.Add("个数:" + ocrNum);
listBox1.TopIndex = listBox1.Items.Count - 1;

}
  1. 点击方案执行验证效果

2. VmParamsConfigControl

与上述类似,只是参数配置控件不带右侧图像渲染.

vmParamsConfigControl1.ModuleSource = ocrTool;