コード例 #1
0
 public int GetTaskStatus()
 {
     if (engine != null)
     {
         return(engine.GetGlobalCtrlVarTuple("StopTask"));
     }
     else
     {
         return(0);
     }
 }
コード例 #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            try
            {
                if (engine != null)
                {
                    textBox1.Text = engine.GetGlobalCtrlVarTuple("ExceptionMessage").ToString();
                    int[] Result = engine.GetGlobalCtrlVarTuple("IsOK").ToIArr();
                    if (Result.Length > 0)
                    {
                        switch (Result[1])
                        {
                        case 0:
                            label1.BackColor = Color.Red;
                            button2.Text     = "连续采集";
                            button1.Enabled  = false;
                            button2.Enabled  = false;
                            break;

                        case 1:
                            label1.BackColor = Color.LimeGreen;
                            if (engine.GetGlobalCtrlVarTuple("Id") != 3 && task.Status == TaskStatus.Running)
                            {
                                button1.Enabled = true;
                            }
                            button2.Enabled = true;
                            break;
                        }
                    }
                    else
                    {
                        label1.BackColor = Color.Red;
                    }
                    if (engine.GetGlobalCtrlVarTuple("Id") == 3 && task.Status == TaskStatus.Running)
                    {
                        button1.Enabled = false;
                    }
                }
                if (task.Status == TaskStatus.Running)
                {
                    label2.BackColor = Color.LimeGreen;
                }
                else
                {
                    label2.BackColor = Color.Red;
                }


                if (task.Status == TaskStatus.Running)
                {
                    button4.Enabled = true;
                }
                else
                {
                    button4.Enabled = false;
                    button2.Enabled = false;
                    button1.Enabled = false;
                }
            }
            catch
            {
            }
        }