Esempio n. 1
0
        private void ShowActions(long customID)
        {
            ALS.BLL.actions bllact = new ALS.BLL.actions();
            DataSet         dsact  = bllact.GetList("customID='" + customID + "'", true);

            this.dgActions.DataSource         = dsact.Tables[0];
            this.dgActions.Columns[0].Visible = this.dgActions.Columns[1].Visible = false;
            this.dgActions.Refresh();
        }
Esempio n. 2
0
        private void btnVeinOpen_Click(object sender, EventArgs e)
        {
            ALS.Model.actions modact = new ALS.Model.actions();
            ALS.BLL.actions   bllact = new ALS.BLL.actions();
            Button            b      = sender as Button;

            if (b.Tag != null)
            {
                switch (b.Tag.ToString())
                {
                case "1":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel1Up;
                    modact.actionInfo = "静脉壶液面上升";
                    break;

                case "2":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel1Down;
                    modact.actionInfo = "静脉壶液面下降";
                    break;

                case "3":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel2Up;
                    modact.actionInfo = "动脉壶液面上升";
                    break;

                case "4":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel2Down;
                    modact.actionInfo = "动脉壶液面下降";
                    break;

                case "5":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel3Up;
                    modact.actionInfo = "M1液面上升";
                    break;

                case "6":
                    modact.arrCommand = Cls.Comm_Main.LiquidLevel.liquidLevel3Down;
                    modact.actionInfo = "M1液面下降";
                    break;
                }
            }
            modact.customID  = m_customID;
            modact.portName  = Port_Main.PortName;
            modact.cmdLength = modact.arrCommand.Length;
            if (bllact.Add(modact))
            {
                ShowActions(m_customID);
            }
        }
Esempio n. 3
0
        private void btnVoiseClose_Click(object sender, EventArgs e)
        {
            ALS.Model.actions modact = new ALS.Model.actions();
            ALS.BLL.actions   bllact = new ALS.BLL.actions();
            Button            b      = sender as Button;

            switch (b.Tag.ToString())
            {
            case "voise1":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.Alarm1;
                modact.actionInfo = "报警音1";
                break;

            case "voise2":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.Alarm2;
                modact.actionInfo = "报警音2";
                break;

            case "lightclose":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.AllLightClose;
                modact.actionInfo = "所有灯关闭";
                break;

            case "lightred":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.RedTwinkle;
                modact.actionInfo = "红灯闪烁";
                break;

            case "lightyellow":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.YellowTwinkle;
                modact.actionInfo = "黄灯闪烁";
                break;

            case "lightgreen":
                modact.arrCommand = Cls.Comm_Main.CmdAlarmLamp.GreenAlways;
                modact.actionInfo = "绿灯常亮";
                break;
            }
            modact.customID  = m_customID;
            modact.portName  = Port_Main.PortName;
            modact.cmdLength = modact.arrCommand.Length;
            if (bllact.Add(modact))
            {
                ShowActions(m_customID);
            }
        }
Esempio n. 4
0
        public bool GetCustCmd(string method)
        {
            ShowCustomActions(method);
            ALS.BLL.customactions bllCust = new ALS.BLL.customactions();
            m_lstCust = bllCust.GetModelList("methodName='" + method + "'");

            if (m_lstCust.Count > 0)
            {
                m_queueCustSendCmd = new Queue <Cls.Model_CustomCMD>();
                ALS.BLL.actions bllact = new ALS.BLL.actions();
                for (int i = 0; i < m_lstCust.Count; i++)
                {
                    //重新计算时间点
                    if (i > 0)
                    {
                        m_lstCust[i].timeCount = m_lstCust[i - 1].timeCount + m_lstCust[i - 1].timeSpan;
                    }
                    //读取步骤下相应的动作列表
                    int customID = (int)m_lstCust[i].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);
                    }
                    Cls.Model_CustomCMD modCustCmd = new Cls.Model_CustomCMD();
                    modCustCmd._TimesCount  = (int)m_lstCust[i].timeCount;
                    modCustCmd._LstSendCMDs = lstActions;
                    modCustCmd._LastTime    = (int)m_lstCust[i].timeSpan;
                    modCustCmd._ActionName  = m_lstCust[i].actionName;
                    modCustCmd._Index       = m_queueCustSendCmd.Count;
                    //将该动作列表加入步骤里
                    m_queueCustSendCmd.Enqueue(modCustCmd);
                }
                //最后一项提取总时间
                int timefull = (int)(m_lstCust[m_lstCust.Count - 1].timeCount + m_lstCust[m_lstCust.Count - 1].timeSpan);// (int)modCust.timeCount + (int)modCust.timeSpan;
                this.lblFullTime.Text = Cls.utils.SecondsToTime(timefull);
                return(true);
            }
            else
            {
                this.lblFullTime.Text = "00:00:00";
                return(false);
            }
        }
