예제 #1
0
        //生成组合
        public void MakeGroup(List <LogicActionUnity> act_list, LogicActionGoupEnum group_type)
        {
            LogicActionGoup group = null;

            if (act_list[0] is LogicActionGoup)
            {
                group           = (LogicActionGoup)act_list[0];
                group.GroupType = group_type;
                for (int i = 1; i < act_list.Count; i++)
                {
                    group.AddAction(act_list[i]);
                    action_group.Remove(act_list[i]);
                }
            }
            else
            {
                int index = action_group.FindIndex(item => item == act_list[0]);
                group           = new LogicActionGoup();
                group.GroupType = group_type;
                action_group.Insert(index, group);
                for (int i = 0; i < act_list.Count; i++)
                {
                    group.AddAction(act_list[i]);
                    action_group.Remove(act_list[i]);
                }
            }
            group.UpdataOneTube();
        }
예제 #2
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;
                            }
                        }
                    }
                }
            }
        }