Beispiel #1
0
        public void btnAddFlush_Click(object sender, EventArgs e)
        {
            if (this.dgvStep.SelectedRows.Count == 0)
            {
                MessageBox.Show("请选择需要追加预冲的步骤!");
                return;
            }
            else
            {
                m_isAddFlush = !m_isAddFlush;
                if (m_isAddFlush)
                {
                    int customID = Convert.ToInt32(this.dgvStep.SelectedRows[0].Cells["ID"].Value);
                    m_tCountAddFlush = (int)m_lstCust[this.dgvStep.SelectedRows[0].Index].timeSpan;

                    BLL.actions bllact = new BLL.actions();
                    List <ALS.Model.actions> lstModAct  = bllact.GetModelList("customID='" + customID + "'");
                    List <Cls.Model_SendCMD> lstActions = new List <Cls.Model_SendCMD>();
                    if (lstModAct.Count > 0)
                    {
                        lstActions = GetlstActions(lstModAct);
                        //创建发送追加预冲的任务
                        m_taskActions = new Task(RunActions, lstActions, TaskCreationOptions.LongRunning);
                        m_taskActions.Start();
                    }
                    this.btnAddFlush.Text = "停止";
                    //改变Enable
                    this.btnStart.Enabled  = false;
                    this.btnFinish.Enabled = false;
                    this.dgvStep.Enabled   = false;
                    //简单的步骤计时器
                    this.timerFlush.Enabled = true;
                    this.timerFlush.Start();
                }
                else
                {
                    this.btnAddFlush.Text = "追加预冲";
                    //发送停止命令
                    Cls.utils.SendOrder(_port_Pump, Cls.Comm_PeristalticPump.Command(0x1F, 0, false, true));
                    //this.btnStart.Enabled = false;
                    this.btnFinish.Enabled = true;
                    this.dgvStep.Enabled   = true;
                    timerFlush.Enabled     = false;
                    timerFlush.Stop();
                    M_int_FlushCount = 0;
                    m_tCountAddFlush = 0;
                    this.timerFlush.Stop();
                }
            }
        }
Beispiel #2
0
 private void ReadLastActionAVState()
 {
     BLL.actions bllact = new BLL.actions();
     if (m_lstCust.Count > 0)
     {
         //读取步骤下相应的动作列表
         int customID = (int)m_lstCust[m_lstCust.Count - 1].ID;
         List <ALS.Model.actions> lstModAct  = bllact.GetModelList("customID='" + customID + "'");
         List <Cls.Model_SendCMD> lstActions = new List <Cls.Model_SendCMD>();
         if (lstModAct.Count > 0)
         {
             lstActions = GetlstActions(lstModAct);
             UpdatePumpState(lstActions);
         }
     }
 }