Beispiel #1
0
 public void RemoveAction(LogicActionUnity logicaction)
 {
     action_group.Remove(logicaction);
     if (action_group.Count == 0)
     {
         if (father != null)
         {
             father.RemoveAction(this);
         }
     }
 }
Beispiel #2
0
        public bool RemoveAct(LogicActionUnity act)
        {
            var ret = action_list.Remove(act);

            return(ret);
        }
Beispiel #3
0
        //组合整理
        public void UpdataGroup()
        {
            LogicActionUnity max_group = null;
            int max_count = 0;

            for (int i = 0; i < action_group.Count; i++)
            {
                if (i % ExeActionCount == 0)
                {
                    int range_count = ExeActionCount < (action_group.Count - i) ? ExeActionCount : (action_group.Count - i);
                    var group_list  = action_group.GetRange(i, range_count).OrderByDescending(item => item.GetActionCount()).ToList();
                    max_group = group_list[0];
                    int group_count = max_group.GetActionCount();
                    foreach (var group in group_list)
                    {
                        //把最多的那个多加一个动作用来先完成多动作那个针头
                        if (group is LogicActionGoup && group.GetActionCount() == group_count)
                        {
                            var max_last_act = group.GetLastAction();
                            var action_tem   = max_last_act.GetGelStep().clone();
                            action_tem.StepClass        = TestStepEnum.FULLUP;
                            action_tem.is_skip_zjt      = true; //是否跳过装针
                            action_tem.is_skip_abs      = true; //是否跳过加样
                            action_tem.is_skip_spu      = true; //是否跳过分配
                            action_tem.is_skip_puttip   = true; //是否跳过脱针
                            action_tem.is_skip_mix      = true; //是否跳过混合
                            action_tem.is_skip_spu_back = true; //是否跳过分配回零
                            var logaction = new LogicAction(action_tem);
                            ((LogicActionGoup)group).AddAction(logaction);
                            ((LogicActionGoup)group).UpdataOneTube();
                            max_last_act.GetGelStep().is_skip_spu_back = false;
                        }
                    }



                    //int range_count = ExeActionCount<(action_group.Count-i)? ExeActionCount: (action_group.Count-i);
                    //max_group = action_group.GetRange(i, range_count).OrderByDescending(item => item.GetActionCount()).ToList()[0];
                    ////把最多的那个多加一个动作用来先完成多动作那个针头
                    //if (max_group is LogicActionGoup)
                    //{
                    //    var max_last_act = max_group.GetLastAction();
                    //    var action_tem = max_last_act.GetGelStep().clone();
                    //    action_tem.StepClass = TestStepEnum.FULLUP;
                    //    action_tem.is_skip_zjt = true;//是否跳过装针
                    //    action_tem.is_skip_abs = true;//是否跳过加样
                    //    action_tem.is_skip_spu = true;//是否跳过分配
                    //    action_tem.is_skip_puttip = true;//是否跳过脱针
                    //    action_tem.is_skip_mix = true;//是否跳过混合
                    //    action_tem.is_skip_spu_back = true;//是否跳过分配回零
                    //    var logaction = new LogicAction(action_tem);
                    //    ((LogicActionGoup)max_group).AddAction(logaction);
                    //    ((LogicActionGoup)max_group).UpdataOneTube();
                    //}
                }

                max_count = max_group.GetActionCount();

                int count    = max_count - action_group[i].GetActionCount();
                var last_act = action_group[i].GetLastAction();
                if (count != 0 && action_group[i] is LogicAction)
                {
                    var group_tem = action_group[i];
                    action_group[i]        = new LogicActionGoup(group_tem);
                    action_group[i].father = group_tem.father;
                }
                if (max_group is LogicActionGoup)
                {
                    for (int j = 0; j < count; j++)
                    {
                        var action_tem = last_act.GetGelStep().clone();
                        action_tem.StepClass        = TestStepEnum.FULLUP;
                        action_tem.is_skip_zjt      = true; //是否跳过装针
                        action_tem.is_skip_abs      = true; //是否跳过加样
                        action_tem.is_skip_spu      = true; //是否跳过分配
                        action_tem.is_skip_puttip   = true; //是否跳过脱针
                        action_tem.is_skip_mix      = true; //是否跳过混合
                        action_tem.is_skip_spu_back = true; //是否跳过分配回零
                        var logaction = new LogicAction(action_tem);
                        ((LogicActionGoup)action_group[i]).AddAction(logaction);
                    }
                    if (count != 0)
                    {
                        for (int j = 0; j < action_group[i].GetActionCount(); j++)
                        {
                            var action_tem = ((LogicActionGoup)action_group[i]).action_group[j].GetGelStep();
                            action_tem.is_skip_spu      = j != (action_group[i].GetActionCount() - 1); //分配
                            action_tem.is_skip_puttip   = j != (action_group[i].GetActionCount() - 1); //脱针
                            action_tem.is_skip_spu_back = j != (action_group[i].GetActionCount() - 1); //脱针
                            if (j == action_group[i].GetActionCount() - 1)
                            {
                                action_tem.StepClass = action_group[i].GetGelStep().StepClass;
                            }
                        }
                    }
                }
            }
        }
