コード例 #1
0
 /// <summary>
 /// 获取测试组信息
 /// </summary>
 /// <param name="groupID"></param>
 /// <returns></returns>
 public TestSystemGroup GetTestGroup(Guid groupID)
 {
     return(TestSystemGroups.FirstOrDefault(q => q.TestGroupID == groupID));
 }
コード例 #2
0
        public MeasurementJobSpec(SpecInfo specInfo, Guid classID)
        {
            SeqID            = specInfo.SeqID;
            SeqName          = specInfo.SeqName;
            CenterWavelenghs = specInfo.CenterWavelenghs.Split(',').Select(q => q.CastTo(1550D)).ToArray();
            WavelenghStart   = specInfo.WavelenghStart;
            WavelenghEnd     = specInfo.WavelenghEnd;
            WavelenghStep    = specInfo.WavelenghStep;
            TempSetting      = specInfo.TempSetting.Split(',');
            SeqData          = specInfo.SeqData;
            CreateTime       = specInfo.CreateTime;
            UpdateTime       = specInfo.UpdateTime;
            SeqVersion       = specInfo.SeqVersion;

            WorkInfoSpecItems = new List <WorkInfoSpecItem>();

            TestLists = new List <Dictionary <int, Dictionary <Guid, List <Guid> > > >();

            var groupSetting = BaseSettingsManager.Get <SystemGroupSetting>();

            TestSystemGroups = groupSetting.GetTestGroupByProductClass(classID).OrderBy(q => q.OrderID).ToList();
            Ports            = groupSetting.GetPorts(classID);

            foreach (var item in specInfo.SpecItems)
            {
                var systemItem = groupSetting.GetTestSystemItem(item.SystemID);
                if (systemItem == null)
                {
                    continue;
                }
                var systemGroup = TestSystemGroups.FirstOrDefault(q => q.TestGroupID == systemItem.TestGroupID);
                if (systemGroup == null)
                {
                    continue;
                }

                int tempIndex = Array.IndexOf(TempSetting, item.TestTemp);
                WorkInfoSpecItems.Add(
                    new WorkInfoSpecItem()
                {
                    SpecItemID         = item.SpecItemID,
                    TestGroupID        = systemGroup.TestGroupID,
                    TestGroupTestType  = systemGroup.TestGroupTestType,
                    SystemID           = item.SystemID,
                    SystemName         = systemItem.SystemName,
                    SystemTypeID       = systemItem.SystemTypeID,
                    PortSetting        = systemItem.PortSetting,
                    TemperatureSetting = systemItem.TemperatureSetting,
                    ItemName           = item.ItemName,
                    TestTemp           = item.TestTemp,
                    TestTempOrder      = tempIndex,
                    TestSetting        = item.TestInfo,
                    ComputeSetting     = item.ComputeSetting.FromJsonString <Dictionary <int, ComputeSettingItem> >(),
                    OrderID            = item.OrderID
                });
            }
            WorkInfoSpecItems.Sort((a, b) => a.OrderID.CompareTo(b.OrderID));

            var groups = SystemGroupSetting.GroupSystemByTempGroup(TestSystemGroups);

            foreach (var group in groups)
            {
                var groupItems = new Dictionary <int, Dictionary <Guid, List <Guid> > >();
                for (int temp = 0; temp < TempSetting.Length; temp++)
                {
                    var tempData = new Dictionary <Guid, List <Guid> >();
                    foreach (var systemGroup in group.Value)
                    {
                        var items = WorkInfoSpecItems.Where(q => q.TestGroupID == systemGroup.TestGroupID).ToList();
                        if (items.Count < 1)
                        {
                            continue;
                        }

                        var tempList = items.Where(q => q.TestTempOrder == temp).Select(q => q.SpecItemID).ToList();
                        if (tempList.Count < 1)
                        {
                            continue;
                        }

                        tempData[systemGroup.TestGroupID] = new List <Guid>(tempList);
                    }

                    if (tempData.Count > 0)
                    {
                        groupItems[temp] = tempData;
                    }
                }
                if (groupItems.Count > 0)
                {
                    TestLists.Add(groupItems);
                }
            }
        }