Esempio n. 5
0
 private void btnDelAction1_Click(object sender, EventArgs e)
 {
     if (m_ActionID != -1)
     {
         ALS.BLL.actions bllact = new ALS.BLL.actions();
         //获取该步骤信息
         if (DialogResult.Yes == MessageBox.Show("确认删除该动作?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
         {
             if (bllact.Delete(m_ActionID))
             {
                 ShowActions(m_customID);
             }
             m_ActionID = -1;
         }
     }
     else
     {
         MessageBox.Show("请选择要删除的动作", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Esempio n. 6
0
        private void rbtnAddActionOfAD_Click(object sender, EventArgs e)
        {
            if (m_ADID == 0)
            {
                MessageBox.Show("请选择气泡检测器");
                return;
            }

            if (!(this.rbtnOpenAD.Checked) && !(this.rbtnCloseAD.Checked))
            {
                MessageBox.Show("请选择气泡检测器状态");
                return;
            }

            ALS.Model.actions modact = new ALS.Model.actions();
            ALS.BLL.actions   bllact = new ALS.BLL.actions();
            switch (m_ADID)
            {
            case 1:
                if (rbtnOpenAD.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.OpenBubble1;
                    modact.actionInfo = "气泡检测器1打开";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.CloseBubble1;
                    modact.actionInfo = "气泡检测器1关闭";
                }
                break;

            case 2:
                if (rbtnOpenAD.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.OpenBubble2;
                    modact.actionInfo = "气泡检测器2打开";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.CloseBubble2;
                    modact.actionInfo = "气泡检测器2关闭";
                }
                break;

            case 3:
                if (rbtnOpenAD.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.OpenBubble3;
                    modact.actionInfo = "气泡检测器3打开";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdBubble.CloseBubble3;
                    modact.actionInfo = "气泡检测器3关闭";
                }
                break;
            }
            modact.customID  = m_customID;
            modact.portName  = Port_Main.PortName;
            modact.cmdLength = modact.arrCommand.Length;
            if (bllact.Add(modact))
            {
                ShowActions(m_customID);
            }
        }
Esempio n. 7
0
        private void btnAddActionOfV_Click(object sender, EventArgs e)
        {
            byte[]        vstate = new byte[6];
            StringBuilder sb     = new StringBuilder();

            ALS.Model.actions modact = new ALS.Model.actions();
            ALS.BLL.actions   bllact = new ALS.BLL.actions();

            if (chkV1.Checked)
            {
                sb.Append("V1夹管,"); vstate[0] = 0x01;
            }
            else
            {
                sb.Append("V1松管,"); vstate[0] = 0x00;
            }

            if (chkV2.Checked)
            {
                sb.Append("V2夹管,"); vstate[1] = 0x01;
            }
            else
            {
                sb.Append("V2松管,"); vstate[1] = 0x00;
            }
            if (chkV3.Checked)
            {
                sb.Append("V3夹管,"); vstate[2] = 0x01;
            }
            else
            {
                sb.Append("V3松管,"); vstate[2] = 0x00;
            }
            if (chkV4.Checked)
            {
                sb.Append("V4夹管,"); vstate[3] = 0x01;
            }
            else
            {
                sb.Append("V4松管,"); vstate[3] = 0x00;
            }
            if (chkV5.Checked)
            {
                sb.Append("V5夹管,"); vstate[4] = 0x01;
            }
            else
            {
                sb.Append("V5松管,"); vstate[4] = 0x00;
            }
            if (chkV6.Checked)
            {
                sb.Append("V6夹管."); vstate[5] = 0x01;
            }
            else
            {
                sb.Append("V6松管."); vstate[5] = 0x00;
            }

            string info = sb.ToString();

            if (DialogResult.OK == MessageBox.Show("请确认夹管阀状态是否正确:[" + info + "] ?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
            {
                modact.actionInfo = info;
                modact.customID   = m_customID;
                modact.portName   = Port_Main.PortName;
                modact.arrCommand = Cls.Comm_Main.CmdValve.SetVState(vstate[0], vstate[1], vstate[2], vstate[3], vstate[4], vstate[5]);
                modact.cmdLength  = modact.arrCommand.Length;
                if (bllact.Add(modact))
                {
                    ShowActions(m_customID);
                }
            }
        }
Esempio n. 8
0
        private void btnAddActionOfPump_Click(object sender, EventArgs e)
        {
            if (m_pumpID == 0)
            {
                MessageBox.Show("请选择泵!");
                return;
            }

            if ((!rbtnClockwise.Checked) && (!rbtnAntiClockwise.Checked) && (!rbtnIsRun.Checked))
            {
                MessageBox.Show("请选择泵运转方向!");
                return;
            }

            //当选择所有泵时,必须选择rbtnIsRun
            if (rbtnAllPump.Checked)
            {
                if (rbtnIsRun.Checked == false)
                {
                    MessageBox.Show("请选择所有泵的运转状态,此处必须选择停止!");
                    return;
                }
            }

            //if (lblPumpSpeed.Text == "0.0" && (!rbtnIsRun.Checked))
            //{
            //    MessageBox.Show("请设定泵速!");
            //    return;
            //}

            if (m_modc != null)
            {
                //当前选择的自定义步骤
                m_customID = (int)m_modc.ID;
                //添加泵动作
                //针对创新模式中,预计  预冲量的确认需要计算:
                //第一部分:预冲量 以自定义步骤中 BP运转时间 * 速度;
                //第二部分:预冲量 以自定义步骤中 RP运转时间 * 速度;
                //当添加的动作里包含 BP 或 RP 运转时,需要更新该步骤中的累计流量字段;
                //注:原有字段 timeCount ,存储 累计流量
                ALS.Model.actions modact = new ALS.Model.actions();
                modact.customID   = m_customID;
                m_bPumpDirection  = rbtnClockwise.Checked ? true : false;
                m_bPumpRun        = rbtnIsRun.Checked ? false : true;
                modact.arrCommand = Cls.Comm_PeristalticPump.Command(m_pumpID, Convert.ToDouble(this.lblPumpSpeed.Text), m_bPumpRun, m_bPumpDirection);

                modact.portName  = _port_Pump.PortName;
                modact.cmdLength = modact.arrCommand.Length;
                if (m_bPumpRun)
                {
                    modact.actionInfo = m_strPumpText + "," + m_strPumpDirection + "," + lblPumpSpeed.Text + "mL/min,持续时间:" + lbltsPump.Text + ",预计流量:" + lblml.Text + "mL";
                }
                else
                {
                    modact.actionInfo = m_strPumpText + ",停止运行!";
                }
                ALS.BLL.actions bllact = new ALS.BLL.actions();

                if (bllact.Add(modact))
                {
                    ////如果泵ID为1
                    //if(m_pumpID==1)
                    //{
                    //    m_modc.timeCount = int.Parse(lblml.Text);
                    //    new BLL.customactions().Update(m_modc);
                    //}
                    DataSet dsact = bllact.GetList("customID='" + m_customID + "'", true);
                    this.dgActions.DataSource = dsact.Tables[0];
                    this.dgActions.Refresh();
                }
            }
            else
            {
                MessageBox.Show("请选择需要添加操作的步骤", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }
Esempio n. 9
0
        private void btnAddActionOfV_Click(object sender, EventArgs e)
        {
            if (m_VID == 0)
            {
                MessageBox.Show("请选择夹管阀");
                return;
            }

            if (!(rbtnClampV.Checked) && !(rbtnLooseV.Checked))
            {
                MessageBox.Show("请选择夹管阀动作状态");
                return;
            }

            ALS.Model.actions modact = new ALS.Model.actions();
            ALS.BLL.actions   bllact = new ALS.BLL.actions();
            switch (m_VID)
            {
            case 1:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV1;
                    modact.actionInfo = "夹管阀1夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV1;
                    modact.actionInfo = "夹管阀1松管";
                }
                break;

            case 2:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV2;
                    modact.actionInfo = "夹管阀2夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV2;
                    modact.actionInfo = "夹管阀2松管";
                }
                break;

            case 3:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV3;
                    modact.actionInfo = "夹管阀3夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV3;
                    modact.actionInfo = "夹管阀3松管";
                }
                break;

            case 4:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV4;
                    modact.actionInfo = "夹管阀4夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV4;
                    modact.actionInfo = "夹管阀4松管";
                }
                break;

            case 5:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV5;
                    modact.actionInfo = "夹管阀5夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV5;
                    modact.actionInfo = "夹管阀5松管";
                }
                break;

            case 6:
                if (rbtnClampV.Checked)
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.ClampV6;
                    modact.actionInfo = "夹管阀6夹管";
                }
                else
                {
                    modact.arrCommand = Cls.Comm_Main.CmdValve.LoosenV6;
                    modact.actionInfo = "夹管阀6松管";
                }
                break;
            }
            modact.customID  = m_customID;
            modact.portName  = Port_Main.PortName;
            modact.cmdLength = modact.arrCommand.Length;
            if (bllact.Add(modact))
            {
                ShowActions(m_customID);
            }
        }
Esempio n. 10
0
        private void btnAddActionOfPump_Click(object sender, EventArgs e)
        {
            if (m_pumpID == 0)
            {
                MessageBox.Show("请选择泵!");
                return;
            }

            if ((!rbtnClockwise.Checked) && (!rbtnAntiClockwise.Checked) && (!rbtnIsRun.Checked))
            {
                MessageBox.Show("请选择泵运转方向!");
                return;
            }

            //当选择所有泵时,必须选择rbtnIsRun
            if (rbtnAllPump.Checked)
            {
                if (rbtnIsRun.Checked == false)
                {
                    MessageBox.Show("请选择所有泵的运转状态,此处必须选择停止!");
                    return;
                }
            }

            if (lblPumpSpeed.Text == "0.0" && (!rbtnIsRun.Checked))
            {
                MessageBox.Show("请设定泵速!");
                return;
            }


            if (m_modc != null)
            {
                m_customID = (int)m_modc.ID;
                ALS.Model.actions modact = new ALS.Model.actions();
                modact.customID   = m_customID;
                m_bPumpDirection  = rbtnClockwise.Checked ? true : false;
                m_bPumpRun        = rbtnIsRun.Checked ? false : true;
                modact.arrCommand = Cls.Comm_PeristalticPump.Command(m_pumpID, Convert.ToDouble(this.lblPumpSpeed.Text), m_bPumpRun, m_bPumpDirection);

                modact.portName  = _port_Pump.PortName;
                modact.cmdLength = modact.arrCommand.Length;
                if (m_bPumpRun)
                {
                    modact.actionInfo = m_strPumpText + "," + m_strPumpDirection + "," + lblPumpSpeed.Text + "mL/min,持续时间:" + lbltsPump.Text + ",预计流量:" + lblml.Text + "mL";
                }
                else
                {
                    modact.actionInfo = m_strPumpText + ",停止运行!";
                }
                ALS.BLL.actions bllact = new ALS.BLL.actions();

                if (bllact.Add(modact))
                {
                    DataSet dsact = bllact.GetList("customID='" + m_customID + "'", true);
                    this.dgActions.DataSource = dsact.Tables[0];
                    this.dgActions.Refresh();
                }
            }
            else
            {
                MessageBox.Show("请选择需要添加操作的步骤", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
        }