private void GenOthers(Item item, List <string> lots) { bool writeSTD = false; ListItem std1 = new ListItem(); //speical injs process //CDN 溶出的speical序列特殊化 bool specialInsert = false; if (projName == "CDN" && item.Name == "Dissolution" && item.Injs.First().Volume > 100) { //Hint 1 //如果选择了新列,则需要特殊插针 if (item.NewLine) { //先搜索是否有符合条件的连续Available,记录第一个Avail瓶号;如没有,搜索紧靠前面是否有符合条件的连续Preserved,记录第一个Avail瓶号;如都没有,则使用currentVial if ((FindAvailable(4, out int availVial) || FindPreserved(4, out availVial)) && VialConfirm(availVial)) { for (int i = 0; i < 4; i++) { Add(new ListItem((availVial + i).ToString(), item.Injs[i])); if (i == 0) { std1 = new ListItem((availVial + i).ToString(), item.Injs[i]); } conditionList[0][availVial - 1 + i] = VialCondition.Used; } specialInsert = true; } } if (!specialInsert) { for (int i = 0; i < 4; i++) { VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs[i])); if (i == 0) { std1 = new ListItem(currentVial.ToString(), item.Injs[i]); } currentVial++; } } } else { //获取非FLD特殊针 var specials = item.FindAll(false).FindAll(x => !x.Name.Contains("FLD")); //获取STD针数 int countSTD = specials.Count(x => x.Name.Contains("STD")); //如果STD存在,则设置插针STD,然后设置非STD的特殊针;不存在则继续 if (std1StartVials.ContainsKey(item.StdType)) { var currentSTD1Condition = specials.Find(x => x.Name.Contains("STD1")); if (stdTypes.Count > 1) { std1 = new ListItem(std1StartVials[item.StdType].ToString(), currentSTD1Condition, currentSTD1Condition.Name + std1StartVialsSuffix[item.StdType]).InsertSTD1(); } else { std1 = new ListItem(std1StartVials[item.StdType].ToString(), currentSTD1Condition).InsertSTD1(); } if (item.NewLine && specials.Count != countSTD) { //先搜索是否有符合条件的连续Available,记录第一个Avail瓶号;如没有,搜索紧靠前面是否有符合条件的连续Preserved,记录第一个Avail瓶号;如都没有,则使用currentVial if ((FindAvailable(specials.Count - countSTD, out int availVial) || FindPreserved(specials.Count - countSTD, out availVial)) && VialConfirm(availVial)) { for (int i = 0; i < specials.Count - countSTD; i++) { Add(new ListItem((availVial + i).ToString(), item.Injs[i])); conditionList[0][availVial - 1 + i] = VialCondition.Used; } specialInsert = true; } } } else { int count = item.FindAll(false).Count(x => !x.Name.Contains("FLD")); if (item.NewLine) { //先搜索是否有符合条件的连续Available,记录第一个Avail瓶号;如没有,搜索紧靠前面是否有符合条件的连续Preserved,记录第一个Avail瓶号;如都没有,则使用currentVial if ((FindAvailable(count, out int availVial) || FindPreserved(count, out availVial)) && VialConfirm(availVial)) { int increment = 0; foreach (var inj in item.FindAll(false).Where(x => !x.Name.Contains("FLD"))) { if (inj.Name.Contains("STD1") && stdTypes.Count > 1) { writeSTD = true; Add(new ListItem((availVial + increment).ToString(), inj, inj.Name + "-" + (char)(STDenum + 65))); std1 = new ListItem((availVial + increment).ToString(), inj, inj.Name + "-" + (char)(STDenum + 65)); std1StartVials.Add(item.StdType, currentVial); std1StartVialsSuffix.Add(item.StdType, "-" + (char)(STDenum + 65)); STDenum++; conditionList[0][availVial - 1 + increment] = VialCondition.Used; } else { if (writeSTD && (inj.Name.Contains("STD2") || (inj.Name.Contains("STD3")))) { string name = inj.Name + std1StartVialsSuffix[item.StdType]; Add(new ListItem((availVial + increment).ToString(), inj, name)); } else { Add(new ListItem((availVial + increment).ToString(), inj)); } conditionList[0][availVial - 1 + increment] = VialCondition.Used; } increment++; } specialInsert = true; } } if (!specialInsert) { foreach (var inj in item.FindAll(false)) { if (!inj.Name.Contains("FLD")) { if (inj.Name.Contains("STD1")) { writeSTD = true; if (stdTypes.Count > 1) { VialConfirm(); std1 = new ListItem(currentVial.ToString(), inj, inj.Name + "-" + (char)(STDenum + 65)); Add(std1); std1StartVials.Add(item.StdType, currentVial); std1StartVialsSuffix.Add(item.StdType, "-" + (char)(STDenum + 65)); STDenum++; currentVial++; } else { VialConfirm(); std1 = new ListItem(currentVial.ToString(), inj); Add(std1); std1StartVials.Add(item.StdType, currentVial); currentVial++; } } else if (inj.Name.Contains("STD2") || inj.Name.Contains("STD3")) { if (writeSTD) { VialConfirm(); Add(new ListItem(currentVial.ToString(), inj, FullList1.Last().Name.Replace("STD2", "STD3").Replace("STD1", "STD2"))); currentVial++; } } else { VialConfirm(); Add(new ListItem(currentVial.ToString(), inj)); currentVial++; } } } } std1 = std1.InsertSTD1(); } } //end of special inj process //sample inj process var sampleInjs = item.FindAll(true); foreach (var lot in lots) { if (item.NewLine) { NewLineCurrentVial(plateStyle == PlateStyle.Normal ? 10 : (plateStyle == PlateStyle.NewA ? 11 : 8)); } switch (item.Name) { case "Acid Tolerance": case "Dissolution": //MBL-ONCE 溶出特殊化 if (projName == "MBL-ONCE") { for (int m = 0; m < 3; m++) { if (item.NewLine) { NewLineCurrentVial(plateStyle == PlateStyle.Normal ? 10 : (plateStyle == PlateStyle.NewA ? 11 : 8)); } for (int i = 0; i < 6; i++) { VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + "-Time" + (char)(m + 65) + "-R" + (i + 1))); currentVial++; } VialConfirm(); Add(std1.IntertSTD1ForDissolutionOfLargeInjAmount(currentVial)); currentVial++; } } else { for (int i = 0; i < 6; i++) { VialConfirm(); string suf = item.Name == "Dissolution" ? "-R" : "-N"; Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + suf + (i + 1))); //Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + suf + (i + 1))); currentVial++; } if (!item.NewStd) { Add(std1); } else { VialConfirm(); Add(std1.IntertSTD1ForDissolutionOfLargeInjAmount(currentVial)); currentVial++; } } break; case "Content Uniformity": for (int i = 0; i < 10; i++) { VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + "-HJ" + (i + 1))); currentVial++; } if (!item.NewStd) { Add(std1); } else { VialConfirm(); Add(std1.IntertSTD1ForDissolutionOfLargeInjAmount(currentVial)); currentVial++; } break; } } //end of sample inj process }
private void Add(ListItem item) { FullList1.Add(item); }
private void GenSubListAssay(Item item, List <string> lots) { if (item.NewLine) { NewLineCurrentVial(plateStyle == PlateStyle.Normal ? 10 : (plateStyle == PlateStyle.NewA ? 11 : 8)); } bool writeSTD = false; ListItem std1 = new ListItem(); foreach (var inj in item.FindAll(false)) { if (inj.Name.Contains("STD1")) { //已有STD1 if (std1StartVials.ContainsKey(item.StdType)) { writeSTD = false; if (stdTypes.Count > 1) { std1 = new ListItem(std1StartVials[item.StdType].ToString(), inj, inj.Name + std1StartVialsSuffix[item.StdType]); } else { std1 = new ListItem(std1StartVials[item.StdType].ToString(), inj); } } //无STD1 else { writeSTD = true; if (stdTypes.Count > 1) { VialConfirm(); std1 = new ListItem(currentVial.ToString(), inj, inj.Name + "-" + (char)(STDenum + 65)); Add(std1); std1StartVials.Add(item.StdType, currentVial); std1StartVialsSuffix.Add(item.StdType, "-" + (char)(STDenum + 65)); STDenum++; currentVial++; } else { VialConfirm(); std1 = new ListItem(currentVial.ToString(), inj); Add(std1); std1StartVials.Add(item.StdType, currentVial); currentVial++; } } } else if (inj.Name.Contains("STD2") || inj.Name.Contains("STD3")) { if (writeSTD) { VialConfirm(); Add(new ListItem(currentVial.ToString(), inj, FullList1.Last().Name.Replace(FullList1.Last().Name.Contains("STD1") ? "STD1" : "STD2", FullList1.Last().Name.Contains("STD1") ? "STD2" : "STD3"))); currentVial++; } } else if (!inj.Name.Contains("FLD")) { VialConfirm(); Add(new ListItem(currentVial.ToString(), inj)); currentVial++; } } std1 = std1.InsertSTD1(); //将特殊的std1(5针)转变为插针(1针) var sampleInjs = item.FindAll(true); int assayEnum = 0; foreach (var lot in lots) { if ((assayEnum >= 9) || (assayEnum == 8 && (lot.Contains("(") || lot.Contains("(")))) { Add(std1); assayEnum = 0; } VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + "-H1")); currentVial++; VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + "-H2")); currentVial++; assayEnum += 2; if (lot.Contains("(") || lot.Contains("(")) { VialConfirm(); Add(new ListItem(currentVial.ToString(), item.Injs.Last(), lot + "-H3")); currentVial++; assayEnum++; } } Add(std1); }