コード例 #1
0
        public Form1()
        {
            InitializeComponent();
            // 设置温度曲线
            Series seriesTmp = chart1.Series[0];

            seriesTmp.ChartType   = SeriesChartType.Line;
            seriesTmp.BorderWidth = 2;
            seriesTmp.Color       = System.Drawing.Color.Red;
            seriesTmp.LegendText  = "温度曲线";
            //设置目标曲线
            Series seriesTgt = chart1.Series[1];

            seriesTgt.ChartType   = SeriesChartType.Line;
            seriesTgt.BorderWidth = 2;
            seriesTgt.Color       = System.Drawing.Color.Blue;
            seriesTgt.LegendText  = "目标曲线";

            //设置定时器
            timer1.Enabled  = false;
            timer1.Interval = int.Parse(ConfigurationSettings.AppSettings.Get("interval"));
            timer1.Tick    += new EventHandler(timer1_Tick);

            pid                = new PidCalculator();
            pid.getFeed       += Pid_getFeed;
            module             = new Module();
            module.moduleBack += Module_moduleBack;
            module.lockTap(false);

            //设置最小开度
            thresh = int.Parse(ConfigurationSettings.AppSettings.Get("minTap"));

            this.button2.Enabled = false;
        }
コード例 #2
0
 public TestForm()
 {
     InitializeComponent();
     pid                = new PidCalculator();
     pid.getFeed       += Pid_getFeed;
     module             = new Module();
     module.moduleBack += Module_moduleBack;
 }