Beispiel #4
0
        //是否融合
        public bool IsCombination(LogicActionUnity action)
        {
            var last_action  = GetLastAction();
            int maxinj_count = Engine.getInstance().injectorDevice.GetMaxInjCount();
            //int group_max_count = action.GetExperPackage().is_crossmatching&& GroupType == LogicActionGoupEnum.CrossmatchingSlys? 64 : 12;
            int group_max_count = action.GetExperPackage().is_crossmatching? 64 : 12;

            if (action_group.Count < group_max_count && last_action != null && last_action.GetGelStep().StepClass == TestStepEnum.FPYT && action.GetGelStep().StepClass == TestStepEnum.FPYT)
            {
                var exp        = action.GetExperPackage();
                var liquidinfo = action.GetGelStep().GetLiquidInfo();
                var fpytinfo   = action.GetGelStep().GetFpytInfo();
                var samplecode = exp.GetSampleCode(action.GetGelStep().SampleIndex);

                var    last_exp        = last_action.GetExperPackage();
                var    last_liquidinfo = last_action.GetGelStep().GetLiquidInfo();
                var    last_fpytinfo   = last_action.GetGelStep().GetFpytInfo();
                var    last_samplecode = last_exp.GetSampleCode(last_action.GetGelStep().SampleIndex);
                string liquidtype      = liquidinfo.LiquidType;
                string last_liquidtype = last_liquidinfo.LiquidType;
                if (exp.is_crossmatching && last_exp.is_crossmatching)
                {
                    liquidtype      = liquidtype.Replace("病人", "");
                    liquidtype      = liquidtype.Replace("献血员", "");
                    last_liquidtype = last_liquidtype.Replace("病人", "");
                    last_liquidtype = last_liquidtype.Replace("献血员", "");
                }
                if (liquidtype == last_liquidtype && exp.gel_test_id == last_exp.gel_test_id)
                {
                    //试剂
                    if (liquidinfo.IsAgentia && last_liquidinfo.IsAgentia)
                    {
                        ExeActionCount = 2;
                        GroupType      = LogicActionGoupEnum.Agentia;
                        return(true);
                    }
                    //交叉配血
                    else if (exp.is_crossmatching && last_exp.is_crossmatching && liquidinfo.IsSlys == last_liquidinfo.IsSlys && liquidinfo.IsAgentia == last_liquidinfo.IsAgentia)
                    {
                        ExeActionCount = maxinj_count;
                        bool is_bingren   = fpytinfo.FindLiquidType("病人*");
                        bool is_xueqing   = liquidinfo.LiquidType.IndexOf("清") != -1;
                        bool is_hongxibao = liquidinfo.LiquidType.IndexOf("红") != -1;
                        if (liquidinfo.IsSlys)
                        {
                            GroupType = LogicActionGoupEnum.CrossmatchingSlys;
                        }
                        else if (is_xueqing)
                        {
                            GroupType = LogicActionGoupEnum.CrossmatchingXueQing;
                        }
                        else if (is_hongxibao)
                        {
                            GroupType = LogicActionGoupEnum.CrossmatchingHxb;
                        }
                        return(true);
                    }
                    //生理盐水
                    else if (liquidinfo.IsSlys && last_liquidinfo.IsSlys)
                    {
                        ExeActionCount = maxinj_count;
                        GroupType      = LogicActionGoupEnum.Slys;
                        return(true);
                    }
                    //默认
                    else if (samplecode != last_samplecode)
                    {
                        ExeActionCount = maxinj_count;
                        GroupType      = LogicActionGoupEnum.Define;
                        return(true);
                    }
                }
            }
            return(false);
        }
Beispiel #5
0
 public void AddAction(LogicActionUnity action)
 {
     action.father = this;
     action_group.Add(action);
 }
Beispiel #6
0
 public LogicActionGoup(LogicActionUnity action)
 {
     AddAction(action);
 }