C3032
3 天以前 ebcc1d53f14112363bbf539bcaf0202aadcdc9d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace LB_VisionProcesses.Processes
{
    [Process("延时工具", Category = "其他工具", Description = "创建延时工具")]
    public class DelayTime : BaseProcess
    {
        public DelayTime()
        {
            strProcessClass = "LB_VisionProcesses.Processes.DelayTime";
            strProcessName = "延时工具";
 
            Params.Inputs.Add("延时时间", 1000.0);
        }
        public override bool Run()
        {
            try
            {
                InitRunParams();
                int DelayMilliseconds = 0;
                if (!int.TryParse(this.Params.Inputs["延时时间"].ToString(), out DelayMilliseconds))
                {
                    Msg = string.Format("延时时间未设置");
                    return false;
                }
 
                Thread.Sleep(DelayMilliseconds);
                return true;
            }
            catch
            {
                Msg = string.Format("运行出现异常");
                return false;
            }
        }
    }
}